From 27d653e8cc2713c674c157cfebc0f9eca8fe1af7 Mon Sep 17 00:00:00 2001 From: FireHydrant Bot <44629778+firehydrant-ops@users.noreply.github.com> Date: Tue, 22 Apr 2025 00:25:51 +0000 Subject: [PATCH] Regenerate Swagger code c2f8788e --- .../account_settings_client.go | 100 +- .../get_ai_preferences_parameters.go | 128 ++ .../get_ai_preferences_responses.go | 98 ++ .../get_bootstrap_parameters.go | 128 ++ .../get_bootstrap_responses.go | 98 ++ .../list_entitlements_parameters.go | 197 +++ .../list_entitlements_responses.go | 98 ++ .../ping_noauth_parameters.go | 128 ++ .../account_settings/ping_noauth_responses.go | 98 ++ client/account_settings/ping_parameters.go | 128 ++ client/account_settings/ping_responses.go | 98 ++ .../update_ai_preferences_parameters.go | 386 +++++ .../update_ai_preferences_responses.go | 98 ++ client/alerts/alerts_client.go | 144 +- .../create_incident_alert_parameters.go | 170 ++ .../alerts/create_incident_alert_responses.go | 83 + .../delete_incident_alert_parameters.go | 167 ++ .../alerts/delete_incident_alert_responses.go | 83 + client/alerts/get_alert_parameters.go | 148 ++ client/alerts/get_alert_responses.go | 98 ++ client/alerts/list_alerts_parameters.go | 536 +++++++ client/alerts/list_alerts_responses.go | 98 ++ .../alerts/list_incident_alerts_parameters.go | 148 ++ .../alerts/list_incident_alerts_responses.go | 98 ++ .../list_processing_log_entries_parameters.go | 332 ++++ .../list_processing_log_entries_responses.go | 98 ++ ...pdate_incident_alert_primary_parameters.go | 188 +++ ...update_incident_alert_primary_responses.go | 98 ++ .../audiences/archive_audience_parameters.go | 151 ++ .../audiences/archive_audience_responses.go | 98 ++ client/audiences/audiences_client.go | 228 +-- .../audiences/create_audience_parameters.go | 360 +++++ client/audiences/create_audience_responses.go | 98 ++ .../generate_audience_summary_parameters.go | 219 +++ .../generate_audience_summary_responses.go | 98 ++ client/audiences/get_audience_parameters.go | 151 ++ client/audiences/get_audience_responses.go | 98 ++ .../get_audience_summary_parameters.go | 173 ++ .../get_audience_summary_responses.go | 98 ++ .../get_member_default_audience_parameters.go | 151 ++ .../get_member_default_audience_responses.go | 98 ++ .../list_audience_summaries_parameters.go | 151 ++ .../list_audience_summaries_responses.go | 98 ++ client/audiences/list_audiences_parameters.go | 175 ++ client/audiences/list_audiences_responses.go | 98 ++ .../audiences/restore_audience_parameters.go | 151 ++ .../audiences/restore_audience_responses.go | 98 ++ .../set_member_default_audience_parameters.go | 177 ++ .../set_member_default_audience_responses.go | 98 ++ .../audiences/update_audience_parameters.go | 460 ++++++ client/audiences/update_audience_responses.go | 98 ++ .../catalog_entries/catalog_entries_client.go | 1331 +++++++++++++++ .../create_environment_parameters.go | 150 ++ .../create_environment_responses.go | 98 ++ .../create_functionality_parameters.go | 150 ++ .../create_functionality_responses.go | 98 ++ ...e_service_checklist_response_parameters.go | 188 +++ ...te_service_checklist_response_responses.go | 83 + .../create_service_dependency_parameters.go | 150 ++ .../create_service_dependency_responses.go | 98 ++ .../create_service_links_parameters.go | 150 ++ .../create_service_links_responses.go | 96 ++ .../create_service_parameters.go | 150 ++ .../create_service_responses.go | 167 ++ .../delete_environment_parameters.go | 151 ++ .../delete_environment_responses.go | 98 ++ .../delete_functionality_parameters.go | 148 ++ .../delete_functionality_responses.go | 98 ++ .../delete_service_dependency_parameters.go | 148 ++ .../delete_service_dependency_responses.go | 98 ++ .../delete_service_link_parameters.go | 173 ++ .../delete_service_link_responses.go | 83 + .../delete_service_parameters.go | 148 ++ .../delete_service_responses.go | 98 ++ .../get_environment_parameters.go | 151 ++ .../get_environment_responses.go | 98 ++ .../get_functionality_parameters.go | 148 ++ .../get_functionality_responses.go | 98 ++ .../get_service_dependencies_parameters.go | 183 +++ .../get_service_dependencies_responses.go | 98 ++ .../get_service_dependency_parameters.go | 148 ++ .../get_service_dependency_responses.go | 98 ++ .../catalog_entries/get_service_parameters.go | 148 ++ .../catalog_entries/get_service_responses.go | 98 ++ .../ingest_catalog_data_parameters.go | 169 ++ .../ingest_catalog_data_responses.go | 98 ++ .../list_environments_parameters.go | 264 +++ .../list_environments_responses.go | 98 ++ .../list_functionalities_parameters.go | 400 +++++ .../list_functionalities_responses.go | 98 ++ .../list_functionality_services_parameters.go | 148 ++ .../list_functionality_services_responses.go | 98 ++ .../list_infrastructures_parameters.go | 298 ++++ .../list_infrastructures_responses.go | 98 ++ ...able_downstream_dependencies_parameters.go | 148 ++ ...lable_downstream_dependencies_responses.go | 98 ++ ...ilable_upstream_dependencies_parameters.go | 148 ++ ...ailable_upstream_dependencies_responses.go | 98 ++ .../list_services_parameters.go | 615 +++++++ .../list_services_responses.go | 98 ++ .../list_user_owned_services_parameters.go | 215 +++ .../list_user_owned_services_responses.go | 96 ++ .../refresh_catalog_parameters.go | 148 ++ .../refresh_catalog_responses.go | 83 + .../update_environment_parameters.go | 172 ++ .../update_environment_responses.go | 98 ++ .../update_functionality_parameters.go | 169 ++ .../update_functionality_responses.go | 98 ++ .../update_service_dependency_parameters.go | 169 ++ .../update_service_dependency_responses.go | 98 ++ .../update_service_parameters.go | 169 ++ .../update_service_responses.go | 100 ++ client/changes/changes_client.go | 304 ++-- .../changes/create_change_event_parameters.go | 150 ++ .../changes/create_change_event_responses.go | 98 ++ .../create_change_identity_parameters.go | 169 ++ .../create_change_identity_responses.go | 167 ++ client/changes/create_change_parameters.go | 150 ++ client/changes/create_change_responses.go | 167 ++ .../changes/delete_change_event_parameters.go | 148 ++ .../changes/delete_change_event_responses.go | 83 + .../delete_change_identity_parameters.go | 167 ++ .../delete_change_identity_responses.go | 155 ++ client/changes/delete_change_parameters.go | 148 ++ client/changes/delete_change_responses.go | 83 + client/changes/get_change_event_parameters.go | 148 ++ client/changes/get_change_event_responses.go | 98 ++ .../changes/list_change_events_parameters.go | 436 +++++ .../changes/list_change_events_responses.go | 98 ++ .../list_change_identities_parameters.go | 215 +++ .../list_change_identities_responses.go | 98 ++ .../changes/list_change_types_parameters.go | 196 +++ client/changes/list_change_types_responses.go | 98 ++ client/changes/list_changes_parameters.go | 230 +++ client/changes/list_changes_responses.go | 83 + .../changes/update_change_event_parameters.go | 169 ++ .../changes/update_change_event_responses.go | 98 ++ .../update_change_identity_parameters.go | 188 +++ .../update_change_identity_responses.go | 167 ++ client/changes/update_change_parameters.go | 169 ++ client/changes/update_change_responses.go | 98 ++ client/communication/communication_client.go | 104 +- ...reate_status_update_template_parameters.go | 150 ++ ...create_status_update_template_responses.go | 98 ++ ...elete_status_update_template_parameters.go | 148 ++ ...delete_status_update_template_responses.go | 98 ++ .../get_status_update_template_parameters.go | 148 ++ .../get_status_update_template_responses.go | 98 ++ ...list_status_update_templates_parameters.go | 196 +++ .../list_status_update_templates_responses.go | 98 ++ ...pdate_status_update_template_parameters.go | 169 ++ ...update_status_update_template_responses.go | 98 ++ client/conversations/conversations_client.go | 368 ++--- .../create_comment_parameters.go | 169 ++ .../create_comment_reaction_parameters.go | 188 +++ .../create_comment_reaction_responses.go | 83 + .../conversations/create_comment_responses.go | 83 + .../delete_comment_parameters.go | 167 ++ .../delete_comment_reaction_parameters.go | 186 +++ .../delete_comment_reaction_responses.go | 83 + .../conversations/delete_comment_responses.go | 83 + .../conversations/get_comment_parameters.go | 167 ++ client/conversations/get_comment_responses.go | 83 + .../get_vote_status_parameters.go | 167 ++ .../get_vote_status_responses.go | 98 ++ .../list_comment_reactions_parameters.go | 167 ++ .../list_comment_reactions_responses.go | 83 + .../conversations/list_comments_parameters.go | 267 +++ .../conversations/list_comments_responses.go | 83 + .../update_comment_parameters.go | 188 +++ .../conversations/update_comment_responses.go | 83 + .../conversations/update_vote_parameters.go | 188 +++ client/conversations/update_vote_responses.go | 98 ++ client/fire_hydrant_api_client.go | 20 +- ...eate_custom_field_definition_parameters.go | 150 ++ ...reate_custom_field_definition_responses.go | 98 ++ .../create_incident_role_parameters.go | 150 ++ .../create_incident_role_responses.go | 98 ++ .../create_incident_type_parameters.go | 150 ++ .../create_incident_type_responses.go | 98 ++ ...cycle_measurement_definition_parameters.go | 256 +++ ...ecycle_measurement_definition_responses.go | 83 + .../create_lifecycle_milestone_parameters.go | 338 ++++ .../create_lifecycle_milestone_responses.go | 98 ++ .../create_priority_parameters.go | 150 ++ .../create_priority_responses.go | 98 ++ ...te_severity_matrix_condition_parameters.go | 150 ++ ...ate_severity_matrix_condition_responses.go | 98 ++ ...reate_severity_matrix_impact_parameters.go | 150 ++ ...create_severity_matrix_impact_responses.go | 98 ++ .../create_severity_parameters.go | 150 ++ .../create_severity_responses.go | 98 ++ ...lete_custom_field_definition_parameters.go | 148 ++ ...elete_custom_field_definition_responses.go | 98 ++ .../delete_incident_role_parameters.go | 148 ++ .../delete_incident_role_responses.go | 98 ++ .../delete_incident_type_parameters.go | 148 ++ .../delete_incident_type_responses.go | 98 ++ ...cycle_measurement_definition_parameters.go | 148 ++ ...ecycle_measurement_definition_responses.go | 83 + .../delete_lifecycle_milestone_parameters.go | 148 ++ .../delete_lifecycle_milestone_responses.go | 98 ++ .../delete_priority_parameters.go | 148 ++ .../delete_priority_responses.go | 98 ++ ...te_severity_matrix_condition_parameters.go | 148 ++ ...ete_severity_matrix_condition_responses.go | 98 ++ ...elete_severity_matrix_impact_parameters.go | 148 ++ ...delete_severity_matrix_impact_responses.go | 98 ++ .../delete_severity_parameters.go | 148 ++ .../delete_severity_responses.go | 98 ++ .../get_form_configuration_parameters.go | 148 ++ .../get_form_configuration_responses.go | 98 ++ .../get_incident_role_parameters.go | 148 ++ .../get_incident_role_responses.go | 98 ++ .../get_incident_type_parameters.go | 148 ++ .../get_incident_type_responses.go | 98 ++ ...cycle_measurement_definition_parameters.go | 148 ++ ...ecycle_measurement_definition_responses.go | 83 + .../get_priority_parameters.go | 148 ++ .../get_priority_responses.go | 98 ++ ...et_severity_matrix_condition_parameters.go | 148 ++ ...get_severity_matrix_condition_responses.go | 98 ++ .../get_severity_matrix_parameters.go | 128 ++ .../get_severity_matrix_responses.go | 98 ++ .../get_severity_parameters.go | 148 ++ .../get_severity_responses.go | 98 ++ .../incident_settings_client.go | 1024 ++++++------ ...ist_custom_field_definitions_parameters.go | 128 ++ ...list_custom_field_definitions_responses.go | 98 ++ ..._custom_field_select_options_parameters.go | 217 +++ ...t_custom_field_select_options_responses.go | 98 ++ .../list_incident_roles_parameters.go | 196 +++ .../list_incident_roles_responses.go | 98 ++ .../list_incident_tags_parameters.go | 160 ++ .../list_incident_tags_responses.go | 98 ++ .../list_incident_types_parameters.go | 230 +++ .../list_incident_types_responses.go | 98 ++ ...ycle_measurement_definitions_parameters.go | 196 +++ ...cycle_measurement_definitions_responses.go | 83 + .../list_lifecycle_phases_parameters.go | 128 ++ .../list_lifecycle_phases_responses.go | 98 ++ .../list_priorities_parameters.go | 196 +++ .../list_priorities_responses.go | 98 ++ .../list_severities_parameters.go | 196 +++ .../list_severities_responses.go | 98 ++ ...t_severity_matrix_conditions_parameters.go | 196 +++ ...st_severity_matrix_conditions_responses.go | 98 ++ ...list_severity_matrix_impacts_parameters.go | 196 +++ .../list_severity_matrix_impacts_responses.go | 98 ++ ...date_custom_field_definition_parameters.go | 169 ++ ...pdate_custom_field_definition_responses.go | 98 ++ .../update_incident_role_parameters.go | 169 ++ .../update_incident_role_responses.go | 98 ++ .../update_incident_type_parameters.go | 169 ++ .../update_incident_type_responses.go | 98 ++ ...cycle_measurement_definition_parameters.go | 293 ++++ ...ecycle_measurement_definition_responses.go | 83 + .../update_lifecycle_milestone_parameters.go | 343 ++++ .../update_lifecycle_milestone_responses.go | 98 ++ .../update_priority_parameters.go | 169 ++ .../update_priority_responses.go | 98 ++ ...te_severity_matrix_condition_parameters.go | 169 ++ ...ate_severity_matrix_condition_responses.go | 98 ++ ...pdate_severity_matrix_impact_parameters.go | 169 ++ ...update_severity_matrix_impact_responses.go | 98 ++ .../update_severity_matrix_parameters.go | 150 ++ .../update_severity_matrix_responses.go | 98 ++ .../update_severity_parameters.go | 169 ++ .../update_severity_responses.go | 98 ++ .../validate_incident_tags_parameters.go | 151 ++ .../validate_incident_tags_responses.go | 98 ++ ...k_update_incident_milestones_parameters.go | 169 ++ ...lk_update_incident_milestones_responses.go | 104 ++ client/incidents/close_incident_parameters.go | 148 ++ client/incidents/close_incident_responses.go | 98 ++ .../create_incident_attachment_parameters.go | 255 +++ .../create_incident_attachment_responses.go | 98 ++ ...create_incident_change_event_parameters.go | 169 ++ .../create_incident_change_event_responses.go | 236 +++ ...create_incident_chat_message_parameters.go | 169 ++ .../create_incident_chat_message_responses.go | 98 ++ .../create_incident_impact_parameters.go | 188 +++ .../create_incident_impact_responses.go | 167 ++ .../create_incident_link_parameters.go | 169 ++ .../create_incident_link_responses.go | 98 ++ .../create_incident_note_parameters.go | 169 ++ .../create_incident_note_responses.go | 98 ++ .../incidents/create_incident_parameters.go | 150 ++ client/incidents/create_incident_responses.go | 98 ++ ...ate_incident_role_assignment_parameters.go | 169 ++ ...eate_incident_role_assignment_responses.go | 98 ++ .../create_incident_status_page_parameters.go | 169 ++ .../create_incident_status_page_responses.go | 98 ++ ...ate_incident_team_assignment_parameters.go | 169 ++ ...eate_incident_team_assignment_responses.go | 83 + ...create_scheduled_maintenance_parameters.go | 150 ++ .../create_scheduled_maintenance_responses.go | 167 ++ ...delete_incident_chat_message_parameters.go | 167 ++ .../delete_incident_chat_message_responses.go | 98 ++ .../delete_incident_event_parameters.go | 167 ++ .../delete_incident_event_responses.go | 98 ++ .../delete_incident_impact_parameters.go | 186 +++ .../delete_incident_impact_responses.go | 155 ++ .../delete_incident_link_parameters.go | 167 ++ .../delete_incident_link_responses.go | 83 + .../incidents/delete_incident_parameters.go | 148 ++ client/incidents/delete_incident_responses.go | 98 ++ ...ete_incident_role_assignment_parameters.go | 167 ++ ...lete_incident_role_assignment_responses.go | 98 ++ ...ete_incident_team_assignment_parameters.go | 213 +++ ...lete_incident_team_assignment_responses.go | 83 + ...delete_scheduled_maintenance_parameters.go | 148 ++ .../delete_scheduled_maintenance_responses.go | 83 + .../delete_transcript_entry_parameters.go | 167 ++ .../delete_transcript_entry_responses.go | 98 ++ ...incident_summary_vote_status_parameters.go | 167 ++ ..._incident_summary_vote_status_responses.go | 83 + ...onference_bridge_translation_parameters.go | 192 +++ ...conference_bridge_translation_responses.go | 98 ++ .../get_incident_channel_parameters.go | 148 ++ .../get_incident_channel_responses.go | 98 ++ .../get_incident_event_parameters.go | 167 ++ .../incidents/get_incident_event_responses.go | 98 ++ client/incidents/get_incident_parameters.go | 148 ++ .../get_incident_relationships_parameters.go | 148 ++ .../get_incident_relationships_responses.go | 98 ++ client/incidents/get_incident_responses.go | 98 ++ .../incidents/get_incident_user_parameters.go | 167 ++ .../incidents/get_incident_user_responses.go | 98 ++ .../get_scheduled_maintenance_parameters.go | 148 ++ .../get_scheduled_maintenance_responses.go | 98 ++ client/incidents/incidents_client.go | 1246 +++++++------- .../list_incident_attachments_parameters.go | 246 +++ .../list_incident_attachments_responses.go | 98 ++ .../list_incident_change_events_parameters.go | 249 +++ .../list_incident_change_events_responses.go | 98 ++ ..._incident_conference_bridges_parameters.go | 148 ++ ...t_incident_conference_bridges_responses.go | 98 ++ .../list_incident_events_parameters.go | 271 ++++ .../list_incident_events_responses.go | 98 ++ .../list_incident_impacts_parameters.go | 167 ++ .../list_incident_impacts_responses.go | 98 ++ .../list_incident_links_parameters.go | 215 +++ .../list_incident_links_responses.go | 98 ++ .../list_incident_milestones_parameters.go | 148 ++ .../list_incident_milestones_responses.go | 98 ++ ...st_incident_role_assignments_parameters.go | 182 +++ ...ist_incident_role_assignments_responses.go | 98 ++ .../list_incident_status_pages_parameters.go | 148 ++ .../list_incident_status_pages_responses.go | 98 ++ client/incidents/list_incidents_parameters.go | 1236 ++++++++++++++ client/incidents/list_incidents_responses.go | 98 ++ .../list_scheduled_maintenances_parameters.go | 230 +++ .../list_scheduled_maintenances_responses.go | 98 ++ .../list_similar_incidents_parameters.go | 231 +++ .../list_similar_incidents_responses.go | 98 ++ .../list_transcript_entries_parameters.go | 263 +++ .../list_transcript_entries_responses.go | 98 ++ .../incidents/resolve_incident_parameters.go | 180 +++ .../incidents/resolve_incident_responses.go | 98 ++ .../unarchive_incident_parameters.go | 148 ++ .../incidents/unarchive_incident_responses.go | 98 ++ ...update_incident_change_event_parameters.go | 188 +++ .../update_incident_change_event_responses.go | 236 +++ ...update_incident_chat_message_parameters.go | 188 +++ .../update_incident_chat_message_responses.go | 98 ++ .../update_incident_event_parameters.go | 167 ++ .../update_incident_event_responses.go | 98 ++ ...update_incident_impact_patch_parameters.go | 169 ++ .../update_incident_impact_patch_responses.go | 105 ++ .../update_incident_impact_put_parameters.go | 169 ++ .../update_incident_impact_put_responses.go | 105 ++ .../update_incident_link_parameters.go | 188 +++ .../update_incident_link_responses.go | 83 + .../update_incident_note_parameters.go | 188 +++ .../update_incident_note_responses.go | 98 ++ .../incidents/update_incident_parameters.go | 169 ++ client/incidents/update_incident_responses.go | 98 ++ ...update_scheduled_maintenance_parameters.go | 169 ++ .../update_scheduled_maintenance_responses.go | 98 ++ ...pdate_transcript_attribution_parameters.go | 302 ++++ ...update_transcript_attribution_responses.go | 83 + .../vote_ai_incident_summary_parameters.go | 190 +++ .../vote_ai_incident_summary_responses.go | 98 ++ .../create_connection_parameters.go | 148 ++ .../create_connection_responses.go | 98 ++ .../create_slack_emoji_action_parameters.go | 209 +++ .../create_slack_emoji_action_responses.go | 83 + .../delete_slack_emoji_action_parameters.go | 170 ++ .../delete_slack_emoji_action_responses.go | 83 + ...delete_statuspage_connection_parameters.go | 151 ++ .../delete_statuspage_connection_responses.go | 98 ++ .../get_aws_cloudtrail_batch_parameters.go | 148 ++ .../get_aws_cloudtrail_batch_responses.go | 98 ++ .../get_aws_connection_parameters.go | 148 ++ .../get_aws_connection_responses.go | 98 ++ .../get_integration_parameters.go | 151 ++ .../integrations/get_integration_responses.go | 98 ++ .../get_slack_emoji_action_parameters.go | 170 ++ .../get_slack_emoji_action_responses.go | 83 + .../get_statuspage_connection_parameters.go | 151 ++ .../get_statuspage_connection_responses.go | 98 ++ ...ndesk_customer_support_issue_parameters.go | 190 +++ ...endesk_customer_support_issue_responses.go | 83 + client/integrations/integrations_client.go | 696 ++++---- .../list_authed_providers_parameters.go | 207 +++ .../list_authed_providers_responses.go | 98 ++ ..._aws_cloudtrail_batch_events_parameters.go | 148 ++ ...t_aws_cloudtrail_batch_events_responses.go | 98 ++ .../list_aws_cloudtrail_batches_parameters.go | 230 +++ .../list_aws_cloudtrail_batches_responses.go | 98 ++ .../list_aws_connections_parameters.go | 298 ++++ .../list_aws_connections_responses.go | 98 ++ ..._connection_statuses_by_slug_parameters.go | 148 ++ ...t_connection_statuses_by_slug_responses.go | 98 ++ .../list_connection_statuses_parameters.go | 128 ++ .../list_connection_statuses_responses.go | 98 ++ .../list_connections_parameters.go | 163 ++ .../list_connections_responses.go | 98 ++ ...t_field_map_available_fields_parameters.go | 148 ++ ...st_field_map_available_fields_responses.go | 98 ++ .../list_integrations_parameters.go | 128 ++ .../list_integrations_responses.go | 98 ++ .../list_slack_emoji_actions_parameters.go | 218 +++ .../list_slack_emoji_actions_responses.go | 83 + .../list_slack_usergroups_parameters.go | 128 ++ .../list_slack_usergroups_responses.go | 98 ++ .../list_slack_workspaces_parameters.go | 151 ++ .../list_slack_workspaces_responses.go | 98 ++ ..._statuspage_connection_pages_parameters.go | 151 ++ ...t_statuspage_connection_pages_responses.go | 98 ++ .../list_statuspage_connections_parameters.go | 196 +++ .../list_statuspage_connections_responses.go | 98 ++ .../refresh_connection_parameters.go | 167 ++ .../refresh_connection_responses.go | 98 ++ .../search_confluence_spaces_parameters.go | 182 +++ .../search_confluence_spaces_responses.go | 98 ++ .../search_zendesk_tickets_parameters.go | 239 +++ .../search_zendesk_tickets_responses.go | 98 ++ .../update_authed_provider_parameters.go | 228 +++ .../update_authed_provider_responses.go | 98 ++ .../update_aws_cloudtrail_batch_parameters.go | 169 ++ .../update_aws_cloudtrail_batch_responses.go | 98 ++ .../update_aws_connection_parameters.go | 169 ++ .../update_aws_connection_responses.go | 98 ++ .../update_connection_parameters.go | 167 ++ .../update_connection_responses.go | 98 ++ .../update_field_map_parameters.go | 148 ++ .../update_field_map_responses.go | 98 ++ .../update_slack_emoji_action_parameters.go | 234 +++ .../update_slack_emoji_action_responses.go | 83 + ...update_statuspage_connection_parameters.go | 172 ++ .../update_statuspage_connection_responses.go | 98 ++ .../create_saved_search_parameters.go | 169 ++ .../create_saved_search_responses.go | 98 ++ .../delete_saved_search_parameters.go | 167 ++ .../delete_saved_search_responses.go | 98 ++ ...port_signals_shift_analytics_parameters.go | 278 ++++ ...xport_signals_shift_analytics_responses.go | 83 + .../get_mean_time_report_parameters.go | 576 +++++++ .../get_mean_time_report_responses.go | 98 ++ .../reporting/get_saved_search_parameters.go | 167 ++ .../reporting/get_saved_search_responses.go | 98 ++ .../get_signals_grouped_metrics_parameters.go | 507 ++++++ .../get_signals_grouped_metrics_responses.go | 83 + .../get_signals_mttx_analytics_parameters.go | 507 ++++++ .../get_signals_mttx_analytics_responses.go | 83 + ...signals_timeseries_analytics_parameters.go | 541 +++++++ ..._signals_timeseries_analytics_responses.go | 83 + .../list_incident_metrics_parameters.go | 390 +++++ .../list_incident_metrics_responses.go | 98 ++ .../list_infrastructure_metrics_parameters.go | 242 +++ .../list_infrastructure_metrics_responses.go | 98 ++ ..._infrastructure_type_metrics_parameters.go | 220 +++ ...t_infrastructure_type_metrics_responses.go | 98 ++ ...ist_milestone_funnel_metrics_parameters.go | 1212 ++++++++++++++ ...list_milestone_funnel_metrics_responses.go | 98 ++ .../reporting/list_mttx_metrics_parameters.go | 1360 ++++++++++++++++ .../reporting/list_mttx_metrics_responses.go | 98 ++ .../list_retrospective_metrics_parameters.go | 201 +++ .../list_retrospective_metrics_responses.go | 98 ++ .../list_saved_searches_parameters.go | 283 ++++ .../list_saved_searches_responses.go | 98 ++ .../list_ticket_funnel_metrics_parameters.go | 1212 ++++++++++++++ .../list_ticket_funnel_metrics_responses.go | 98 ++ ...ist_user_involvement_metrics_parameters.go | 359 +++++ ...list_user_involvement_metrics_responses.go | 98 ++ client/reporting/reporting_client.go | 366 ++--- .../update_saved_search_parameters.go | 188 +++ .../update_saved_search_responses.go | 98 ++ ..._retrospective_dynamic_input_parameters.go | 186 +++ ...t_retrospective_dynamic_input_responses.go | 98 ++ ...incident_retrospective_field_parameters.go | 356 ++++ ..._incident_retrospective_field_responses.go | 98 ++ ...reate_incident_retrospective_parameters.go | 174 ++ ...create_incident_retrospective_responses.go | 98 ++ .../create_post_mortem_reason_parameters.go | 169 ++ .../create_post_mortem_reason_responses.go | 98 ++ .../create_post_mortem_report_parameters.go | 150 ++ .../create_post_mortem_report_responses.go | 98 ++ ...reate_retrospective_template_parameters.go | 541 +++++++ ...create_retrospective_template_responses.go | 98 ++ ..._retrospective_dynamic_input_parameters.go | 213 +++ ...t_retrospective_dynamic_input_responses.go | 98 ++ .../delete_post_mortem_reason_parameters.go | 167 ++ .../delete_post_mortem_reason_responses.go | 98 ++ ...elete_retrospective_template_parameters.go | 148 ++ ...delete_retrospective_template_responses.go | 98 ++ ...port_incident_retrospectives_parameters.go | 206 +++ ...xport_incident_retrospectives_responses.go | 98 ++ ...incident_retrospective_field_parameters.go | 186 +++ ..._incident_retrospective_field_responses.go | 98 ++ .../get_post_mortem_question_parameters.go | 148 ++ .../get_post_mortem_question_responses.go | 83 + .../get_post_mortem_report_parameters.go | 148 ++ .../get_post_mortem_report_responses.go | 98 ++ .../get_retrospective_template_parameters.go | 148 ++ .../get_retrospective_template_responses.go | 98 ++ ...list_incident_retrospectives_parameters.go | 249 +++ .../list_incident_retrospectives_responses.go | 98 ++ .../list_post_mortem_questions_parameters.go | 196 +++ .../list_post_mortem_questions_responses.go | 98 ++ .../list_post_mortem_reasons_parameters.go | 215 +++ .../list_post_mortem_reasons_responses.go | 98 ++ .../list_post_mortem_reports_parameters.go | 266 +++ .../list_post_mortem_reports_responses.go | 98 ++ ...list_retrospective_templates_parameters.go | 227 +++ .../list_retrospective_templates_responses.go | 98 ++ .../list_retrospectives_parameters.go | 266 +++ .../list_retrospectives_responses.go | 98 ++ .../publish_post_mortem_report_parameters.go | 169 ++ .../publish_post_mortem_report_responses.go | 167 ++ .../reorder_post_mortem_reasons_parameters.go | 169 ++ .../reorder_post_mortem_reasons_responses.go | 98 ++ .../retrospectives/retrospectives_client.go | 650 ++++---- ...hare_incident_retrospectives_parameters.go | 284 ++++ ...share_incident_retrospectives_responses.go | 98 ++ ...incident_retrospective_field_parameters.go | 207 +++ ..._incident_retrospective_field_responses.go | 98 ++ ...pdate_incident_retrospective_parameters.go | 188 +++ ...update_incident_retrospective_responses.go | 98 ++ .../update_post_mortem_field_parameters.go | 188 +++ .../update_post_mortem_field_responses.go | 98 ++ ...update_post_mortem_questions_parameters.go | 150 ++ .../update_post_mortem_questions_responses.go | 98 ++ .../update_post_mortem_reason_parameters.go | 188 +++ .../update_post_mortem_reason_responses.go | 98 ++ .../update_post_mortem_report_parameters.go | 169 ++ .../update_post_mortem_report_responses.go | 98 ++ ...pdate_retrospective_template_parameters.go | 614 +++++++ ...update_retrospective_template_responses.go | 98 ++ .../create_runbook_execution_parameters.go | 150 ++ .../create_runbook_execution_responses.go | 98 ++ client/runbooks/create_runbook_parameters.go | 150 ++ client/runbooks/create_runbook_responses.go | 98 ++ .../delete_runbook_execution_parameters.go | 175 ++ .../delete_runbook_execution_responses.go | 83 + client/runbooks/delete_runbook_parameters.go | 148 ++ client/runbooks/delete_runbook_responses.go | 98 ++ ...runbook_action_field_options_parameters.go | 291 ++++ ..._runbook_action_field_options_responses.go | 83 + .../get_runbook_execution_parameters.go | 148 ++ .../get_runbook_execution_responses.go | 98 ++ ...unbook_execution_step_script_parameters.go | 167 ++ ...runbook_execution_step_script_responses.go | 98 ++ client/runbooks/get_runbook_parameters.go | 148 ++ client/runbooks/get_runbook_responses.go | 98 ++ .../list_runbook_actions_parameters.go | 264 +++ .../list_runbook_actions_responses.go | 98 ++ .../list_runbook_audits_parameters.go | 277 ++++ .../runbooks/list_runbook_audits_responses.go | 83 + .../list_runbook_executions_parameters.go | 196 +++ .../list_runbook_executions_responses.go | 98 ++ client/runbooks/list_runbooks_parameters.go | 366 +++++ client/runbooks/list_runbooks_responses.go | 98 ++ client/runbooks/runbooks_client.go | 308 ++-- ...pdate_runbook_execution_step_parameters.go | 188 +++ ...update_runbook_execution_step_responses.go | 98 ++ ...unbook_execution_step_script_parameters.go | 186 +++ ...runbook_execution_step_script_responses.go | 98 ++ client/runbooks/update_runbook_parameters.go | 169 ++ client/runbooks/update_runbook_responses.go | 100 ++ .../s_c_i_m/create_scim_group_parameters.go | 150 ++ client/s_c_i_m/create_scim_group_responses.go | 83 + client/s_c_i_m/create_scim_user_parameters.go | 150 ++ client/s_c_i_m/create_scim_user_responses.go | 83 + .../s_c_i_m/delete_scim_group_parameters.go | 148 ++ client/s_c_i_m/delete_scim_group_responses.go | 83 + client/s_c_i_m/delete_scim_user_parameters.go | 148 ++ client/s_c_i_m/delete_scim_user_responses.go | 83 + client/s_c_i_m/get_scim_group_parameters.go | 148 ++ client/s_c_i_m/get_scim_group_responses.go | 83 + client/s_c_i_m/get_scim_user_parameters.go | 148 ++ client/s_c_i_m/get_scim_user_responses.go | 83 + client/s_c_i_m/list_scim_groups_parameters.go | 232 +++ client/s_c_i_m/list_scim_groups_responses.go | 83 + client/s_c_i_m/list_scim_users_parameters.go | 238 +++ client/s_c_i_m/list_scim_users_responses.go | 83 + client/s_c_i_m/patch_scim_user_parameters.go | 169 ++ client/s_c_i_m/patch_scim_user_responses.go | 83 + client/s_c_i_m/scim_client.go | 230 +-- .../s_c_i_m/update_scim_group_parameters.go | 169 ++ client/s_c_i_m/update_scim_group_responses.go | 83 + client/s_c_i_m/update_scim_user_parameters.go | 169 ++ client/s_c_i_m/update_scim_user_responses.go | 83 + .../create_on_call_shift_parameters.go | 188 +++ .../signals/create_on_call_shift_responses.go | 83 + .../create_signals_email_target_parameters.go | 150 ++ .../create_signals_email_target_responses.go | 83 + ...reate_signals_webhook_target_parameters.go | 150 ++ ...create_signals_webhook_target_responses.go | 83 + ...reate_team_escalation_policy_parameters.go | 169 ++ ...create_team_escalation_policy_responses.go | 83 + ...create_team_on_call_schedule_parameters.go | 169 ++ .../create_team_on_call_schedule_responses.go | 83 + .../create_team_signal_rule_parameters.go | 169 ++ .../create_team_signal_rule_responses.go | 83 + .../debug_signals_expression_parameters.go | 150 ++ .../debug_signals_expression_responses.go | 83 + .../delete_on_call_shift_parameters.go | 186 +++ .../signals/delete_on_call_shift_responses.go | 83 + .../delete_signals_email_target_parameters.go | 148 ++ .../delete_signals_email_target_responses.go | 83 + ...elete_signals_webhook_target_parameters.go | 148 ++ ...delete_signals_webhook_target_responses.go | 83 + ...elete_team_escalation_policy_parameters.go | 167 ++ ...delete_team_escalation_policy_responses.go | 83 + ...delete_team_on_call_schedule_parameters.go | 167 ++ .../delete_team_on_call_schedule_responses.go | 83 + .../delete_team_signal_rule_parameters.go | 167 ++ .../delete_team_signal_rule_responses.go | 83 + .../signals/get_on_call_shift_parameters.go | 186 +++ client/signals/get_on_call_shift_responses.go | 83 + .../get_signals_email_target_parameters.go | 148 ++ .../get_signals_email_target_responses.go | 83 + .../get_signals_ingest_url_parameters.go | 265 +++ .../get_signals_ingest_url_responses.go | 98 ++ .../get_signals_webhook_target_parameters.go | 148 ++ .../get_signals_webhook_target_responses.go | 83 + .../get_team_escalation_policy_parameters.go | 167 ++ .../get_team_escalation_policy_responses.go | 83 + .../get_team_on_call_schedule_parameters.go | 167 ++ .../get_team_on_call_schedule_responses.go | 83 + .../get_team_signal_rule_parameters.go | 167 ++ .../signals/get_team_signal_rule_responses.go | 83 + ...ganization_on_call_schedules_parameters.go | 163 ++ ...rganization_on_call_schedules_responses.go | 83 + .../list_signals_email_targets_parameters.go | 163 ++ .../list_signals_email_targets_responses.go | 83 + .../list_signals_event_sources_parameters.go | 265 +++ .../list_signals_event_sources_responses.go | 83 + .../list_signals_transposers_parameters.go | 128 ++ .../list_signals_transposers_responses.go | 98 ++ ...list_signals_webhook_targets_parameters.go | 230 +++ .../list_signals_webhook_targets_responses.go | 83 + ...ist_team_escalation_policies_parameters.go | 249 +++ ...list_team_escalation_policies_responses.go | 83 + .../list_team_on_call_schedules_parameters.go | 249 +++ .../list_team_on_call_schedules_responses.go | 83 + .../list_team_signal_rules_parameters.go | 249 +++ .../list_team_signal_rules_responses.go | 83 + client/signals/signals_client.go | 732 ++++----- .../update_on_call_shift_parameters.go | 207 +++ .../signals/update_on_call_shift_responses.go | 83 + .../update_signals_email_target_parameters.go | 169 ++ .../update_signals_email_target_responses.go | 83 + ...pdate_signals_webhook_target_parameters.go | 169 ++ ...update_signals_webhook_target_responses.go | 83 + ...pdate_team_escalation_policy_parameters.go | 188 +++ ...update_team_escalation_policy_responses.go | 83 + ...update_team_on_call_schedule_parameters.go | 188 +++ .../update_team_on_call_schedule_responses.go | 83 + .../update_team_signal_rule_parameters.go | 188 +++ .../update_team_signal_rule_responses.go | 83 + .../create_email_subscriber_parameters.go | 174 ++ .../create_email_subscriber_responses.go | 98 ++ .../create_nunc_component_group_parameters.go | 232 +++ .../create_nunc_component_group_responses.go | 98 ++ .../create_nunc_connection_parameters.go | 690 ++++++++ .../create_nunc_connection_responses.go | 98 ++ .../create_nunc_link_parameters.go | 148 ++ .../create_nunc_link_responses.go | 98 ++ .../create_nunc_subscription_parameters.go | 150 ++ .../create_nunc_subscription_responses.go | 98 ++ .../delete_email_subscriber_parameters.go | 175 ++ .../delete_email_subscriber_responses.go | 98 ++ .../delete_incident_status_page_parameters.go | 167 ++ .../delete_incident_status_page_responses.go | 83 + .../delete_nunc_component_group_parameters.go | 167 ++ .../delete_nunc_component_group_responses.go | 83 + .../delete_nunc_connection_parameters.go | 148 ++ .../delete_nunc_connection_responses.go | 98 ++ .../delete_nunc_image_parameters.go | 167 ++ .../delete_nunc_image_responses.go | 98 ++ .../delete_nunc_link_parameters.go | 167 ++ .../delete_nunc_link_responses.go | 83 + .../delete_nunc_subscription_parameters.go | 148 ++ .../delete_nunc_subscription_responses.go | 98 ++ .../get_nunc_connection_parameters.go | 148 ++ .../get_nunc_connection_responses.go | 98 ++ .../list_email_subscribers_parameters.go | 148 ++ .../list_email_subscribers_responses.go | 98 ++ .../list_nunc_connections_parameters.go | 128 ++ .../list_nunc_connections_responses.go | 98 ++ client/status_pages/status_pages_client.go | 410 ++--- .../update_nunc_component_group_parameters.go | 257 +++ .../update_nunc_component_group_responses.go | 83 + .../update_nunc_connection_parameters.go | 686 ++++++++ .../update_nunc_connection_responses.go | 98 ++ .../update_nunc_image_parameters.go | 191 +++ .../update_nunc_image_responses.go | 98 ++ .../update_nunc_link_parameters.go | 188 +++ .../update_nunc_link_responses.go | 83 + .../tasks/convert_incident_task_parameters.go | 188 +++ .../tasks/convert_incident_task_responses.go | 98 ++ .../create_checklist_template_parameters.go | 150 ++ .../create_checklist_template_responses.go | 167 ++ .../create_incident_task_list_parameters.go | 169 ++ .../create_incident_task_list_responses.go | 98 ++ .../tasks/create_incident_task_parameters.go | 169 ++ .../tasks/create_incident_task_responses.go | 98 ++ client/tasks/create_task_list_parameters.go | 150 ++ client/tasks/create_task_list_responses.go | 98 ++ .../delete_checklist_template_parameters.go | 151 ++ .../delete_checklist_template_responses.go | 98 ++ .../tasks/delete_incident_task_parameters.go | 167 ++ .../tasks/delete_incident_task_responses.go | 83 + client/tasks/delete_task_list_parameters.go | 148 ++ client/tasks/delete_task_list_responses.go | 98 ++ .../get_checklist_template_parameters.go | 148 ++ .../tasks/get_checklist_template_responses.go | 98 ++ client/tasks/get_incident_task_parameters.go | 167 ++ client/tasks/get_incident_task_responses.go | 83 + client/tasks/get_task_list_parameters.go | 148 ++ client/tasks/get_task_list_responses.go | 98 ++ .../list_checklist_templates_parameters.go | 230 +++ .../list_checklist_templates_responses.go | 98 ++ .../tasks/list_incident_tasks_parameters.go | 215 +++ client/tasks/list_incident_tasks_responses.go | 98 ++ client/tasks/list_task_lists_parameters.go | 196 +++ client/tasks/list_task_lists_responses.go | 98 ++ client/tasks/tasks_client.go | 370 ++--- .../update_checklist_template_parameters.go | 169 ++ .../update_checklist_template_responses.go | 98 ++ .../tasks/update_incident_task_parameters.go | 188 +++ .../tasks/update_incident_task_responses.go | 98 ++ client/tasks/update_task_list_parameters.go | 169 ++ client/tasks/update_task_list_responses.go | 98 ++ client/teams/create_team_parameters.go | 150 ++ client/teams/create_team_responses.go | 98 ++ client/teams/delete_team_parameters.go | 148 ++ client/teams/delete_team_responses.go | 98 ++ client/teams/get_team_parameters.go | 183 +++ client/teams/get_team_responses.go | 98 ++ client/teams/list_schedules_parameters.go | 230 +++ client/teams/list_schedules_responses.go | 98 ++ client/teams/list_teams_parameters.go | 366 +++++ client/teams/list_teams_responses.go | 98 ++ client/teams/teams_client.go | 128 +- client/teams/update_team_parameters.go | 169 ++ client/teams/update_team_responses.go | 98 ++ .../create_inbound_field_map_parameters.go | 148 ++ .../create_inbound_field_map_responses.go | 98 ++ client/ticketing/create_ticket_parameters.go | 150 ++ client/ticketing/create_ticket_responses.go | 98 ++ .../create_ticketing_field_map_parameters.go | 148 ++ .../create_ticketing_field_map_responses.go | 98 ++ .../create_ticketing_priority_parameters.go | 150 ++ .../create_ticketing_priority_responses.go | 98 ++ ...ate_ticketing_project_config_parameters.go | 148 ++ ...eate_ticketing_project_config_responses.go | 98 ++ .../delete_inbound_field_map_parameters.go | 167 ++ .../delete_inbound_field_map_responses.go | 83 + client/ticketing/delete_ticket_parameters.go | 148 ++ client/ticketing/delete_ticket_responses.go | 83 + .../delete_ticketing_field_map_parameters.go | 167 ++ .../delete_ticketing_field_map_responses.go | 83 + .../delete_ticketing_priority_parameters.go | 148 ++ .../delete_ticketing_priority_responses.go | 98 ++ ...ete_ticketing_project_config_parameters.go | 167 ++ ...lete_ticketing_project_config_responses.go | 98 ++ .../get_configuration_options_parameters.go | 148 ++ .../get_configuration_options_responses.go | 83 + .../get_inbound_field_map_parameters.go | 167 ++ .../get_inbound_field_map_responses.go | 98 ++ .../get_options_for_field_parameters.go | 167 ++ .../get_options_for_field_responses.go | 83 + client/ticketing/get_ticket_parameters.go | 148 ++ client/ticketing/get_ticket_responses.go | 98 ++ .../get_ticketing_field_map_parameters.go | 167 ++ .../get_ticketing_field_map_responses.go | 98 ++ .../get_ticketing_priority_parameters.go | 148 ++ .../get_ticketing_priority_responses.go | 98 ++ ...get_ticketing_project_config_parameters.go | 167 ++ .../get_ticketing_project_config_responses.go | 98 ++ .../get_ticketing_project_parameters.go | 148 ++ .../get_ticketing_project_responses.go | 98 ++ ...available_inbound_field_maps_parameters.go | 148 ++ ..._available_inbound_field_maps_responses.go | 98 ++ ...ailable_ticketing_field_maps_parameters.go | 148 ++ ...vailable_ticketing_field_maps_responses.go | 98 ++ .../list_inbound_field_maps_parameters.go | 249 +++ .../list_inbound_field_maps_responses.go | 98 ++ .../ticketing/list_ticket_tags_parameters.go | 160 ++ .../ticketing/list_ticket_tags_responses.go | 98 ++ .../list_ticketing_priorities_parameters.go | 128 ++ .../list_ticketing_priorities_responses.go | 98 ++ .../list_ticketing_projects_parameters.go | 351 ++++ .../list_ticketing_projects_responses.go | 98 ++ client/ticketing/list_tickets_parameters.go | 332 ++++ client/ticketing/list_tickets_responses.go | 98 ++ client/ticketing/ticketing_client.go | 640 ++++---- .../update_inbound_field_map_parameters.go | 167 ++ .../update_inbound_field_map_responses.go | 98 ++ client/ticketing/update_ticket_parameters.go | 169 ++ client/ticketing/update_ticket_responses.go | 98 ++ .../update_ticketing_field_map_parameters.go | 167 ++ .../update_ticketing_field_map_responses.go | 98 ++ .../update_ticketing_priority_parameters.go | 169 ++ .../update_ticketing_priority_responses.go | 98 ++ ...ate_ticketing_project_config_parameters.go | 167 ++ ...date_ticketing_project_config_responses.go | 98 ++ client/users/get_current_user_parameters.go | 128 ++ client/users/get_current_user_responses.go | 98 ++ client/users/get_user_parameters.go | 148 ++ client/users/get_user_responses.go | 98 ++ client/users/list_users_parameters.go | 264 +++ client/users/list_users_responses.go | 98 ++ client/users/users_client.go | 56 +- client/webhooks/create_webhook_parameters.go | 150 ++ client/webhooks/create_webhook_responses.go | 98 ++ client/webhooks/delete_webhook_parameters.go | 148 ++ client/webhooks/delete_webhook_responses.go | 83 + client/webhooks/get_webhook_parameters.go | 148 ++ client/webhooks/get_webhook_responses.go | 98 ++ .../list_webhook_deliveries_parameters.go | 151 ++ .../list_webhook_deliveries_responses.go | 83 + client/webhooks/list_webhooks_parameters.go | 196 +++ client/webhooks/list_webhooks_responses.go | 98 ++ client/webhooks/update_webhook_parameters.go | 169 ++ client/webhooks/update_webhook_responses.go | 98 ++ client/webhooks/webhooks_client.go | 120 +- models/alerts_alert_entity.go | 57 + models/bulk_update_incident_milestones.go | 253 +++ models/convert_incident_task.go | 62 + models/create_change.go | 56 + models/create_change_event.go | 558 +++++++ models/create_change_identity.go | 88 + models/create_checklist_template.go | 314 ++++ models/create_comment.go | 71 + models/create_comment_reaction.go | 71 + models/create_custom_field_definition.go | 114 ++ models/create_environment.go | 74 + models/create_functionality.go | 666 ++++++++ models/create_incident.go | 523 ++++++ models/create_incident_change_event.go | 133 ++ models/create_incident_chat_message.go | 142 ++ models/create_incident_impact.go | 74 + models/create_incident_link.go | 77 + models/create_incident_note.go | 281 ++++ models/create_incident_role.go | 91 ++ models/create_incident_role_assignment.go | 88 + models/create_incident_status_page.go | 91 ++ models/create_incident_task.go | 83 + models/create_incident_task_list.go | 74 + models/create_incident_team_assignment.go | 71 + models/create_incident_type.go | 326 ++++ models/create_nunc_subscription.go | 71 + models/create_on_call_shift.go | 91 ++ models/create_post_mortem_reason.go | 71 + models/create_post_mortem_report.go | 71 + models/create_priority.go | 77 + models/create_runbook.go | 595 +++++++ models/create_runbook_execution.go | 88 + models/create_saved_search.go | 91 ++ models/create_scheduled_maintenance.go | 393 +++++ models/create_scim_group.go | 192 +++ models/create_scim_user.go | 336 ++++ models/create_service.go | 692 ++++++++ models/create_service_checklist_response.go | 88 + models/create_service_dependency.go | 91 ++ models/create_service_links.go | 144 ++ models/create_severity.go | 140 ++ models/create_severity_matrix_condition.go | 74 + models/create_severity_matrix_impact.go | 91 ++ models/create_signals_email_target.go | 317 ++++ models/create_signals_webhook_target.go | 97 ++ models/create_status_update_template.go | 88 + models/create_task_list.go | 198 +++ models/create_team.go | 306 ++++ models/create_team_escalation_policy.go | 1427 +++++++++++++++++ models/create_team_on_call_schedule.go | 684 ++++++++ models/create_team_signal_rule.go | 279 ++++ models/create_ticket.go | 95 ++ models/create_ticketing_priority.go | 74 + models/create_webhook.go | 71 + models/debug_signals_expression.go | 395 +++++ models/ingest_catalog_data.go | 127 ++ models/patch_scim_user.go | 195 +++ models/publish_post_mortem_report.go | 108 ++ models/reorder_post_mortem_reasons.go | 88 + models/update_aws_cloudtrail_batch.go | 83 + models/update_aws_connection.go | 56 + models/update_change.go | 56 + models/update_change_event.go | 261 +++ models/update_change_identity.go | 88 + models/update_checklist_template.go | 307 ++++ models/update_comment.go | 50 + models/update_custom_field_definition.go | 62 + models/update_environment.go | 74 + models/update_functionality.go | 679 ++++++++ models/update_incident.go | 77 + models/update_incident_alert_primary.go | 71 + models/update_incident_change_event.go | 114 ++ models/update_incident_chat_message.go | 71 + models/update_incident_impact_patch.go | 332 ++++ models/update_incident_impact_put.go | 332 ++++ models/update_incident_link.go | 56 + models/update_incident_note.go | 71 + models/update_incident_retrospective.go | 50 + models/update_incident_retrospective_field.go | 74 + models/update_incident_role.go | 56 + models/update_incident_task.go | 62 + models/update_incident_type.go | 326 ++++ models/update_nunc_link.go | 56 + models/update_on_call_shift.go | 59 + models/update_post_mortem_field.go | 71 + models/update_post_mortem_questions.go | 162 ++ models/update_post_mortem_reason.go | 50 + models/update_post_mortem_report.go | 165 ++ models/update_priority.go | 56 + models/update_runbook.go | 789 +++++++++ models/update_runbook_execution_step.go | 114 ++ models/update_saved_search.go | 56 + models/update_scheduled_maintenance.go | 375 +++++ models/update_scim_group.go | 192 +++ models/update_scim_user.go | 304 ++++ models/update_service.go | 825 ++++++++++ models/update_service_dependency.go | 50 + models/update_severity.go | 126 ++ models/update_severity_matrix.go | 212 +++ models/update_severity_matrix_condition.go | 53 + models/update_severity_matrix_impact.go | 53 + models/update_signals_email_target.go | 303 ++++ models/update_signals_webhook_target.go | 62 + models/update_status_update_template.go | 53 + models/update_statuspage_connection.go | 495 ++++++ models/update_task_list.go | 182 +++ models/update_team.go | 292 ++++ models/update_team_escalation_policy.go | 1409 ++++++++++++++++ models/update_team_on_call_schedule.go | 657 ++++++++ models/update_team_signal_rule.go | 235 +++ models/update_ticket.go | 65 + models/update_ticketing_priority.go | 53 + models/update_vote.go | 110 ++ models/update_webhook.go | 108 ++ 956 files changed, 151670 insertions(+), 4213 deletions(-) create mode 100644 client/account_settings/get_ai_preferences_parameters.go create mode 100644 client/account_settings/get_ai_preferences_responses.go create mode 100644 client/account_settings/get_bootstrap_parameters.go create mode 100644 client/account_settings/get_bootstrap_responses.go create mode 100644 client/account_settings/list_entitlements_parameters.go create mode 100644 client/account_settings/list_entitlements_responses.go create mode 100644 client/account_settings/ping_noauth_parameters.go create mode 100644 client/account_settings/ping_noauth_responses.go create mode 100644 client/account_settings/ping_parameters.go create mode 100644 client/account_settings/ping_responses.go create mode 100644 client/account_settings/update_ai_preferences_parameters.go create mode 100644 client/account_settings/update_ai_preferences_responses.go create mode 100644 client/alerts/create_incident_alert_parameters.go create mode 100644 client/alerts/create_incident_alert_responses.go create mode 100644 client/alerts/delete_incident_alert_parameters.go create mode 100644 client/alerts/delete_incident_alert_responses.go create mode 100644 client/alerts/get_alert_parameters.go create mode 100644 client/alerts/get_alert_responses.go create mode 100644 client/alerts/list_alerts_parameters.go create mode 100644 client/alerts/list_alerts_responses.go create mode 100644 client/alerts/list_incident_alerts_parameters.go create mode 100644 client/alerts/list_incident_alerts_responses.go create mode 100644 client/alerts/list_processing_log_entries_parameters.go create mode 100644 client/alerts/list_processing_log_entries_responses.go create mode 100644 client/alerts/update_incident_alert_primary_parameters.go create mode 100644 client/alerts/update_incident_alert_primary_responses.go create mode 100644 client/audiences/archive_audience_parameters.go create mode 100644 client/audiences/archive_audience_responses.go create mode 100644 client/audiences/create_audience_parameters.go create mode 100644 client/audiences/create_audience_responses.go create mode 100644 client/audiences/generate_audience_summary_parameters.go create mode 100644 client/audiences/generate_audience_summary_responses.go create mode 100644 client/audiences/get_audience_parameters.go create mode 100644 client/audiences/get_audience_responses.go create mode 100644 client/audiences/get_audience_summary_parameters.go create mode 100644 client/audiences/get_audience_summary_responses.go create mode 100644 client/audiences/get_member_default_audience_parameters.go create mode 100644 client/audiences/get_member_default_audience_responses.go create mode 100644 client/audiences/list_audience_summaries_parameters.go create mode 100644 client/audiences/list_audience_summaries_responses.go create mode 100644 client/audiences/list_audiences_parameters.go create mode 100644 client/audiences/list_audiences_responses.go create mode 100644 client/audiences/restore_audience_parameters.go create mode 100644 client/audiences/restore_audience_responses.go create mode 100644 client/audiences/set_member_default_audience_parameters.go create mode 100644 client/audiences/set_member_default_audience_responses.go create mode 100644 client/audiences/update_audience_parameters.go create mode 100644 client/audiences/update_audience_responses.go create mode 100644 client/catalog_entries/catalog_entries_client.go create mode 100644 client/catalog_entries/create_environment_parameters.go create mode 100644 client/catalog_entries/create_environment_responses.go create mode 100644 client/catalog_entries/create_functionality_parameters.go create mode 100644 client/catalog_entries/create_functionality_responses.go create mode 100644 client/catalog_entries/create_service_checklist_response_parameters.go create mode 100644 client/catalog_entries/create_service_checklist_response_responses.go create mode 100644 client/catalog_entries/create_service_dependency_parameters.go create mode 100644 client/catalog_entries/create_service_dependency_responses.go create mode 100644 client/catalog_entries/create_service_links_parameters.go create mode 100644 client/catalog_entries/create_service_links_responses.go create mode 100644 client/catalog_entries/create_service_parameters.go create mode 100644 client/catalog_entries/create_service_responses.go create mode 100644 client/catalog_entries/delete_environment_parameters.go create mode 100644 client/catalog_entries/delete_environment_responses.go create mode 100644 client/catalog_entries/delete_functionality_parameters.go create mode 100644 client/catalog_entries/delete_functionality_responses.go create mode 100644 client/catalog_entries/delete_service_dependency_parameters.go create mode 100644 client/catalog_entries/delete_service_dependency_responses.go create mode 100644 client/catalog_entries/delete_service_link_parameters.go create mode 100644 client/catalog_entries/delete_service_link_responses.go create mode 100644 client/catalog_entries/delete_service_parameters.go create mode 100644 client/catalog_entries/delete_service_responses.go create mode 100644 client/catalog_entries/get_environment_parameters.go create mode 100644 client/catalog_entries/get_environment_responses.go create mode 100644 client/catalog_entries/get_functionality_parameters.go create mode 100644 client/catalog_entries/get_functionality_responses.go create mode 100644 client/catalog_entries/get_service_dependencies_parameters.go create mode 100644 client/catalog_entries/get_service_dependencies_responses.go create mode 100644 client/catalog_entries/get_service_dependency_parameters.go create mode 100644 client/catalog_entries/get_service_dependency_responses.go create mode 100644 client/catalog_entries/get_service_parameters.go create mode 100644 client/catalog_entries/get_service_responses.go create mode 100644 client/catalog_entries/ingest_catalog_data_parameters.go create mode 100644 client/catalog_entries/ingest_catalog_data_responses.go create mode 100644 client/catalog_entries/list_environments_parameters.go create mode 100644 client/catalog_entries/list_environments_responses.go create mode 100644 client/catalog_entries/list_functionalities_parameters.go create mode 100644 client/catalog_entries/list_functionalities_responses.go create mode 100644 client/catalog_entries/list_functionality_services_parameters.go create mode 100644 client/catalog_entries/list_functionality_services_responses.go create mode 100644 client/catalog_entries/list_infrastructures_parameters.go create mode 100644 client/catalog_entries/list_infrastructures_responses.go create mode 100644 client/catalog_entries/list_service_available_downstream_dependencies_parameters.go create mode 100644 client/catalog_entries/list_service_available_downstream_dependencies_responses.go create mode 100644 client/catalog_entries/list_service_available_upstream_dependencies_parameters.go create mode 100644 client/catalog_entries/list_service_available_upstream_dependencies_responses.go create mode 100644 client/catalog_entries/list_services_parameters.go create mode 100644 client/catalog_entries/list_services_responses.go create mode 100644 client/catalog_entries/list_user_owned_services_parameters.go create mode 100644 client/catalog_entries/list_user_owned_services_responses.go create mode 100644 client/catalog_entries/refresh_catalog_parameters.go create mode 100644 client/catalog_entries/refresh_catalog_responses.go create mode 100644 client/catalog_entries/update_environment_parameters.go create mode 100644 client/catalog_entries/update_environment_responses.go create mode 100644 client/catalog_entries/update_functionality_parameters.go create mode 100644 client/catalog_entries/update_functionality_responses.go create mode 100644 client/catalog_entries/update_service_dependency_parameters.go create mode 100644 client/catalog_entries/update_service_dependency_responses.go create mode 100644 client/catalog_entries/update_service_parameters.go create mode 100644 client/catalog_entries/update_service_responses.go create mode 100644 client/changes/create_change_event_parameters.go create mode 100644 client/changes/create_change_event_responses.go create mode 100644 client/changes/create_change_identity_parameters.go create mode 100644 client/changes/create_change_identity_responses.go create mode 100644 client/changes/create_change_parameters.go create mode 100644 client/changes/create_change_responses.go create mode 100644 client/changes/delete_change_event_parameters.go create mode 100644 client/changes/delete_change_event_responses.go create mode 100644 client/changes/delete_change_identity_parameters.go create mode 100644 client/changes/delete_change_identity_responses.go create mode 100644 client/changes/delete_change_parameters.go create mode 100644 client/changes/delete_change_responses.go create mode 100644 client/changes/get_change_event_parameters.go create mode 100644 client/changes/get_change_event_responses.go create mode 100644 client/changes/list_change_events_parameters.go create mode 100644 client/changes/list_change_events_responses.go create mode 100644 client/changes/list_change_identities_parameters.go create mode 100644 client/changes/list_change_identities_responses.go create mode 100644 client/changes/list_change_types_parameters.go create mode 100644 client/changes/list_change_types_responses.go create mode 100644 client/changes/list_changes_parameters.go create mode 100644 client/changes/list_changes_responses.go create mode 100644 client/changes/update_change_event_parameters.go create mode 100644 client/changes/update_change_event_responses.go create mode 100644 client/changes/update_change_identity_parameters.go create mode 100644 client/changes/update_change_identity_responses.go create mode 100644 client/changes/update_change_parameters.go create mode 100644 client/changes/update_change_responses.go create mode 100644 client/communication/create_status_update_template_parameters.go create mode 100644 client/communication/create_status_update_template_responses.go create mode 100644 client/communication/delete_status_update_template_parameters.go create mode 100644 client/communication/delete_status_update_template_responses.go create mode 100644 client/communication/get_status_update_template_parameters.go create mode 100644 client/communication/get_status_update_template_responses.go create mode 100644 client/communication/list_status_update_templates_parameters.go create mode 100644 client/communication/list_status_update_templates_responses.go create mode 100644 client/communication/update_status_update_template_parameters.go create mode 100644 client/communication/update_status_update_template_responses.go create mode 100644 client/conversations/create_comment_parameters.go create mode 100644 client/conversations/create_comment_reaction_parameters.go create mode 100644 client/conversations/create_comment_reaction_responses.go create mode 100644 client/conversations/create_comment_responses.go create mode 100644 client/conversations/delete_comment_parameters.go create mode 100644 client/conversations/delete_comment_reaction_parameters.go create mode 100644 client/conversations/delete_comment_reaction_responses.go create mode 100644 client/conversations/delete_comment_responses.go create mode 100644 client/conversations/get_comment_parameters.go create mode 100644 client/conversations/get_comment_responses.go create mode 100644 client/conversations/get_vote_status_parameters.go create mode 100644 client/conversations/get_vote_status_responses.go create mode 100644 client/conversations/list_comment_reactions_parameters.go create mode 100644 client/conversations/list_comment_reactions_responses.go create mode 100644 client/conversations/list_comments_parameters.go create mode 100644 client/conversations/list_comments_responses.go create mode 100644 client/conversations/update_comment_parameters.go create mode 100644 client/conversations/update_comment_responses.go create mode 100644 client/conversations/update_vote_parameters.go create mode 100644 client/conversations/update_vote_responses.go create mode 100644 client/incident_settings/create_custom_field_definition_parameters.go create mode 100644 client/incident_settings/create_custom_field_definition_responses.go create mode 100644 client/incident_settings/create_incident_role_parameters.go create mode 100644 client/incident_settings/create_incident_role_responses.go create mode 100644 client/incident_settings/create_incident_type_parameters.go create mode 100644 client/incident_settings/create_incident_type_responses.go create mode 100644 client/incident_settings/create_lifecycle_measurement_definition_parameters.go create mode 100644 client/incident_settings/create_lifecycle_measurement_definition_responses.go create mode 100644 client/incident_settings/create_lifecycle_milestone_parameters.go create mode 100644 client/incident_settings/create_lifecycle_milestone_responses.go create mode 100644 client/incident_settings/create_priority_parameters.go create mode 100644 client/incident_settings/create_priority_responses.go create mode 100644 client/incident_settings/create_severity_matrix_condition_parameters.go create mode 100644 client/incident_settings/create_severity_matrix_condition_responses.go create mode 100644 client/incident_settings/create_severity_matrix_impact_parameters.go create mode 100644 client/incident_settings/create_severity_matrix_impact_responses.go create mode 100644 client/incident_settings/create_severity_parameters.go create mode 100644 client/incident_settings/create_severity_responses.go create mode 100644 client/incident_settings/delete_custom_field_definition_parameters.go create mode 100644 client/incident_settings/delete_custom_field_definition_responses.go create mode 100644 client/incident_settings/delete_incident_role_parameters.go create mode 100644 client/incident_settings/delete_incident_role_responses.go create mode 100644 client/incident_settings/delete_incident_type_parameters.go create mode 100644 client/incident_settings/delete_incident_type_responses.go create mode 100644 client/incident_settings/delete_lifecycle_measurement_definition_parameters.go create mode 100644 client/incident_settings/delete_lifecycle_measurement_definition_responses.go create mode 100644 client/incident_settings/delete_lifecycle_milestone_parameters.go create mode 100644 client/incident_settings/delete_lifecycle_milestone_responses.go create mode 100644 client/incident_settings/delete_priority_parameters.go create mode 100644 client/incident_settings/delete_priority_responses.go create mode 100644 client/incident_settings/delete_severity_matrix_condition_parameters.go create mode 100644 client/incident_settings/delete_severity_matrix_condition_responses.go create mode 100644 client/incident_settings/delete_severity_matrix_impact_parameters.go create mode 100644 client/incident_settings/delete_severity_matrix_impact_responses.go create mode 100644 client/incident_settings/delete_severity_parameters.go create mode 100644 client/incident_settings/delete_severity_responses.go create mode 100644 client/incident_settings/get_form_configuration_parameters.go create mode 100644 client/incident_settings/get_form_configuration_responses.go create mode 100644 client/incident_settings/get_incident_role_parameters.go create mode 100644 client/incident_settings/get_incident_role_responses.go create mode 100644 client/incident_settings/get_incident_type_parameters.go create mode 100644 client/incident_settings/get_incident_type_responses.go create mode 100644 client/incident_settings/get_lifecycle_measurement_definition_parameters.go create mode 100644 client/incident_settings/get_lifecycle_measurement_definition_responses.go create mode 100644 client/incident_settings/get_priority_parameters.go create mode 100644 client/incident_settings/get_priority_responses.go create mode 100644 client/incident_settings/get_severity_matrix_condition_parameters.go create mode 100644 client/incident_settings/get_severity_matrix_condition_responses.go create mode 100644 client/incident_settings/get_severity_matrix_parameters.go create mode 100644 client/incident_settings/get_severity_matrix_responses.go create mode 100644 client/incident_settings/get_severity_parameters.go create mode 100644 client/incident_settings/get_severity_responses.go create mode 100644 client/incident_settings/list_custom_field_definitions_parameters.go create mode 100644 client/incident_settings/list_custom_field_definitions_responses.go create mode 100644 client/incident_settings/list_custom_field_select_options_parameters.go create mode 100644 client/incident_settings/list_custom_field_select_options_responses.go create mode 100644 client/incident_settings/list_incident_roles_parameters.go create mode 100644 client/incident_settings/list_incident_roles_responses.go create mode 100644 client/incident_settings/list_incident_tags_parameters.go create mode 100644 client/incident_settings/list_incident_tags_responses.go create mode 100644 client/incident_settings/list_incident_types_parameters.go create mode 100644 client/incident_settings/list_incident_types_responses.go create mode 100644 client/incident_settings/list_lifecycle_measurement_definitions_parameters.go create mode 100644 client/incident_settings/list_lifecycle_measurement_definitions_responses.go create mode 100644 client/incident_settings/list_lifecycle_phases_parameters.go create mode 100644 client/incident_settings/list_lifecycle_phases_responses.go create mode 100644 client/incident_settings/list_priorities_parameters.go create mode 100644 client/incident_settings/list_priorities_responses.go create mode 100644 client/incident_settings/list_severities_parameters.go create mode 100644 client/incident_settings/list_severities_responses.go create mode 100644 client/incident_settings/list_severity_matrix_conditions_parameters.go create mode 100644 client/incident_settings/list_severity_matrix_conditions_responses.go create mode 100644 client/incident_settings/list_severity_matrix_impacts_parameters.go create mode 100644 client/incident_settings/list_severity_matrix_impacts_responses.go create mode 100644 client/incident_settings/update_custom_field_definition_parameters.go create mode 100644 client/incident_settings/update_custom_field_definition_responses.go create mode 100644 client/incident_settings/update_incident_role_parameters.go create mode 100644 client/incident_settings/update_incident_role_responses.go create mode 100644 client/incident_settings/update_incident_type_parameters.go create mode 100644 client/incident_settings/update_incident_type_responses.go create mode 100644 client/incident_settings/update_lifecycle_measurement_definition_parameters.go create mode 100644 client/incident_settings/update_lifecycle_measurement_definition_responses.go create mode 100644 client/incident_settings/update_lifecycle_milestone_parameters.go create mode 100644 client/incident_settings/update_lifecycle_milestone_responses.go create mode 100644 client/incident_settings/update_priority_parameters.go create mode 100644 client/incident_settings/update_priority_responses.go create mode 100644 client/incident_settings/update_severity_matrix_condition_parameters.go create mode 100644 client/incident_settings/update_severity_matrix_condition_responses.go create mode 100644 client/incident_settings/update_severity_matrix_impact_parameters.go create mode 100644 client/incident_settings/update_severity_matrix_impact_responses.go create mode 100644 client/incident_settings/update_severity_matrix_parameters.go create mode 100644 client/incident_settings/update_severity_matrix_responses.go create mode 100644 client/incident_settings/update_severity_parameters.go create mode 100644 client/incident_settings/update_severity_responses.go create mode 100644 client/incident_settings/validate_incident_tags_parameters.go create mode 100644 client/incident_settings/validate_incident_tags_responses.go create mode 100644 client/incidents/bulk_update_incident_milestones_parameters.go create mode 100644 client/incidents/bulk_update_incident_milestones_responses.go create mode 100644 client/incidents/close_incident_parameters.go create mode 100644 client/incidents/close_incident_responses.go create mode 100644 client/incidents/create_incident_attachment_parameters.go create mode 100644 client/incidents/create_incident_attachment_responses.go create mode 100644 client/incidents/create_incident_change_event_parameters.go create mode 100644 client/incidents/create_incident_change_event_responses.go create mode 100644 client/incidents/create_incident_chat_message_parameters.go create mode 100644 client/incidents/create_incident_chat_message_responses.go create mode 100644 client/incidents/create_incident_impact_parameters.go create mode 100644 client/incidents/create_incident_impact_responses.go create mode 100644 client/incidents/create_incident_link_parameters.go create mode 100644 client/incidents/create_incident_link_responses.go create mode 100644 client/incidents/create_incident_note_parameters.go create mode 100644 client/incidents/create_incident_note_responses.go create mode 100644 client/incidents/create_incident_parameters.go create mode 100644 client/incidents/create_incident_responses.go create mode 100644 client/incidents/create_incident_role_assignment_parameters.go create mode 100644 client/incidents/create_incident_role_assignment_responses.go create mode 100644 client/incidents/create_incident_status_page_parameters.go create mode 100644 client/incidents/create_incident_status_page_responses.go create mode 100644 client/incidents/create_incident_team_assignment_parameters.go create mode 100644 client/incidents/create_incident_team_assignment_responses.go create mode 100644 client/incidents/create_scheduled_maintenance_parameters.go create mode 100644 client/incidents/create_scheduled_maintenance_responses.go create mode 100644 client/incidents/delete_incident_chat_message_parameters.go create mode 100644 client/incidents/delete_incident_chat_message_responses.go create mode 100644 client/incidents/delete_incident_event_parameters.go create mode 100644 client/incidents/delete_incident_event_responses.go create mode 100644 client/incidents/delete_incident_impact_parameters.go create mode 100644 client/incidents/delete_incident_impact_responses.go create mode 100644 client/incidents/delete_incident_link_parameters.go create mode 100644 client/incidents/delete_incident_link_responses.go create mode 100644 client/incidents/delete_incident_parameters.go create mode 100644 client/incidents/delete_incident_responses.go create mode 100644 client/incidents/delete_incident_role_assignment_parameters.go create mode 100644 client/incidents/delete_incident_role_assignment_responses.go create mode 100644 client/incidents/delete_incident_team_assignment_parameters.go create mode 100644 client/incidents/delete_incident_team_assignment_responses.go create mode 100644 client/incidents/delete_scheduled_maintenance_parameters.go create mode 100644 client/incidents/delete_scheduled_maintenance_responses.go create mode 100644 client/incidents/delete_transcript_entry_parameters.go create mode 100644 client/incidents/delete_transcript_entry_responses.go create mode 100644 client/incidents/get_ai_incident_summary_vote_status_parameters.go create mode 100644 client/incidents/get_ai_incident_summary_vote_status_responses.go create mode 100644 client/incidents/get_conference_bridge_translation_parameters.go create mode 100644 client/incidents/get_conference_bridge_translation_responses.go create mode 100644 client/incidents/get_incident_channel_parameters.go create mode 100644 client/incidents/get_incident_channel_responses.go create mode 100644 client/incidents/get_incident_event_parameters.go create mode 100644 client/incidents/get_incident_event_responses.go create mode 100644 client/incidents/get_incident_parameters.go create mode 100644 client/incidents/get_incident_relationships_parameters.go create mode 100644 client/incidents/get_incident_relationships_responses.go create mode 100644 client/incidents/get_incident_responses.go create mode 100644 client/incidents/get_incident_user_parameters.go create mode 100644 client/incidents/get_incident_user_responses.go create mode 100644 client/incidents/get_scheduled_maintenance_parameters.go create mode 100644 client/incidents/get_scheduled_maintenance_responses.go create mode 100644 client/incidents/list_incident_attachments_parameters.go create mode 100644 client/incidents/list_incident_attachments_responses.go create mode 100644 client/incidents/list_incident_change_events_parameters.go create mode 100644 client/incidents/list_incident_change_events_responses.go create mode 100644 client/incidents/list_incident_conference_bridges_parameters.go create mode 100644 client/incidents/list_incident_conference_bridges_responses.go create mode 100644 client/incidents/list_incident_events_parameters.go create mode 100644 client/incidents/list_incident_events_responses.go create mode 100644 client/incidents/list_incident_impacts_parameters.go create mode 100644 client/incidents/list_incident_impacts_responses.go create mode 100644 client/incidents/list_incident_links_parameters.go create mode 100644 client/incidents/list_incident_links_responses.go create mode 100644 client/incidents/list_incident_milestones_parameters.go create mode 100644 client/incidents/list_incident_milestones_responses.go create mode 100644 client/incidents/list_incident_role_assignments_parameters.go create mode 100644 client/incidents/list_incident_role_assignments_responses.go create mode 100644 client/incidents/list_incident_status_pages_parameters.go create mode 100644 client/incidents/list_incident_status_pages_responses.go create mode 100644 client/incidents/list_incidents_parameters.go create mode 100644 client/incidents/list_incidents_responses.go create mode 100644 client/incidents/list_scheduled_maintenances_parameters.go create mode 100644 client/incidents/list_scheduled_maintenances_responses.go create mode 100644 client/incidents/list_similar_incidents_parameters.go create mode 100644 client/incidents/list_similar_incidents_responses.go create mode 100644 client/incidents/list_transcript_entries_parameters.go create mode 100644 client/incidents/list_transcript_entries_responses.go create mode 100644 client/incidents/resolve_incident_parameters.go create mode 100644 client/incidents/resolve_incident_responses.go create mode 100644 client/incidents/unarchive_incident_parameters.go create mode 100644 client/incidents/unarchive_incident_responses.go create mode 100644 client/incidents/update_incident_change_event_parameters.go create mode 100644 client/incidents/update_incident_change_event_responses.go create mode 100644 client/incidents/update_incident_chat_message_parameters.go create mode 100644 client/incidents/update_incident_chat_message_responses.go create mode 100644 client/incidents/update_incident_event_parameters.go create mode 100644 client/incidents/update_incident_event_responses.go create mode 100644 client/incidents/update_incident_impact_patch_parameters.go create mode 100644 client/incidents/update_incident_impact_patch_responses.go create mode 100644 client/incidents/update_incident_impact_put_parameters.go create mode 100644 client/incidents/update_incident_impact_put_responses.go create mode 100644 client/incidents/update_incident_link_parameters.go create mode 100644 client/incidents/update_incident_link_responses.go create mode 100644 client/incidents/update_incident_note_parameters.go create mode 100644 client/incidents/update_incident_note_responses.go create mode 100644 client/incidents/update_incident_parameters.go create mode 100644 client/incidents/update_incident_responses.go create mode 100644 client/incidents/update_scheduled_maintenance_parameters.go create mode 100644 client/incidents/update_scheduled_maintenance_responses.go create mode 100644 client/incidents/update_transcript_attribution_parameters.go create mode 100644 client/incidents/update_transcript_attribution_responses.go create mode 100644 client/incidents/vote_ai_incident_summary_parameters.go create mode 100644 client/incidents/vote_ai_incident_summary_responses.go create mode 100644 client/integrations/create_connection_parameters.go create mode 100644 client/integrations/create_connection_responses.go create mode 100644 client/integrations/create_slack_emoji_action_parameters.go create mode 100644 client/integrations/create_slack_emoji_action_responses.go create mode 100644 client/integrations/delete_slack_emoji_action_parameters.go create mode 100644 client/integrations/delete_slack_emoji_action_responses.go create mode 100644 client/integrations/delete_statuspage_connection_parameters.go create mode 100644 client/integrations/delete_statuspage_connection_responses.go create mode 100644 client/integrations/get_aws_cloudtrail_batch_parameters.go create mode 100644 client/integrations/get_aws_cloudtrail_batch_responses.go create mode 100644 client/integrations/get_aws_connection_parameters.go create mode 100644 client/integrations/get_aws_connection_responses.go create mode 100644 client/integrations/get_integration_parameters.go create mode 100644 client/integrations/get_integration_responses.go create mode 100644 client/integrations/get_slack_emoji_action_parameters.go create mode 100644 client/integrations/get_slack_emoji_action_responses.go create mode 100644 client/integrations/get_statuspage_connection_parameters.go create mode 100644 client/integrations/get_statuspage_connection_responses.go create mode 100644 client/integrations/get_zendesk_customer_support_issue_parameters.go create mode 100644 client/integrations/get_zendesk_customer_support_issue_responses.go create mode 100644 client/integrations/list_authed_providers_parameters.go create mode 100644 client/integrations/list_authed_providers_responses.go create mode 100644 client/integrations/list_aws_cloudtrail_batch_events_parameters.go create mode 100644 client/integrations/list_aws_cloudtrail_batch_events_responses.go create mode 100644 client/integrations/list_aws_cloudtrail_batches_parameters.go create mode 100644 client/integrations/list_aws_cloudtrail_batches_responses.go create mode 100644 client/integrations/list_aws_connections_parameters.go create mode 100644 client/integrations/list_aws_connections_responses.go create mode 100644 client/integrations/list_connection_statuses_by_slug_parameters.go create mode 100644 client/integrations/list_connection_statuses_by_slug_responses.go create mode 100644 client/integrations/list_connection_statuses_parameters.go create mode 100644 client/integrations/list_connection_statuses_responses.go create mode 100644 client/integrations/list_connections_parameters.go create mode 100644 client/integrations/list_connections_responses.go create mode 100644 client/integrations/list_field_map_available_fields_parameters.go create mode 100644 client/integrations/list_field_map_available_fields_responses.go create mode 100644 client/integrations/list_integrations_parameters.go create mode 100644 client/integrations/list_integrations_responses.go create mode 100644 client/integrations/list_slack_emoji_actions_parameters.go create mode 100644 client/integrations/list_slack_emoji_actions_responses.go create mode 100644 client/integrations/list_slack_usergroups_parameters.go create mode 100644 client/integrations/list_slack_usergroups_responses.go create mode 100644 client/integrations/list_slack_workspaces_parameters.go create mode 100644 client/integrations/list_slack_workspaces_responses.go create mode 100644 client/integrations/list_statuspage_connection_pages_parameters.go create mode 100644 client/integrations/list_statuspage_connection_pages_responses.go create mode 100644 client/integrations/list_statuspage_connections_parameters.go create mode 100644 client/integrations/list_statuspage_connections_responses.go create mode 100644 client/integrations/refresh_connection_parameters.go create mode 100644 client/integrations/refresh_connection_responses.go create mode 100644 client/integrations/search_confluence_spaces_parameters.go create mode 100644 client/integrations/search_confluence_spaces_responses.go create mode 100644 client/integrations/search_zendesk_tickets_parameters.go create mode 100644 client/integrations/search_zendesk_tickets_responses.go create mode 100644 client/integrations/update_authed_provider_parameters.go create mode 100644 client/integrations/update_authed_provider_responses.go create mode 100644 client/integrations/update_aws_cloudtrail_batch_parameters.go create mode 100644 client/integrations/update_aws_cloudtrail_batch_responses.go create mode 100644 client/integrations/update_aws_connection_parameters.go create mode 100644 client/integrations/update_aws_connection_responses.go create mode 100644 client/integrations/update_connection_parameters.go create mode 100644 client/integrations/update_connection_responses.go create mode 100644 client/integrations/update_field_map_parameters.go create mode 100644 client/integrations/update_field_map_responses.go create mode 100644 client/integrations/update_slack_emoji_action_parameters.go create mode 100644 client/integrations/update_slack_emoji_action_responses.go create mode 100644 client/integrations/update_statuspage_connection_parameters.go create mode 100644 client/integrations/update_statuspage_connection_responses.go create mode 100644 client/reporting/create_saved_search_parameters.go create mode 100644 client/reporting/create_saved_search_responses.go create mode 100644 client/reporting/delete_saved_search_parameters.go create mode 100644 client/reporting/delete_saved_search_responses.go create mode 100644 client/reporting/export_signals_shift_analytics_parameters.go create mode 100644 client/reporting/export_signals_shift_analytics_responses.go create mode 100644 client/reporting/get_mean_time_report_parameters.go create mode 100644 client/reporting/get_mean_time_report_responses.go create mode 100644 client/reporting/get_saved_search_parameters.go create mode 100644 client/reporting/get_saved_search_responses.go create mode 100644 client/reporting/get_signals_grouped_metrics_parameters.go create mode 100644 client/reporting/get_signals_grouped_metrics_responses.go create mode 100644 client/reporting/get_signals_mttx_analytics_parameters.go create mode 100644 client/reporting/get_signals_mttx_analytics_responses.go create mode 100644 client/reporting/get_signals_timeseries_analytics_parameters.go create mode 100644 client/reporting/get_signals_timeseries_analytics_responses.go create mode 100644 client/reporting/list_incident_metrics_parameters.go create mode 100644 client/reporting/list_incident_metrics_responses.go create mode 100644 client/reporting/list_infrastructure_metrics_parameters.go create mode 100644 client/reporting/list_infrastructure_metrics_responses.go create mode 100644 client/reporting/list_infrastructure_type_metrics_parameters.go create mode 100644 client/reporting/list_infrastructure_type_metrics_responses.go create mode 100644 client/reporting/list_milestone_funnel_metrics_parameters.go create mode 100644 client/reporting/list_milestone_funnel_metrics_responses.go create mode 100644 client/reporting/list_mttx_metrics_parameters.go create mode 100644 client/reporting/list_mttx_metrics_responses.go create mode 100644 client/reporting/list_retrospective_metrics_parameters.go create mode 100644 client/reporting/list_retrospective_metrics_responses.go create mode 100644 client/reporting/list_saved_searches_parameters.go create mode 100644 client/reporting/list_saved_searches_responses.go create mode 100644 client/reporting/list_ticket_funnel_metrics_parameters.go create mode 100644 client/reporting/list_ticket_funnel_metrics_responses.go create mode 100644 client/reporting/list_user_involvement_metrics_parameters.go create mode 100644 client/reporting/list_user_involvement_metrics_responses.go create mode 100644 client/reporting/update_saved_search_parameters.go create mode 100644 client/reporting/update_saved_search_responses.go create mode 100644 client/retrospectives/create_incident_retrospective_dynamic_input_parameters.go create mode 100644 client/retrospectives/create_incident_retrospective_dynamic_input_responses.go create mode 100644 client/retrospectives/create_incident_retrospective_field_parameters.go create mode 100644 client/retrospectives/create_incident_retrospective_field_responses.go create mode 100644 client/retrospectives/create_incident_retrospective_parameters.go create mode 100644 client/retrospectives/create_incident_retrospective_responses.go create mode 100644 client/retrospectives/create_post_mortem_reason_parameters.go create mode 100644 client/retrospectives/create_post_mortem_reason_responses.go create mode 100644 client/retrospectives/create_post_mortem_report_parameters.go create mode 100644 client/retrospectives/create_post_mortem_report_responses.go create mode 100644 client/retrospectives/create_retrospective_template_parameters.go create mode 100644 client/retrospectives/create_retrospective_template_responses.go create mode 100644 client/retrospectives/delete_incident_retrospective_dynamic_input_parameters.go create mode 100644 client/retrospectives/delete_incident_retrospective_dynamic_input_responses.go create mode 100644 client/retrospectives/delete_post_mortem_reason_parameters.go create mode 100644 client/retrospectives/delete_post_mortem_reason_responses.go create mode 100644 client/retrospectives/delete_retrospective_template_parameters.go create mode 100644 client/retrospectives/delete_retrospective_template_responses.go create mode 100644 client/retrospectives/export_incident_retrospectives_parameters.go create mode 100644 client/retrospectives/export_incident_retrospectives_responses.go create mode 100644 client/retrospectives/get_incident_retrospective_field_parameters.go create mode 100644 client/retrospectives/get_incident_retrospective_field_responses.go create mode 100644 client/retrospectives/get_post_mortem_question_parameters.go create mode 100644 client/retrospectives/get_post_mortem_question_responses.go create mode 100644 client/retrospectives/get_post_mortem_report_parameters.go create mode 100644 client/retrospectives/get_post_mortem_report_responses.go create mode 100644 client/retrospectives/get_retrospective_template_parameters.go create mode 100644 client/retrospectives/get_retrospective_template_responses.go create mode 100644 client/retrospectives/list_incident_retrospectives_parameters.go create mode 100644 client/retrospectives/list_incident_retrospectives_responses.go create mode 100644 client/retrospectives/list_post_mortem_questions_parameters.go create mode 100644 client/retrospectives/list_post_mortem_questions_responses.go create mode 100644 client/retrospectives/list_post_mortem_reasons_parameters.go create mode 100644 client/retrospectives/list_post_mortem_reasons_responses.go create mode 100644 client/retrospectives/list_post_mortem_reports_parameters.go create mode 100644 client/retrospectives/list_post_mortem_reports_responses.go create mode 100644 client/retrospectives/list_retrospective_templates_parameters.go create mode 100644 client/retrospectives/list_retrospective_templates_responses.go create mode 100644 client/retrospectives/list_retrospectives_parameters.go create mode 100644 client/retrospectives/list_retrospectives_responses.go create mode 100644 client/retrospectives/publish_post_mortem_report_parameters.go create mode 100644 client/retrospectives/publish_post_mortem_report_responses.go create mode 100644 client/retrospectives/reorder_post_mortem_reasons_parameters.go create mode 100644 client/retrospectives/reorder_post_mortem_reasons_responses.go create mode 100644 client/retrospectives/share_incident_retrospectives_parameters.go create mode 100644 client/retrospectives/share_incident_retrospectives_responses.go create mode 100644 client/retrospectives/update_incident_retrospective_field_parameters.go create mode 100644 client/retrospectives/update_incident_retrospective_field_responses.go create mode 100644 client/retrospectives/update_incident_retrospective_parameters.go create mode 100644 client/retrospectives/update_incident_retrospective_responses.go create mode 100644 client/retrospectives/update_post_mortem_field_parameters.go create mode 100644 client/retrospectives/update_post_mortem_field_responses.go create mode 100644 client/retrospectives/update_post_mortem_questions_parameters.go create mode 100644 client/retrospectives/update_post_mortem_questions_responses.go create mode 100644 client/retrospectives/update_post_mortem_reason_parameters.go create mode 100644 client/retrospectives/update_post_mortem_reason_responses.go create mode 100644 client/retrospectives/update_post_mortem_report_parameters.go create mode 100644 client/retrospectives/update_post_mortem_report_responses.go create mode 100644 client/retrospectives/update_retrospective_template_parameters.go create mode 100644 client/retrospectives/update_retrospective_template_responses.go create mode 100644 client/runbooks/create_runbook_execution_parameters.go create mode 100644 client/runbooks/create_runbook_execution_responses.go create mode 100644 client/runbooks/create_runbook_parameters.go create mode 100644 client/runbooks/create_runbook_responses.go create mode 100644 client/runbooks/delete_runbook_execution_parameters.go create mode 100644 client/runbooks/delete_runbook_execution_responses.go create mode 100644 client/runbooks/delete_runbook_parameters.go create mode 100644 client/runbooks/delete_runbook_responses.go create mode 100644 client/runbooks/get_runbook_action_field_options_parameters.go create mode 100644 client/runbooks/get_runbook_action_field_options_responses.go create mode 100644 client/runbooks/get_runbook_execution_parameters.go create mode 100644 client/runbooks/get_runbook_execution_responses.go create mode 100644 client/runbooks/get_runbook_execution_step_script_parameters.go create mode 100644 client/runbooks/get_runbook_execution_step_script_responses.go create mode 100644 client/runbooks/get_runbook_parameters.go create mode 100644 client/runbooks/get_runbook_responses.go create mode 100644 client/runbooks/list_runbook_actions_parameters.go create mode 100644 client/runbooks/list_runbook_actions_responses.go create mode 100644 client/runbooks/list_runbook_audits_parameters.go create mode 100644 client/runbooks/list_runbook_audits_responses.go create mode 100644 client/runbooks/list_runbook_executions_parameters.go create mode 100644 client/runbooks/list_runbook_executions_responses.go create mode 100644 client/runbooks/list_runbooks_parameters.go create mode 100644 client/runbooks/list_runbooks_responses.go create mode 100644 client/runbooks/update_runbook_execution_step_parameters.go create mode 100644 client/runbooks/update_runbook_execution_step_responses.go create mode 100644 client/runbooks/update_runbook_execution_step_script_parameters.go create mode 100644 client/runbooks/update_runbook_execution_step_script_responses.go create mode 100644 client/runbooks/update_runbook_parameters.go create mode 100644 client/runbooks/update_runbook_responses.go create mode 100644 client/s_c_i_m/create_scim_group_parameters.go create mode 100644 client/s_c_i_m/create_scim_group_responses.go create mode 100644 client/s_c_i_m/create_scim_user_parameters.go create mode 100644 client/s_c_i_m/create_scim_user_responses.go create mode 100644 client/s_c_i_m/delete_scim_group_parameters.go create mode 100644 client/s_c_i_m/delete_scim_group_responses.go create mode 100644 client/s_c_i_m/delete_scim_user_parameters.go create mode 100644 client/s_c_i_m/delete_scim_user_responses.go create mode 100644 client/s_c_i_m/get_scim_group_parameters.go create mode 100644 client/s_c_i_m/get_scim_group_responses.go create mode 100644 client/s_c_i_m/get_scim_user_parameters.go create mode 100644 client/s_c_i_m/get_scim_user_responses.go create mode 100644 client/s_c_i_m/list_scim_groups_parameters.go create mode 100644 client/s_c_i_m/list_scim_groups_responses.go create mode 100644 client/s_c_i_m/list_scim_users_parameters.go create mode 100644 client/s_c_i_m/list_scim_users_responses.go create mode 100644 client/s_c_i_m/patch_scim_user_parameters.go create mode 100644 client/s_c_i_m/patch_scim_user_responses.go create mode 100644 client/s_c_i_m/update_scim_group_parameters.go create mode 100644 client/s_c_i_m/update_scim_group_responses.go create mode 100644 client/s_c_i_m/update_scim_user_parameters.go create mode 100644 client/s_c_i_m/update_scim_user_responses.go create mode 100644 client/signals/create_on_call_shift_parameters.go create mode 100644 client/signals/create_on_call_shift_responses.go create mode 100644 client/signals/create_signals_email_target_parameters.go create mode 100644 client/signals/create_signals_email_target_responses.go create mode 100644 client/signals/create_signals_webhook_target_parameters.go create mode 100644 client/signals/create_signals_webhook_target_responses.go create mode 100644 client/signals/create_team_escalation_policy_parameters.go create mode 100644 client/signals/create_team_escalation_policy_responses.go create mode 100644 client/signals/create_team_on_call_schedule_parameters.go create mode 100644 client/signals/create_team_on_call_schedule_responses.go create mode 100644 client/signals/create_team_signal_rule_parameters.go create mode 100644 client/signals/create_team_signal_rule_responses.go create mode 100644 client/signals/debug_signals_expression_parameters.go create mode 100644 client/signals/debug_signals_expression_responses.go create mode 100644 client/signals/delete_on_call_shift_parameters.go create mode 100644 client/signals/delete_on_call_shift_responses.go create mode 100644 client/signals/delete_signals_email_target_parameters.go create mode 100644 client/signals/delete_signals_email_target_responses.go create mode 100644 client/signals/delete_signals_webhook_target_parameters.go create mode 100644 client/signals/delete_signals_webhook_target_responses.go create mode 100644 client/signals/delete_team_escalation_policy_parameters.go create mode 100644 client/signals/delete_team_escalation_policy_responses.go create mode 100644 client/signals/delete_team_on_call_schedule_parameters.go create mode 100644 client/signals/delete_team_on_call_schedule_responses.go create mode 100644 client/signals/delete_team_signal_rule_parameters.go create mode 100644 client/signals/delete_team_signal_rule_responses.go create mode 100644 client/signals/get_on_call_shift_parameters.go create mode 100644 client/signals/get_on_call_shift_responses.go create mode 100644 client/signals/get_signals_email_target_parameters.go create mode 100644 client/signals/get_signals_email_target_responses.go create mode 100644 client/signals/get_signals_ingest_url_parameters.go create mode 100644 client/signals/get_signals_ingest_url_responses.go create mode 100644 client/signals/get_signals_webhook_target_parameters.go create mode 100644 client/signals/get_signals_webhook_target_responses.go create mode 100644 client/signals/get_team_escalation_policy_parameters.go create mode 100644 client/signals/get_team_escalation_policy_responses.go create mode 100644 client/signals/get_team_on_call_schedule_parameters.go create mode 100644 client/signals/get_team_on_call_schedule_responses.go create mode 100644 client/signals/get_team_signal_rule_parameters.go create mode 100644 client/signals/get_team_signal_rule_responses.go create mode 100644 client/signals/list_organization_on_call_schedules_parameters.go create mode 100644 client/signals/list_organization_on_call_schedules_responses.go create mode 100644 client/signals/list_signals_email_targets_parameters.go create mode 100644 client/signals/list_signals_email_targets_responses.go create mode 100644 client/signals/list_signals_event_sources_parameters.go create mode 100644 client/signals/list_signals_event_sources_responses.go create mode 100644 client/signals/list_signals_transposers_parameters.go create mode 100644 client/signals/list_signals_transposers_responses.go create mode 100644 client/signals/list_signals_webhook_targets_parameters.go create mode 100644 client/signals/list_signals_webhook_targets_responses.go create mode 100644 client/signals/list_team_escalation_policies_parameters.go create mode 100644 client/signals/list_team_escalation_policies_responses.go create mode 100644 client/signals/list_team_on_call_schedules_parameters.go create mode 100644 client/signals/list_team_on_call_schedules_responses.go create mode 100644 client/signals/list_team_signal_rules_parameters.go create mode 100644 client/signals/list_team_signal_rules_responses.go create mode 100644 client/signals/update_on_call_shift_parameters.go create mode 100644 client/signals/update_on_call_shift_responses.go create mode 100644 client/signals/update_signals_email_target_parameters.go create mode 100644 client/signals/update_signals_email_target_responses.go create mode 100644 client/signals/update_signals_webhook_target_parameters.go create mode 100644 client/signals/update_signals_webhook_target_responses.go create mode 100644 client/signals/update_team_escalation_policy_parameters.go create mode 100644 client/signals/update_team_escalation_policy_responses.go create mode 100644 client/signals/update_team_on_call_schedule_parameters.go create mode 100644 client/signals/update_team_on_call_schedule_responses.go create mode 100644 client/signals/update_team_signal_rule_parameters.go create mode 100644 client/signals/update_team_signal_rule_responses.go create mode 100644 client/status_pages/create_email_subscriber_parameters.go create mode 100644 client/status_pages/create_email_subscriber_responses.go create mode 100644 client/status_pages/create_nunc_component_group_parameters.go create mode 100644 client/status_pages/create_nunc_component_group_responses.go create mode 100644 client/status_pages/create_nunc_connection_parameters.go create mode 100644 client/status_pages/create_nunc_connection_responses.go create mode 100644 client/status_pages/create_nunc_link_parameters.go create mode 100644 client/status_pages/create_nunc_link_responses.go create mode 100644 client/status_pages/create_nunc_subscription_parameters.go create mode 100644 client/status_pages/create_nunc_subscription_responses.go create mode 100644 client/status_pages/delete_email_subscriber_parameters.go create mode 100644 client/status_pages/delete_email_subscriber_responses.go create mode 100644 client/status_pages/delete_incident_status_page_parameters.go create mode 100644 client/status_pages/delete_incident_status_page_responses.go create mode 100644 client/status_pages/delete_nunc_component_group_parameters.go create mode 100644 client/status_pages/delete_nunc_component_group_responses.go create mode 100644 client/status_pages/delete_nunc_connection_parameters.go create mode 100644 client/status_pages/delete_nunc_connection_responses.go create mode 100644 client/status_pages/delete_nunc_image_parameters.go create mode 100644 client/status_pages/delete_nunc_image_responses.go create mode 100644 client/status_pages/delete_nunc_link_parameters.go create mode 100644 client/status_pages/delete_nunc_link_responses.go create mode 100644 client/status_pages/delete_nunc_subscription_parameters.go create mode 100644 client/status_pages/delete_nunc_subscription_responses.go create mode 100644 client/status_pages/get_nunc_connection_parameters.go create mode 100644 client/status_pages/get_nunc_connection_responses.go create mode 100644 client/status_pages/list_email_subscribers_parameters.go create mode 100644 client/status_pages/list_email_subscribers_responses.go create mode 100644 client/status_pages/list_nunc_connections_parameters.go create mode 100644 client/status_pages/list_nunc_connections_responses.go create mode 100644 client/status_pages/update_nunc_component_group_parameters.go create mode 100644 client/status_pages/update_nunc_component_group_responses.go create mode 100644 client/status_pages/update_nunc_connection_parameters.go create mode 100644 client/status_pages/update_nunc_connection_responses.go create mode 100644 client/status_pages/update_nunc_image_parameters.go create mode 100644 client/status_pages/update_nunc_image_responses.go create mode 100644 client/status_pages/update_nunc_link_parameters.go create mode 100644 client/status_pages/update_nunc_link_responses.go create mode 100644 client/tasks/convert_incident_task_parameters.go create mode 100644 client/tasks/convert_incident_task_responses.go create mode 100644 client/tasks/create_checklist_template_parameters.go create mode 100644 client/tasks/create_checklist_template_responses.go create mode 100644 client/tasks/create_incident_task_list_parameters.go create mode 100644 client/tasks/create_incident_task_list_responses.go create mode 100644 client/tasks/create_incident_task_parameters.go create mode 100644 client/tasks/create_incident_task_responses.go create mode 100644 client/tasks/create_task_list_parameters.go create mode 100644 client/tasks/create_task_list_responses.go create mode 100644 client/tasks/delete_checklist_template_parameters.go create mode 100644 client/tasks/delete_checklist_template_responses.go create mode 100644 client/tasks/delete_incident_task_parameters.go create mode 100644 client/tasks/delete_incident_task_responses.go create mode 100644 client/tasks/delete_task_list_parameters.go create mode 100644 client/tasks/delete_task_list_responses.go create mode 100644 client/tasks/get_checklist_template_parameters.go create mode 100644 client/tasks/get_checklist_template_responses.go create mode 100644 client/tasks/get_incident_task_parameters.go create mode 100644 client/tasks/get_incident_task_responses.go create mode 100644 client/tasks/get_task_list_parameters.go create mode 100644 client/tasks/get_task_list_responses.go create mode 100644 client/tasks/list_checklist_templates_parameters.go create mode 100644 client/tasks/list_checklist_templates_responses.go create mode 100644 client/tasks/list_incident_tasks_parameters.go create mode 100644 client/tasks/list_incident_tasks_responses.go create mode 100644 client/tasks/list_task_lists_parameters.go create mode 100644 client/tasks/list_task_lists_responses.go create mode 100644 client/tasks/update_checklist_template_parameters.go create mode 100644 client/tasks/update_checklist_template_responses.go create mode 100644 client/tasks/update_incident_task_parameters.go create mode 100644 client/tasks/update_incident_task_responses.go create mode 100644 client/tasks/update_task_list_parameters.go create mode 100644 client/tasks/update_task_list_responses.go create mode 100644 client/teams/create_team_parameters.go create mode 100644 client/teams/create_team_responses.go create mode 100644 client/teams/delete_team_parameters.go create mode 100644 client/teams/delete_team_responses.go create mode 100644 client/teams/get_team_parameters.go create mode 100644 client/teams/get_team_responses.go create mode 100644 client/teams/list_schedules_parameters.go create mode 100644 client/teams/list_schedules_responses.go create mode 100644 client/teams/list_teams_parameters.go create mode 100644 client/teams/list_teams_responses.go create mode 100644 client/teams/update_team_parameters.go create mode 100644 client/teams/update_team_responses.go create mode 100644 client/ticketing/create_inbound_field_map_parameters.go create mode 100644 client/ticketing/create_inbound_field_map_responses.go create mode 100644 client/ticketing/create_ticket_parameters.go create mode 100644 client/ticketing/create_ticket_responses.go create mode 100644 client/ticketing/create_ticketing_field_map_parameters.go create mode 100644 client/ticketing/create_ticketing_field_map_responses.go create mode 100644 client/ticketing/create_ticketing_priority_parameters.go create mode 100644 client/ticketing/create_ticketing_priority_responses.go create mode 100644 client/ticketing/create_ticketing_project_config_parameters.go create mode 100644 client/ticketing/create_ticketing_project_config_responses.go create mode 100644 client/ticketing/delete_inbound_field_map_parameters.go create mode 100644 client/ticketing/delete_inbound_field_map_responses.go create mode 100644 client/ticketing/delete_ticket_parameters.go create mode 100644 client/ticketing/delete_ticket_responses.go create mode 100644 client/ticketing/delete_ticketing_field_map_parameters.go create mode 100644 client/ticketing/delete_ticketing_field_map_responses.go create mode 100644 client/ticketing/delete_ticketing_priority_parameters.go create mode 100644 client/ticketing/delete_ticketing_priority_responses.go create mode 100644 client/ticketing/delete_ticketing_project_config_parameters.go create mode 100644 client/ticketing/delete_ticketing_project_config_responses.go create mode 100644 client/ticketing/get_configuration_options_parameters.go create mode 100644 client/ticketing/get_configuration_options_responses.go create mode 100644 client/ticketing/get_inbound_field_map_parameters.go create mode 100644 client/ticketing/get_inbound_field_map_responses.go create mode 100644 client/ticketing/get_options_for_field_parameters.go create mode 100644 client/ticketing/get_options_for_field_responses.go create mode 100644 client/ticketing/get_ticket_parameters.go create mode 100644 client/ticketing/get_ticket_responses.go create mode 100644 client/ticketing/get_ticketing_field_map_parameters.go create mode 100644 client/ticketing/get_ticketing_field_map_responses.go create mode 100644 client/ticketing/get_ticketing_priority_parameters.go create mode 100644 client/ticketing/get_ticketing_priority_responses.go create mode 100644 client/ticketing/get_ticketing_project_config_parameters.go create mode 100644 client/ticketing/get_ticketing_project_config_responses.go create mode 100644 client/ticketing/get_ticketing_project_parameters.go create mode 100644 client/ticketing/get_ticketing_project_responses.go create mode 100644 client/ticketing/list_available_inbound_field_maps_parameters.go create mode 100644 client/ticketing/list_available_inbound_field_maps_responses.go create mode 100644 client/ticketing/list_available_ticketing_field_maps_parameters.go create mode 100644 client/ticketing/list_available_ticketing_field_maps_responses.go create mode 100644 client/ticketing/list_inbound_field_maps_parameters.go create mode 100644 client/ticketing/list_inbound_field_maps_responses.go create mode 100644 client/ticketing/list_ticket_tags_parameters.go create mode 100644 client/ticketing/list_ticket_tags_responses.go create mode 100644 client/ticketing/list_ticketing_priorities_parameters.go create mode 100644 client/ticketing/list_ticketing_priorities_responses.go create mode 100644 client/ticketing/list_ticketing_projects_parameters.go create mode 100644 client/ticketing/list_ticketing_projects_responses.go create mode 100644 client/ticketing/list_tickets_parameters.go create mode 100644 client/ticketing/list_tickets_responses.go create mode 100644 client/ticketing/update_inbound_field_map_parameters.go create mode 100644 client/ticketing/update_inbound_field_map_responses.go create mode 100644 client/ticketing/update_ticket_parameters.go create mode 100644 client/ticketing/update_ticket_responses.go create mode 100644 client/ticketing/update_ticketing_field_map_parameters.go create mode 100644 client/ticketing/update_ticketing_field_map_responses.go create mode 100644 client/ticketing/update_ticketing_priority_parameters.go create mode 100644 client/ticketing/update_ticketing_priority_responses.go create mode 100644 client/ticketing/update_ticketing_project_config_parameters.go create mode 100644 client/ticketing/update_ticketing_project_config_responses.go create mode 100644 client/users/get_current_user_parameters.go create mode 100644 client/users/get_current_user_responses.go create mode 100644 client/users/get_user_parameters.go create mode 100644 client/users/get_user_responses.go create mode 100644 client/users/list_users_parameters.go create mode 100644 client/users/list_users_responses.go create mode 100644 client/webhooks/create_webhook_parameters.go create mode 100644 client/webhooks/create_webhook_responses.go create mode 100644 client/webhooks/delete_webhook_parameters.go create mode 100644 client/webhooks/delete_webhook_responses.go create mode 100644 client/webhooks/get_webhook_parameters.go create mode 100644 client/webhooks/get_webhook_responses.go create mode 100644 client/webhooks/list_webhook_deliveries_parameters.go create mode 100644 client/webhooks/list_webhook_deliveries_responses.go create mode 100644 client/webhooks/list_webhooks_parameters.go create mode 100644 client/webhooks/list_webhooks_responses.go create mode 100644 client/webhooks/update_webhook_parameters.go create mode 100644 client/webhooks/update_webhook_responses.go create mode 100644 models/bulk_update_incident_milestones.go create mode 100644 models/convert_incident_task.go create mode 100644 models/create_change.go create mode 100644 models/create_change_event.go create mode 100644 models/create_change_identity.go create mode 100644 models/create_checklist_template.go create mode 100644 models/create_comment.go create mode 100644 models/create_comment_reaction.go create mode 100644 models/create_custom_field_definition.go create mode 100644 models/create_environment.go create mode 100644 models/create_functionality.go create mode 100644 models/create_incident.go create mode 100644 models/create_incident_change_event.go create mode 100644 models/create_incident_chat_message.go create mode 100644 models/create_incident_impact.go create mode 100644 models/create_incident_link.go create mode 100644 models/create_incident_note.go create mode 100644 models/create_incident_role.go create mode 100644 models/create_incident_role_assignment.go create mode 100644 models/create_incident_status_page.go create mode 100644 models/create_incident_task.go create mode 100644 models/create_incident_task_list.go create mode 100644 models/create_incident_team_assignment.go create mode 100644 models/create_incident_type.go create mode 100644 models/create_nunc_subscription.go create mode 100644 models/create_on_call_shift.go create mode 100644 models/create_post_mortem_reason.go create mode 100644 models/create_post_mortem_report.go create mode 100644 models/create_priority.go create mode 100644 models/create_runbook.go create mode 100644 models/create_runbook_execution.go create mode 100644 models/create_saved_search.go create mode 100644 models/create_scheduled_maintenance.go create mode 100644 models/create_scim_group.go create mode 100644 models/create_scim_user.go create mode 100644 models/create_service.go create mode 100644 models/create_service_checklist_response.go create mode 100644 models/create_service_dependency.go create mode 100644 models/create_service_links.go create mode 100644 models/create_severity.go create mode 100644 models/create_severity_matrix_condition.go create mode 100644 models/create_severity_matrix_impact.go create mode 100644 models/create_signals_email_target.go create mode 100644 models/create_signals_webhook_target.go create mode 100644 models/create_status_update_template.go create mode 100644 models/create_task_list.go create mode 100644 models/create_team.go create mode 100644 models/create_team_escalation_policy.go create mode 100644 models/create_team_on_call_schedule.go create mode 100644 models/create_team_signal_rule.go create mode 100644 models/create_ticket.go create mode 100644 models/create_ticketing_priority.go create mode 100644 models/create_webhook.go create mode 100644 models/debug_signals_expression.go create mode 100644 models/ingest_catalog_data.go create mode 100644 models/patch_scim_user.go create mode 100644 models/publish_post_mortem_report.go create mode 100644 models/reorder_post_mortem_reasons.go create mode 100644 models/update_aws_cloudtrail_batch.go create mode 100644 models/update_aws_connection.go create mode 100644 models/update_change.go create mode 100644 models/update_change_event.go create mode 100644 models/update_change_identity.go create mode 100644 models/update_checklist_template.go create mode 100644 models/update_comment.go create mode 100644 models/update_custom_field_definition.go create mode 100644 models/update_environment.go create mode 100644 models/update_functionality.go create mode 100644 models/update_incident.go create mode 100644 models/update_incident_alert_primary.go create mode 100644 models/update_incident_change_event.go create mode 100644 models/update_incident_chat_message.go create mode 100644 models/update_incident_impact_patch.go create mode 100644 models/update_incident_impact_put.go create mode 100644 models/update_incident_link.go create mode 100644 models/update_incident_note.go create mode 100644 models/update_incident_retrospective.go create mode 100644 models/update_incident_retrospective_field.go create mode 100644 models/update_incident_role.go create mode 100644 models/update_incident_task.go create mode 100644 models/update_incident_type.go create mode 100644 models/update_nunc_link.go create mode 100644 models/update_on_call_shift.go create mode 100644 models/update_post_mortem_field.go create mode 100644 models/update_post_mortem_questions.go create mode 100644 models/update_post_mortem_reason.go create mode 100644 models/update_post_mortem_report.go create mode 100644 models/update_priority.go create mode 100644 models/update_runbook.go create mode 100644 models/update_runbook_execution_step.go create mode 100644 models/update_saved_search.go create mode 100644 models/update_scheduled_maintenance.go create mode 100644 models/update_scim_group.go create mode 100644 models/update_scim_user.go create mode 100644 models/update_service.go create mode 100644 models/update_service_dependency.go create mode 100644 models/update_severity.go create mode 100644 models/update_severity_matrix.go create mode 100644 models/update_severity_matrix_condition.go create mode 100644 models/update_severity_matrix_impact.go create mode 100644 models/update_signals_email_target.go create mode 100644 models/update_signals_webhook_target.go create mode 100644 models/update_status_update_template.go create mode 100644 models/update_statuspage_connection.go create mode 100644 models/update_task_list.go create mode 100644 models/update_team.go create mode 100644 models/update_team_escalation_policy.go create mode 100644 models/update_team_on_call_schedule.go create mode 100644 models/update_team_signal_rule.go create mode 100644 models/update_ticket.go create mode 100644 models/update_ticketing_priority.go create mode 100644 models/update_vote.go create mode 100644 models/update_webhook.go diff --git a/client/account_settings/account_settings_client.go b/client/account_settings/account_settings_client.go index 88ff1b9..275d2bd 100644 --- a/client/account_settings/account_settings_client.go +++ b/client/account_settings/account_settings_client.go @@ -30,40 +30,40 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - GetV1AiPreferences(params *GetV1AiPreferencesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AiPreferencesOK, error) + GetAiPreferences(params *GetAiPreferencesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAiPreferencesOK, error) - GetV1Bootstrap(params *GetV1BootstrapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1BootstrapOK, error) + GetBootstrap(params *GetBootstrapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBootstrapOK, error) - GetV1Entitlements(params *GetV1EntitlementsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1EntitlementsOK, error) + ListEntitlements(params *ListEntitlementsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEntitlementsOK, error) - GetV1NoauthPing(params *GetV1NoauthPingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1NoauthPingOK, error) + Ping(params *PingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PingOK, error) - GetV1Ping(params *GetV1PingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PingOK, error) + PingNoauth(params *PingNoauthParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PingNoauthOK, error) - PatchV1AiPreferences(params *PatchV1AiPreferencesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1AiPreferencesOK, error) + UpdateAiPreferences(params *UpdateAiPreferencesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAiPreferencesOK, error) SetTransport(transport runtime.ClientTransport) } /* -GetV1AiPreferences gets a i preferences +GetAiPreferences gets a i preferences Retrieves the current AI preferences */ -func (a *Client) GetV1AiPreferences(params *GetV1AiPreferencesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AiPreferencesOK, error) { +func (a *Client) GetAiPreferences(params *GetAiPreferencesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAiPreferencesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1AiPreferencesParams() + params = NewGetAiPreferencesParams() } op := &runtime.ClientOperation{ - ID: "getV1AiPreferences", + ID: "get_ai_preferences", Method: "GET", PathPattern: "/v1/ai/preferences", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1AiPreferencesReader{formats: a.formats}, + Reader: &GetAiPreferencesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -76,35 +76,35 @@ func (a *Client) GetV1AiPreferences(params *GetV1AiPreferencesParams, authInfo r if err != nil { return nil, err } - success, ok := result.(*GetV1AiPreferencesOK) + success, ok := result.(*GetAiPreferencesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1AiPreferences: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_ai_preferences: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Bootstrap gets initial application configuration +GetBootstrap gets initial application configuration Get initial application configuration */ -func (a *Client) GetV1Bootstrap(params *GetV1BootstrapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1BootstrapOK, error) { +func (a *Client) GetBootstrap(params *GetBootstrapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetBootstrapOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1BootstrapParams() + params = NewGetBootstrapParams() } op := &runtime.ClientOperation{ - ID: "getV1Bootstrap", + ID: "get_bootstrap", Method: "GET", PathPattern: "/v1/bootstrap", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1BootstrapReader{formats: a.formats}, + Reader: &GetBootstrapReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -117,35 +117,35 @@ func (a *Client) GetV1Bootstrap(params *GetV1BootstrapParams, authInfo runtime.C if err != nil { return nil, err } - success, ok := result.(*GetV1BootstrapOK) + success, ok := result.(*GetBootstrapOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Bootstrap: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_bootstrap: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Entitlements lists entitlements +ListEntitlements lists entitlements List the organization's entitlements */ -func (a *Client) GetV1Entitlements(params *GetV1EntitlementsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1EntitlementsOK, error) { +func (a *Client) ListEntitlements(params *ListEntitlementsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEntitlementsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1EntitlementsParams() + params = NewListEntitlementsParams() } op := &runtime.ClientOperation{ - ID: "getV1Entitlements", + ID: "list_entitlements", Method: "GET", PathPattern: "/v1/entitlements", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1EntitlementsReader{formats: a.formats}, + Reader: &ListEntitlementsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -158,35 +158,35 @@ func (a *Client) GetV1Entitlements(params *GetV1EntitlementsParams, authInfo run if err != nil { return nil, err } - success, ok := result.(*GetV1EntitlementsOK) + success, ok := result.(*ListEntitlementsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Entitlements: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_entitlements: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1NoauthPing checks API connectivity +Ping checks API connectivity Simple endpoint to verify your API connection is working */ -func (a *Client) GetV1NoauthPing(params *GetV1NoauthPingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1NoauthPingOK, error) { +func (a *Client) Ping(params *PingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PingOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1NoauthPingParams() + params = NewPingParams() } op := &runtime.ClientOperation{ - ID: "getV1NoauthPing", + ID: "ping", Method: "GET", - PathPattern: "/v1/noauth/ping", + PathPattern: "/v1/ping", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1NoauthPingReader{formats: a.formats}, + Reader: &PingReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -199,35 +199,35 @@ func (a *Client) GetV1NoauthPing(params *GetV1NoauthPingParams, authInfo runtime if err != nil { return nil, err } - success, ok := result.(*GetV1NoauthPingOK) + success, ok := result.(*PingOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1NoauthPing: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ping: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Ping checks API connectivity +PingNoauth checks API connectivity Simple endpoint to verify your API connection is working */ -func (a *Client) GetV1Ping(params *GetV1PingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PingOK, error) { +func (a *Client) PingNoauth(params *PingNoauthParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PingNoauthOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1PingParams() + params = NewPingNoauthParams() } op := &runtime.ClientOperation{ - ID: "getV1Ping", + ID: "ping_noauth", Method: "GET", - PathPattern: "/v1/ping", + PathPattern: "/v1/noauth/ping", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1PingReader{formats: a.formats}, + Reader: &PingNoauthReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -240,35 +240,35 @@ func (a *Client) GetV1Ping(params *GetV1PingParams, authInfo runtime.ClientAuthI if err != nil { return nil, err } - success, ok := result.(*GetV1PingOK) + success, ok := result.(*PingNoauthOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Ping: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ping_noauth: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1AiPreferences updates a i preferences +UpdateAiPreferences updates a i preferences Updates the AI preferences */ -func (a *Client) PatchV1AiPreferences(params *PatchV1AiPreferencesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1AiPreferencesOK, error) { +func (a *Client) UpdateAiPreferences(params *UpdateAiPreferencesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAiPreferencesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1AiPreferencesParams() + params = NewUpdateAiPreferencesParams() } op := &runtime.ClientOperation{ - ID: "patchV1AiPreferences", + ID: "update_ai_preferences", Method: "PATCH", PathPattern: "/v1/ai/preferences", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1AiPreferencesReader{formats: a.formats}, + Reader: &UpdateAiPreferencesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -281,13 +281,13 @@ func (a *Client) PatchV1AiPreferences(params *PatchV1AiPreferencesParams, authIn if err != nil { return nil, err } - success, ok := result.(*PatchV1AiPreferencesOK) + success, ok := result.(*UpdateAiPreferencesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1AiPreferences: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_ai_preferences: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/account_settings/get_ai_preferences_parameters.go b/client/account_settings/get_ai_preferences_parameters.go new file mode 100644 index 0000000..da1813c --- /dev/null +++ b/client/account_settings/get_ai_preferences_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package account_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetAiPreferencesParams creates a new GetAiPreferencesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetAiPreferencesParams() *GetAiPreferencesParams { + return &GetAiPreferencesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAiPreferencesParamsWithTimeout creates a new GetAiPreferencesParams object +// with the ability to set a timeout on a request. +func NewGetAiPreferencesParamsWithTimeout(timeout time.Duration) *GetAiPreferencesParams { + return &GetAiPreferencesParams{ + timeout: timeout, + } +} + +// NewGetAiPreferencesParamsWithContext creates a new GetAiPreferencesParams object +// with the ability to set a context for a request. +func NewGetAiPreferencesParamsWithContext(ctx context.Context) *GetAiPreferencesParams { + return &GetAiPreferencesParams{ + Context: ctx, + } +} + +// NewGetAiPreferencesParamsWithHTTPClient creates a new GetAiPreferencesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAiPreferencesParamsWithHTTPClient(client *http.Client) *GetAiPreferencesParams { + return &GetAiPreferencesParams{ + HTTPClient: client, + } +} + +/* +GetAiPreferencesParams contains all the parameters to send to the API endpoint + + for the get ai preferences operation. + + Typically these are written to a http.Request. +*/ +type GetAiPreferencesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get ai preferences params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAiPreferencesParams) WithDefaults() *GetAiPreferencesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get ai preferences params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAiPreferencesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get ai preferences params +func (o *GetAiPreferencesParams) WithTimeout(timeout time.Duration) *GetAiPreferencesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get ai preferences params +func (o *GetAiPreferencesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get ai preferences params +func (o *GetAiPreferencesParams) WithContext(ctx context.Context) *GetAiPreferencesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get ai preferences params +func (o *GetAiPreferencesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get ai preferences params +func (o *GetAiPreferencesParams) WithHTTPClient(client *http.Client) *GetAiPreferencesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get ai preferences params +func (o *GetAiPreferencesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAiPreferencesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/account_settings/get_ai_preferences_responses.go b/client/account_settings/get_ai_preferences_responses.go new file mode 100644 index 0000000..22100b7 --- /dev/null +++ b/client/account_settings/get_ai_preferences_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package account_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetAiPreferencesReader is a Reader for the GetAiPreferences structure. +type GetAiPreferencesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAiPreferencesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAiPreferencesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAiPreferencesOK creates a GetAiPreferencesOK with default headers values +func NewGetAiPreferencesOK() *GetAiPreferencesOK { + return &GetAiPreferencesOK{} +} + +/* +GetAiPreferencesOK describes a response with status code 200, with default header values. + +Retrieves the current AI preferences +*/ +type GetAiPreferencesOK struct { + Payload *models.AIEntitiesPreferencesEntity +} + +// IsSuccess returns true when this get ai preferences o k response has a 2xx status code +func (o *GetAiPreferencesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get ai preferences o k response has a 3xx status code +func (o *GetAiPreferencesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get ai preferences o k response has a 4xx status code +func (o *GetAiPreferencesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get ai preferences o k response has a 5xx status code +func (o *GetAiPreferencesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get ai preferences o k response a status code equal to that given +func (o *GetAiPreferencesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetAiPreferencesOK) Error() string { + return fmt.Sprintf("[GET /v1/ai/preferences][%d] getAiPreferencesOK %+v", 200, o.Payload) +} + +func (o *GetAiPreferencesOK) String() string { + return fmt.Sprintf("[GET /v1/ai/preferences][%d] getAiPreferencesOK %+v", 200, o.Payload) +} + +func (o *GetAiPreferencesOK) GetPayload() *models.AIEntitiesPreferencesEntity { + return o.Payload +} + +func (o *GetAiPreferencesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AIEntitiesPreferencesEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/account_settings/get_bootstrap_parameters.go b/client/account_settings/get_bootstrap_parameters.go new file mode 100644 index 0000000..acb2409 --- /dev/null +++ b/client/account_settings/get_bootstrap_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package account_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetBootstrapParams creates a new GetBootstrapParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetBootstrapParams() *GetBootstrapParams { + return &GetBootstrapParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetBootstrapParamsWithTimeout creates a new GetBootstrapParams object +// with the ability to set a timeout on a request. +func NewGetBootstrapParamsWithTimeout(timeout time.Duration) *GetBootstrapParams { + return &GetBootstrapParams{ + timeout: timeout, + } +} + +// NewGetBootstrapParamsWithContext creates a new GetBootstrapParams object +// with the ability to set a context for a request. +func NewGetBootstrapParamsWithContext(ctx context.Context) *GetBootstrapParams { + return &GetBootstrapParams{ + Context: ctx, + } +} + +// NewGetBootstrapParamsWithHTTPClient creates a new GetBootstrapParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetBootstrapParamsWithHTTPClient(client *http.Client) *GetBootstrapParams { + return &GetBootstrapParams{ + HTTPClient: client, + } +} + +/* +GetBootstrapParams contains all the parameters to send to the API endpoint + + for the get bootstrap operation. + + Typically these are written to a http.Request. +*/ +type GetBootstrapParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get bootstrap params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBootstrapParams) WithDefaults() *GetBootstrapParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get bootstrap params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetBootstrapParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get bootstrap params +func (o *GetBootstrapParams) WithTimeout(timeout time.Duration) *GetBootstrapParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get bootstrap params +func (o *GetBootstrapParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get bootstrap params +func (o *GetBootstrapParams) WithContext(ctx context.Context) *GetBootstrapParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get bootstrap params +func (o *GetBootstrapParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get bootstrap params +func (o *GetBootstrapParams) WithHTTPClient(client *http.Client) *GetBootstrapParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get bootstrap params +func (o *GetBootstrapParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetBootstrapParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/account_settings/get_bootstrap_responses.go b/client/account_settings/get_bootstrap_responses.go new file mode 100644 index 0000000..fdb0512 --- /dev/null +++ b/client/account_settings/get_bootstrap_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package account_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetBootstrapReader is a Reader for the GetBootstrap structure. +type GetBootstrapReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetBootstrapReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetBootstrapOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetBootstrapOK creates a GetBootstrapOK with default headers values +func NewGetBootstrapOK() *GetBootstrapOK { + return &GetBootstrapOK{} +} + +/* +GetBootstrapOK describes a response with status code 200, with default header values. + +Get initial application configuration +*/ +type GetBootstrapOK struct { + Payload *models.PublicAPIV1BootstrapEntity +} + +// IsSuccess returns true when this get bootstrap o k response has a 2xx status code +func (o *GetBootstrapOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get bootstrap o k response has a 3xx status code +func (o *GetBootstrapOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get bootstrap o k response has a 4xx status code +func (o *GetBootstrapOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get bootstrap o k response has a 5xx status code +func (o *GetBootstrapOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get bootstrap o k response a status code equal to that given +func (o *GetBootstrapOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetBootstrapOK) Error() string { + return fmt.Sprintf("[GET /v1/bootstrap][%d] getBootstrapOK %+v", 200, o.Payload) +} + +func (o *GetBootstrapOK) String() string { + return fmt.Sprintf("[GET /v1/bootstrap][%d] getBootstrapOK %+v", 200, o.Payload) +} + +func (o *GetBootstrapOK) GetPayload() *models.PublicAPIV1BootstrapEntity { + return o.Payload +} + +func (o *GetBootstrapOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PublicAPIV1BootstrapEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/account_settings/list_entitlements_parameters.go b/client/account_settings/list_entitlements_parameters.go new file mode 100644 index 0000000..ed46c22 --- /dev/null +++ b/client/account_settings/list_entitlements_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package account_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListEntitlementsParams creates a new ListEntitlementsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListEntitlementsParams() *ListEntitlementsParams { + return &ListEntitlementsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListEntitlementsParamsWithTimeout creates a new ListEntitlementsParams object +// with the ability to set a timeout on a request. +func NewListEntitlementsParamsWithTimeout(timeout time.Duration) *ListEntitlementsParams { + return &ListEntitlementsParams{ + timeout: timeout, + } +} + +// NewListEntitlementsParamsWithContext creates a new ListEntitlementsParams object +// with the ability to set a context for a request. +func NewListEntitlementsParamsWithContext(ctx context.Context) *ListEntitlementsParams { + return &ListEntitlementsParams{ + Context: ctx, + } +} + +// NewListEntitlementsParamsWithHTTPClient creates a new ListEntitlementsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListEntitlementsParamsWithHTTPClient(client *http.Client) *ListEntitlementsParams { + return &ListEntitlementsParams{ + HTTPClient: client, + } +} + +/* +ListEntitlementsParams contains all the parameters to send to the API endpoint + + for the list entitlements operation. + + Typically these are written to a http.Request. +*/ +type ListEntitlementsParams struct { + + /* Name. + + Name of Entitlement + */ + Name *string + + /* Type. + + Type of Entitlement + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list entitlements params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListEntitlementsParams) WithDefaults() *ListEntitlementsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list entitlements params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListEntitlementsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list entitlements params +func (o *ListEntitlementsParams) WithTimeout(timeout time.Duration) *ListEntitlementsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list entitlements params +func (o *ListEntitlementsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list entitlements params +func (o *ListEntitlementsParams) WithContext(ctx context.Context) *ListEntitlementsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list entitlements params +func (o *ListEntitlementsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list entitlements params +func (o *ListEntitlementsParams) WithHTTPClient(client *http.Client) *ListEntitlementsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list entitlements params +func (o *ListEntitlementsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the list entitlements params +func (o *ListEntitlementsParams) WithName(name *string) *ListEntitlementsParams { + o.SetName(name) + return o +} + +// SetName adds the name to the list entitlements params +func (o *ListEntitlementsParams) SetName(name *string) { + o.Name = name +} + +// WithType adds the typeVar to the list entitlements params +func (o *ListEntitlementsParams) WithType(typeVar *string) *ListEntitlementsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the list entitlements params +func (o *ListEntitlementsParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ListEntitlementsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/account_settings/list_entitlements_responses.go b/client/account_settings/list_entitlements_responses.go new file mode 100644 index 0000000..883948d --- /dev/null +++ b/client/account_settings/list_entitlements_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package account_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListEntitlementsReader is a Reader for the ListEntitlements structure. +type ListEntitlementsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListEntitlementsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListEntitlementsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListEntitlementsOK creates a ListEntitlementsOK with default headers values +func NewListEntitlementsOK() *ListEntitlementsOK { + return &ListEntitlementsOK{} +} + +/* +ListEntitlementsOK describes a response with status code 200, with default header values. + +List the organization's entitlements +*/ +type ListEntitlementsOK struct { + Payload *models.EntitlementEntityPaginated +} + +// IsSuccess returns true when this list entitlements o k response has a 2xx status code +func (o *ListEntitlementsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list entitlements o k response has a 3xx status code +func (o *ListEntitlementsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list entitlements o k response has a 4xx status code +func (o *ListEntitlementsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list entitlements o k response has a 5xx status code +func (o *ListEntitlementsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list entitlements o k response a status code equal to that given +func (o *ListEntitlementsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListEntitlementsOK) Error() string { + return fmt.Sprintf("[GET /v1/entitlements][%d] listEntitlementsOK %+v", 200, o.Payload) +} + +func (o *ListEntitlementsOK) String() string { + return fmt.Sprintf("[GET /v1/entitlements][%d] listEntitlementsOK %+v", 200, o.Payload) +} + +func (o *ListEntitlementsOK) GetPayload() *models.EntitlementEntityPaginated { + return o.Payload +} + +func (o *ListEntitlementsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.EntitlementEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/account_settings/ping_noauth_parameters.go b/client/account_settings/ping_noauth_parameters.go new file mode 100644 index 0000000..ff268c8 --- /dev/null +++ b/client/account_settings/ping_noauth_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package account_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewPingNoauthParams creates a new PingNoauthParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPingNoauthParams() *PingNoauthParams { + return &PingNoauthParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPingNoauthParamsWithTimeout creates a new PingNoauthParams object +// with the ability to set a timeout on a request. +func NewPingNoauthParamsWithTimeout(timeout time.Duration) *PingNoauthParams { + return &PingNoauthParams{ + timeout: timeout, + } +} + +// NewPingNoauthParamsWithContext creates a new PingNoauthParams object +// with the ability to set a context for a request. +func NewPingNoauthParamsWithContext(ctx context.Context) *PingNoauthParams { + return &PingNoauthParams{ + Context: ctx, + } +} + +// NewPingNoauthParamsWithHTTPClient creates a new PingNoauthParams object +// with the ability to set a custom HTTPClient for a request. +func NewPingNoauthParamsWithHTTPClient(client *http.Client) *PingNoauthParams { + return &PingNoauthParams{ + HTTPClient: client, + } +} + +/* +PingNoauthParams contains all the parameters to send to the API endpoint + + for the ping noauth operation. + + Typically these are written to a http.Request. +*/ +type PingNoauthParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ping noauth params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PingNoauthParams) WithDefaults() *PingNoauthParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ping noauth params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PingNoauthParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ping noauth params +func (o *PingNoauthParams) WithTimeout(timeout time.Duration) *PingNoauthParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ping noauth params +func (o *PingNoauthParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ping noauth params +func (o *PingNoauthParams) WithContext(ctx context.Context) *PingNoauthParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ping noauth params +func (o *PingNoauthParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ping noauth params +func (o *PingNoauthParams) WithHTTPClient(client *http.Client) *PingNoauthParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ping noauth params +func (o *PingNoauthParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *PingNoauthParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/account_settings/ping_noauth_responses.go b/client/account_settings/ping_noauth_responses.go new file mode 100644 index 0000000..3c71e83 --- /dev/null +++ b/client/account_settings/ping_noauth_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package account_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// PingNoauthReader is a Reader for the PingNoauth structure. +type PingNoauthReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PingNoauthReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPingNoauthOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPingNoauthOK creates a PingNoauthOK with default headers values +func NewPingNoauthOK() *PingNoauthOK { + return &PingNoauthOK{} +} + +/* +PingNoauthOK describes a response with status code 200, with default header values. + +Simple endpoint to verify your API connection is working +*/ +type PingNoauthOK struct { + Payload *models.PongEntity +} + +// IsSuccess returns true when this ping noauth o k response has a 2xx status code +func (o *PingNoauthOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this ping noauth o k response has a 3xx status code +func (o *PingNoauthOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ping noauth o k response has a 4xx status code +func (o *PingNoauthOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this ping noauth o k response has a 5xx status code +func (o *PingNoauthOK) IsServerError() bool { + return false +} + +// IsCode returns true when this ping noauth o k response a status code equal to that given +func (o *PingNoauthOK) IsCode(code int) bool { + return code == 200 +} + +func (o *PingNoauthOK) Error() string { + return fmt.Sprintf("[GET /v1/noauth/ping][%d] pingNoauthOK %+v", 200, o.Payload) +} + +func (o *PingNoauthOK) String() string { + return fmt.Sprintf("[GET /v1/noauth/ping][%d] pingNoauthOK %+v", 200, o.Payload) +} + +func (o *PingNoauthOK) GetPayload() *models.PongEntity { + return o.Payload +} + +func (o *PingNoauthOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PongEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/account_settings/ping_parameters.go b/client/account_settings/ping_parameters.go new file mode 100644 index 0000000..f70dbb6 --- /dev/null +++ b/client/account_settings/ping_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package account_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewPingParams creates a new PingParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPingParams() *PingParams { + return &PingParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPingParamsWithTimeout creates a new PingParams object +// with the ability to set a timeout on a request. +func NewPingParamsWithTimeout(timeout time.Duration) *PingParams { + return &PingParams{ + timeout: timeout, + } +} + +// NewPingParamsWithContext creates a new PingParams object +// with the ability to set a context for a request. +func NewPingParamsWithContext(ctx context.Context) *PingParams { + return &PingParams{ + Context: ctx, + } +} + +// NewPingParamsWithHTTPClient creates a new PingParams object +// with the ability to set a custom HTTPClient for a request. +func NewPingParamsWithHTTPClient(client *http.Client) *PingParams { + return &PingParams{ + HTTPClient: client, + } +} + +/* +PingParams contains all the parameters to send to the API endpoint + + for the ping operation. + + Typically these are written to a http.Request. +*/ +type PingParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ping params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PingParams) WithDefaults() *PingParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ping params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PingParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ping params +func (o *PingParams) WithTimeout(timeout time.Duration) *PingParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ping params +func (o *PingParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ping params +func (o *PingParams) WithContext(ctx context.Context) *PingParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ping params +func (o *PingParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ping params +func (o *PingParams) WithHTTPClient(client *http.Client) *PingParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ping params +func (o *PingParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *PingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/account_settings/ping_responses.go b/client/account_settings/ping_responses.go new file mode 100644 index 0000000..8d5e3e3 --- /dev/null +++ b/client/account_settings/ping_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package account_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// PingReader is a Reader for the Ping structure. +type PingReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPingOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPingOK creates a PingOK with default headers values +func NewPingOK() *PingOK { + return &PingOK{} +} + +/* +PingOK describes a response with status code 200, with default header values. + +Simple endpoint to verify your API connection is working +*/ +type PingOK struct { + Payload *models.PongEntity +} + +// IsSuccess returns true when this ping o k response has a 2xx status code +func (o *PingOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this ping o k response has a 3xx status code +func (o *PingOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ping o k response has a 4xx status code +func (o *PingOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this ping o k response has a 5xx status code +func (o *PingOK) IsServerError() bool { + return false +} + +// IsCode returns true when this ping o k response a status code equal to that given +func (o *PingOK) IsCode(code int) bool { + return code == 200 +} + +func (o *PingOK) Error() string { + return fmt.Sprintf("[GET /v1/ping][%d] pingOK %+v", 200, o.Payload) +} + +func (o *PingOK) String() string { + return fmt.Sprintf("[GET /v1/ping][%d] pingOK %+v", 200, o.Payload) +} + +func (o *PingOK) GetPayload() *models.PongEntity { + return o.Payload +} + +func (o *PingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PongEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/account_settings/update_ai_preferences_parameters.go b/client/account_settings/update_ai_preferences_parameters.go new file mode 100644 index 0000000..e32df6a --- /dev/null +++ b/client/account_settings/update_ai_preferences_parameters.go @@ -0,0 +1,386 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package account_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewUpdateAiPreferencesParams creates a new UpdateAiPreferencesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateAiPreferencesParams() *UpdateAiPreferencesParams { + return &UpdateAiPreferencesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateAiPreferencesParamsWithTimeout creates a new UpdateAiPreferencesParams object +// with the ability to set a timeout on a request. +func NewUpdateAiPreferencesParamsWithTimeout(timeout time.Duration) *UpdateAiPreferencesParams { + return &UpdateAiPreferencesParams{ + timeout: timeout, + } +} + +// NewUpdateAiPreferencesParamsWithContext creates a new UpdateAiPreferencesParams object +// with the ability to set a context for a request. +func NewUpdateAiPreferencesParamsWithContext(ctx context.Context) *UpdateAiPreferencesParams { + return &UpdateAiPreferencesParams{ + Context: ctx, + } +} + +// NewUpdateAiPreferencesParamsWithHTTPClient creates a new UpdateAiPreferencesParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateAiPreferencesParamsWithHTTPClient(client *http.Client) *UpdateAiPreferencesParams { + return &UpdateAiPreferencesParams{ + HTTPClient: client, + } +} + +/* +UpdateAiPreferencesParams contains all the parameters to send to the API endpoint + + for the update ai preferences operation. + + Typically these are written to a http.Request. +*/ +type UpdateAiPreferencesParams struct { + + /* Ai. + + Whether to enable AI features + */ + Ai *bool + + /* Description. + + Whether to enable incident descriptions + */ + Description *bool + + /* Followups. + + Whether to enable incident followups + */ + Followups *bool + + /* Impact. + + Whether to enable incident impact + */ + Impact *bool + + /* Retros. + + Whether to enable incident retrospectives + */ + Retros *bool + + /* SimilarIncidents. + + Whether to enable similar incidents + */ + SimilarIncidents *bool + + /* Summaries. + + Whether to enable incident summaries + */ + Summaries *bool + + /* Updates. + + Whether to enable incident updates + */ + Updates *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update ai preferences params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAiPreferencesParams) WithDefaults() *UpdateAiPreferencesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update ai preferences params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAiPreferencesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update ai preferences params +func (o *UpdateAiPreferencesParams) WithTimeout(timeout time.Duration) *UpdateAiPreferencesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update ai preferences params +func (o *UpdateAiPreferencesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update ai preferences params +func (o *UpdateAiPreferencesParams) WithContext(ctx context.Context) *UpdateAiPreferencesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update ai preferences params +func (o *UpdateAiPreferencesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update ai preferences params +func (o *UpdateAiPreferencesParams) WithHTTPClient(client *http.Client) *UpdateAiPreferencesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update ai preferences params +func (o *UpdateAiPreferencesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAi adds the ai to the update ai preferences params +func (o *UpdateAiPreferencesParams) WithAi(ai *bool) *UpdateAiPreferencesParams { + o.SetAi(ai) + return o +} + +// SetAi adds the ai to the update ai preferences params +func (o *UpdateAiPreferencesParams) SetAi(ai *bool) { + o.Ai = ai +} + +// WithDescription adds the description to the update ai preferences params +func (o *UpdateAiPreferencesParams) WithDescription(description *bool) *UpdateAiPreferencesParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the update ai preferences params +func (o *UpdateAiPreferencesParams) SetDescription(description *bool) { + o.Description = description +} + +// WithFollowups adds the followups to the update ai preferences params +func (o *UpdateAiPreferencesParams) WithFollowups(followups *bool) *UpdateAiPreferencesParams { + o.SetFollowups(followups) + return o +} + +// SetFollowups adds the followups to the update ai preferences params +func (o *UpdateAiPreferencesParams) SetFollowups(followups *bool) { + o.Followups = followups +} + +// WithImpact adds the impact to the update ai preferences params +func (o *UpdateAiPreferencesParams) WithImpact(impact *bool) *UpdateAiPreferencesParams { + o.SetImpact(impact) + return o +} + +// SetImpact adds the impact to the update ai preferences params +func (o *UpdateAiPreferencesParams) SetImpact(impact *bool) { + o.Impact = impact +} + +// WithRetros adds the retros to the update ai preferences params +func (o *UpdateAiPreferencesParams) WithRetros(retros *bool) *UpdateAiPreferencesParams { + o.SetRetros(retros) + return o +} + +// SetRetros adds the retros to the update ai preferences params +func (o *UpdateAiPreferencesParams) SetRetros(retros *bool) { + o.Retros = retros +} + +// WithSimilarIncidents adds the similarIncidents to the update ai preferences params +func (o *UpdateAiPreferencesParams) WithSimilarIncidents(similarIncidents *bool) *UpdateAiPreferencesParams { + o.SetSimilarIncidents(similarIncidents) + return o +} + +// SetSimilarIncidents adds the similarIncidents to the update ai preferences params +func (o *UpdateAiPreferencesParams) SetSimilarIncidents(similarIncidents *bool) { + o.SimilarIncidents = similarIncidents +} + +// WithSummaries adds the summaries to the update ai preferences params +func (o *UpdateAiPreferencesParams) WithSummaries(summaries *bool) *UpdateAiPreferencesParams { + o.SetSummaries(summaries) + return o +} + +// SetSummaries adds the summaries to the update ai preferences params +func (o *UpdateAiPreferencesParams) SetSummaries(summaries *bool) { + o.Summaries = summaries +} + +// WithUpdates adds the updates to the update ai preferences params +func (o *UpdateAiPreferencesParams) WithUpdates(updates *bool) *UpdateAiPreferencesParams { + o.SetUpdates(updates) + return o +} + +// SetUpdates adds the updates to the update ai preferences params +func (o *UpdateAiPreferencesParams) SetUpdates(updates *bool) { + o.Updates = updates +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateAiPreferencesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Ai != nil { + + // form param ai + var frAi bool + if o.Ai != nil { + frAi = *o.Ai + } + fAi := swag.FormatBool(frAi) + if fAi != "" { + if err := r.SetFormParam("ai", fAi); err != nil { + return err + } + } + } + + if o.Description != nil { + + // form param description + var frDescription bool + if o.Description != nil { + frDescription = *o.Description + } + fDescription := swag.FormatBool(frDescription) + if fDescription != "" { + if err := r.SetFormParam("description", fDescription); err != nil { + return err + } + } + } + + if o.Followups != nil { + + // form param followups + var frFollowups bool + if o.Followups != nil { + frFollowups = *o.Followups + } + fFollowups := swag.FormatBool(frFollowups) + if fFollowups != "" { + if err := r.SetFormParam("followups", fFollowups); err != nil { + return err + } + } + } + + if o.Impact != nil { + + // form param impact + var frImpact bool + if o.Impact != nil { + frImpact = *o.Impact + } + fImpact := swag.FormatBool(frImpact) + if fImpact != "" { + if err := r.SetFormParam("impact", fImpact); err != nil { + return err + } + } + } + + if o.Retros != nil { + + // form param retros + var frRetros bool + if o.Retros != nil { + frRetros = *o.Retros + } + fRetros := swag.FormatBool(frRetros) + if fRetros != "" { + if err := r.SetFormParam("retros", fRetros); err != nil { + return err + } + } + } + + if o.SimilarIncidents != nil { + + // form param similar_incidents + var frSimilarIncidents bool + if o.SimilarIncidents != nil { + frSimilarIncidents = *o.SimilarIncidents + } + fSimilarIncidents := swag.FormatBool(frSimilarIncidents) + if fSimilarIncidents != "" { + if err := r.SetFormParam("similar_incidents", fSimilarIncidents); err != nil { + return err + } + } + } + + if o.Summaries != nil { + + // form param summaries + var frSummaries bool + if o.Summaries != nil { + frSummaries = *o.Summaries + } + fSummaries := swag.FormatBool(frSummaries) + if fSummaries != "" { + if err := r.SetFormParam("summaries", fSummaries); err != nil { + return err + } + } + } + + if o.Updates != nil { + + // form param updates + var frUpdates bool + if o.Updates != nil { + frUpdates = *o.Updates + } + fUpdates := swag.FormatBool(frUpdates) + if fUpdates != "" { + if err := r.SetFormParam("updates", fUpdates); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/account_settings/update_ai_preferences_responses.go b/client/account_settings/update_ai_preferences_responses.go new file mode 100644 index 0000000..d8361cc --- /dev/null +++ b/client/account_settings/update_ai_preferences_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package account_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateAiPreferencesReader is a Reader for the UpdateAiPreferences structure. +type UpdateAiPreferencesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateAiPreferencesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateAiPreferencesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateAiPreferencesOK creates a UpdateAiPreferencesOK with default headers values +func NewUpdateAiPreferencesOK() *UpdateAiPreferencesOK { + return &UpdateAiPreferencesOK{} +} + +/* +UpdateAiPreferencesOK describes a response with status code 200, with default header values. + +Updates the AI preferences +*/ +type UpdateAiPreferencesOK struct { + Payload *models.AIEntitiesPreferencesEntity +} + +// IsSuccess returns true when this update ai preferences o k response has a 2xx status code +func (o *UpdateAiPreferencesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update ai preferences o k response has a 3xx status code +func (o *UpdateAiPreferencesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update ai preferences o k response has a 4xx status code +func (o *UpdateAiPreferencesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update ai preferences o k response has a 5xx status code +func (o *UpdateAiPreferencesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update ai preferences o k response a status code equal to that given +func (o *UpdateAiPreferencesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateAiPreferencesOK) Error() string { + return fmt.Sprintf("[PATCH /v1/ai/preferences][%d] updateAiPreferencesOK %+v", 200, o.Payload) +} + +func (o *UpdateAiPreferencesOK) String() string { + return fmt.Sprintf("[PATCH /v1/ai/preferences][%d] updateAiPreferencesOK %+v", 200, o.Payload) +} + +func (o *UpdateAiPreferencesOK) GetPayload() *models.AIEntitiesPreferencesEntity { + return o.Payload +} + +func (o *UpdateAiPreferencesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AIEntitiesPreferencesEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/alerts/alerts_client.go b/client/alerts/alerts_client.go index abd3bfa..3d3e2fc 100644 --- a/client/alerts/alerts_client.go +++ b/client/alerts/alerts_client.go @@ -30,42 +30,42 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1IncidentsIncidentIDAlertsIncidentAlertID(params *DeleteV1IncidentsIncidentIDAlertsIncidentAlertIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDAlertsIncidentAlertIDNoContent, error) + CreateIncidentAlert(params *CreateIncidentAlertParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentAlertNoContent, error) - GetV1Alerts(params *GetV1AlertsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AlertsOK, error) + DeleteIncidentAlert(params *DeleteIncidentAlertParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentAlertNoContent, error) - GetV1AlertsAlertID(params *GetV1AlertsAlertIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AlertsAlertIDOK, error) + GetAlert(params *GetAlertParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAlertOK, error) - GetV1IncidentsIncidentIDAlerts(params *GetV1IncidentsIncidentIDAlertsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDAlertsOK, error) + ListAlerts(params *ListAlertsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAlertsOK, error) - GetV1ProcessingLogEntries(params *GetV1ProcessingLogEntriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ProcessingLogEntriesOK, error) + ListIncidentAlerts(params *ListIncidentAlertsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentAlertsOK, error) - PatchV1IncidentsIncidentIDAlertsIncidentAlertIDPrimary(params *PatchV1IncidentsIncidentIDAlertsIncidentAlertIDPrimaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDAlertsIncidentAlertIDPrimaryOK, error) + ListProcessingLogEntries(params *ListProcessingLogEntriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListProcessingLogEntriesOK, error) - PostV1IncidentsIncidentIDAlerts(params *PostV1IncidentsIncidentIDAlertsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDAlertsNoContent, error) + UpdateIncidentAlertPrimary(params *UpdateIncidentAlertPrimaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentAlertPrimaryOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1IncidentsIncidentIDAlertsIncidentAlertID removes an alert from an incident +CreateIncidentAlert attaches an alert to an incident -Remove an alert from an incident +Add an alert to an incident. FireHydrant needs to have ingested the alert from a third party system in order to attach it to the incident. */ -func (a *Client) DeleteV1IncidentsIncidentIDAlertsIncidentAlertID(params *DeleteV1IncidentsIncidentIDAlertsIncidentAlertIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDAlertsIncidentAlertIDNoContent, error) { +func (a *Client) CreateIncidentAlert(params *CreateIncidentAlertParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentAlertNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IncidentsIncidentIDAlertsIncidentAlertIDParams() + params = NewCreateIncidentAlertParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IncidentsIncidentIdAlertsIncidentAlertId", - Method: "DELETE", - PathPattern: "/v1/incidents/{incident_id}/alerts/{incident_alert_id}", + ID: "create_incident_alert", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/alerts", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IncidentsIncidentIDAlertsIncidentAlertIDReader{formats: a.formats}, + Reader: &CreateIncidentAlertReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -78,35 +78,35 @@ func (a *Client) DeleteV1IncidentsIncidentIDAlertsIncidentAlertID(params *Delete if err != nil { return nil, err } - success, ok := result.(*DeleteV1IncidentsIncidentIDAlertsIncidentAlertIDNoContent) + success, ok := result.(*CreateIncidentAlertNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IncidentsIncidentIdAlertsIncidentAlertId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_alert: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Alerts lists alerts +DeleteIncidentAlert removes an alert from an incident -Retrieve all alerts from third parties +Remove an alert from an incident */ -func (a *Client) GetV1Alerts(params *GetV1AlertsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AlertsOK, error) { +func (a *Client) DeleteIncidentAlert(params *DeleteIncidentAlertParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentAlertNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1AlertsParams() + params = NewDeleteIncidentAlertParams() } op := &runtime.ClientOperation{ - ID: "getV1Alerts", - Method: "GET", - PathPattern: "/v1/alerts", + ID: "delete_incident_alert", + Method: "DELETE", + PathPattern: "/v1/incidents/{incident_id}/alerts/{incident_alert_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1AlertsReader{formats: a.formats}, + Reader: &DeleteIncidentAlertReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -119,35 +119,35 @@ func (a *Client) GetV1Alerts(params *GetV1AlertsParams, authInfo runtime.ClientA if err != nil { return nil, err } - success, ok := result.(*GetV1AlertsOK) + success, ok := result.(*DeleteIncidentAlertNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Alerts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_incident_alert: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1AlertsAlertID gets an alert +GetAlert gets an alert Retrieve a single alert */ -func (a *Client) GetV1AlertsAlertID(params *GetV1AlertsAlertIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AlertsAlertIDOK, error) { +func (a *Client) GetAlert(params *GetAlertParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAlertOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1AlertsAlertIDParams() + params = NewGetAlertParams() } op := &runtime.ClientOperation{ - ID: "getV1AlertsAlertId", + ID: "get_alert", Method: "GET", PathPattern: "/v1/alerts/{alert_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1AlertsAlertIDReader{formats: a.formats}, + Reader: &GetAlertReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -160,35 +160,35 @@ func (a *Client) GetV1AlertsAlertID(params *GetV1AlertsAlertIDParams, authInfo r if err != nil { return nil, err } - success, ok := result.(*GetV1AlertsAlertIDOK) + success, ok := result.(*GetAlertOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1AlertsAlertId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_alert: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDAlerts lists alerts for an incident +ListAlerts lists alerts -List alerts that have been attached to an incident +Retrieve all alerts from third parties */ -func (a *Client) GetV1IncidentsIncidentIDAlerts(params *GetV1IncidentsIncidentIDAlertsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDAlertsOK, error) { +func (a *Client) ListAlerts(params *ListAlertsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAlertsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDAlertsParams() + params = NewListAlertsParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdAlerts", + ID: "list_alerts", Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/alerts", + PathPattern: "/v1/alerts", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDAlertsReader{formats: a.formats}, + Reader: &ListAlertsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -201,35 +201,35 @@ func (a *Client) GetV1IncidentsIncidentIDAlerts(params *GetV1IncidentsIncidentID if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDAlertsOK) + success, ok := result.(*ListAlertsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdAlerts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_alerts: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ProcessingLogEntries lists alert processing log entries +ListIncidentAlerts lists alerts for an incident -Processing Log Entries for a specific alert +List alerts that have been attached to an incident */ -func (a *Client) GetV1ProcessingLogEntries(params *GetV1ProcessingLogEntriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ProcessingLogEntriesOK, error) { +func (a *Client) ListIncidentAlerts(params *ListIncidentAlertsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentAlertsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ProcessingLogEntriesParams() + params = NewListIncidentAlertsParams() } op := &runtime.ClientOperation{ - ID: "getV1ProcessingLogEntries", + ID: "list_incident_alerts", Method: "GET", - PathPattern: "/v1/processing_log_entries", + PathPattern: "/v1/incidents/{incident_id}/alerts", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ProcessingLogEntriesReader{formats: a.formats}, + Reader: &ListIncidentAlertsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -242,35 +242,35 @@ func (a *Client) GetV1ProcessingLogEntries(params *GetV1ProcessingLogEntriesPara if err != nil { return nil, err } - success, ok := result.(*GetV1ProcessingLogEntriesOK) + success, ok := result.(*ListIncidentAlertsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ProcessingLogEntries: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_alerts: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IncidentsIncidentIDAlertsIncidentAlertIDPrimary sets an alert as primary for an incident +ListProcessingLogEntries lists alert processing log entries -Setting an alert as primary will overwrite milestone times in the FireHydrant incident with times included in the primary alert. Services attached to the primary alert will also be automatically added to the incident. +Processing Log Entries for a specific alert */ -func (a *Client) PatchV1IncidentsIncidentIDAlertsIncidentAlertIDPrimary(params *PatchV1IncidentsIncidentIDAlertsIncidentAlertIDPrimaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDAlertsIncidentAlertIDPrimaryOK, error) { +func (a *Client) ListProcessingLogEntries(params *ListProcessingLogEntriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListProcessingLogEntriesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IncidentsIncidentIDAlertsIncidentAlertIDPrimaryParams() + params = NewListProcessingLogEntriesParams() } op := &runtime.ClientOperation{ - ID: "patchV1IncidentsIncidentIdAlertsIncidentAlertIdPrimary", - Method: "PATCH", - PathPattern: "/v1/incidents/{incident_id}/alerts/{incident_alert_id}/primary", + ID: "list_processing_log_entries", + Method: "GET", + PathPattern: "/v1/processing_log_entries", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IncidentsIncidentIDAlertsIncidentAlertIDPrimaryReader{formats: a.formats}, + Reader: &ListProcessingLogEntriesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -283,35 +283,35 @@ func (a *Client) PatchV1IncidentsIncidentIDAlertsIncidentAlertIDPrimary(params * if err != nil { return nil, err } - success, ok := result.(*PatchV1IncidentsIncidentIDAlertsIncidentAlertIDPrimaryOK) + success, ok := result.(*ListProcessingLogEntriesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IncidentsIncidentIdAlertsIncidentAlertIdPrimary: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_processing_log_entries: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDAlerts attaches an alert to an incident +UpdateIncidentAlertPrimary sets an alert as primary for an incident -Add an alert to an incident. FireHydrant needs to have ingested the alert from a third party system in order to attach it to the incident. +Setting an alert as primary will overwrite milestone times in the FireHydrant incident with times included in the primary alert. Services attached to the primary alert will also be automatically added to the incident. */ -func (a *Client) PostV1IncidentsIncidentIDAlerts(params *PostV1IncidentsIncidentIDAlertsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDAlertsNoContent, error) { +func (a *Client) UpdateIncidentAlertPrimary(params *UpdateIncidentAlertPrimaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentAlertPrimaryOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDAlertsParams() + params = NewUpdateIncidentAlertPrimaryParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdAlerts", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/alerts", + ID: "update_incident_alert_primary", + Method: "PATCH", + PathPattern: "/v1/incidents/{incident_id}/alerts/{incident_alert_id}/primary", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDAlertsReader{formats: a.formats}, + Reader: &UpdateIncidentAlertPrimaryReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -324,13 +324,13 @@ func (a *Client) PostV1IncidentsIncidentIDAlerts(params *PostV1IncidentsIncident if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDAlertsNoContent) + success, ok := result.(*UpdateIncidentAlertPrimaryOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdAlerts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_incident_alert_primary: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/alerts/create_incident_alert_parameters.go b/client/alerts/create_incident_alert_parameters.go new file mode 100644 index 0000000..ed1254c --- /dev/null +++ b/client/alerts/create_incident_alert_parameters.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateIncidentAlertParams creates a new CreateIncidentAlertParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentAlertParams() *CreateIncidentAlertParams { + return &CreateIncidentAlertParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentAlertParamsWithTimeout creates a new CreateIncidentAlertParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentAlertParamsWithTimeout(timeout time.Duration) *CreateIncidentAlertParams { + return &CreateIncidentAlertParams{ + timeout: timeout, + } +} + +// NewCreateIncidentAlertParamsWithContext creates a new CreateIncidentAlertParams object +// with the ability to set a context for a request. +func NewCreateIncidentAlertParamsWithContext(ctx context.Context) *CreateIncidentAlertParams { + return &CreateIncidentAlertParams{ + Context: ctx, + } +} + +// NewCreateIncidentAlertParamsWithHTTPClient creates a new CreateIncidentAlertParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentAlertParamsWithHTTPClient(client *http.Client) *CreateIncidentAlertParams { + return &CreateIncidentAlertParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentAlertParams contains all the parameters to send to the API endpoint + + for the create incident alert operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentAlertParams struct { + + /* AlertIds. + + Array of alert IDs to be assigned to the incident + */ + AlertIds []string + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident alert params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentAlertParams) WithDefaults() *CreateIncidentAlertParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident alert params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentAlertParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident alert params +func (o *CreateIncidentAlertParams) WithTimeout(timeout time.Duration) *CreateIncidentAlertParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident alert params +func (o *CreateIncidentAlertParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident alert params +func (o *CreateIncidentAlertParams) WithContext(ctx context.Context) *CreateIncidentAlertParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident alert params +func (o *CreateIncidentAlertParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident alert params +func (o *CreateIncidentAlertParams) WithHTTPClient(client *http.Client) *CreateIncidentAlertParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident alert params +func (o *CreateIncidentAlertParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAlertIds adds the alertIds to the create incident alert params +func (o *CreateIncidentAlertParams) WithAlertIds(alertIds []string) *CreateIncidentAlertParams { + o.SetAlertIds(alertIds) + return o +} + +// SetAlertIds adds the alertIds to the create incident alert params +func (o *CreateIncidentAlertParams) SetAlertIds(alertIds []string) { + o.AlertIds = alertIds +} + +// WithIncidentID adds the incidentID to the create incident alert params +func (o *CreateIncidentAlertParams) WithIncidentID(incidentID string) *CreateIncidentAlertParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident alert params +func (o *CreateIncidentAlertParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentAlertParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.AlertIds != nil { + if err := r.SetBodyParam(o.AlertIds); err != nil { + return err + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/alerts/create_incident_alert_responses.go b/client/alerts/create_incident_alert_responses.go new file mode 100644 index 0000000..1311ef8 --- /dev/null +++ b/client/alerts/create_incident_alert_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateIncidentAlertReader is a Reader for the CreateIncidentAlert structure. +type CreateIncidentAlertReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentAlertReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewCreateIncidentAlertNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentAlertNoContent creates a CreateIncidentAlertNoContent with default headers values +func NewCreateIncidentAlertNoContent() *CreateIncidentAlertNoContent { + return &CreateIncidentAlertNoContent{} +} + +/* +CreateIncidentAlertNoContent describes a response with status code 204, with default header values. + +Add an alert to an incident. FireHydrant needs to have ingested the alert from a third party system in order to attach it to the incident. +*/ +type CreateIncidentAlertNoContent struct { +} + +// IsSuccess returns true when this create incident alert no content response has a 2xx status code +func (o *CreateIncidentAlertNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident alert no content response has a 3xx status code +func (o *CreateIncidentAlertNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident alert no content response has a 4xx status code +func (o *CreateIncidentAlertNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident alert no content response has a 5xx status code +func (o *CreateIncidentAlertNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident alert no content response a status code equal to that given +func (o *CreateIncidentAlertNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *CreateIncidentAlertNoContent) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/alerts][%d] createIncidentAlertNoContent ", 204) +} + +func (o *CreateIncidentAlertNoContent) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/alerts][%d] createIncidentAlertNoContent ", 204) +} + +func (o *CreateIncidentAlertNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/alerts/delete_incident_alert_parameters.go b/client/alerts/delete_incident_alert_parameters.go new file mode 100644 index 0000000..4705838 --- /dev/null +++ b/client/alerts/delete_incident_alert_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteIncidentAlertParams creates a new DeleteIncidentAlertParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteIncidentAlertParams() *DeleteIncidentAlertParams { + return &DeleteIncidentAlertParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteIncidentAlertParamsWithTimeout creates a new DeleteIncidentAlertParams object +// with the ability to set a timeout on a request. +func NewDeleteIncidentAlertParamsWithTimeout(timeout time.Duration) *DeleteIncidentAlertParams { + return &DeleteIncidentAlertParams{ + timeout: timeout, + } +} + +// NewDeleteIncidentAlertParamsWithContext creates a new DeleteIncidentAlertParams object +// with the ability to set a context for a request. +func NewDeleteIncidentAlertParamsWithContext(ctx context.Context) *DeleteIncidentAlertParams { + return &DeleteIncidentAlertParams{ + Context: ctx, + } +} + +// NewDeleteIncidentAlertParamsWithHTTPClient creates a new DeleteIncidentAlertParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteIncidentAlertParamsWithHTTPClient(client *http.Client) *DeleteIncidentAlertParams { + return &DeleteIncidentAlertParams{ + HTTPClient: client, + } +} + +/* +DeleteIncidentAlertParams contains all the parameters to send to the API endpoint + + for the delete incident alert operation. + + Typically these are written to a http.Request. +*/ +type DeleteIncidentAlertParams struct { + + // IncidentAlertID. + IncidentAlertID string + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete incident alert params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentAlertParams) WithDefaults() *DeleteIncidentAlertParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete incident alert params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentAlertParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete incident alert params +func (o *DeleteIncidentAlertParams) WithTimeout(timeout time.Duration) *DeleteIncidentAlertParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete incident alert params +func (o *DeleteIncidentAlertParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete incident alert params +func (o *DeleteIncidentAlertParams) WithContext(ctx context.Context) *DeleteIncidentAlertParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete incident alert params +func (o *DeleteIncidentAlertParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete incident alert params +func (o *DeleteIncidentAlertParams) WithHTTPClient(client *http.Client) *DeleteIncidentAlertParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete incident alert params +func (o *DeleteIncidentAlertParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentAlertID adds the incidentAlertID to the delete incident alert params +func (o *DeleteIncidentAlertParams) WithIncidentAlertID(incidentAlertID string) *DeleteIncidentAlertParams { + o.SetIncidentAlertID(incidentAlertID) + return o +} + +// SetIncidentAlertID adds the incidentAlertId to the delete incident alert params +func (o *DeleteIncidentAlertParams) SetIncidentAlertID(incidentAlertID string) { + o.IncidentAlertID = incidentAlertID +} + +// WithIncidentID adds the incidentID to the delete incident alert params +func (o *DeleteIncidentAlertParams) WithIncidentID(incidentID string) *DeleteIncidentAlertParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the delete incident alert params +func (o *DeleteIncidentAlertParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteIncidentAlertParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_alert_id + if err := r.SetPathParam("incident_alert_id", o.IncidentAlertID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/alerts/delete_incident_alert_responses.go b/client/alerts/delete_incident_alert_responses.go new file mode 100644 index 0000000..c2dd39c --- /dev/null +++ b/client/alerts/delete_incident_alert_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteIncidentAlertReader is a Reader for the DeleteIncidentAlert structure. +type DeleteIncidentAlertReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteIncidentAlertReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteIncidentAlertNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteIncidentAlertNoContent creates a DeleteIncidentAlertNoContent with default headers values +func NewDeleteIncidentAlertNoContent() *DeleteIncidentAlertNoContent { + return &DeleteIncidentAlertNoContent{} +} + +/* +DeleteIncidentAlertNoContent describes a response with status code 204, with default header values. + +Remove an alert from an incident +*/ +type DeleteIncidentAlertNoContent struct { +} + +// IsSuccess returns true when this delete incident alert no content response has a 2xx status code +func (o *DeleteIncidentAlertNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete incident alert no content response has a 3xx status code +func (o *DeleteIncidentAlertNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete incident alert no content response has a 4xx status code +func (o *DeleteIncidentAlertNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete incident alert no content response has a 5xx status code +func (o *DeleteIncidentAlertNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete incident alert no content response a status code equal to that given +func (o *DeleteIncidentAlertNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteIncidentAlertNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/alerts/{incident_alert_id}][%d] deleteIncidentAlertNoContent ", 204) +} + +func (o *DeleteIncidentAlertNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/alerts/{incident_alert_id}][%d] deleteIncidentAlertNoContent ", 204) +} + +func (o *DeleteIncidentAlertNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/alerts/get_alert_parameters.go b/client/alerts/get_alert_parameters.go new file mode 100644 index 0000000..10dd7d5 --- /dev/null +++ b/client/alerts/get_alert_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetAlertParams creates a new GetAlertParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetAlertParams() *GetAlertParams { + return &GetAlertParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAlertParamsWithTimeout creates a new GetAlertParams object +// with the ability to set a timeout on a request. +func NewGetAlertParamsWithTimeout(timeout time.Duration) *GetAlertParams { + return &GetAlertParams{ + timeout: timeout, + } +} + +// NewGetAlertParamsWithContext creates a new GetAlertParams object +// with the ability to set a context for a request. +func NewGetAlertParamsWithContext(ctx context.Context) *GetAlertParams { + return &GetAlertParams{ + Context: ctx, + } +} + +// NewGetAlertParamsWithHTTPClient creates a new GetAlertParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAlertParamsWithHTTPClient(client *http.Client) *GetAlertParams { + return &GetAlertParams{ + HTTPClient: client, + } +} + +/* +GetAlertParams contains all the parameters to send to the API endpoint + + for the get alert operation. + + Typically these are written to a http.Request. +*/ +type GetAlertParams struct { + + // AlertID. + AlertID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get alert params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAlertParams) WithDefaults() *GetAlertParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get alert params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAlertParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get alert params +func (o *GetAlertParams) WithTimeout(timeout time.Duration) *GetAlertParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get alert params +func (o *GetAlertParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get alert params +func (o *GetAlertParams) WithContext(ctx context.Context) *GetAlertParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get alert params +func (o *GetAlertParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get alert params +func (o *GetAlertParams) WithHTTPClient(client *http.Client) *GetAlertParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get alert params +func (o *GetAlertParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAlertID adds the alertID to the get alert params +func (o *GetAlertParams) WithAlertID(alertID string) *GetAlertParams { + o.SetAlertID(alertID) + return o +} + +// SetAlertID adds the alertId to the get alert params +func (o *GetAlertParams) SetAlertID(alertID string) { + o.AlertID = alertID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAlertParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param alert_id + if err := r.SetPathParam("alert_id", o.AlertID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/alerts/get_alert_responses.go b/client/alerts/get_alert_responses.go new file mode 100644 index 0000000..da78e4e --- /dev/null +++ b/client/alerts/get_alert_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetAlertReader is a Reader for the GetAlert structure. +type GetAlertReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAlertReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAlertOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAlertOK creates a GetAlertOK with default headers values +func NewGetAlertOK() *GetAlertOK { + return &GetAlertOK{} +} + +/* +GetAlertOK describes a response with status code 200, with default header values. + +Retrieve a single alert +*/ +type GetAlertOK struct { + Payload *models.AlertsAlertEntity +} + +// IsSuccess returns true when this get alert o k response has a 2xx status code +func (o *GetAlertOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get alert o k response has a 3xx status code +func (o *GetAlertOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get alert o k response has a 4xx status code +func (o *GetAlertOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get alert o k response has a 5xx status code +func (o *GetAlertOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get alert o k response a status code equal to that given +func (o *GetAlertOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetAlertOK) Error() string { + return fmt.Sprintf("[GET /v1/alerts/{alert_id}][%d] getAlertOK %+v", 200, o.Payload) +} + +func (o *GetAlertOK) String() string { + return fmt.Sprintf("[GET /v1/alerts/{alert_id}][%d] getAlertOK %+v", 200, o.Payload) +} + +func (o *GetAlertOK) GetPayload() *models.AlertsAlertEntity { + return o.Payload +} + +func (o *GetAlertOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AlertsAlertEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/alerts/list_alerts_parameters.go b/client/alerts/list_alerts_parameters.go new file mode 100644 index 0000000..6dbecad --- /dev/null +++ b/client/alerts/list_alerts_parameters.go @@ -0,0 +1,536 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListAlertsParams creates a new ListAlertsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListAlertsParams() *ListAlertsParams { + return &ListAlertsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListAlertsParamsWithTimeout creates a new ListAlertsParams object +// with the ability to set a timeout on a request. +func NewListAlertsParamsWithTimeout(timeout time.Duration) *ListAlertsParams { + return &ListAlertsParams{ + timeout: timeout, + } +} + +// NewListAlertsParamsWithContext creates a new ListAlertsParams object +// with the ability to set a context for a request. +func NewListAlertsParamsWithContext(ctx context.Context) *ListAlertsParams { + return &ListAlertsParams{ + Context: ctx, + } +} + +// NewListAlertsParamsWithHTTPClient creates a new ListAlertsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListAlertsParamsWithHTTPClient(client *http.Client) *ListAlertsParams { + return &ListAlertsParams{ + HTTPClient: client, + } +} + +/* +ListAlertsParams contains all the parameters to send to the API endpoint + + for the list alerts operation. + + Typically these are written to a http.Request. +*/ +type ListAlertsParams struct { + + /* Environments. + + A comma separated list of environment IDs. This currently only works for Signals alerts. + */ + Environments *string + + /* Functionalities. + + A comma separated list of functionality IDs. This currently only works for Signals alerts. + */ + Functionalities *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + A text query for alerts + */ + Query *string + + /* Services. + + A comma separated list of service IDs. This currently only works for Signals alerts. + */ + Services *string + + /* SignalRules. + + A comma separated list of signals rule IDs. This currently only works for Signals alerts. + */ + SignalRules *string + + /* Statuses. + + A comma separated list of statuses to filter by. Valid statuses are: opened, acknowledged, resolved, ignored, expired, or linked + */ + Statuses *string + + /* TagMatchStrategy. + + The strategy to match tags. `any` will return alerts that have at least one of the supplied tags, `match_all` will return only alerts that have all of the supplied tags, and `exclude` will only return alerts that have none of the supplied tags. This currently only works for Signals alerts. + */ + TagMatchStrategy *string + + /* Tags. + + A comma separated list of tags. This currently only works for Signals alerts. + */ + Tags *string + + /* Teams. + + A comma separated list of team IDs. This currently only works for Signals alerts. + */ + Teams *string + + /* Users. + + A comma separated list of user IDs. This currently only works for Signals alerts. + */ + Users *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list alerts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAlertsParams) WithDefaults() *ListAlertsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list alerts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAlertsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list alerts params +func (o *ListAlertsParams) WithTimeout(timeout time.Duration) *ListAlertsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list alerts params +func (o *ListAlertsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list alerts params +func (o *ListAlertsParams) WithContext(ctx context.Context) *ListAlertsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list alerts params +func (o *ListAlertsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list alerts params +func (o *ListAlertsParams) WithHTTPClient(client *http.Client) *ListAlertsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list alerts params +func (o *ListAlertsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEnvironments adds the environments to the list alerts params +func (o *ListAlertsParams) WithEnvironments(environments *string) *ListAlertsParams { + o.SetEnvironments(environments) + return o +} + +// SetEnvironments adds the environments to the list alerts params +func (o *ListAlertsParams) SetEnvironments(environments *string) { + o.Environments = environments +} + +// WithFunctionalities adds the functionalities to the list alerts params +func (o *ListAlertsParams) WithFunctionalities(functionalities *string) *ListAlertsParams { + o.SetFunctionalities(functionalities) + return o +} + +// SetFunctionalities adds the functionalities to the list alerts params +func (o *ListAlertsParams) SetFunctionalities(functionalities *string) { + o.Functionalities = functionalities +} + +// WithPage adds the page to the list alerts params +func (o *ListAlertsParams) WithPage(page *int32) *ListAlertsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list alerts params +func (o *ListAlertsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list alerts params +func (o *ListAlertsParams) WithPerPage(perPage *int32) *ListAlertsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list alerts params +func (o *ListAlertsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list alerts params +func (o *ListAlertsParams) WithQuery(query *string) *ListAlertsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list alerts params +func (o *ListAlertsParams) SetQuery(query *string) { + o.Query = query +} + +// WithServices adds the services to the list alerts params +func (o *ListAlertsParams) WithServices(services *string) *ListAlertsParams { + o.SetServices(services) + return o +} + +// SetServices adds the services to the list alerts params +func (o *ListAlertsParams) SetServices(services *string) { + o.Services = services +} + +// WithSignalRules adds the signalRules to the list alerts params +func (o *ListAlertsParams) WithSignalRules(signalRules *string) *ListAlertsParams { + o.SetSignalRules(signalRules) + return o +} + +// SetSignalRules adds the signalRules to the list alerts params +func (o *ListAlertsParams) SetSignalRules(signalRules *string) { + o.SignalRules = signalRules +} + +// WithStatuses adds the statuses to the list alerts params +func (o *ListAlertsParams) WithStatuses(statuses *string) *ListAlertsParams { + o.SetStatuses(statuses) + return o +} + +// SetStatuses adds the statuses to the list alerts params +func (o *ListAlertsParams) SetStatuses(statuses *string) { + o.Statuses = statuses +} + +// WithTagMatchStrategy adds the tagMatchStrategy to the list alerts params +func (o *ListAlertsParams) WithTagMatchStrategy(tagMatchStrategy *string) *ListAlertsParams { + o.SetTagMatchStrategy(tagMatchStrategy) + return o +} + +// SetTagMatchStrategy adds the tagMatchStrategy to the list alerts params +func (o *ListAlertsParams) SetTagMatchStrategy(tagMatchStrategy *string) { + o.TagMatchStrategy = tagMatchStrategy +} + +// WithTags adds the tags to the list alerts params +func (o *ListAlertsParams) WithTags(tags *string) *ListAlertsParams { + o.SetTags(tags) + return o +} + +// SetTags adds the tags to the list alerts params +func (o *ListAlertsParams) SetTags(tags *string) { + o.Tags = tags +} + +// WithTeams adds the teams to the list alerts params +func (o *ListAlertsParams) WithTeams(teams *string) *ListAlertsParams { + o.SetTeams(teams) + return o +} + +// SetTeams adds the teams to the list alerts params +func (o *ListAlertsParams) SetTeams(teams *string) { + o.Teams = teams +} + +// WithUsers adds the users to the list alerts params +func (o *ListAlertsParams) WithUsers(users *string) *ListAlertsParams { + o.SetUsers(users) + return o +} + +// SetUsers adds the users to the list alerts params +func (o *ListAlertsParams) SetUsers(users *string) { + o.Users = users +} + +// WriteToRequest writes these params to a swagger request +func (o *ListAlertsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Environments != nil { + + // query param environments + var qrEnvironments string + + if o.Environments != nil { + qrEnvironments = *o.Environments + } + qEnvironments := qrEnvironments + if qEnvironments != "" { + + if err := r.SetQueryParam("environments", qEnvironments); err != nil { + return err + } + } + } + + if o.Functionalities != nil { + + // query param functionalities + var qrFunctionalities string + + if o.Functionalities != nil { + qrFunctionalities = *o.Functionalities + } + qFunctionalities := qrFunctionalities + if qFunctionalities != "" { + + if err := r.SetQueryParam("functionalities", qFunctionalities); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if o.Services != nil { + + // query param services + var qrServices string + + if o.Services != nil { + qrServices = *o.Services + } + qServices := qrServices + if qServices != "" { + + if err := r.SetQueryParam("services", qServices); err != nil { + return err + } + } + } + + if o.SignalRules != nil { + + // query param signal_rules + var qrSignalRules string + + if o.SignalRules != nil { + qrSignalRules = *o.SignalRules + } + qSignalRules := qrSignalRules + if qSignalRules != "" { + + if err := r.SetQueryParam("signal_rules", qSignalRules); err != nil { + return err + } + } + } + + if o.Statuses != nil { + + // query param statuses + var qrStatuses string + + if o.Statuses != nil { + qrStatuses = *o.Statuses + } + qStatuses := qrStatuses + if qStatuses != "" { + + if err := r.SetQueryParam("statuses", qStatuses); err != nil { + return err + } + } + } + + if o.TagMatchStrategy != nil { + + // query param tag_match_strategy + var qrTagMatchStrategy string + + if o.TagMatchStrategy != nil { + qrTagMatchStrategy = *o.TagMatchStrategy + } + qTagMatchStrategy := qrTagMatchStrategy + if qTagMatchStrategy != "" { + + if err := r.SetQueryParam("tag_match_strategy", qTagMatchStrategy); err != nil { + return err + } + } + } + + if o.Tags != nil { + + // query param tags + var qrTags string + + if o.Tags != nil { + qrTags = *o.Tags + } + qTags := qrTags + if qTags != "" { + + if err := r.SetQueryParam("tags", qTags); err != nil { + return err + } + } + } + + if o.Teams != nil { + + // query param teams + var qrTeams string + + if o.Teams != nil { + qrTeams = *o.Teams + } + qTeams := qrTeams + if qTeams != "" { + + if err := r.SetQueryParam("teams", qTeams); err != nil { + return err + } + } + } + + if o.Users != nil { + + // query param users + var qrUsers string + + if o.Users != nil { + qrUsers = *o.Users + } + qUsers := qrUsers + if qUsers != "" { + + if err := r.SetQueryParam("users", qUsers); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/alerts/list_alerts_responses.go b/client/alerts/list_alerts_responses.go new file mode 100644 index 0000000..d60716d --- /dev/null +++ b/client/alerts/list_alerts_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListAlertsReader is a Reader for the ListAlerts structure. +type ListAlertsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListAlertsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListAlertsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListAlertsOK creates a ListAlertsOK with default headers values +func NewListAlertsOK() *ListAlertsOK { + return &ListAlertsOK{} +} + +/* +ListAlertsOK describes a response with status code 200, with default header values. + +Retrieve all alerts from third parties +*/ +type ListAlertsOK struct { + Payload *models.AlertsAlertEntityPaginated +} + +// IsSuccess returns true when this list alerts o k response has a 2xx status code +func (o *ListAlertsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list alerts o k response has a 3xx status code +func (o *ListAlertsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list alerts o k response has a 4xx status code +func (o *ListAlertsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list alerts o k response has a 5xx status code +func (o *ListAlertsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list alerts o k response a status code equal to that given +func (o *ListAlertsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListAlertsOK) Error() string { + return fmt.Sprintf("[GET /v1/alerts][%d] listAlertsOK %+v", 200, o.Payload) +} + +func (o *ListAlertsOK) String() string { + return fmt.Sprintf("[GET /v1/alerts][%d] listAlertsOK %+v", 200, o.Payload) +} + +func (o *ListAlertsOK) GetPayload() *models.AlertsAlertEntityPaginated { + return o.Payload +} + +func (o *ListAlertsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AlertsAlertEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/alerts/list_incident_alerts_parameters.go b/client/alerts/list_incident_alerts_parameters.go new file mode 100644 index 0000000..776da5b --- /dev/null +++ b/client/alerts/list_incident_alerts_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListIncidentAlertsParams creates a new ListIncidentAlertsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentAlertsParams() *ListIncidentAlertsParams { + return &ListIncidentAlertsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentAlertsParamsWithTimeout creates a new ListIncidentAlertsParams object +// with the ability to set a timeout on a request. +func NewListIncidentAlertsParamsWithTimeout(timeout time.Duration) *ListIncidentAlertsParams { + return &ListIncidentAlertsParams{ + timeout: timeout, + } +} + +// NewListIncidentAlertsParamsWithContext creates a new ListIncidentAlertsParams object +// with the ability to set a context for a request. +func NewListIncidentAlertsParamsWithContext(ctx context.Context) *ListIncidentAlertsParams { + return &ListIncidentAlertsParams{ + Context: ctx, + } +} + +// NewListIncidentAlertsParamsWithHTTPClient creates a new ListIncidentAlertsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentAlertsParamsWithHTTPClient(client *http.Client) *ListIncidentAlertsParams { + return &ListIncidentAlertsParams{ + HTTPClient: client, + } +} + +/* +ListIncidentAlertsParams contains all the parameters to send to the API endpoint + + for the list incident alerts operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentAlertsParams struct { + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident alerts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentAlertsParams) WithDefaults() *ListIncidentAlertsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident alerts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentAlertsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident alerts params +func (o *ListIncidentAlertsParams) WithTimeout(timeout time.Duration) *ListIncidentAlertsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident alerts params +func (o *ListIncidentAlertsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident alerts params +func (o *ListIncidentAlertsParams) WithContext(ctx context.Context) *ListIncidentAlertsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident alerts params +func (o *ListIncidentAlertsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident alerts params +func (o *ListIncidentAlertsParams) WithHTTPClient(client *http.Client) *ListIncidentAlertsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident alerts params +func (o *ListIncidentAlertsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list incident alerts params +func (o *ListIncidentAlertsParams) WithIncidentID(incidentID string) *ListIncidentAlertsParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list incident alerts params +func (o *ListIncidentAlertsParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentAlertsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/alerts/list_incident_alerts_responses.go b/client/alerts/list_incident_alerts_responses.go new file mode 100644 index 0000000..8a4cfe7 --- /dev/null +++ b/client/alerts/list_incident_alerts_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentAlertsReader is a Reader for the ListIncidentAlerts structure. +type ListIncidentAlertsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentAlertsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentAlertsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentAlertsOK creates a ListIncidentAlertsOK with default headers values +func NewListIncidentAlertsOK() *ListIncidentAlertsOK { + return &ListIncidentAlertsOK{} +} + +/* +ListIncidentAlertsOK describes a response with status code 200, with default header values. + +List alerts that have been attached to an incident +*/ +type ListIncidentAlertsOK struct { + Payload *models.IncidentsAlertEntityPaginated +} + +// IsSuccess returns true when this list incident alerts o k response has a 2xx status code +func (o *ListIncidentAlertsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident alerts o k response has a 3xx status code +func (o *ListIncidentAlertsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident alerts o k response has a 4xx status code +func (o *ListIncidentAlertsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident alerts o k response has a 5xx status code +func (o *ListIncidentAlertsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident alerts o k response a status code equal to that given +func (o *ListIncidentAlertsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentAlertsOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/alerts][%d] listIncidentAlertsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentAlertsOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/alerts][%d] listIncidentAlertsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentAlertsOK) GetPayload() *models.IncidentsAlertEntityPaginated { + return o.Payload +} + +func (o *ListIncidentAlertsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsAlertEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/alerts/list_processing_log_entries_parameters.go b/client/alerts/list_processing_log_entries_parameters.go new file mode 100644 index 0000000..436d6fd --- /dev/null +++ b/client/alerts/list_processing_log_entries_parameters.go @@ -0,0 +1,332 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListProcessingLogEntriesParams creates a new ListProcessingLogEntriesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListProcessingLogEntriesParams() *ListProcessingLogEntriesParams { + return &ListProcessingLogEntriesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListProcessingLogEntriesParamsWithTimeout creates a new ListProcessingLogEntriesParams object +// with the ability to set a timeout on a request. +func NewListProcessingLogEntriesParamsWithTimeout(timeout time.Duration) *ListProcessingLogEntriesParams { + return &ListProcessingLogEntriesParams{ + timeout: timeout, + } +} + +// NewListProcessingLogEntriesParamsWithContext creates a new ListProcessingLogEntriesParams object +// with the ability to set a context for a request. +func NewListProcessingLogEntriesParamsWithContext(ctx context.Context) *ListProcessingLogEntriesParams { + return &ListProcessingLogEntriesParams{ + Context: ctx, + } +} + +// NewListProcessingLogEntriesParamsWithHTTPClient creates a new ListProcessingLogEntriesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListProcessingLogEntriesParamsWithHTTPClient(client *http.Client) *ListProcessingLogEntriesParams { + return &ListProcessingLogEntriesParams{ + HTTPClient: client, + } +} + +/* +ListProcessingLogEntriesParams contains all the parameters to send to the API endpoint + + for the list processing log entries operation. + + Typically these are written to a http.Request. +*/ +type ListProcessingLogEntriesParams struct { + + /* ConnectionID. + + Scopes returned log entries to a specific connection ID + */ + ConnectionID *string + + /* ExactLevel. + + Returns log entries of all levels equal to the provided level + */ + ExactLevel *string + + /* IntegrationSlug. + + Scopes returned log entries to a specific integration ID + */ + IntegrationSlug *string + + /* OfLevel. + + Returns logs of all levels equal to or above the provided level + */ + OfLevel *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list processing log entries params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListProcessingLogEntriesParams) WithDefaults() *ListProcessingLogEntriesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list processing log entries params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListProcessingLogEntriesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list processing log entries params +func (o *ListProcessingLogEntriesParams) WithTimeout(timeout time.Duration) *ListProcessingLogEntriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list processing log entries params +func (o *ListProcessingLogEntriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list processing log entries params +func (o *ListProcessingLogEntriesParams) WithContext(ctx context.Context) *ListProcessingLogEntriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list processing log entries params +func (o *ListProcessingLogEntriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list processing log entries params +func (o *ListProcessingLogEntriesParams) WithHTTPClient(client *http.Client) *ListProcessingLogEntriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list processing log entries params +func (o *ListProcessingLogEntriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the list processing log entries params +func (o *ListProcessingLogEntriesParams) WithConnectionID(connectionID *string) *ListProcessingLogEntriesParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the list processing log entries params +func (o *ListProcessingLogEntriesParams) SetConnectionID(connectionID *string) { + o.ConnectionID = connectionID +} + +// WithExactLevel adds the exactLevel to the list processing log entries params +func (o *ListProcessingLogEntriesParams) WithExactLevel(exactLevel *string) *ListProcessingLogEntriesParams { + o.SetExactLevel(exactLevel) + return o +} + +// SetExactLevel adds the exactLevel to the list processing log entries params +func (o *ListProcessingLogEntriesParams) SetExactLevel(exactLevel *string) { + o.ExactLevel = exactLevel +} + +// WithIntegrationSlug adds the integrationSlug to the list processing log entries params +func (o *ListProcessingLogEntriesParams) WithIntegrationSlug(integrationSlug *string) *ListProcessingLogEntriesParams { + o.SetIntegrationSlug(integrationSlug) + return o +} + +// SetIntegrationSlug adds the integrationSlug to the list processing log entries params +func (o *ListProcessingLogEntriesParams) SetIntegrationSlug(integrationSlug *string) { + o.IntegrationSlug = integrationSlug +} + +// WithOfLevel adds the ofLevel to the list processing log entries params +func (o *ListProcessingLogEntriesParams) WithOfLevel(ofLevel *string) *ListProcessingLogEntriesParams { + o.SetOfLevel(ofLevel) + return o +} + +// SetOfLevel adds the ofLevel to the list processing log entries params +func (o *ListProcessingLogEntriesParams) SetOfLevel(ofLevel *string) { + o.OfLevel = ofLevel +} + +// WithPage adds the page to the list processing log entries params +func (o *ListProcessingLogEntriesParams) WithPage(page *int32) *ListProcessingLogEntriesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list processing log entries params +func (o *ListProcessingLogEntriesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list processing log entries params +func (o *ListProcessingLogEntriesParams) WithPerPage(perPage *int32) *ListProcessingLogEntriesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list processing log entries params +func (o *ListProcessingLogEntriesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListProcessingLogEntriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ConnectionID != nil { + + // query param connection_id + var qrConnectionID string + + if o.ConnectionID != nil { + qrConnectionID = *o.ConnectionID + } + qConnectionID := qrConnectionID + if qConnectionID != "" { + + if err := r.SetQueryParam("connection_id", qConnectionID); err != nil { + return err + } + } + } + + if o.ExactLevel != nil { + + // query param exact_level + var qrExactLevel string + + if o.ExactLevel != nil { + qrExactLevel = *o.ExactLevel + } + qExactLevel := qrExactLevel + if qExactLevel != "" { + + if err := r.SetQueryParam("exact_level", qExactLevel); err != nil { + return err + } + } + } + + if o.IntegrationSlug != nil { + + // query param integration_slug + var qrIntegrationSlug string + + if o.IntegrationSlug != nil { + qrIntegrationSlug = *o.IntegrationSlug + } + qIntegrationSlug := qrIntegrationSlug + if qIntegrationSlug != "" { + + if err := r.SetQueryParam("integration_slug", qIntegrationSlug); err != nil { + return err + } + } + } + + if o.OfLevel != nil { + + // query param of_level + var qrOfLevel string + + if o.OfLevel != nil { + qrOfLevel = *o.OfLevel + } + qOfLevel := qrOfLevel + if qOfLevel != "" { + + if err := r.SetQueryParam("of_level", qOfLevel); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/alerts/list_processing_log_entries_responses.go b/client/alerts/list_processing_log_entries_responses.go new file mode 100644 index 0000000..f3eced0 --- /dev/null +++ b/client/alerts/list_processing_log_entries_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListProcessingLogEntriesReader is a Reader for the ListProcessingLogEntries structure. +type ListProcessingLogEntriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListProcessingLogEntriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListProcessingLogEntriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListProcessingLogEntriesOK creates a ListProcessingLogEntriesOK with default headers values +func NewListProcessingLogEntriesOK() *ListProcessingLogEntriesOK { + return &ListProcessingLogEntriesOK{} +} + +/* +ListProcessingLogEntriesOK describes a response with status code 200, with default header values. + +Processing Log Entries for a specific alert +*/ +type ListProcessingLogEntriesOK struct { + Payload *models.AlertsProcessingLogEntryEntityPaginated +} + +// IsSuccess returns true when this list processing log entries o k response has a 2xx status code +func (o *ListProcessingLogEntriesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list processing log entries o k response has a 3xx status code +func (o *ListProcessingLogEntriesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list processing log entries o k response has a 4xx status code +func (o *ListProcessingLogEntriesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list processing log entries o k response has a 5xx status code +func (o *ListProcessingLogEntriesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list processing log entries o k response a status code equal to that given +func (o *ListProcessingLogEntriesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListProcessingLogEntriesOK) Error() string { + return fmt.Sprintf("[GET /v1/processing_log_entries][%d] listProcessingLogEntriesOK %+v", 200, o.Payload) +} + +func (o *ListProcessingLogEntriesOK) String() string { + return fmt.Sprintf("[GET /v1/processing_log_entries][%d] listProcessingLogEntriesOK %+v", 200, o.Payload) +} + +func (o *ListProcessingLogEntriesOK) GetPayload() *models.AlertsProcessingLogEntryEntityPaginated { + return o.Payload +} + +func (o *ListProcessingLogEntriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AlertsProcessingLogEntryEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/alerts/update_incident_alert_primary_parameters.go b/client/alerts/update_incident_alert_primary_parameters.go new file mode 100644 index 0000000..eb9b1de --- /dev/null +++ b/client/alerts/update_incident_alert_primary_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateIncidentAlertPrimaryParams creates a new UpdateIncidentAlertPrimaryParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIncidentAlertPrimaryParams() *UpdateIncidentAlertPrimaryParams { + return &UpdateIncidentAlertPrimaryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIncidentAlertPrimaryParamsWithTimeout creates a new UpdateIncidentAlertPrimaryParams object +// with the ability to set a timeout on a request. +func NewUpdateIncidentAlertPrimaryParamsWithTimeout(timeout time.Duration) *UpdateIncidentAlertPrimaryParams { + return &UpdateIncidentAlertPrimaryParams{ + timeout: timeout, + } +} + +// NewUpdateIncidentAlertPrimaryParamsWithContext creates a new UpdateIncidentAlertPrimaryParams object +// with the ability to set a context for a request. +func NewUpdateIncidentAlertPrimaryParamsWithContext(ctx context.Context) *UpdateIncidentAlertPrimaryParams { + return &UpdateIncidentAlertPrimaryParams{ + Context: ctx, + } +} + +// NewUpdateIncidentAlertPrimaryParamsWithHTTPClient creates a new UpdateIncidentAlertPrimaryParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIncidentAlertPrimaryParamsWithHTTPClient(client *http.Client) *UpdateIncidentAlertPrimaryParams { + return &UpdateIncidentAlertPrimaryParams{ + HTTPClient: client, + } +} + +/* +UpdateIncidentAlertPrimaryParams contains all the parameters to send to the API endpoint + + for the update incident alert primary operation. + + Typically these are written to a http.Request. +*/ +type UpdateIncidentAlertPrimaryParams struct { + + // IncidentAlertID. + IncidentAlertID string + + // IncidentID. + IncidentID string + + // UpdateIncidentAlertPrimary. + UpdateIncidentAlertPrimary *models.UpdateIncidentAlertPrimary + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update incident alert primary params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentAlertPrimaryParams) WithDefaults() *UpdateIncidentAlertPrimaryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update incident alert primary params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentAlertPrimaryParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update incident alert primary params +func (o *UpdateIncidentAlertPrimaryParams) WithTimeout(timeout time.Duration) *UpdateIncidentAlertPrimaryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update incident alert primary params +func (o *UpdateIncidentAlertPrimaryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update incident alert primary params +func (o *UpdateIncidentAlertPrimaryParams) WithContext(ctx context.Context) *UpdateIncidentAlertPrimaryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update incident alert primary params +func (o *UpdateIncidentAlertPrimaryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update incident alert primary params +func (o *UpdateIncidentAlertPrimaryParams) WithHTTPClient(client *http.Client) *UpdateIncidentAlertPrimaryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update incident alert primary params +func (o *UpdateIncidentAlertPrimaryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentAlertID adds the incidentAlertID to the update incident alert primary params +func (o *UpdateIncidentAlertPrimaryParams) WithIncidentAlertID(incidentAlertID string) *UpdateIncidentAlertPrimaryParams { + o.SetIncidentAlertID(incidentAlertID) + return o +} + +// SetIncidentAlertID adds the incidentAlertId to the update incident alert primary params +func (o *UpdateIncidentAlertPrimaryParams) SetIncidentAlertID(incidentAlertID string) { + o.IncidentAlertID = incidentAlertID +} + +// WithIncidentID adds the incidentID to the update incident alert primary params +func (o *UpdateIncidentAlertPrimaryParams) WithIncidentID(incidentID string) *UpdateIncidentAlertPrimaryParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the update incident alert primary params +func (o *UpdateIncidentAlertPrimaryParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithUpdateIncidentAlertPrimary adds the updateIncidentAlertPrimary to the update incident alert primary params +func (o *UpdateIncidentAlertPrimaryParams) WithUpdateIncidentAlertPrimary(updateIncidentAlertPrimary *models.UpdateIncidentAlertPrimary) *UpdateIncidentAlertPrimaryParams { + o.SetUpdateIncidentAlertPrimary(updateIncidentAlertPrimary) + return o +} + +// SetUpdateIncidentAlertPrimary adds the updateIncidentAlertPrimary to the update incident alert primary params +func (o *UpdateIncidentAlertPrimaryParams) SetUpdateIncidentAlertPrimary(updateIncidentAlertPrimary *models.UpdateIncidentAlertPrimary) { + o.UpdateIncidentAlertPrimary = updateIncidentAlertPrimary +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIncidentAlertPrimaryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_alert_id + if err := r.SetPathParam("incident_alert_id", o.IncidentAlertID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + if o.UpdateIncidentAlertPrimary != nil { + if err := r.SetBodyParam(o.UpdateIncidentAlertPrimary); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/alerts/update_incident_alert_primary_responses.go b/client/alerts/update_incident_alert_primary_responses.go new file mode 100644 index 0000000..6cc5ed9 --- /dev/null +++ b/client/alerts/update_incident_alert_primary_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package alerts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateIncidentAlertPrimaryReader is a Reader for the UpdateIncidentAlertPrimary structure. +type UpdateIncidentAlertPrimaryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIncidentAlertPrimaryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIncidentAlertPrimaryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIncidentAlertPrimaryOK creates a UpdateIncidentAlertPrimaryOK with default headers values +func NewUpdateIncidentAlertPrimaryOK() *UpdateIncidentAlertPrimaryOK { + return &UpdateIncidentAlertPrimaryOK{} +} + +/* +UpdateIncidentAlertPrimaryOK describes a response with status code 200, with default header values. + +Setting an alert as primary will overwrite milestone times in the FireHydrant incident with times included in the primary alert. Services attached to the primary alert will also be automatically added to the incident. +*/ +type UpdateIncidentAlertPrimaryOK struct { + Payload *models.IncidentsAlertEntity +} + +// IsSuccess returns true when this update incident alert primary o k response has a 2xx status code +func (o *UpdateIncidentAlertPrimaryOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update incident alert primary o k response has a 3xx status code +func (o *UpdateIncidentAlertPrimaryOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident alert primary o k response has a 4xx status code +func (o *UpdateIncidentAlertPrimaryOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update incident alert primary o k response has a 5xx status code +func (o *UpdateIncidentAlertPrimaryOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident alert primary o k response a status code equal to that given +func (o *UpdateIncidentAlertPrimaryOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateIncidentAlertPrimaryOK) Error() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/alerts/{incident_alert_id}/primary][%d] updateIncidentAlertPrimaryOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentAlertPrimaryOK) String() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/alerts/{incident_alert_id}/primary][%d] updateIncidentAlertPrimaryOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentAlertPrimaryOK) GetPayload() *models.IncidentsAlertEntity { + return o.Payload +} + +func (o *UpdateIncidentAlertPrimaryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsAlertEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/audiences/archive_audience_parameters.go b/client/audiences/archive_audience_parameters.go new file mode 100644 index 0000000..6f52f38 --- /dev/null +++ b/client/audiences/archive_audience_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewArchiveAudienceParams creates a new ArchiveAudienceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewArchiveAudienceParams() *ArchiveAudienceParams { + return &ArchiveAudienceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewArchiveAudienceParamsWithTimeout creates a new ArchiveAudienceParams object +// with the ability to set a timeout on a request. +func NewArchiveAudienceParamsWithTimeout(timeout time.Duration) *ArchiveAudienceParams { + return &ArchiveAudienceParams{ + timeout: timeout, + } +} + +// NewArchiveAudienceParamsWithContext creates a new ArchiveAudienceParams object +// with the ability to set a context for a request. +func NewArchiveAudienceParamsWithContext(ctx context.Context) *ArchiveAudienceParams { + return &ArchiveAudienceParams{ + Context: ctx, + } +} + +// NewArchiveAudienceParamsWithHTTPClient creates a new ArchiveAudienceParams object +// with the ability to set a custom HTTPClient for a request. +func NewArchiveAudienceParamsWithHTTPClient(client *http.Client) *ArchiveAudienceParams { + return &ArchiveAudienceParams{ + HTTPClient: client, + } +} + +/* +ArchiveAudienceParams contains all the parameters to send to the API endpoint + + for the archive audience operation. + + Typically these are written to a http.Request. +*/ +type ArchiveAudienceParams struct { + + /* AudienceID. + + Unique identifier of the audience + */ + AudienceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the archive audience params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ArchiveAudienceParams) WithDefaults() *ArchiveAudienceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the archive audience params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ArchiveAudienceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the archive audience params +func (o *ArchiveAudienceParams) WithTimeout(timeout time.Duration) *ArchiveAudienceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the archive audience params +func (o *ArchiveAudienceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the archive audience params +func (o *ArchiveAudienceParams) WithContext(ctx context.Context) *ArchiveAudienceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the archive audience params +func (o *ArchiveAudienceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the archive audience params +func (o *ArchiveAudienceParams) WithHTTPClient(client *http.Client) *ArchiveAudienceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the archive audience params +func (o *ArchiveAudienceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAudienceID adds the audienceID to the archive audience params +func (o *ArchiveAudienceParams) WithAudienceID(audienceID string) *ArchiveAudienceParams { + o.SetAudienceID(audienceID) + return o +} + +// SetAudienceID adds the audienceId to the archive audience params +func (o *ArchiveAudienceParams) SetAudienceID(audienceID string) { + o.AudienceID = audienceID +} + +// WriteToRequest writes these params to a swagger request +func (o *ArchiveAudienceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param audience_id + if err := r.SetPathParam("audience_id", o.AudienceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/audiences/archive_audience_responses.go b/client/audiences/archive_audience_responses.go new file mode 100644 index 0000000..2552a4e --- /dev/null +++ b/client/audiences/archive_audience_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ArchiveAudienceReader is a Reader for the ArchiveAudience structure. +type ArchiveAudienceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ArchiveAudienceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewArchiveAudienceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewArchiveAudienceOK creates a ArchiveAudienceOK with default headers values +func NewArchiveAudienceOK() *ArchiveAudienceOK { + return &ArchiveAudienceOK{} +} + +/* +ArchiveAudienceOK describes a response with status code 200, with default header values. + +Archive an audience +*/ +type ArchiveAudienceOK struct { + Payload *models.AudiencesEntitiesAudienceEntity +} + +// IsSuccess returns true when this archive audience o k response has a 2xx status code +func (o *ArchiveAudienceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this archive audience o k response has a 3xx status code +func (o *ArchiveAudienceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this archive audience o k response has a 4xx status code +func (o *ArchiveAudienceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this archive audience o k response has a 5xx status code +func (o *ArchiveAudienceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this archive audience o k response a status code equal to that given +func (o *ArchiveAudienceOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ArchiveAudienceOK) Error() string { + return fmt.Sprintf("[DELETE /v1/audiences/{audience_id}][%d] archiveAudienceOK %+v", 200, o.Payload) +} + +func (o *ArchiveAudienceOK) String() string { + return fmt.Sprintf("[DELETE /v1/audiences/{audience_id}][%d] archiveAudienceOK %+v", 200, o.Payload) +} + +func (o *ArchiveAudienceOK) GetPayload() *models.AudiencesEntitiesAudienceEntity { + return o.Payload +} + +func (o *ArchiveAudienceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AudiencesEntitiesAudienceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/audiences/audiences_client.go b/client/audiences/audiences_client.go index cae4016..89a3524 100644 --- a/client/audiences/audiences_client.go +++ b/client/audiences/audiences_client.go @@ -30,50 +30,50 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1AudiencesAudienceID(params *DeleteV1AudiencesAudienceIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1AudiencesAudienceIDOK, error) + ArchiveAudience(params *ArchiveAudienceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ArchiveAudienceOK, error) - GetV1Audiences(params *GetV1AudiencesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AudiencesOK, error) + CreateAudience(params *CreateAudienceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAudienceCreated, error) - GetV1AudiencesAudienceID(params *GetV1AudiencesAudienceIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AudiencesAudienceIDOK, error) + GenerateAudienceSummary(params *GenerateAudienceSummaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GenerateAudienceSummaryCreated, error) - GetV1AudiencesAudienceIDSummariesIncidentID(params *GetV1AudiencesAudienceIDSummariesIncidentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AudiencesAudienceIDSummariesIncidentIDOK, error) + GetAudience(params *GetAudienceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAudienceOK, error) - GetV1AudiencesMemberMemberIDDefault(params *GetV1AudiencesMemberMemberIDDefaultParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AudiencesMemberMemberIDDefaultOK, error) + GetAudienceSummary(params *GetAudienceSummaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAudienceSummaryOK, error) - GetV1AudiencesSummariesIncidentID(params *GetV1AudiencesSummariesIncidentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AudiencesSummariesIncidentIDOK, error) + GetMemberDefaultAudience(params *GetMemberDefaultAudienceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetMemberDefaultAudienceOK, error) - PatchV1AudiencesAudienceID(params *PatchV1AudiencesAudienceIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1AudiencesAudienceIDOK, error) + ListAudienceSummaries(params *ListAudienceSummariesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAudienceSummariesOK, error) - PatchV1AudiencesAudienceIDRestore(params *PatchV1AudiencesAudienceIDRestoreParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1AudiencesAudienceIDRestoreOK, error) + ListAudiences(params *ListAudiencesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAudiencesOK, error) - PostV1Audiences(params *PostV1AudiencesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1AudiencesCreated, error) + RestoreAudience(params *RestoreAudienceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RestoreAudienceOK, error) - PostV1AudiencesAudienceIDSummariesIncidentID(params *PostV1AudiencesAudienceIDSummariesIncidentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1AudiencesAudienceIDSummariesIncidentIDCreated, error) + SetMemberDefaultAudience(params *SetMemberDefaultAudienceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SetMemberDefaultAudienceOK, error) - PutV1AudiencesMemberMemberIDDefault(params *PutV1AudiencesMemberMemberIDDefaultParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1AudiencesMemberMemberIDDefaultOK, error) + UpdateAudience(params *UpdateAudienceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAudienceOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1AudiencesAudienceID archives audience +ArchiveAudience archives audience Archive an audience */ -func (a *Client) DeleteV1AudiencesAudienceID(params *DeleteV1AudiencesAudienceIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1AudiencesAudienceIDOK, error) { +func (a *Client) ArchiveAudience(params *ArchiveAudienceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ArchiveAudienceOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1AudiencesAudienceIDParams() + params = NewArchiveAudienceParams() } op := &runtime.ClientOperation{ - ID: "deleteV1AudiencesAudienceId", + ID: "archive_audience", Method: "DELETE", PathPattern: "/v1/audiences/{audience_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1AudiencesAudienceIDReader{formats: a.formats}, + Reader: &ArchiveAudienceReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -86,35 +86,35 @@ func (a *Client) DeleteV1AudiencesAudienceID(params *DeleteV1AudiencesAudienceID if err != nil { return nil, err } - success, ok := result.(*DeleteV1AudiencesAudienceIDOK) + success, ok := result.(*ArchiveAudienceOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1AudiencesAudienceId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for archive_audience: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Audiences lists audiences +CreateAudience creates audience -List all audiences +Create a new audience */ -func (a *Client) GetV1Audiences(params *GetV1AudiencesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AudiencesOK, error) { +func (a *Client) CreateAudience(params *CreateAudienceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAudienceCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1AudiencesParams() + params = NewCreateAudienceParams() } op := &runtime.ClientOperation{ - ID: "getV1Audiences", - Method: "GET", + ID: "create_audience", + Method: "POST", PathPattern: "/v1/audiences", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1AudiencesReader{formats: a.formats}, + Reader: &CreateAudienceReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -127,35 +127,35 @@ func (a *Client) GetV1Audiences(params *GetV1AudiencesParams, authInfo runtime.C if err != nil { return nil, err } - success, ok := result.(*GetV1AudiencesOK) + success, ok := result.(*CreateAudienceCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Audiences: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_audience: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1AudiencesAudienceID gets audience +GenerateAudienceSummary generates summary -Get audience details +Generate a new audience-specific summary for an incident */ -func (a *Client) GetV1AudiencesAudienceID(params *GetV1AudiencesAudienceIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AudiencesAudienceIDOK, error) { +func (a *Client) GenerateAudienceSummary(params *GenerateAudienceSummaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GenerateAudienceSummaryCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1AudiencesAudienceIDParams() + params = NewGenerateAudienceSummaryParams() } op := &runtime.ClientOperation{ - ID: "getV1AudiencesAudienceId", - Method: "GET", - PathPattern: "/v1/audiences/{audience_id}", + ID: "generate_audience_summary", + Method: "POST", + PathPattern: "/v1/audiences/{audience_id}/summaries/{incident_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1AudiencesAudienceIDReader{formats: a.formats}, + Reader: &GenerateAudienceSummaryReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -168,35 +168,35 @@ func (a *Client) GetV1AudiencesAudienceID(params *GetV1AudiencesAudienceIDParams if err != nil { return nil, err } - success, ok := result.(*GetV1AudiencesAudienceIDOK) + success, ok := result.(*GenerateAudienceSummaryCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1AudiencesAudienceId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for generate_audience_summary: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1AudiencesAudienceIDSummariesIncidentID gets latest summary +GetAudience gets audience -Get the latest audience-specific summary for an incident +Get audience details */ -func (a *Client) GetV1AudiencesAudienceIDSummariesIncidentID(params *GetV1AudiencesAudienceIDSummariesIncidentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AudiencesAudienceIDSummariesIncidentIDOK, error) { +func (a *Client) GetAudience(params *GetAudienceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAudienceOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1AudiencesAudienceIDSummariesIncidentIDParams() + params = NewGetAudienceParams() } op := &runtime.ClientOperation{ - ID: "getV1AudiencesAudienceIdSummariesIncidentId", + ID: "get_audience", Method: "GET", - PathPattern: "/v1/audiences/{audience_id}/summaries/{incident_id}", + PathPattern: "/v1/audiences/{audience_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1AudiencesAudienceIDSummariesIncidentIDReader{formats: a.formats}, + Reader: &GetAudienceReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -209,35 +209,35 @@ func (a *Client) GetV1AudiencesAudienceIDSummariesIncidentID(params *GetV1Audien if err != nil { return nil, err } - success, ok := result.(*GetV1AudiencesAudienceIDSummariesIncidentIDOK) + success, ok := result.(*GetAudienceOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1AudiencesAudienceIdSummariesIncidentId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_audience: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1AudiencesMemberMemberIDDefault gets default audience +GetAudienceSummary gets latest summary -Get member's default audience +Get the latest audience-specific summary for an incident */ -func (a *Client) GetV1AudiencesMemberMemberIDDefault(params *GetV1AudiencesMemberMemberIDDefaultParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AudiencesMemberMemberIDDefaultOK, error) { +func (a *Client) GetAudienceSummary(params *GetAudienceSummaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAudienceSummaryOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1AudiencesMemberMemberIDDefaultParams() + params = NewGetAudienceSummaryParams() } op := &runtime.ClientOperation{ - ID: "getV1AudiencesMemberMemberIdDefault", + ID: "get_audience_summary", Method: "GET", - PathPattern: "/v1/audiences/member/{member_id}/default", + PathPattern: "/v1/audiences/{audience_id}/summaries/{incident_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1AudiencesMemberMemberIDDefaultReader{formats: a.formats}, + Reader: &GetAudienceSummaryReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -250,35 +250,35 @@ func (a *Client) GetV1AudiencesMemberMemberIDDefault(params *GetV1AudiencesMembe if err != nil { return nil, err } - success, ok := result.(*GetV1AudiencesMemberMemberIDDefaultOK) + success, ok := result.(*GetAudienceSummaryOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1AudiencesMemberMemberIdDefault: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_audience_summary: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1AudiencesSummariesIncidentID lists audience summaries +GetMemberDefaultAudience gets default audience -List all audience summaries for an incident +Get member's default audience */ -func (a *Client) GetV1AudiencesSummariesIncidentID(params *GetV1AudiencesSummariesIncidentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AudiencesSummariesIncidentIDOK, error) { +func (a *Client) GetMemberDefaultAudience(params *GetMemberDefaultAudienceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetMemberDefaultAudienceOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1AudiencesSummariesIncidentIDParams() + params = NewGetMemberDefaultAudienceParams() } op := &runtime.ClientOperation{ - ID: "getV1AudiencesSummariesIncidentId", + ID: "get_member_default_audience", Method: "GET", - PathPattern: "/v1/audiences/summaries/{incident_id}", + PathPattern: "/v1/audiences/member/{member_id}/default", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1AudiencesSummariesIncidentIDReader{formats: a.formats}, + Reader: &GetMemberDefaultAudienceReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -291,35 +291,35 @@ func (a *Client) GetV1AudiencesSummariesIncidentID(params *GetV1AudiencesSummari if err != nil { return nil, err } - success, ok := result.(*GetV1AudiencesSummariesIncidentIDOK) + success, ok := result.(*GetMemberDefaultAudienceOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1AudiencesSummariesIncidentId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_member_default_audience: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1AudiencesAudienceID updates audience +ListAudienceSummaries lists audience summaries -Update an existing audience +List all audience summaries for an incident */ -func (a *Client) PatchV1AudiencesAudienceID(params *PatchV1AudiencesAudienceIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1AudiencesAudienceIDOK, error) { +func (a *Client) ListAudienceSummaries(params *ListAudienceSummariesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAudienceSummariesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1AudiencesAudienceIDParams() + params = NewListAudienceSummariesParams() } op := &runtime.ClientOperation{ - ID: "patchV1AudiencesAudienceId", - Method: "PATCH", - PathPattern: "/v1/audiences/{audience_id}", + ID: "list_audience_summaries", + Method: "GET", + PathPattern: "/v1/audiences/summaries/{incident_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1AudiencesAudienceIDReader{formats: a.formats}, + Reader: &ListAudienceSummariesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -332,35 +332,35 @@ func (a *Client) PatchV1AudiencesAudienceID(params *PatchV1AudiencesAudienceIDPa if err != nil { return nil, err } - success, ok := result.(*PatchV1AudiencesAudienceIDOK) + success, ok := result.(*ListAudienceSummariesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1AudiencesAudienceId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_audience_summaries: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1AudiencesAudienceIDRestore restores audience +ListAudiences lists audiences -Restore a previously archived audience +List all audiences */ -func (a *Client) PatchV1AudiencesAudienceIDRestore(params *PatchV1AudiencesAudienceIDRestoreParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1AudiencesAudienceIDRestoreOK, error) { +func (a *Client) ListAudiences(params *ListAudiencesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAudiencesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1AudiencesAudienceIDRestoreParams() + params = NewListAudiencesParams() } op := &runtime.ClientOperation{ - ID: "patchV1AudiencesAudienceIdRestore", - Method: "PATCH", - PathPattern: "/v1/audiences/{audience_id}/restore", + ID: "list_audiences", + Method: "GET", + PathPattern: "/v1/audiences", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1AudiencesAudienceIDRestoreReader{formats: a.formats}, + Reader: &ListAudiencesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -373,35 +373,35 @@ func (a *Client) PatchV1AudiencesAudienceIDRestore(params *PatchV1AudiencesAudie if err != nil { return nil, err } - success, ok := result.(*PatchV1AudiencesAudienceIDRestoreOK) + success, ok := result.(*ListAudiencesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1AudiencesAudienceIdRestore: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_audiences: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1Audiences creates audience +RestoreAudience restores audience -Create a new audience +Restore a previously archived audience */ -func (a *Client) PostV1Audiences(params *PostV1AudiencesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1AudiencesCreated, error) { +func (a *Client) RestoreAudience(params *RestoreAudienceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RestoreAudienceOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1AudiencesParams() + params = NewRestoreAudienceParams() } op := &runtime.ClientOperation{ - ID: "postV1Audiences", - Method: "POST", - PathPattern: "/v1/audiences", + ID: "restore_audience", + Method: "PATCH", + PathPattern: "/v1/audiences/{audience_id}/restore", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1AudiencesReader{formats: a.formats}, + Reader: &RestoreAudienceReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -414,35 +414,35 @@ func (a *Client) PostV1Audiences(params *PostV1AudiencesParams, authInfo runtime if err != nil { return nil, err } - success, ok := result.(*PostV1AudiencesCreated) + success, ok := result.(*RestoreAudienceOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1Audiences: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for restore_audience: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1AudiencesAudienceIDSummariesIncidentID generates summary +SetMemberDefaultAudience sets default audience -Generate a new audience-specific summary for an incident +Set member's default audience */ -func (a *Client) PostV1AudiencesAudienceIDSummariesIncidentID(params *PostV1AudiencesAudienceIDSummariesIncidentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1AudiencesAudienceIDSummariesIncidentIDCreated, error) { +func (a *Client) SetMemberDefaultAudience(params *SetMemberDefaultAudienceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SetMemberDefaultAudienceOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1AudiencesAudienceIDSummariesIncidentIDParams() + params = NewSetMemberDefaultAudienceParams() } op := &runtime.ClientOperation{ - ID: "postV1AudiencesAudienceIdSummariesIncidentId", - Method: "POST", - PathPattern: "/v1/audiences/{audience_id}/summaries/{incident_id}", + ID: "set_member_default_audience", + Method: "PUT", + PathPattern: "/v1/audiences/member/{member_id}/default", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1AudiencesAudienceIDSummariesIncidentIDReader{formats: a.formats}, + Reader: &SetMemberDefaultAudienceReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -455,35 +455,35 @@ func (a *Client) PostV1AudiencesAudienceIDSummariesIncidentID(params *PostV1Audi if err != nil { return nil, err } - success, ok := result.(*PostV1AudiencesAudienceIDSummariesIncidentIDCreated) + success, ok := result.(*SetMemberDefaultAudienceOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1AudiencesAudienceIdSummariesIncidentId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for set_member_default_audience: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1AudiencesMemberMemberIDDefault sets default audience +UpdateAudience updates audience -Set member's default audience +Update an existing audience */ -func (a *Client) PutV1AudiencesMemberMemberIDDefault(params *PutV1AudiencesMemberMemberIDDefaultParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1AudiencesMemberMemberIDDefaultOK, error) { +func (a *Client) UpdateAudience(params *UpdateAudienceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAudienceOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1AudiencesMemberMemberIDDefaultParams() + params = NewUpdateAudienceParams() } op := &runtime.ClientOperation{ - ID: "putV1AudiencesMemberMemberIdDefault", - Method: "PUT", - PathPattern: "/v1/audiences/member/{member_id}/default", + ID: "update_audience", + Method: "PATCH", + PathPattern: "/v1/audiences/{audience_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1AudiencesMemberMemberIDDefaultReader{formats: a.formats}, + Reader: &UpdateAudienceReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -496,13 +496,13 @@ func (a *Client) PutV1AudiencesMemberMemberIDDefault(params *PutV1AudiencesMembe if err != nil { return nil, err } - success, ok := result.(*PutV1AudiencesMemberMemberIDDefaultOK) + success, ok := result.(*UpdateAudienceOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1AudiencesMemberMemberIdDefault: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_audience: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/audiences/create_audience_parameters.go b/client/audiences/create_audience_parameters.go new file mode 100644 index 0000000..06166e1 --- /dev/null +++ b/client/audiences/create_audience_parameters.go @@ -0,0 +1,360 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCreateAudienceParams creates a new CreateAudienceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateAudienceParams() *CreateAudienceParams { + return &CreateAudienceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateAudienceParamsWithTimeout creates a new CreateAudienceParams object +// with the ability to set a timeout on a request. +func NewCreateAudienceParamsWithTimeout(timeout time.Duration) *CreateAudienceParams { + return &CreateAudienceParams{ + timeout: timeout, + } +} + +// NewCreateAudienceParamsWithContext creates a new CreateAudienceParams object +// with the ability to set a context for a request. +func NewCreateAudienceParamsWithContext(ctx context.Context) *CreateAudienceParams { + return &CreateAudienceParams{ + Context: ctx, + } +} + +// NewCreateAudienceParamsWithHTTPClient creates a new CreateAudienceParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateAudienceParamsWithHTTPClient(client *http.Client) *CreateAudienceParams { + return &CreateAudienceParams{ + HTTPClient: client, + } +} + +/* +CreateAudienceParams contains all the parameters to send to the API endpoint + + for the create audience operation. + + Typically these are written to a http.Request. +*/ +type CreateAudienceParams struct { + + /* Default. + + Whether this is the default audience + */ + Default *bool + + /* Description. + + Description of the audience (max 4000 characters) + */ + Description string + + /* DetailsPrompt. + + The prompt to display when collecting this detail + */ + DetailsPrompt []string + + /* DetailsQuestion. + + The incident detail question (max 255 characters) + */ + DetailsQuestion []string + + /* DetailsSlug. + + Optional unique identifier for this detail + */ + DetailsSlug []string + + /* Name. + + Name of the audience (max 255 characters) + */ + Name string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create audience params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAudienceParams) WithDefaults() *CreateAudienceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create audience params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAudienceParams) SetDefaults() { + var ( + defaultVarDefault = bool(false) + ) + + val := CreateAudienceParams{ + Default: &defaultVarDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the create audience params +func (o *CreateAudienceParams) WithTimeout(timeout time.Duration) *CreateAudienceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create audience params +func (o *CreateAudienceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create audience params +func (o *CreateAudienceParams) WithContext(ctx context.Context) *CreateAudienceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create audience params +func (o *CreateAudienceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create audience params +func (o *CreateAudienceParams) WithHTTPClient(client *http.Client) *CreateAudienceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create audience params +func (o *CreateAudienceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDefault adds the defaultVar to the create audience params +func (o *CreateAudienceParams) WithDefault(defaultVar *bool) *CreateAudienceParams { + o.SetDefault(defaultVar) + return o +} + +// SetDefault adds the default to the create audience params +func (o *CreateAudienceParams) SetDefault(defaultVar *bool) { + o.Default = defaultVar +} + +// WithDescription adds the description to the create audience params +func (o *CreateAudienceParams) WithDescription(description string) *CreateAudienceParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the create audience params +func (o *CreateAudienceParams) SetDescription(description string) { + o.Description = description +} + +// WithDetailsPrompt adds the detailsPrompt to the create audience params +func (o *CreateAudienceParams) WithDetailsPrompt(detailsPrompt []string) *CreateAudienceParams { + o.SetDetailsPrompt(detailsPrompt) + return o +} + +// SetDetailsPrompt adds the detailsPrompt to the create audience params +func (o *CreateAudienceParams) SetDetailsPrompt(detailsPrompt []string) { + o.DetailsPrompt = detailsPrompt +} + +// WithDetailsQuestion adds the detailsQuestion to the create audience params +func (o *CreateAudienceParams) WithDetailsQuestion(detailsQuestion []string) *CreateAudienceParams { + o.SetDetailsQuestion(detailsQuestion) + return o +} + +// SetDetailsQuestion adds the detailsQuestion to the create audience params +func (o *CreateAudienceParams) SetDetailsQuestion(detailsQuestion []string) { + o.DetailsQuestion = detailsQuestion +} + +// WithDetailsSlug adds the detailsSlug to the create audience params +func (o *CreateAudienceParams) WithDetailsSlug(detailsSlug []string) *CreateAudienceParams { + o.SetDetailsSlug(detailsSlug) + return o +} + +// SetDetailsSlug adds the detailsSlug to the create audience params +func (o *CreateAudienceParams) SetDetailsSlug(detailsSlug []string) { + o.DetailsSlug = detailsSlug +} + +// WithName adds the name to the create audience params +func (o *CreateAudienceParams) WithName(name string) *CreateAudienceParams { + o.SetName(name) + return o +} + +// SetName adds the name to the create audience params +func (o *CreateAudienceParams) SetName(name string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateAudienceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Default != nil { + + // form param default + var frDefault bool + if o.Default != nil { + frDefault = *o.Default + } + fDefault := swag.FormatBool(frDefault) + if fDefault != "" { + if err := r.SetFormParam("default", fDefault); err != nil { + return err + } + } + } + + // form param description + frDescription := o.Description + fDescription := frDescription + if fDescription != "" { + if err := r.SetFormParam("description", fDescription); err != nil { + return err + } + } + + if o.DetailsPrompt != nil { + + // binding items for details[prompt] + joinedDetailsPrompt := o.bindParamDetailsPrompt(reg) + + // form array param details[prompt] + if err := r.SetFormParam("details[prompt]", joinedDetailsPrompt...); err != nil { + return err + } + } + + if o.DetailsQuestion != nil { + + // binding items for details[question] + joinedDetailsQuestion := o.bindParamDetailsQuestion(reg) + + // form array param details[question] + if err := r.SetFormParam("details[question]", joinedDetailsQuestion...); err != nil { + return err + } + } + + if o.DetailsSlug != nil { + + // binding items for details[slug] + joinedDetailsSlug := o.bindParamDetailsSlug(reg) + + // form array param details[slug] + if err := r.SetFormParam("details[slug]", joinedDetailsSlug...); err != nil { + return err + } + } + + // form param name + frName := o.Name + fName := frName + if fName != "" { + if err := r.SetFormParam("name", fName); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamCreateAudience binds the parameter details[prompt] +func (o *CreateAudienceParams) bindParamDetailsPrompt(formats strfmt.Registry) []string { + detailsPromptIR := o.DetailsPrompt + + var detailsPromptIC []string + for _, detailsPromptIIR := range detailsPromptIR { // explode []string + + detailsPromptIIV := detailsPromptIIR // string as string + detailsPromptIC = append(detailsPromptIC, detailsPromptIIV) + } + + // items.CollectionFormat: "" + detailsPromptIS := swag.JoinByFormat(detailsPromptIC, "") + + return detailsPromptIS +} + +// bindParamCreateAudience binds the parameter details[question] +func (o *CreateAudienceParams) bindParamDetailsQuestion(formats strfmt.Registry) []string { + detailsQuestionIR := o.DetailsQuestion + + var detailsQuestionIC []string + for _, detailsQuestionIIR := range detailsQuestionIR { // explode []string + + detailsQuestionIIV := detailsQuestionIIR // string as string + detailsQuestionIC = append(detailsQuestionIC, detailsQuestionIIV) + } + + // items.CollectionFormat: "" + detailsQuestionIS := swag.JoinByFormat(detailsQuestionIC, "") + + return detailsQuestionIS +} + +// bindParamCreateAudience binds the parameter details[slug] +func (o *CreateAudienceParams) bindParamDetailsSlug(formats strfmt.Registry) []string { + detailsSlugIR := o.DetailsSlug + + var detailsSlugIC []string + for _, detailsSlugIIR := range detailsSlugIR { // explode []string + + detailsSlugIIV := detailsSlugIIR // string as string + detailsSlugIC = append(detailsSlugIC, detailsSlugIIV) + } + + // items.CollectionFormat: "" + detailsSlugIS := swag.JoinByFormat(detailsSlugIC, "") + + return detailsSlugIS +} diff --git a/client/audiences/create_audience_responses.go b/client/audiences/create_audience_responses.go new file mode 100644 index 0000000..ca8e697 --- /dev/null +++ b/client/audiences/create_audience_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateAudienceReader is a Reader for the CreateAudience structure. +type CreateAudienceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateAudienceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateAudienceCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateAudienceCreated creates a CreateAudienceCreated with default headers values +func NewCreateAudienceCreated() *CreateAudienceCreated { + return &CreateAudienceCreated{} +} + +/* +CreateAudienceCreated describes a response with status code 201, with default header values. + +Create a new audience +*/ +type CreateAudienceCreated struct { + Payload *models.AudiencesEntitiesAudienceEntity +} + +// IsSuccess returns true when this create audience created response has a 2xx status code +func (o *CreateAudienceCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create audience created response has a 3xx status code +func (o *CreateAudienceCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create audience created response has a 4xx status code +func (o *CreateAudienceCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create audience created response has a 5xx status code +func (o *CreateAudienceCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create audience created response a status code equal to that given +func (o *CreateAudienceCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateAudienceCreated) Error() string { + return fmt.Sprintf("[POST /v1/audiences][%d] createAudienceCreated %+v", 201, o.Payload) +} + +func (o *CreateAudienceCreated) String() string { + return fmt.Sprintf("[POST /v1/audiences][%d] createAudienceCreated %+v", 201, o.Payload) +} + +func (o *CreateAudienceCreated) GetPayload() *models.AudiencesEntitiesAudienceEntity { + return o.Payload +} + +func (o *CreateAudienceCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AudiencesEntitiesAudienceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/audiences/generate_audience_summary_parameters.go b/client/audiences/generate_audience_summary_parameters.go new file mode 100644 index 0000000..ea0b49c --- /dev/null +++ b/client/audiences/generate_audience_summary_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGenerateAudienceSummaryParams creates a new GenerateAudienceSummaryParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGenerateAudienceSummaryParams() *GenerateAudienceSummaryParams { + return &GenerateAudienceSummaryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGenerateAudienceSummaryParamsWithTimeout creates a new GenerateAudienceSummaryParams object +// with the ability to set a timeout on a request. +func NewGenerateAudienceSummaryParamsWithTimeout(timeout time.Duration) *GenerateAudienceSummaryParams { + return &GenerateAudienceSummaryParams{ + timeout: timeout, + } +} + +// NewGenerateAudienceSummaryParamsWithContext creates a new GenerateAudienceSummaryParams object +// with the ability to set a context for a request. +func NewGenerateAudienceSummaryParamsWithContext(ctx context.Context) *GenerateAudienceSummaryParams { + return &GenerateAudienceSummaryParams{ + Context: ctx, + } +} + +// NewGenerateAudienceSummaryParamsWithHTTPClient creates a new GenerateAudienceSummaryParams object +// with the ability to set a custom HTTPClient for a request. +func NewGenerateAudienceSummaryParamsWithHTTPClient(client *http.Client) *GenerateAudienceSummaryParams { + return &GenerateAudienceSummaryParams{ + HTTPClient: client, + } +} + +/* +GenerateAudienceSummaryParams contains all the parameters to send to the API endpoint + + for the generate audience summary operation. + + Typically these are written to a http.Request. +*/ +type GenerateAudienceSummaryParams struct { + + /* AudienceID. + + Unique identifier of the audience + */ + AudienceID string + + /* ForceRegenerate. + + Whether to force regeneration of the summary + + Default: true + */ + ForceRegenerate *bool + + /* IncidentID. + + Unique identifier of the incident to summarize + */ + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the generate audience summary params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GenerateAudienceSummaryParams) WithDefaults() *GenerateAudienceSummaryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the generate audience summary params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GenerateAudienceSummaryParams) SetDefaults() { + var ( + forceRegenerateDefault = bool(true) + ) + + val := GenerateAudienceSummaryParams{ + ForceRegenerate: &forceRegenerateDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the generate audience summary params +func (o *GenerateAudienceSummaryParams) WithTimeout(timeout time.Duration) *GenerateAudienceSummaryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the generate audience summary params +func (o *GenerateAudienceSummaryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the generate audience summary params +func (o *GenerateAudienceSummaryParams) WithContext(ctx context.Context) *GenerateAudienceSummaryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the generate audience summary params +func (o *GenerateAudienceSummaryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the generate audience summary params +func (o *GenerateAudienceSummaryParams) WithHTTPClient(client *http.Client) *GenerateAudienceSummaryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the generate audience summary params +func (o *GenerateAudienceSummaryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAudienceID adds the audienceID to the generate audience summary params +func (o *GenerateAudienceSummaryParams) WithAudienceID(audienceID string) *GenerateAudienceSummaryParams { + o.SetAudienceID(audienceID) + return o +} + +// SetAudienceID adds the audienceId to the generate audience summary params +func (o *GenerateAudienceSummaryParams) SetAudienceID(audienceID string) { + o.AudienceID = audienceID +} + +// WithForceRegenerate adds the forceRegenerate to the generate audience summary params +func (o *GenerateAudienceSummaryParams) WithForceRegenerate(forceRegenerate *bool) *GenerateAudienceSummaryParams { + o.SetForceRegenerate(forceRegenerate) + return o +} + +// SetForceRegenerate adds the forceRegenerate to the generate audience summary params +func (o *GenerateAudienceSummaryParams) SetForceRegenerate(forceRegenerate *bool) { + o.ForceRegenerate = forceRegenerate +} + +// WithIncidentID adds the incidentID to the generate audience summary params +func (o *GenerateAudienceSummaryParams) WithIncidentID(incidentID string) *GenerateAudienceSummaryParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the generate audience summary params +func (o *GenerateAudienceSummaryParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *GenerateAudienceSummaryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param audience_id + if err := r.SetPathParam("audience_id", o.AudienceID); err != nil { + return err + } + + if o.ForceRegenerate != nil { + + // form param force_regenerate + var frForceRegenerate bool + if o.ForceRegenerate != nil { + frForceRegenerate = *o.ForceRegenerate + } + fForceRegenerate := swag.FormatBool(frForceRegenerate) + if fForceRegenerate != "" { + if err := r.SetFormParam("force_regenerate", fForceRegenerate); err != nil { + return err + } + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/audiences/generate_audience_summary_responses.go b/client/audiences/generate_audience_summary_responses.go new file mode 100644 index 0000000..eaa0007 --- /dev/null +++ b/client/audiences/generate_audience_summary_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GenerateAudienceSummaryReader is a Reader for the GenerateAudienceSummary structure. +type GenerateAudienceSummaryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GenerateAudienceSummaryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewGenerateAudienceSummaryCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGenerateAudienceSummaryCreated creates a GenerateAudienceSummaryCreated with default headers values +func NewGenerateAudienceSummaryCreated() *GenerateAudienceSummaryCreated { + return &GenerateAudienceSummaryCreated{} +} + +/* +GenerateAudienceSummaryCreated describes a response with status code 201, with default header values. + +Generate a new audience-specific summary for an incident +*/ +type GenerateAudienceSummaryCreated struct { + Payload *models.AIEntitiesIncidentSummaryEntity +} + +// IsSuccess returns true when this generate audience summary created response has a 2xx status code +func (o *GenerateAudienceSummaryCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this generate audience summary created response has a 3xx status code +func (o *GenerateAudienceSummaryCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this generate audience summary created response has a 4xx status code +func (o *GenerateAudienceSummaryCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this generate audience summary created response has a 5xx status code +func (o *GenerateAudienceSummaryCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this generate audience summary created response a status code equal to that given +func (o *GenerateAudienceSummaryCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *GenerateAudienceSummaryCreated) Error() string { + return fmt.Sprintf("[POST /v1/audiences/{audience_id}/summaries/{incident_id}][%d] generateAudienceSummaryCreated %+v", 201, o.Payload) +} + +func (o *GenerateAudienceSummaryCreated) String() string { + return fmt.Sprintf("[POST /v1/audiences/{audience_id}/summaries/{incident_id}][%d] generateAudienceSummaryCreated %+v", 201, o.Payload) +} + +func (o *GenerateAudienceSummaryCreated) GetPayload() *models.AIEntitiesIncidentSummaryEntity { + return o.Payload +} + +func (o *GenerateAudienceSummaryCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AIEntitiesIncidentSummaryEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/audiences/get_audience_parameters.go b/client/audiences/get_audience_parameters.go new file mode 100644 index 0000000..1db0edd --- /dev/null +++ b/client/audiences/get_audience_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetAudienceParams creates a new GetAudienceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetAudienceParams() *GetAudienceParams { + return &GetAudienceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAudienceParamsWithTimeout creates a new GetAudienceParams object +// with the ability to set a timeout on a request. +func NewGetAudienceParamsWithTimeout(timeout time.Duration) *GetAudienceParams { + return &GetAudienceParams{ + timeout: timeout, + } +} + +// NewGetAudienceParamsWithContext creates a new GetAudienceParams object +// with the ability to set a context for a request. +func NewGetAudienceParamsWithContext(ctx context.Context) *GetAudienceParams { + return &GetAudienceParams{ + Context: ctx, + } +} + +// NewGetAudienceParamsWithHTTPClient creates a new GetAudienceParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAudienceParamsWithHTTPClient(client *http.Client) *GetAudienceParams { + return &GetAudienceParams{ + HTTPClient: client, + } +} + +/* +GetAudienceParams contains all the parameters to send to the API endpoint + + for the get audience operation. + + Typically these are written to a http.Request. +*/ +type GetAudienceParams struct { + + /* AudienceID. + + Unique identifier of the audience + */ + AudienceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get audience params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAudienceParams) WithDefaults() *GetAudienceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get audience params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAudienceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get audience params +func (o *GetAudienceParams) WithTimeout(timeout time.Duration) *GetAudienceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get audience params +func (o *GetAudienceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get audience params +func (o *GetAudienceParams) WithContext(ctx context.Context) *GetAudienceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get audience params +func (o *GetAudienceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get audience params +func (o *GetAudienceParams) WithHTTPClient(client *http.Client) *GetAudienceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get audience params +func (o *GetAudienceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAudienceID adds the audienceID to the get audience params +func (o *GetAudienceParams) WithAudienceID(audienceID string) *GetAudienceParams { + o.SetAudienceID(audienceID) + return o +} + +// SetAudienceID adds the audienceId to the get audience params +func (o *GetAudienceParams) SetAudienceID(audienceID string) { + o.AudienceID = audienceID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAudienceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param audience_id + if err := r.SetPathParam("audience_id", o.AudienceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/audiences/get_audience_responses.go b/client/audiences/get_audience_responses.go new file mode 100644 index 0000000..14f6327 --- /dev/null +++ b/client/audiences/get_audience_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetAudienceReader is a Reader for the GetAudience structure. +type GetAudienceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAudienceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAudienceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAudienceOK creates a GetAudienceOK with default headers values +func NewGetAudienceOK() *GetAudienceOK { + return &GetAudienceOK{} +} + +/* +GetAudienceOK describes a response with status code 200, with default header values. + +Get audience details +*/ +type GetAudienceOK struct { + Payload *models.AudiencesEntitiesAudienceEntity +} + +// IsSuccess returns true when this get audience o k response has a 2xx status code +func (o *GetAudienceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get audience o k response has a 3xx status code +func (o *GetAudienceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get audience o k response has a 4xx status code +func (o *GetAudienceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get audience o k response has a 5xx status code +func (o *GetAudienceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get audience o k response a status code equal to that given +func (o *GetAudienceOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetAudienceOK) Error() string { + return fmt.Sprintf("[GET /v1/audiences/{audience_id}][%d] getAudienceOK %+v", 200, o.Payload) +} + +func (o *GetAudienceOK) String() string { + return fmt.Sprintf("[GET /v1/audiences/{audience_id}][%d] getAudienceOK %+v", 200, o.Payload) +} + +func (o *GetAudienceOK) GetPayload() *models.AudiencesEntitiesAudienceEntity { + return o.Payload +} + +func (o *GetAudienceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AudiencesEntitiesAudienceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/audiences/get_audience_summary_parameters.go b/client/audiences/get_audience_summary_parameters.go new file mode 100644 index 0000000..c767598 --- /dev/null +++ b/client/audiences/get_audience_summary_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetAudienceSummaryParams creates a new GetAudienceSummaryParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetAudienceSummaryParams() *GetAudienceSummaryParams { + return &GetAudienceSummaryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAudienceSummaryParamsWithTimeout creates a new GetAudienceSummaryParams object +// with the ability to set a timeout on a request. +func NewGetAudienceSummaryParamsWithTimeout(timeout time.Duration) *GetAudienceSummaryParams { + return &GetAudienceSummaryParams{ + timeout: timeout, + } +} + +// NewGetAudienceSummaryParamsWithContext creates a new GetAudienceSummaryParams object +// with the ability to set a context for a request. +func NewGetAudienceSummaryParamsWithContext(ctx context.Context) *GetAudienceSummaryParams { + return &GetAudienceSummaryParams{ + Context: ctx, + } +} + +// NewGetAudienceSummaryParamsWithHTTPClient creates a new GetAudienceSummaryParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAudienceSummaryParamsWithHTTPClient(client *http.Client) *GetAudienceSummaryParams { + return &GetAudienceSummaryParams{ + HTTPClient: client, + } +} + +/* +GetAudienceSummaryParams contains all the parameters to send to the API endpoint + + for the get audience summary operation. + + Typically these are written to a http.Request. +*/ +type GetAudienceSummaryParams struct { + + /* AudienceID. + + Unique identifier of the audience + */ + AudienceID string + + /* IncidentID. + + Unique identifier of the incident to summarize + */ + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get audience summary params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAudienceSummaryParams) WithDefaults() *GetAudienceSummaryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get audience summary params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAudienceSummaryParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get audience summary params +func (o *GetAudienceSummaryParams) WithTimeout(timeout time.Duration) *GetAudienceSummaryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get audience summary params +func (o *GetAudienceSummaryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get audience summary params +func (o *GetAudienceSummaryParams) WithContext(ctx context.Context) *GetAudienceSummaryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get audience summary params +func (o *GetAudienceSummaryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get audience summary params +func (o *GetAudienceSummaryParams) WithHTTPClient(client *http.Client) *GetAudienceSummaryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get audience summary params +func (o *GetAudienceSummaryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAudienceID adds the audienceID to the get audience summary params +func (o *GetAudienceSummaryParams) WithAudienceID(audienceID string) *GetAudienceSummaryParams { + o.SetAudienceID(audienceID) + return o +} + +// SetAudienceID adds the audienceId to the get audience summary params +func (o *GetAudienceSummaryParams) SetAudienceID(audienceID string) { + o.AudienceID = audienceID +} + +// WithIncidentID adds the incidentID to the get audience summary params +func (o *GetAudienceSummaryParams) WithIncidentID(incidentID string) *GetAudienceSummaryParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the get audience summary params +func (o *GetAudienceSummaryParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAudienceSummaryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param audience_id + if err := r.SetPathParam("audience_id", o.AudienceID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/audiences/get_audience_summary_responses.go b/client/audiences/get_audience_summary_responses.go new file mode 100644 index 0000000..6b82ac7 --- /dev/null +++ b/client/audiences/get_audience_summary_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetAudienceSummaryReader is a Reader for the GetAudienceSummary structure. +type GetAudienceSummaryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAudienceSummaryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAudienceSummaryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAudienceSummaryOK creates a GetAudienceSummaryOK with default headers values +func NewGetAudienceSummaryOK() *GetAudienceSummaryOK { + return &GetAudienceSummaryOK{} +} + +/* +GetAudienceSummaryOK describes a response with status code 200, with default header values. + +Get the latest audience-specific summary for an incident +*/ +type GetAudienceSummaryOK struct { + Payload *models.AIEntitiesIncidentSummaryEntity +} + +// IsSuccess returns true when this get audience summary o k response has a 2xx status code +func (o *GetAudienceSummaryOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get audience summary o k response has a 3xx status code +func (o *GetAudienceSummaryOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get audience summary o k response has a 4xx status code +func (o *GetAudienceSummaryOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get audience summary o k response has a 5xx status code +func (o *GetAudienceSummaryOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get audience summary o k response a status code equal to that given +func (o *GetAudienceSummaryOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetAudienceSummaryOK) Error() string { + return fmt.Sprintf("[GET /v1/audiences/{audience_id}/summaries/{incident_id}][%d] getAudienceSummaryOK %+v", 200, o.Payload) +} + +func (o *GetAudienceSummaryOK) String() string { + return fmt.Sprintf("[GET /v1/audiences/{audience_id}/summaries/{incident_id}][%d] getAudienceSummaryOK %+v", 200, o.Payload) +} + +func (o *GetAudienceSummaryOK) GetPayload() *models.AIEntitiesIncidentSummaryEntity { + return o.Payload +} + +func (o *GetAudienceSummaryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AIEntitiesIncidentSummaryEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/audiences/get_member_default_audience_parameters.go b/client/audiences/get_member_default_audience_parameters.go new file mode 100644 index 0000000..346ae5d --- /dev/null +++ b/client/audiences/get_member_default_audience_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetMemberDefaultAudienceParams creates a new GetMemberDefaultAudienceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetMemberDefaultAudienceParams() *GetMemberDefaultAudienceParams { + return &GetMemberDefaultAudienceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetMemberDefaultAudienceParamsWithTimeout creates a new GetMemberDefaultAudienceParams object +// with the ability to set a timeout on a request. +func NewGetMemberDefaultAudienceParamsWithTimeout(timeout time.Duration) *GetMemberDefaultAudienceParams { + return &GetMemberDefaultAudienceParams{ + timeout: timeout, + } +} + +// NewGetMemberDefaultAudienceParamsWithContext creates a new GetMemberDefaultAudienceParams object +// with the ability to set a context for a request. +func NewGetMemberDefaultAudienceParamsWithContext(ctx context.Context) *GetMemberDefaultAudienceParams { + return &GetMemberDefaultAudienceParams{ + Context: ctx, + } +} + +// NewGetMemberDefaultAudienceParamsWithHTTPClient creates a new GetMemberDefaultAudienceParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetMemberDefaultAudienceParamsWithHTTPClient(client *http.Client) *GetMemberDefaultAudienceParams { + return &GetMemberDefaultAudienceParams{ + HTTPClient: client, + } +} + +/* +GetMemberDefaultAudienceParams contains all the parameters to send to the API endpoint + + for the get member default audience operation. + + Typically these are written to a http.Request. +*/ +type GetMemberDefaultAudienceParams struct { + + // MemberID. + // + // Format: int32 + MemberID int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get member default audience params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMemberDefaultAudienceParams) WithDefaults() *GetMemberDefaultAudienceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get member default audience params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMemberDefaultAudienceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get member default audience params +func (o *GetMemberDefaultAudienceParams) WithTimeout(timeout time.Duration) *GetMemberDefaultAudienceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get member default audience params +func (o *GetMemberDefaultAudienceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get member default audience params +func (o *GetMemberDefaultAudienceParams) WithContext(ctx context.Context) *GetMemberDefaultAudienceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get member default audience params +func (o *GetMemberDefaultAudienceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get member default audience params +func (o *GetMemberDefaultAudienceParams) WithHTTPClient(client *http.Client) *GetMemberDefaultAudienceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get member default audience params +func (o *GetMemberDefaultAudienceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMemberID adds the memberID to the get member default audience params +func (o *GetMemberDefaultAudienceParams) WithMemberID(memberID int32) *GetMemberDefaultAudienceParams { + o.SetMemberID(memberID) + return o +} + +// SetMemberID adds the memberId to the get member default audience params +func (o *GetMemberDefaultAudienceParams) SetMemberID(memberID int32) { + o.MemberID = memberID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetMemberDefaultAudienceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param member_id + if err := r.SetPathParam("member_id", swag.FormatInt32(o.MemberID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/audiences/get_member_default_audience_responses.go b/client/audiences/get_member_default_audience_responses.go new file mode 100644 index 0000000..1a18da6 --- /dev/null +++ b/client/audiences/get_member_default_audience_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetMemberDefaultAudienceReader is a Reader for the GetMemberDefaultAudience structure. +type GetMemberDefaultAudienceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetMemberDefaultAudienceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetMemberDefaultAudienceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetMemberDefaultAudienceOK creates a GetMemberDefaultAudienceOK with default headers values +func NewGetMemberDefaultAudienceOK() *GetMemberDefaultAudienceOK { + return &GetMemberDefaultAudienceOK{} +} + +/* +GetMemberDefaultAudienceOK describes a response with status code 200, with default header values. + +Get member's default audience +*/ +type GetMemberDefaultAudienceOK struct { + Payload *models.AudiencesEntitiesAudienceEntity +} + +// IsSuccess returns true when this get member default audience o k response has a 2xx status code +func (o *GetMemberDefaultAudienceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get member default audience o k response has a 3xx status code +func (o *GetMemberDefaultAudienceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get member default audience o k response has a 4xx status code +func (o *GetMemberDefaultAudienceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get member default audience o k response has a 5xx status code +func (o *GetMemberDefaultAudienceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get member default audience o k response a status code equal to that given +func (o *GetMemberDefaultAudienceOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetMemberDefaultAudienceOK) Error() string { + return fmt.Sprintf("[GET /v1/audiences/member/{member_id}/default][%d] getMemberDefaultAudienceOK %+v", 200, o.Payload) +} + +func (o *GetMemberDefaultAudienceOK) String() string { + return fmt.Sprintf("[GET /v1/audiences/member/{member_id}/default][%d] getMemberDefaultAudienceOK %+v", 200, o.Payload) +} + +func (o *GetMemberDefaultAudienceOK) GetPayload() *models.AudiencesEntitiesAudienceEntity { + return o.Payload +} + +func (o *GetMemberDefaultAudienceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AudiencesEntitiesAudienceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/audiences/list_audience_summaries_parameters.go b/client/audiences/list_audience_summaries_parameters.go new file mode 100644 index 0000000..ccb31eb --- /dev/null +++ b/client/audiences/list_audience_summaries_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListAudienceSummariesParams creates a new ListAudienceSummariesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListAudienceSummariesParams() *ListAudienceSummariesParams { + return &ListAudienceSummariesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListAudienceSummariesParamsWithTimeout creates a new ListAudienceSummariesParams object +// with the ability to set a timeout on a request. +func NewListAudienceSummariesParamsWithTimeout(timeout time.Duration) *ListAudienceSummariesParams { + return &ListAudienceSummariesParams{ + timeout: timeout, + } +} + +// NewListAudienceSummariesParamsWithContext creates a new ListAudienceSummariesParams object +// with the ability to set a context for a request. +func NewListAudienceSummariesParamsWithContext(ctx context.Context) *ListAudienceSummariesParams { + return &ListAudienceSummariesParams{ + Context: ctx, + } +} + +// NewListAudienceSummariesParamsWithHTTPClient creates a new ListAudienceSummariesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListAudienceSummariesParamsWithHTTPClient(client *http.Client) *ListAudienceSummariesParams { + return &ListAudienceSummariesParams{ + HTTPClient: client, + } +} + +/* +ListAudienceSummariesParams contains all the parameters to send to the API endpoint + + for the list audience summaries operation. + + Typically these are written to a http.Request. +*/ +type ListAudienceSummariesParams struct { + + /* IncidentID. + + Unique identifier of the incident to summarize + */ + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list audience summaries params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAudienceSummariesParams) WithDefaults() *ListAudienceSummariesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list audience summaries params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAudienceSummariesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list audience summaries params +func (o *ListAudienceSummariesParams) WithTimeout(timeout time.Duration) *ListAudienceSummariesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list audience summaries params +func (o *ListAudienceSummariesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list audience summaries params +func (o *ListAudienceSummariesParams) WithContext(ctx context.Context) *ListAudienceSummariesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list audience summaries params +func (o *ListAudienceSummariesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list audience summaries params +func (o *ListAudienceSummariesParams) WithHTTPClient(client *http.Client) *ListAudienceSummariesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list audience summaries params +func (o *ListAudienceSummariesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list audience summaries params +func (o *ListAudienceSummariesParams) WithIncidentID(incidentID string) *ListAudienceSummariesParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list audience summaries params +func (o *ListAudienceSummariesParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListAudienceSummariesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/audiences/list_audience_summaries_responses.go b/client/audiences/list_audience_summaries_responses.go new file mode 100644 index 0000000..e4d5ef2 --- /dev/null +++ b/client/audiences/list_audience_summaries_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListAudienceSummariesReader is a Reader for the ListAudienceSummaries structure. +type ListAudienceSummariesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListAudienceSummariesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListAudienceSummariesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListAudienceSummariesOK creates a ListAudienceSummariesOK with default headers values +func NewListAudienceSummariesOK() *ListAudienceSummariesOK { + return &ListAudienceSummariesOK{} +} + +/* +ListAudienceSummariesOK describes a response with status code 200, with default header values. + +List all audience summaries for an incident +*/ +type ListAudienceSummariesOK struct { + Payload *models.AudiencesEntitiesAudienceSummariesEntity +} + +// IsSuccess returns true when this list audience summaries o k response has a 2xx status code +func (o *ListAudienceSummariesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list audience summaries o k response has a 3xx status code +func (o *ListAudienceSummariesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list audience summaries o k response has a 4xx status code +func (o *ListAudienceSummariesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list audience summaries o k response has a 5xx status code +func (o *ListAudienceSummariesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list audience summaries o k response a status code equal to that given +func (o *ListAudienceSummariesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListAudienceSummariesOK) Error() string { + return fmt.Sprintf("[GET /v1/audiences/summaries/{incident_id}][%d] listAudienceSummariesOK %+v", 200, o.Payload) +} + +func (o *ListAudienceSummariesOK) String() string { + return fmt.Sprintf("[GET /v1/audiences/summaries/{incident_id}][%d] listAudienceSummariesOK %+v", 200, o.Payload) +} + +func (o *ListAudienceSummariesOK) GetPayload() *models.AudiencesEntitiesAudienceSummariesEntity { + return o.Payload +} + +func (o *ListAudienceSummariesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AudiencesEntitiesAudienceSummariesEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/audiences/list_audiences_parameters.go b/client/audiences/list_audiences_parameters.go new file mode 100644 index 0000000..e536d1e --- /dev/null +++ b/client/audiences/list_audiences_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListAudiencesParams creates a new ListAudiencesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListAudiencesParams() *ListAudiencesParams { + return &ListAudiencesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListAudiencesParamsWithTimeout creates a new ListAudiencesParams object +// with the ability to set a timeout on a request. +func NewListAudiencesParamsWithTimeout(timeout time.Duration) *ListAudiencesParams { + return &ListAudiencesParams{ + timeout: timeout, + } +} + +// NewListAudiencesParamsWithContext creates a new ListAudiencesParams object +// with the ability to set a context for a request. +func NewListAudiencesParamsWithContext(ctx context.Context) *ListAudiencesParams { + return &ListAudiencesParams{ + Context: ctx, + } +} + +// NewListAudiencesParamsWithHTTPClient creates a new ListAudiencesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListAudiencesParamsWithHTTPClient(client *http.Client) *ListAudiencesParams { + return &ListAudiencesParams{ + HTTPClient: client, + } +} + +/* +ListAudiencesParams contains all the parameters to send to the API endpoint + + for the list audiences operation. + + Typically these are written to a http.Request. +*/ +type ListAudiencesParams struct { + + /* IncludeArchived. + + Include archived (discarded) audiences + */ + IncludeArchived *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list audiences params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAudiencesParams) WithDefaults() *ListAudiencesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list audiences params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAudiencesParams) SetDefaults() { + var ( + includeArchivedDefault = bool(false) + ) + + val := ListAudiencesParams{ + IncludeArchived: &includeArchivedDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the list audiences params +func (o *ListAudiencesParams) WithTimeout(timeout time.Duration) *ListAudiencesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list audiences params +func (o *ListAudiencesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list audiences params +func (o *ListAudiencesParams) WithContext(ctx context.Context) *ListAudiencesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list audiences params +func (o *ListAudiencesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list audiences params +func (o *ListAudiencesParams) WithHTTPClient(client *http.Client) *ListAudiencesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list audiences params +func (o *ListAudiencesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncludeArchived adds the includeArchived to the list audiences params +func (o *ListAudiencesParams) WithIncludeArchived(includeArchived *bool) *ListAudiencesParams { + o.SetIncludeArchived(includeArchived) + return o +} + +// SetIncludeArchived adds the includeArchived to the list audiences params +func (o *ListAudiencesParams) SetIncludeArchived(includeArchived *bool) { + o.IncludeArchived = includeArchived +} + +// WriteToRequest writes these params to a swagger request +func (o *ListAudiencesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.IncludeArchived != nil { + + // query param include_archived + var qrIncludeArchived bool + + if o.IncludeArchived != nil { + qrIncludeArchived = *o.IncludeArchived + } + qIncludeArchived := swag.FormatBool(qrIncludeArchived) + if qIncludeArchived != "" { + + if err := r.SetQueryParam("include_archived", qIncludeArchived); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/audiences/list_audiences_responses.go b/client/audiences/list_audiences_responses.go new file mode 100644 index 0000000..840f543 --- /dev/null +++ b/client/audiences/list_audiences_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListAudiencesReader is a Reader for the ListAudiences structure. +type ListAudiencesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListAudiencesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListAudiencesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListAudiencesOK creates a ListAudiencesOK with default headers values +func NewListAudiencesOK() *ListAudiencesOK { + return &ListAudiencesOK{} +} + +/* +ListAudiencesOK describes a response with status code 200, with default header values. + +List all audiences +*/ +type ListAudiencesOK struct { + Payload *models.AudiencesEntitiesAudienceEntity +} + +// IsSuccess returns true when this list audiences o k response has a 2xx status code +func (o *ListAudiencesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list audiences o k response has a 3xx status code +func (o *ListAudiencesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list audiences o k response has a 4xx status code +func (o *ListAudiencesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list audiences o k response has a 5xx status code +func (o *ListAudiencesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list audiences o k response a status code equal to that given +func (o *ListAudiencesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListAudiencesOK) Error() string { + return fmt.Sprintf("[GET /v1/audiences][%d] listAudiencesOK %+v", 200, o.Payload) +} + +func (o *ListAudiencesOK) String() string { + return fmt.Sprintf("[GET /v1/audiences][%d] listAudiencesOK %+v", 200, o.Payload) +} + +func (o *ListAudiencesOK) GetPayload() *models.AudiencesEntitiesAudienceEntity { + return o.Payload +} + +func (o *ListAudiencesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AudiencesEntitiesAudienceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/audiences/restore_audience_parameters.go b/client/audiences/restore_audience_parameters.go new file mode 100644 index 0000000..943cfc4 --- /dev/null +++ b/client/audiences/restore_audience_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewRestoreAudienceParams creates a new RestoreAudienceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRestoreAudienceParams() *RestoreAudienceParams { + return &RestoreAudienceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRestoreAudienceParamsWithTimeout creates a new RestoreAudienceParams object +// with the ability to set a timeout on a request. +func NewRestoreAudienceParamsWithTimeout(timeout time.Duration) *RestoreAudienceParams { + return &RestoreAudienceParams{ + timeout: timeout, + } +} + +// NewRestoreAudienceParamsWithContext creates a new RestoreAudienceParams object +// with the ability to set a context for a request. +func NewRestoreAudienceParamsWithContext(ctx context.Context) *RestoreAudienceParams { + return &RestoreAudienceParams{ + Context: ctx, + } +} + +// NewRestoreAudienceParamsWithHTTPClient creates a new RestoreAudienceParams object +// with the ability to set a custom HTTPClient for a request. +func NewRestoreAudienceParamsWithHTTPClient(client *http.Client) *RestoreAudienceParams { + return &RestoreAudienceParams{ + HTTPClient: client, + } +} + +/* +RestoreAudienceParams contains all the parameters to send to the API endpoint + + for the restore audience operation. + + Typically these are written to a http.Request. +*/ +type RestoreAudienceParams struct { + + /* AudienceID. + + Unique identifier of the audience + */ + AudienceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the restore audience params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestoreAudienceParams) WithDefaults() *RestoreAudienceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the restore audience params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RestoreAudienceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the restore audience params +func (o *RestoreAudienceParams) WithTimeout(timeout time.Duration) *RestoreAudienceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the restore audience params +func (o *RestoreAudienceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the restore audience params +func (o *RestoreAudienceParams) WithContext(ctx context.Context) *RestoreAudienceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the restore audience params +func (o *RestoreAudienceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the restore audience params +func (o *RestoreAudienceParams) WithHTTPClient(client *http.Client) *RestoreAudienceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the restore audience params +func (o *RestoreAudienceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAudienceID adds the audienceID to the restore audience params +func (o *RestoreAudienceParams) WithAudienceID(audienceID string) *RestoreAudienceParams { + o.SetAudienceID(audienceID) + return o +} + +// SetAudienceID adds the audienceId to the restore audience params +func (o *RestoreAudienceParams) SetAudienceID(audienceID string) { + o.AudienceID = audienceID +} + +// WriteToRequest writes these params to a swagger request +func (o *RestoreAudienceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param audience_id + if err := r.SetPathParam("audience_id", o.AudienceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/audiences/restore_audience_responses.go b/client/audiences/restore_audience_responses.go new file mode 100644 index 0000000..6bb5a70 --- /dev/null +++ b/client/audiences/restore_audience_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// RestoreAudienceReader is a Reader for the RestoreAudience structure. +type RestoreAudienceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RestoreAudienceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRestoreAudienceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewRestoreAudienceOK creates a RestoreAudienceOK with default headers values +func NewRestoreAudienceOK() *RestoreAudienceOK { + return &RestoreAudienceOK{} +} + +/* +RestoreAudienceOK describes a response with status code 200, with default header values. + +Restore a previously archived audience +*/ +type RestoreAudienceOK struct { + Payload *models.AudiencesEntitiesAudienceEntity +} + +// IsSuccess returns true when this restore audience o k response has a 2xx status code +func (o *RestoreAudienceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this restore audience o k response has a 3xx status code +func (o *RestoreAudienceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this restore audience o k response has a 4xx status code +func (o *RestoreAudienceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this restore audience o k response has a 5xx status code +func (o *RestoreAudienceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this restore audience o k response a status code equal to that given +func (o *RestoreAudienceOK) IsCode(code int) bool { + return code == 200 +} + +func (o *RestoreAudienceOK) Error() string { + return fmt.Sprintf("[PATCH /v1/audiences/{audience_id}/restore][%d] restoreAudienceOK %+v", 200, o.Payload) +} + +func (o *RestoreAudienceOK) String() string { + return fmt.Sprintf("[PATCH /v1/audiences/{audience_id}/restore][%d] restoreAudienceOK %+v", 200, o.Payload) +} + +func (o *RestoreAudienceOK) GetPayload() *models.AudiencesEntitiesAudienceEntity { + return o.Payload +} + +func (o *RestoreAudienceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AudiencesEntitiesAudienceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/audiences/set_member_default_audience_parameters.go b/client/audiences/set_member_default_audience_parameters.go new file mode 100644 index 0000000..d795004 --- /dev/null +++ b/client/audiences/set_member_default_audience_parameters.go @@ -0,0 +1,177 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewSetMemberDefaultAudienceParams creates a new SetMemberDefaultAudienceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewSetMemberDefaultAudienceParams() *SetMemberDefaultAudienceParams { + return &SetMemberDefaultAudienceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSetMemberDefaultAudienceParamsWithTimeout creates a new SetMemberDefaultAudienceParams object +// with the ability to set a timeout on a request. +func NewSetMemberDefaultAudienceParamsWithTimeout(timeout time.Duration) *SetMemberDefaultAudienceParams { + return &SetMemberDefaultAudienceParams{ + timeout: timeout, + } +} + +// NewSetMemberDefaultAudienceParamsWithContext creates a new SetMemberDefaultAudienceParams object +// with the ability to set a context for a request. +func NewSetMemberDefaultAudienceParamsWithContext(ctx context.Context) *SetMemberDefaultAudienceParams { + return &SetMemberDefaultAudienceParams{ + Context: ctx, + } +} + +// NewSetMemberDefaultAudienceParamsWithHTTPClient creates a new SetMemberDefaultAudienceParams object +// with the ability to set a custom HTTPClient for a request. +func NewSetMemberDefaultAudienceParamsWithHTTPClient(client *http.Client) *SetMemberDefaultAudienceParams { + return &SetMemberDefaultAudienceParams{ + HTTPClient: client, + } +} + +/* +SetMemberDefaultAudienceParams contains all the parameters to send to the API endpoint + + for the set member default audience operation. + + Typically these are written to a http.Request. +*/ +type SetMemberDefaultAudienceParams struct { + + /* AudienceID. + + ID of the audience to set as default + */ + AudienceID string + + // MemberID. + // + // Format: int32 + MemberID int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the set member default audience params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SetMemberDefaultAudienceParams) WithDefaults() *SetMemberDefaultAudienceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the set member default audience params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SetMemberDefaultAudienceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the set member default audience params +func (o *SetMemberDefaultAudienceParams) WithTimeout(timeout time.Duration) *SetMemberDefaultAudienceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the set member default audience params +func (o *SetMemberDefaultAudienceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the set member default audience params +func (o *SetMemberDefaultAudienceParams) WithContext(ctx context.Context) *SetMemberDefaultAudienceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the set member default audience params +func (o *SetMemberDefaultAudienceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the set member default audience params +func (o *SetMemberDefaultAudienceParams) WithHTTPClient(client *http.Client) *SetMemberDefaultAudienceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the set member default audience params +func (o *SetMemberDefaultAudienceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAudienceID adds the audienceID to the set member default audience params +func (o *SetMemberDefaultAudienceParams) WithAudienceID(audienceID string) *SetMemberDefaultAudienceParams { + o.SetAudienceID(audienceID) + return o +} + +// SetAudienceID adds the audienceId to the set member default audience params +func (o *SetMemberDefaultAudienceParams) SetAudienceID(audienceID string) { + o.AudienceID = audienceID +} + +// WithMemberID adds the memberID to the set member default audience params +func (o *SetMemberDefaultAudienceParams) WithMemberID(memberID int32) *SetMemberDefaultAudienceParams { + o.SetMemberID(memberID) + return o +} + +// SetMemberID adds the memberId to the set member default audience params +func (o *SetMemberDefaultAudienceParams) SetMemberID(memberID int32) { + o.MemberID = memberID +} + +// WriteToRequest writes these params to a swagger request +func (o *SetMemberDefaultAudienceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // form param audience_id + frAudienceID := o.AudienceID + fAudienceID := frAudienceID + if fAudienceID != "" { + if err := r.SetFormParam("audience_id", fAudienceID); err != nil { + return err + } + } + + // path param member_id + if err := r.SetPathParam("member_id", swag.FormatInt32(o.MemberID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/audiences/set_member_default_audience_responses.go b/client/audiences/set_member_default_audience_responses.go new file mode 100644 index 0000000..c8b09b0 --- /dev/null +++ b/client/audiences/set_member_default_audience_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// SetMemberDefaultAudienceReader is a Reader for the SetMemberDefaultAudience structure. +type SetMemberDefaultAudienceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SetMemberDefaultAudienceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSetMemberDefaultAudienceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewSetMemberDefaultAudienceOK creates a SetMemberDefaultAudienceOK with default headers values +func NewSetMemberDefaultAudienceOK() *SetMemberDefaultAudienceOK { + return &SetMemberDefaultAudienceOK{} +} + +/* +SetMemberDefaultAudienceOK describes a response with status code 200, with default header values. + +Set member's default audience +*/ +type SetMemberDefaultAudienceOK struct { + Payload *models.AudiencesEntitiesAudienceEntity +} + +// IsSuccess returns true when this set member default audience o k response has a 2xx status code +func (o *SetMemberDefaultAudienceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this set member default audience o k response has a 3xx status code +func (o *SetMemberDefaultAudienceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this set member default audience o k response has a 4xx status code +func (o *SetMemberDefaultAudienceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this set member default audience o k response has a 5xx status code +func (o *SetMemberDefaultAudienceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this set member default audience o k response a status code equal to that given +func (o *SetMemberDefaultAudienceOK) IsCode(code int) bool { + return code == 200 +} + +func (o *SetMemberDefaultAudienceOK) Error() string { + return fmt.Sprintf("[PUT /v1/audiences/member/{member_id}/default][%d] setMemberDefaultAudienceOK %+v", 200, o.Payload) +} + +func (o *SetMemberDefaultAudienceOK) String() string { + return fmt.Sprintf("[PUT /v1/audiences/member/{member_id}/default][%d] setMemberDefaultAudienceOK %+v", 200, o.Payload) +} + +func (o *SetMemberDefaultAudienceOK) GetPayload() *models.AudiencesEntitiesAudienceEntity { + return o.Payload +} + +func (o *SetMemberDefaultAudienceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AudiencesEntitiesAudienceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/audiences/update_audience_parameters.go b/client/audiences/update_audience_parameters.go new file mode 100644 index 0000000..60244b4 --- /dev/null +++ b/client/audiences/update_audience_parameters.go @@ -0,0 +1,460 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewUpdateAudienceParams creates a new UpdateAudienceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateAudienceParams() *UpdateAudienceParams { + return &UpdateAudienceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateAudienceParamsWithTimeout creates a new UpdateAudienceParams object +// with the ability to set a timeout on a request. +func NewUpdateAudienceParamsWithTimeout(timeout time.Duration) *UpdateAudienceParams { + return &UpdateAudienceParams{ + timeout: timeout, + } +} + +// NewUpdateAudienceParamsWithContext creates a new UpdateAudienceParams object +// with the ability to set a context for a request. +func NewUpdateAudienceParamsWithContext(ctx context.Context) *UpdateAudienceParams { + return &UpdateAudienceParams{ + Context: ctx, + } +} + +// NewUpdateAudienceParamsWithHTTPClient creates a new UpdateAudienceParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateAudienceParamsWithHTTPClient(client *http.Client) *UpdateAudienceParams { + return &UpdateAudienceParams{ + HTTPClient: client, + } +} + +/* +UpdateAudienceParams contains all the parameters to send to the API endpoint + + for the update audience operation. + + Typically these are written to a http.Request. +*/ +type UpdateAudienceParams struct { + + /* Active. + + Whether the audience is active or discarded + */ + Active *bool + + /* AudienceID. + + Unique identifier of the audience + */ + AudienceID string + + /* Default. + + Whether this is the default audience + */ + Default *bool + + /* Description. + + Description of the audience (max 4000 characters) + */ + Description *string + + /* DetailsPosition. + + Position of the question in the list (1-based indexing) + */ + DetailsPosition []int32 + + /* DetailsPrompt. + + The prompt to display when collecting this detail + */ + DetailsPrompt []string + + /* DetailsQuestion. + + The incident detail question (max 255 characters) + */ + DetailsQuestion []string + + /* DetailsSlug. + + Optional unique identifier for this detail + */ + DetailsSlug []string + + /* Name. + + Name of the audience (max 255 characters) + */ + Name *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update audience params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAudienceParams) WithDefaults() *UpdateAudienceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update audience params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAudienceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update audience params +func (o *UpdateAudienceParams) WithTimeout(timeout time.Duration) *UpdateAudienceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update audience params +func (o *UpdateAudienceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update audience params +func (o *UpdateAudienceParams) WithContext(ctx context.Context) *UpdateAudienceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update audience params +func (o *UpdateAudienceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update audience params +func (o *UpdateAudienceParams) WithHTTPClient(client *http.Client) *UpdateAudienceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update audience params +func (o *UpdateAudienceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActive adds the active to the update audience params +func (o *UpdateAudienceParams) WithActive(active *bool) *UpdateAudienceParams { + o.SetActive(active) + return o +} + +// SetActive adds the active to the update audience params +func (o *UpdateAudienceParams) SetActive(active *bool) { + o.Active = active +} + +// WithAudienceID adds the audienceID to the update audience params +func (o *UpdateAudienceParams) WithAudienceID(audienceID string) *UpdateAudienceParams { + o.SetAudienceID(audienceID) + return o +} + +// SetAudienceID adds the audienceId to the update audience params +func (o *UpdateAudienceParams) SetAudienceID(audienceID string) { + o.AudienceID = audienceID +} + +// WithDefault adds the defaultVar to the update audience params +func (o *UpdateAudienceParams) WithDefault(defaultVar *bool) *UpdateAudienceParams { + o.SetDefault(defaultVar) + return o +} + +// SetDefault adds the default to the update audience params +func (o *UpdateAudienceParams) SetDefault(defaultVar *bool) { + o.Default = defaultVar +} + +// WithDescription adds the description to the update audience params +func (o *UpdateAudienceParams) WithDescription(description *string) *UpdateAudienceParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the update audience params +func (o *UpdateAudienceParams) SetDescription(description *string) { + o.Description = description +} + +// WithDetailsPosition adds the detailsPosition to the update audience params +func (o *UpdateAudienceParams) WithDetailsPosition(detailsPosition []int32) *UpdateAudienceParams { + o.SetDetailsPosition(detailsPosition) + return o +} + +// SetDetailsPosition adds the detailsPosition to the update audience params +func (o *UpdateAudienceParams) SetDetailsPosition(detailsPosition []int32) { + o.DetailsPosition = detailsPosition +} + +// WithDetailsPrompt adds the detailsPrompt to the update audience params +func (o *UpdateAudienceParams) WithDetailsPrompt(detailsPrompt []string) *UpdateAudienceParams { + o.SetDetailsPrompt(detailsPrompt) + return o +} + +// SetDetailsPrompt adds the detailsPrompt to the update audience params +func (o *UpdateAudienceParams) SetDetailsPrompt(detailsPrompt []string) { + o.DetailsPrompt = detailsPrompt +} + +// WithDetailsQuestion adds the detailsQuestion to the update audience params +func (o *UpdateAudienceParams) WithDetailsQuestion(detailsQuestion []string) *UpdateAudienceParams { + o.SetDetailsQuestion(detailsQuestion) + return o +} + +// SetDetailsQuestion adds the detailsQuestion to the update audience params +func (o *UpdateAudienceParams) SetDetailsQuestion(detailsQuestion []string) { + o.DetailsQuestion = detailsQuestion +} + +// WithDetailsSlug adds the detailsSlug to the update audience params +func (o *UpdateAudienceParams) WithDetailsSlug(detailsSlug []string) *UpdateAudienceParams { + o.SetDetailsSlug(detailsSlug) + return o +} + +// SetDetailsSlug adds the detailsSlug to the update audience params +func (o *UpdateAudienceParams) SetDetailsSlug(detailsSlug []string) { + o.DetailsSlug = detailsSlug +} + +// WithName adds the name to the update audience params +func (o *UpdateAudienceParams) WithName(name *string) *UpdateAudienceParams { + o.SetName(name) + return o +} + +// SetName adds the name to the update audience params +func (o *UpdateAudienceParams) SetName(name *string) { + o.Name = name +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateAudienceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Active != nil { + + // form param active + var frActive bool + if o.Active != nil { + frActive = *o.Active + } + fActive := swag.FormatBool(frActive) + if fActive != "" { + if err := r.SetFormParam("active", fActive); err != nil { + return err + } + } + } + + // path param audience_id + if err := r.SetPathParam("audience_id", o.AudienceID); err != nil { + return err + } + + if o.Default != nil { + + // form param default + var frDefault bool + if o.Default != nil { + frDefault = *o.Default + } + fDefault := swag.FormatBool(frDefault) + if fDefault != "" { + if err := r.SetFormParam("default", fDefault); err != nil { + return err + } + } + } + + if o.Description != nil { + + // form param description + var frDescription string + if o.Description != nil { + frDescription = *o.Description + } + fDescription := frDescription + if fDescription != "" { + if err := r.SetFormParam("description", fDescription); err != nil { + return err + } + } + } + + if o.DetailsPosition != nil { + + // binding items for details[position] + joinedDetailsPosition := o.bindParamDetailsPosition(reg) + + // form array param details[position] + if err := r.SetFormParam("details[position]", joinedDetailsPosition...); err != nil { + return err + } + } + + if o.DetailsPrompt != nil { + + // binding items for details[prompt] + joinedDetailsPrompt := o.bindParamDetailsPrompt(reg) + + // form array param details[prompt] + if err := r.SetFormParam("details[prompt]", joinedDetailsPrompt...); err != nil { + return err + } + } + + if o.DetailsQuestion != nil { + + // binding items for details[question] + joinedDetailsQuestion := o.bindParamDetailsQuestion(reg) + + // form array param details[question] + if err := r.SetFormParam("details[question]", joinedDetailsQuestion...); err != nil { + return err + } + } + + if o.DetailsSlug != nil { + + // binding items for details[slug] + joinedDetailsSlug := o.bindParamDetailsSlug(reg) + + // form array param details[slug] + if err := r.SetFormParam("details[slug]", joinedDetailsSlug...); err != nil { + return err + } + } + + if o.Name != nil { + + // form param name + var frName string + if o.Name != nil { + frName = *o.Name + } + fName := frName + if fName != "" { + if err := r.SetFormParam("name", fName); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamUpdateAudience binds the parameter details[position] +func (o *UpdateAudienceParams) bindParamDetailsPosition(formats strfmt.Registry) []string { + detailsPositionIR := o.DetailsPosition + + var detailsPositionIC []string + for _, detailsPositionIIR := range detailsPositionIR { // explode []int32 + + detailsPositionIIV := swag.FormatInt32(detailsPositionIIR) // int32 as string + detailsPositionIC = append(detailsPositionIC, detailsPositionIIV) + } + + // items.CollectionFormat: "" + detailsPositionIS := swag.JoinByFormat(detailsPositionIC, "") + + return detailsPositionIS +} + +// bindParamUpdateAudience binds the parameter details[prompt] +func (o *UpdateAudienceParams) bindParamDetailsPrompt(formats strfmt.Registry) []string { + detailsPromptIR := o.DetailsPrompt + + var detailsPromptIC []string + for _, detailsPromptIIR := range detailsPromptIR { // explode []string + + detailsPromptIIV := detailsPromptIIR // string as string + detailsPromptIC = append(detailsPromptIC, detailsPromptIIV) + } + + // items.CollectionFormat: "" + detailsPromptIS := swag.JoinByFormat(detailsPromptIC, "") + + return detailsPromptIS +} + +// bindParamUpdateAudience binds the parameter details[question] +func (o *UpdateAudienceParams) bindParamDetailsQuestion(formats strfmt.Registry) []string { + detailsQuestionIR := o.DetailsQuestion + + var detailsQuestionIC []string + for _, detailsQuestionIIR := range detailsQuestionIR { // explode []string + + detailsQuestionIIV := detailsQuestionIIR // string as string + detailsQuestionIC = append(detailsQuestionIC, detailsQuestionIIV) + } + + // items.CollectionFormat: "" + detailsQuestionIS := swag.JoinByFormat(detailsQuestionIC, "") + + return detailsQuestionIS +} + +// bindParamUpdateAudience binds the parameter details[slug] +func (o *UpdateAudienceParams) bindParamDetailsSlug(formats strfmt.Registry) []string { + detailsSlugIR := o.DetailsSlug + + var detailsSlugIC []string + for _, detailsSlugIIR := range detailsSlugIR { // explode []string + + detailsSlugIIV := detailsSlugIIR // string as string + detailsSlugIC = append(detailsSlugIC, detailsSlugIIV) + } + + // items.CollectionFormat: "" + detailsSlugIS := swag.JoinByFormat(detailsSlugIC, "") + + return detailsSlugIS +} diff --git a/client/audiences/update_audience_responses.go b/client/audiences/update_audience_responses.go new file mode 100644 index 0000000..e267e36 --- /dev/null +++ b/client/audiences/update_audience_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package audiences + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateAudienceReader is a Reader for the UpdateAudience structure. +type UpdateAudienceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateAudienceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateAudienceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateAudienceOK creates a UpdateAudienceOK with default headers values +func NewUpdateAudienceOK() *UpdateAudienceOK { + return &UpdateAudienceOK{} +} + +/* +UpdateAudienceOK describes a response with status code 200, with default header values. + +Update an existing audience +*/ +type UpdateAudienceOK struct { + Payload *models.AudiencesEntitiesAudienceEntity +} + +// IsSuccess returns true when this update audience o k response has a 2xx status code +func (o *UpdateAudienceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update audience o k response has a 3xx status code +func (o *UpdateAudienceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update audience o k response has a 4xx status code +func (o *UpdateAudienceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update audience o k response has a 5xx status code +func (o *UpdateAudienceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update audience o k response a status code equal to that given +func (o *UpdateAudienceOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateAudienceOK) Error() string { + return fmt.Sprintf("[PATCH /v1/audiences/{audience_id}][%d] updateAudienceOK %+v", 200, o.Payload) +} + +func (o *UpdateAudienceOK) String() string { + return fmt.Sprintf("[PATCH /v1/audiences/{audience_id}][%d] updateAudienceOK %+v", 200, o.Payload) +} + +func (o *UpdateAudienceOK) GetPayload() *models.AudiencesEntitiesAudienceEntity { + return o.Payload +} + +func (o *UpdateAudienceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AudiencesEntitiesAudienceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/catalog_entries_client.go b/client/catalog_entries/catalog_entries_client.go new file mode 100644 index 0000000..735e9ad --- /dev/null +++ b/client/catalog_entries/catalog_entries_client.go @@ -0,0 +1,1331 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new catalog entries API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for catalog entries API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + CreateEnvironment(params *CreateEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEnvironmentCreated, error) + + CreateFunctionality(params *CreateFunctionalityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateFunctionalityCreated, error) + + CreateService(params *CreateServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceCreated, error) + + CreateServiceChecklistResponse(params *CreateServiceChecklistResponseParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceChecklistResponseCreated, error) + + CreateServiceDependency(params *CreateServiceDependencyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceDependencyCreated, error) + + CreateServiceLinks(params *CreateServiceLinksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceLinksCreated, error) + + DeleteEnvironment(params *DeleteEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEnvironmentOK, error) + + DeleteFunctionality(params *DeleteFunctionalityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteFunctionalityOK, error) + + DeleteService(params *DeleteServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceOK, error) + + DeleteServiceDependency(params *DeleteServiceDependencyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceDependencyOK, error) + + DeleteServiceLink(params *DeleteServiceLinkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceLinkNoContent, error) + + GetEnvironment(params *GetEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEnvironmentOK, error) + + GetFunctionality(params *GetFunctionalityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetFunctionalityOK, error) + + GetService(params *GetServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServiceOK, error) + + GetServiceDependencies(params *GetServiceDependenciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServiceDependenciesOK, error) + + GetServiceDependency(params *GetServiceDependencyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServiceDependencyOK, error) + + IngestCatalogData(params *IngestCatalogDataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IngestCatalogDataCreated, error) + + ListEnvironments(params *ListEnvironmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEnvironmentsOK, error) + + ListFunctionalities(params *ListFunctionalitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListFunctionalitiesOK, error) + + ListFunctionalityServices(params *ListFunctionalityServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListFunctionalityServicesOK, error) + + ListInfrastructures(params *ListInfrastructuresParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListInfrastructuresOK, error) + + ListServiceAvailableDownstreamDependencies(params *ListServiceAvailableDownstreamDependenciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceAvailableDownstreamDependenciesOK, error) + + ListServiceAvailableUpstreamDependencies(params *ListServiceAvailableUpstreamDependenciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceAvailableUpstreamDependenciesOK, error) + + ListServices(params *ListServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicesOK, error) + + ListUserOwnedServices(params *ListUserOwnedServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListUserOwnedServicesOK, error) + + RefreshCatalog(params *RefreshCatalogParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RefreshCatalogOK, error) + + UpdateEnvironment(params *UpdateEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEnvironmentOK, error) + + UpdateFunctionality(params *UpdateFunctionalityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateFunctionalityOK, error) + + UpdateService(params *UpdateServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServiceOK, error) + + UpdateServiceDependency(params *UpdateServiceDependencyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServiceDependencyOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +CreateEnvironment creates an environment + +Creates an environment for the organization +*/ +func (a *Client) CreateEnvironment(params *CreateEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEnvironmentCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateEnvironmentParams() + } + op := &runtime.ClientOperation{ + ID: "create_environment", + Method: "POST", + PathPattern: "/v1/environments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateEnvironmentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateEnvironmentCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for create_environment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +CreateFunctionality creates a functionality + +Creates a functionality for the organization +*/ +func (a *Client) CreateFunctionality(params *CreateFunctionalityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateFunctionalityCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateFunctionalityParams() + } + op := &runtime.ClientOperation{ + ID: "create_functionality", + Method: "POST", + PathPattern: "/v1/functionalities", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateFunctionalityReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateFunctionalityCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for create_functionality: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +CreateService creates a service + +Creates a service for the organization, you may also create or attach functionalities to the service on create. +*/ +func (a *Client) CreateService(params *CreateServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateServiceParams() + } + op := &runtime.ClientOperation{ + ID: "create_service", + Method: "POST", + PathPattern: "/v1/services", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateServiceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateServiceCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for create_service: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +CreateServiceChecklistResponse records a response for a checklist item + +Creates a response for a checklist item +*/ +func (a *Client) CreateServiceChecklistResponse(params *CreateServiceChecklistResponseParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceChecklistResponseCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateServiceChecklistResponseParams() + } + op := &runtime.ClientOperation{ + ID: "create_service_checklist_response", + Method: "POST", + PathPattern: "/v1/services/{service_id}/checklist_response/{checklist_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateServiceChecklistResponseReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateServiceChecklistResponseCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for create_service_checklist_response: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +CreateServiceDependency creates a service dependency + +Creates a service dependency relationship between two services +*/ +func (a *Client) CreateServiceDependency(params *CreateServiceDependencyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceDependencyCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateServiceDependencyParams() + } + op := &runtime.ClientOperation{ + ID: "create_service_dependency", + Method: "POST", + PathPattern: "/v1/service_dependencies", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateServiceDependencyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateServiceDependencyCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for create_service_dependency: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +CreateServiceLinks creates multiple services linked to external services + +Creates a service with the appropriate integration for each external service ID passed +*/ +func (a *Client) CreateServiceLinks(params *CreateServiceLinksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceLinksCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateServiceLinksParams() + } + op := &runtime.ClientOperation{ + ID: "create_service_links", + Method: "POST", + PathPattern: "/v1/services/service_links", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateServiceLinksReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateServiceLinksCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for create_service_links: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteEnvironment archives an environment + +Archive an environment +*/ +func (a *Client) DeleteEnvironment(params *DeleteEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEnvironmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteEnvironmentParams() + } + op := &runtime.ClientOperation{ + ID: "delete_environment", + Method: "DELETE", + PathPattern: "/v1/environments/{environment_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteEnvironmentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteEnvironmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for delete_environment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteFunctionality archives a functionality + +Archive a functionality +*/ +func (a *Client) DeleteFunctionality(params *DeleteFunctionalityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteFunctionalityOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteFunctionalityParams() + } + op := &runtime.ClientOperation{ + ID: "delete_functionality", + Method: "DELETE", + PathPattern: "/v1/functionalities/{functionality_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteFunctionalityReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteFunctionalityOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for delete_functionality: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteService deletes a service + +Deletes the service from FireHydrant. +*/ +func (a *Client) DeleteService(params *DeleteServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteServiceParams() + } + op := &runtime.ClientOperation{ + ID: "delete_service", + Method: "DELETE", + PathPattern: "/v1/services/{service_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteServiceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteServiceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for delete_service: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteServiceDependency deletes a service dependency + +Deletes a single service dependency +*/ +func (a *Client) DeleteServiceDependency(params *DeleteServiceDependencyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceDependencyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteServiceDependencyParams() + } + op := &runtime.ClientOperation{ + ID: "delete_service_dependency", + Method: "DELETE", + PathPattern: "/v1/service_dependencies/{service_dependency_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteServiceDependencyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteServiceDependencyOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for delete_service_dependency: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteServiceLink deletes a service link + +Deletes a service link from FireHydrant. +*/ +func (a *Client) DeleteServiceLink(params *DeleteServiceLinkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceLinkNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteServiceLinkParams() + } + op := &runtime.ClientOperation{ + ID: "delete_service_link", + Method: "DELETE", + PathPattern: "/v1/services/{service_id}/service_links/{remote_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteServiceLinkReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteServiceLinkNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for delete_service_link: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetEnvironment gets an environment + +Retrieves a single environment by ID +*/ +func (a *Client) GetEnvironment(params *GetEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetEnvironmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetEnvironmentParams() + } + op := &runtime.ClientOperation{ + ID: "get_environment", + Method: "GET", + PathPattern: "/v1/environments/{environment_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetEnvironmentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetEnvironmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for get_environment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetFunctionality gets a functionality + +Retrieves a single functionality by ID +*/ +func (a *Client) GetFunctionality(params *GetFunctionalityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetFunctionalityOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetFunctionalityParams() + } + op := &runtime.ClientOperation{ + ID: "get_functionality", + Method: "GET", + PathPattern: "/v1/functionalities/{functionality_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetFunctionalityReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetFunctionalityOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for get_functionality: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetService gets a service + +Retrieves a single service by ID +*/ +func (a *Client) GetService(params *GetServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServiceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServiceParams() + } + op := &runtime.ClientOperation{ + ID: "get_service", + Method: "GET", + PathPattern: "/v1/services/{service_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetServiceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetServiceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for get_service: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetServiceDependencies lists dependencies for a service + +Retrieves a service's dependencies +*/ +func (a *Client) GetServiceDependencies(params *GetServiceDependenciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServiceDependenciesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServiceDependenciesParams() + } + op := &runtime.ClientOperation{ + ID: "get_service_dependencies", + Method: "GET", + PathPattern: "/v1/services/{service_id}/dependencies", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetServiceDependenciesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetServiceDependenciesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for get_service_dependencies: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetServiceDependency gets a service dependency + +Retrieves a single service dependency by ID +*/ +func (a *Client) GetServiceDependency(params *GetServiceDependencyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetServiceDependencyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServiceDependencyParams() + } + op := &runtime.ClientOperation{ + ID: "get_service_dependency", + Method: "GET", + PathPattern: "/v1/service_dependencies/{service_dependency_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetServiceDependencyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetServiceDependencyOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for get_service_dependency: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +IngestCatalogData ingests service catalog data + +Accepts catalog data in the configured format and asyncronously processes the data to incorporate changes into service catalog. +*/ +func (a *Client) IngestCatalogData(params *IngestCatalogDataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IngestCatalogDataCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIngestCatalogDataParams() + } + op := &runtime.ClientOperation{ + ID: "ingest_catalog_data", + Method: "POST", + PathPattern: "/v1/catalogs/{catalog_id}/ingest", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &IngestCatalogDataReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IngestCatalogDataCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ingest_catalog_data: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListEnvironments lists environments + +List all of the environments that have been added to the organiation +*/ +func (a *Client) ListEnvironments(params *ListEnvironmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEnvironmentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListEnvironmentsParams() + } + op := &runtime.ClientOperation{ + ID: "list_environments", + Method: "GET", + PathPattern: "/v1/environments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListEnvironmentsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListEnvironmentsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for list_environments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListFunctionalities lists functionalities + +List all of the functionalities that have been added to the organiation +*/ +func (a *Client) ListFunctionalities(params *ListFunctionalitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListFunctionalitiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListFunctionalitiesParams() + } + op := &runtime.ClientOperation{ + ID: "list_functionalities", + Method: "GET", + PathPattern: "/v1/functionalities", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListFunctionalitiesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListFunctionalitiesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for list_functionalities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListFunctionalityServices lists services for a functionality + +List services for a functionality +*/ +func (a *Client) ListFunctionalityServices(params *ListFunctionalityServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListFunctionalityServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListFunctionalityServicesParams() + } + op := &runtime.ClientOperation{ + ID: "list_functionality_services", + Method: "GET", + PathPattern: "/v1/functionalities/{functionality_id}/services", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListFunctionalityServicesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListFunctionalityServicesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for list_functionality_services: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListInfrastructures lists functionality service and environment objects + +Lists functionality, service and environment objects +*/ +func (a *Client) ListInfrastructures(params *ListInfrastructuresParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListInfrastructuresOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListInfrastructuresParams() + } + op := &runtime.ClientOperation{ + ID: "list_infrastructures", + Method: "GET", + PathPattern: "/v1/infrastructures", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListInfrastructuresReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListInfrastructuresOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for list_infrastructures: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListServiceAvailableDownstreamDependencies lists available downstream service dependencies + +Retrieves all services that are available to be downstream dependencies +*/ +func (a *Client) ListServiceAvailableDownstreamDependencies(params *ListServiceAvailableDownstreamDependenciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceAvailableDownstreamDependenciesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListServiceAvailableDownstreamDependenciesParams() + } + op := &runtime.ClientOperation{ + ID: "list_service_available_downstream_dependencies", + Method: "GET", + PathPattern: "/v1/services/{service_id}/available_downstream_dependencies", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListServiceAvailableDownstreamDependenciesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListServiceAvailableDownstreamDependenciesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for list_service_available_downstream_dependencies: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListServiceAvailableUpstreamDependencies lists available upstream service dependencies + +Retrieves all services that are available to be upstream dependencies +*/ +func (a *Client) ListServiceAvailableUpstreamDependencies(params *ListServiceAvailableUpstreamDependenciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceAvailableUpstreamDependenciesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListServiceAvailableUpstreamDependenciesParams() + } + op := &runtime.ClientOperation{ + ID: "list_service_available_upstream_dependencies", + Method: "GET", + PathPattern: "/v1/services/{service_id}/available_upstream_dependencies", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListServiceAvailableUpstreamDependenciesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListServiceAvailableUpstreamDependenciesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for list_service_available_upstream_dependencies: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListServices lists services + +List all of the services that have been added to the organization. +*/ +func (a *Client) ListServices(params *ListServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListServicesParams() + } + op := &runtime.ClientOperation{ + ID: "list_services", + Method: "GET", + PathPattern: "/v1/services", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListServicesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListServicesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for list_services: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ListUserOwnedServices lists services owned by a user s teams + +Retrieves a list of services owned by the teams a user is on +*/ +func (a *Client) ListUserOwnedServices(params *ListUserOwnedServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListUserOwnedServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListUserOwnedServicesParams() + } + op := &runtime.ClientOperation{ + ID: "list_user_owned_services", + Method: "GET", + PathPattern: "/v1/users/{id}/services", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListUserOwnedServicesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListUserOwnedServicesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for list_user_owned_services: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +RefreshCatalog refreshes a service catalog + +Schedules an async task to re-import catalog info and update catalog data accordingly. +*/ +func (a *Client) RefreshCatalog(params *RefreshCatalogParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RefreshCatalogOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRefreshCatalogParams() + } + op := &runtime.ClientOperation{ + ID: "refresh_catalog", + Method: "GET", + PathPattern: "/v1/catalogs/{catalog_id}/refresh", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &RefreshCatalogReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RefreshCatalogOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for refresh_catalog: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateEnvironment updates an environment + +Update a environments attributes +*/ +func (a *Client) UpdateEnvironment(params *UpdateEnvironmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEnvironmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateEnvironmentParams() + } + op := &runtime.ClientOperation{ + ID: "update_environment", + Method: "PATCH", + PathPattern: "/v1/environments/{environment_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateEnvironmentReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateEnvironmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for update_environment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateFunctionality updates a functionality + +Update a functionalities attributes +*/ +func (a *Client) UpdateFunctionality(params *UpdateFunctionalityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateFunctionalityOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateFunctionalityParams() + } + op := &runtime.ClientOperation{ + ID: "update_functionality", + Method: "PATCH", + PathPattern: "/v1/functionalities/{functionality_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateFunctionalityReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateFunctionalityOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for update_functionality: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdateService updates a service + + Update a services attributes, you may also add or remove functionalities from the service as well. + +Note: You may not remove or add individual label key/value pairs. You must include the entire object to override label values. +*/ +func (a *Client) UpdateService(params *UpdateServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServiceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateServiceParams() + } + op := &runtime.ClientOperation{ + ID: "update_service", + Method: "PATCH", + PathPattern: "/v1/services/{service_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateServiceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateServiceOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for update_service: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateServiceDependency updates a service dependency + +Update the notes of the service dependency +*/ +func (a *Client) UpdateServiceDependency(params *UpdateServiceDependencyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServiceDependencyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateServiceDependencyParams() + } + op := &runtime.ClientOperation{ + ID: "update_service_dependency", + Method: "PATCH", + PathPattern: "/v1/service_dependencies/{service_dependency_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateServiceDependencyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateServiceDependencyOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for update_service_dependency: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/client/catalog_entries/create_environment_parameters.go b/client/catalog_entries/create_environment_parameters.go new file mode 100644 index 0000000..27a0ecf --- /dev/null +++ b/client/catalog_entries/create_environment_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateEnvironmentParams creates a new CreateEnvironmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateEnvironmentParams() *CreateEnvironmentParams { + return &CreateEnvironmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateEnvironmentParamsWithTimeout creates a new CreateEnvironmentParams object +// with the ability to set a timeout on a request. +func NewCreateEnvironmentParamsWithTimeout(timeout time.Duration) *CreateEnvironmentParams { + return &CreateEnvironmentParams{ + timeout: timeout, + } +} + +// NewCreateEnvironmentParamsWithContext creates a new CreateEnvironmentParams object +// with the ability to set a context for a request. +func NewCreateEnvironmentParamsWithContext(ctx context.Context) *CreateEnvironmentParams { + return &CreateEnvironmentParams{ + Context: ctx, + } +} + +// NewCreateEnvironmentParamsWithHTTPClient creates a new CreateEnvironmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateEnvironmentParamsWithHTTPClient(client *http.Client) *CreateEnvironmentParams { + return &CreateEnvironmentParams{ + HTTPClient: client, + } +} + +/* +CreateEnvironmentParams contains all the parameters to send to the API endpoint + + for the create environment operation. + + Typically these are written to a http.Request. +*/ +type CreateEnvironmentParams struct { + + // CreateEnvironment. + CreateEnvironment *models.CreateEnvironment + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateEnvironmentParams) WithDefaults() *CreateEnvironmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateEnvironmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create environment params +func (o *CreateEnvironmentParams) WithTimeout(timeout time.Duration) *CreateEnvironmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create environment params +func (o *CreateEnvironmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create environment params +func (o *CreateEnvironmentParams) WithContext(ctx context.Context) *CreateEnvironmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create environment params +func (o *CreateEnvironmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create environment params +func (o *CreateEnvironmentParams) WithHTTPClient(client *http.Client) *CreateEnvironmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create environment params +func (o *CreateEnvironmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateEnvironment adds the createEnvironment to the create environment params +func (o *CreateEnvironmentParams) WithCreateEnvironment(createEnvironment *models.CreateEnvironment) *CreateEnvironmentParams { + o.SetCreateEnvironment(createEnvironment) + return o +} + +// SetCreateEnvironment adds the createEnvironment to the create environment params +func (o *CreateEnvironmentParams) SetCreateEnvironment(createEnvironment *models.CreateEnvironment) { + o.CreateEnvironment = createEnvironment +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateEnvironmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateEnvironment != nil { + if err := r.SetBodyParam(o.CreateEnvironment); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/create_environment_responses.go b/client/catalog_entries/create_environment_responses.go new file mode 100644 index 0000000..ea98ada --- /dev/null +++ b/client/catalog_entries/create_environment_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateEnvironmentReader is a Reader for the CreateEnvironment structure. +type CreateEnvironmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateEnvironmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateEnvironmentCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateEnvironmentCreated creates a CreateEnvironmentCreated with default headers values +func NewCreateEnvironmentCreated() *CreateEnvironmentCreated { + return &CreateEnvironmentCreated{} +} + +/* +CreateEnvironmentCreated describes a response with status code 201, with default header values. + +Creates an environment for the organization +*/ +type CreateEnvironmentCreated struct { + Payload *models.EnvironmentEntryEntity +} + +// IsSuccess returns true when this create environment created response has a 2xx status code +func (o *CreateEnvironmentCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create environment created response has a 3xx status code +func (o *CreateEnvironmentCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create environment created response has a 4xx status code +func (o *CreateEnvironmentCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create environment created response has a 5xx status code +func (o *CreateEnvironmentCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create environment created response a status code equal to that given +func (o *CreateEnvironmentCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateEnvironmentCreated) Error() string { + return fmt.Sprintf("[POST /v1/environments][%d] createEnvironmentCreated %+v", 201, o.Payload) +} + +func (o *CreateEnvironmentCreated) String() string { + return fmt.Sprintf("[POST /v1/environments][%d] createEnvironmentCreated %+v", 201, o.Payload) +} + +func (o *CreateEnvironmentCreated) GetPayload() *models.EnvironmentEntryEntity { + return o.Payload +} + +func (o *CreateEnvironmentCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.EnvironmentEntryEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/create_functionality_parameters.go b/client/catalog_entries/create_functionality_parameters.go new file mode 100644 index 0000000..b285865 --- /dev/null +++ b/client/catalog_entries/create_functionality_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateFunctionalityParams creates a new CreateFunctionalityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateFunctionalityParams() *CreateFunctionalityParams { + return &CreateFunctionalityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateFunctionalityParamsWithTimeout creates a new CreateFunctionalityParams object +// with the ability to set a timeout on a request. +func NewCreateFunctionalityParamsWithTimeout(timeout time.Duration) *CreateFunctionalityParams { + return &CreateFunctionalityParams{ + timeout: timeout, + } +} + +// NewCreateFunctionalityParamsWithContext creates a new CreateFunctionalityParams object +// with the ability to set a context for a request. +func NewCreateFunctionalityParamsWithContext(ctx context.Context) *CreateFunctionalityParams { + return &CreateFunctionalityParams{ + Context: ctx, + } +} + +// NewCreateFunctionalityParamsWithHTTPClient creates a new CreateFunctionalityParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateFunctionalityParamsWithHTTPClient(client *http.Client) *CreateFunctionalityParams { + return &CreateFunctionalityParams{ + HTTPClient: client, + } +} + +/* +CreateFunctionalityParams contains all the parameters to send to the API endpoint + + for the create functionality operation. + + Typically these are written to a http.Request. +*/ +type CreateFunctionalityParams struct { + + // CreateFunctionality. + CreateFunctionality *models.CreateFunctionality + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create functionality params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateFunctionalityParams) WithDefaults() *CreateFunctionalityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create functionality params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateFunctionalityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create functionality params +func (o *CreateFunctionalityParams) WithTimeout(timeout time.Duration) *CreateFunctionalityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create functionality params +func (o *CreateFunctionalityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create functionality params +func (o *CreateFunctionalityParams) WithContext(ctx context.Context) *CreateFunctionalityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create functionality params +func (o *CreateFunctionalityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create functionality params +func (o *CreateFunctionalityParams) WithHTTPClient(client *http.Client) *CreateFunctionalityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create functionality params +func (o *CreateFunctionalityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateFunctionality adds the createFunctionality to the create functionality params +func (o *CreateFunctionalityParams) WithCreateFunctionality(createFunctionality *models.CreateFunctionality) *CreateFunctionalityParams { + o.SetCreateFunctionality(createFunctionality) + return o +} + +// SetCreateFunctionality adds the createFunctionality to the create functionality params +func (o *CreateFunctionalityParams) SetCreateFunctionality(createFunctionality *models.CreateFunctionality) { + o.CreateFunctionality = createFunctionality +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateFunctionalityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateFunctionality != nil { + if err := r.SetBodyParam(o.CreateFunctionality); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/create_functionality_responses.go b/client/catalog_entries/create_functionality_responses.go new file mode 100644 index 0000000..dfc2f4a --- /dev/null +++ b/client/catalog_entries/create_functionality_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateFunctionalityReader is a Reader for the CreateFunctionality structure. +type CreateFunctionalityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateFunctionalityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateFunctionalityCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateFunctionalityCreated creates a CreateFunctionalityCreated with default headers values +func NewCreateFunctionalityCreated() *CreateFunctionalityCreated { + return &CreateFunctionalityCreated{} +} + +/* +CreateFunctionalityCreated describes a response with status code 201, with default header values. + +Creates a functionality for the organization +*/ +type CreateFunctionalityCreated struct { + Payload *models.FunctionalityEntity +} + +// IsSuccess returns true when this create functionality created response has a 2xx status code +func (o *CreateFunctionalityCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create functionality created response has a 3xx status code +func (o *CreateFunctionalityCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create functionality created response has a 4xx status code +func (o *CreateFunctionalityCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create functionality created response has a 5xx status code +func (o *CreateFunctionalityCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create functionality created response a status code equal to that given +func (o *CreateFunctionalityCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateFunctionalityCreated) Error() string { + return fmt.Sprintf("[POST /v1/functionalities][%d] createFunctionalityCreated %+v", 201, o.Payload) +} + +func (o *CreateFunctionalityCreated) String() string { + return fmt.Sprintf("[POST /v1/functionalities][%d] createFunctionalityCreated %+v", 201, o.Payload) +} + +func (o *CreateFunctionalityCreated) GetPayload() *models.FunctionalityEntity { + return o.Payload +} + +func (o *CreateFunctionalityCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FunctionalityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/create_service_checklist_response_parameters.go b/client/catalog_entries/create_service_checklist_response_parameters.go new file mode 100644 index 0000000..a77c1ec --- /dev/null +++ b/client/catalog_entries/create_service_checklist_response_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateServiceChecklistResponseParams creates a new CreateServiceChecklistResponseParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateServiceChecklistResponseParams() *CreateServiceChecklistResponseParams { + return &CreateServiceChecklistResponseParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateServiceChecklistResponseParamsWithTimeout creates a new CreateServiceChecklistResponseParams object +// with the ability to set a timeout on a request. +func NewCreateServiceChecklistResponseParamsWithTimeout(timeout time.Duration) *CreateServiceChecklistResponseParams { + return &CreateServiceChecklistResponseParams{ + timeout: timeout, + } +} + +// NewCreateServiceChecklistResponseParamsWithContext creates a new CreateServiceChecklistResponseParams object +// with the ability to set a context for a request. +func NewCreateServiceChecklistResponseParamsWithContext(ctx context.Context) *CreateServiceChecklistResponseParams { + return &CreateServiceChecklistResponseParams{ + Context: ctx, + } +} + +// NewCreateServiceChecklistResponseParamsWithHTTPClient creates a new CreateServiceChecklistResponseParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateServiceChecklistResponseParamsWithHTTPClient(client *http.Client) *CreateServiceChecklistResponseParams { + return &CreateServiceChecklistResponseParams{ + HTTPClient: client, + } +} + +/* +CreateServiceChecklistResponseParams contains all the parameters to send to the API endpoint + + for the create service checklist response operation. + + Typically these are written to a http.Request. +*/ +type CreateServiceChecklistResponseParams struct { + + // ChecklistID. + ChecklistID string + + // CreateServiceChecklistResponse. + CreateServiceChecklistResponse *models.CreateServiceChecklistResponse + + // ServiceID. + ServiceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create service checklist response params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateServiceChecklistResponseParams) WithDefaults() *CreateServiceChecklistResponseParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create service checklist response params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateServiceChecklistResponseParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create service checklist response params +func (o *CreateServiceChecklistResponseParams) WithTimeout(timeout time.Duration) *CreateServiceChecklistResponseParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create service checklist response params +func (o *CreateServiceChecklistResponseParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create service checklist response params +func (o *CreateServiceChecklistResponseParams) WithContext(ctx context.Context) *CreateServiceChecklistResponseParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create service checklist response params +func (o *CreateServiceChecklistResponseParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create service checklist response params +func (o *CreateServiceChecklistResponseParams) WithHTTPClient(client *http.Client) *CreateServiceChecklistResponseParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create service checklist response params +func (o *CreateServiceChecklistResponseParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithChecklistID adds the checklistID to the create service checklist response params +func (o *CreateServiceChecklistResponseParams) WithChecklistID(checklistID string) *CreateServiceChecklistResponseParams { + o.SetChecklistID(checklistID) + return o +} + +// SetChecklistID adds the checklistId to the create service checklist response params +func (o *CreateServiceChecklistResponseParams) SetChecklistID(checklistID string) { + o.ChecklistID = checklistID +} + +// WithCreateServiceChecklistResponse adds the createServiceChecklistResponse to the create service checklist response params +func (o *CreateServiceChecklistResponseParams) WithCreateServiceChecklistResponse(createServiceChecklistResponse *models.CreateServiceChecklistResponse) *CreateServiceChecklistResponseParams { + o.SetCreateServiceChecklistResponse(createServiceChecklistResponse) + return o +} + +// SetCreateServiceChecklistResponse adds the createServiceChecklistResponse to the create service checklist response params +func (o *CreateServiceChecklistResponseParams) SetCreateServiceChecklistResponse(createServiceChecklistResponse *models.CreateServiceChecklistResponse) { + o.CreateServiceChecklistResponse = createServiceChecklistResponse +} + +// WithServiceID adds the serviceID to the create service checklist response params +func (o *CreateServiceChecklistResponseParams) WithServiceID(serviceID string) *CreateServiceChecklistResponseParams { + o.SetServiceID(serviceID) + return o +} + +// SetServiceID adds the serviceId to the create service checklist response params +func (o *CreateServiceChecklistResponseParams) SetServiceID(serviceID string) { + o.ServiceID = serviceID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateServiceChecklistResponseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param checklist_id + if err := r.SetPathParam("checklist_id", o.ChecklistID); err != nil { + return err + } + if o.CreateServiceChecklistResponse != nil { + if err := r.SetBodyParam(o.CreateServiceChecklistResponse); err != nil { + return err + } + } + + // path param service_id + if err := r.SetPathParam("service_id", o.ServiceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/create_service_checklist_response_responses.go b/client/catalog_entries/create_service_checklist_response_responses.go new file mode 100644 index 0000000..e4df9b0 --- /dev/null +++ b/client/catalog_entries/create_service_checklist_response_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateServiceChecklistResponseReader is a Reader for the CreateServiceChecklistResponse structure. +type CreateServiceChecklistResponseReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateServiceChecklistResponseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateServiceChecklistResponseCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateServiceChecklistResponseCreated creates a CreateServiceChecklistResponseCreated with default headers values +func NewCreateServiceChecklistResponseCreated() *CreateServiceChecklistResponseCreated { + return &CreateServiceChecklistResponseCreated{} +} + +/* +CreateServiceChecklistResponseCreated describes a response with status code 201, with default header values. + +Creates a response for a checklist item +*/ +type CreateServiceChecklistResponseCreated struct { +} + +// IsSuccess returns true when this create service checklist response created response has a 2xx status code +func (o *CreateServiceChecklistResponseCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create service checklist response created response has a 3xx status code +func (o *CreateServiceChecklistResponseCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create service checklist response created response has a 4xx status code +func (o *CreateServiceChecklistResponseCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create service checklist response created response has a 5xx status code +func (o *CreateServiceChecklistResponseCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create service checklist response created response a status code equal to that given +func (o *CreateServiceChecklistResponseCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateServiceChecklistResponseCreated) Error() string { + return fmt.Sprintf("[POST /v1/services/{service_id}/checklist_response/{checklist_id}][%d] createServiceChecklistResponseCreated ", 201) +} + +func (o *CreateServiceChecklistResponseCreated) String() string { + return fmt.Sprintf("[POST /v1/services/{service_id}/checklist_response/{checklist_id}][%d] createServiceChecklistResponseCreated ", 201) +} + +func (o *CreateServiceChecklistResponseCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/catalog_entries/create_service_dependency_parameters.go b/client/catalog_entries/create_service_dependency_parameters.go new file mode 100644 index 0000000..1bbd771 --- /dev/null +++ b/client/catalog_entries/create_service_dependency_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateServiceDependencyParams creates a new CreateServiceDependencyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateServiceDependencyParams() *CreateServiceDependencyParams { + return &CreateServiceDependencyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateServiceDependencyParamsWithTimeout creates a new CreateServiceDependencyParams object +// with the ability to set a timeout on a request. +func NewCreateServiceDependencyParamsWithTimeout(timeout time.Duration) *CreateServiceDependencyParams { + return &CreateServiceDependencyParams{ + timeout: timeout, + } +} + +// NewCreateServiceDependencyParamsWithContext creates a new CreateServiceDependencyParams object +// with the ability to set a context for a request. +func NewCreateServiceDependencyParamsWithContext(ctx context.Context) *CreateServiceDependencyParams { + return &CreateServiceDependencyParams{ + Context: ctx, + } +} + +// NewCreateServiceDependencyParamsWithHTTPClient creates a new CreateServiceDependencyParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateServiceDependencyParamsWithHTTPClient(client *http.Client) *CreateServiceDependencyParams { + return &CreateServiceDependencyParams{ + HTTPClient: client, + } +} + +/* +CreateServiceDependencyParams contains all the parameters to send to the API endpoint + + for the create service dependency operation. + + Typically these are written to a http.Request. +*/ +type CreateServiceDependencyParams struct { + + // CreateServiceDependency. + CreateServiceDependency *models.CreateServiceDependency + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create service dependency params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateServiceDependencyParams) WithDefaults() *CreateServiceDependencyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create service dependency params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateServiceDependencyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create service dependency params +func (o *CreateServiceDependencyParams) WithTimeout(timeout time.Duration) *CreateServiceDependencyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create service dependency params +func (o *CreateServiceDependencyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create service dependency params +func (o *CreateServiceDependencyParams) WithContext(ctx context.Context) *CreateServiceDependencyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create service dependency params +func (o *CreateServiceDependencyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create service dependency params +func (o *CreateServiceDependencyParams) WithHTTPClient(client *http.Client) *CreateServiceDependencyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create service dependency params +func (o *CreateServiceDependencyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateServiceDependency adds the createServiceDependency to the create service dependency params +func (o *CreateServiceDependencyParams) WithCreateServiceDependency(createServiceDependency *models.CreateServiceDependency) *CreateServiceDependencyParams { + o.SetCreateServiceDependency(createServiceDependency) + return o +} + +// SetCreateServiceDependency adds the createServiceDependency to the create service dependency params +func (o *CreateServiceDependencyParams) SetCreateServiceDependency(createServiceDependency *models.CreateServiceDependency) { + o.CreateServiceDependency = createServiceDependency +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateServiceDependencyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateServiceDependency != nil { + if err := r.SetBodyParam(o.CreateServiceDependency); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/create_service_dependency_responses.go b/client/catalog_entries/create_service_dependency_responses.go new file mode 100644 index 0000000..5a0681c --- /dev/null +++ b/client/catalog_entries/create_service_dependency_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateServiceDependencyReader is a Reader for the CreateServiceDependency structure. +type CreateServiceDependencyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateServiceDependencyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateServiceDependencyCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateServiceDependencyCreated creates a CreateServiceDependencyCreated with default headers values +func NewCreateServiceDependencyCreated() *CreateServiceDependencyCreated { + return &CreateServiceDependencyCreated{} +} + +/* +CreateServiceDependencyCreated describes a response with status code 201, with default header values. + +Creates a service dependency relationship between two services +*/ +type CreateServiceDependencyCreated struct { + Payload *models.ServiceDependencyEntity +} + +// IsSuccess returns true when this create service dependency created response has a 2xx status code +func (o *CreateServiceDependencyCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create service dependency created response has a 3xx status code +func (o *CreateServiceDependencyCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create service dependency created response has a 4xx status code +func (o *CreateServiceDependencyCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create service dependency created response has a 5xx status code +func (o *CreateServiceDependencyCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create service dependency created response a status code equal to that given +func (o *CreateServiceDependencyCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateServiceDependencyCreated) Error() string { + return fmt.Sprintf("[POST /v1/service_dependencies][%d] createServiceDependencyCreated %+v", 201, o.Payload) +} + +func (o *CreateServiceDependencyCreated) String() string { + return fmt.Sprintf("[POST /v1/service_dependencies][%d] createServiceDependencyCreated %+v", 201, o.Payload) +} + +func (o *CreateServiceDependencyCreated) GetPayload() *models.ServiceDependencyEntity { + return o.Payload +} + +func (o *CreateServiceDependencyCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceDependencyEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/create_service_links_parameters.go b/client/catalog_entries/create_service_links_parameters.go new file mode 100644 index 0000000..306d570 --- /dev/null +++ b/client/catalog_entries/create_service_links_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateServiceLinksParams creates a new CreateServiceLinksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateServiceLinksParams() *CreateServiceLinksParams { + return &CreateServiceLinksParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateServiceLinksParamsWithTimeout creates a new CreateServiceLinksParams object +// with the ability to set a timeout on a request. +func NewCreateServiceLinksParamsWithTimeout(timeout time.Duration) *CreateServiceLinksParams { + return &CreateServiceLinksParams{ + timeout: timeout, + } +} + +// NewCreateServiceLinksParamsWithContext creates a new CreateServiceLinksParams object +// with the ability to set a context for a request. +func NewCreateServiceLinksParamsWithContext(ctx context.Context) *CreateServiceLinksParams { + return &CreateServiceLinksParams{ + Context: ctx, + } +} + +// NewCreateServiceLinksParamsWithHTTPClient creates a new CreateServiceLinksParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateServiceLinksParamsWithHTTPClient(client *http.Client) *CreateServiceLinksParams { + return &CreateServiceLinksParams{ + HTTPClient: client, + } +} + +/* +CreateServiceLinksParams contains all the parameters to send to the API endpoint + + for the create service links operation. + + Typically these are written to a http.Request. +*/ +type CreateServiceLinksParams struct { + + // CreateServiceLinks. + CreateServiceLinks *models.CreateServiceLinks + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create service links params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateServiceLinksParams) WithDefaults() *CreateServiceLinksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create service links params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateServiceLinksParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create service links params +func (o *CreateServiceLinksParams) WithTimeout(timeout time.Duration) *CreateServiceLinksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create service links params +func (o *CreateServiceLinksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create service links params +func (o *CreateServiceLinksParams) WithContext(ctx context.Context) *CreateServiceLinksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create service links params +func (o *CreateServiceLinksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create service links params +func (o *CreateServiceLinksParams) WithHTTPClient(client *http.Client) *CreateServiceLinksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create service links params +func (o *CreateServiceLinksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateServiceLinks adds the createServiceLinks to the create service links params +func (o *CreateServiceLinksParams) WithCreateServiceLinks(createServiceLinks *models.CreateServiceLinks) *CreateServiceLinksParams { + o.SetCreateServiceLinks(createServiceLinks) + return o +} + +// SetCreateServiceLinks adds the createServiceLinks to the create service links params +func (o *CreateServiceLinksParams) SetCreateServiceLinks(createServiceLinks *models.CreateServiceLinks) { + o.CreateServiceLinks = createServiceLinks +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateServiceLinksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateServiceLinks != nil { + if err := r.SetBodyParam(o.CreateServiceLinks); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/create_service_links_responses.go b/client/catalog_entries/create_service_links_responses.go new file mode 100644 index 0000000..ac0484a --- /dev/null +++ b/client/catalog_entries/create_service_links_responses.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateServiceLinksReader is a Reader for the CreateServiceLinks structure. +type CreateServiceLinksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateServiceLinksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateServiceLinksCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateServiceLinksCreated creates a CreateServiceLinksCreated with default headers values +func NewCreateServiceLinksCreated() *CreateServiceLinksCreated { + return &CreateServiceLinksCreated{} +} + +/* +CreateServiceLinksCreated describes a response with status code 201, with default header values. + +Creates a service with the appropriate integration for each external service ID passed +*/ +type CreateServiceLinksCreated struct { + Payload []*models.ServiceLinkEntity +} + +// IsSuccess returns true when this create service links created response has a 2xx status code +func (o *CreateServiceLinksCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create service links created response has a 3xx status code +func (o *CreateServiceLinksCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create service links created response has a 4xx status code +func (o *CreateServiceLinksCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create service links created response has a 5xx status code +func (o *CreateServiceLinksCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create service links created response a status code equal to that given +func (o *CreateServiceLinksCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateServiceLinksCreated) Error() string { + return fmt.Sprintf("[POST /v1/services/service_links][%d] createServiceLinksCreated %+v", 201, o.Payload) +} + +func (o *CreateServiceLinksCreated) String() string { + return fmt.Sprintf("[POST /v1/services/service_links][%d] createServiceLinksCreated %+v", 201, o.Payload) +} + +func (o *CreateServiceLinksCreated) GetPayload() []*models.ServiceLinkEntity { + return o.Payload +} + +func (o *CreateServiceLinksCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/create_service_parameters.go b/client/catalog_entries/create_service_parameters.go new file mode 100644 index 0000000..d625165 --- /dev/null +++ b/client/catalog_entries/create_service_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateServiceParams creates a new CreateServiceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateServiceParams() *CreateServiceParams { + return &CreateServiceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateServiceParamsWithTimeout creates a new CreateServiceParams object +// with the ability to set a timeout on a request. +func NewCreateServiceParamsWithTimeout(timeout time.Duration) *CreateServiceParams { + return &CreateServiceParams{ + timeout: timeout, + } +} + +// NewCreateServiceParamsWithContext creates a new CreateServiceParams object +// with the ability to set a context for a request. +func NewCreateServiceParamsWithContext(ctx context.Context) *CreateServiceParams { + return &CreateServiceParams{ + Context: ctx, + } +} + +// NewCreateServiceParamsWithHTTPClient creates a new CreateServiceParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateServiceParamsWithHTTPClient(client *http.Client) *CreateServiceParams { + return &CreateServiceParams{ + HTTPClient: client, + } +} + +/* +CreateServiceParams contains all the parameters to send to the API endpoint + + for the create service operation. + + Typically these are written to a http.Request. +*/ +type CreateServiceParams struct { + + // CreateService. + CreateService *models.CreateService + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateServiceParams) WithDefaults() *CreateServiceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateServiceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create service params +func (o *CreateServiceParams) WithTimeout(timeout time.Duration) *CreateServiceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create service params +func (o *CreateServiceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create service params +func (o *CreateServiceParams) WithContext(ctx context.Context) *CreateServiceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create service params +func (o *CreateServiceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create service params +func (o *CreateServiceParams) WithHTTPClient(client *http.Client) *CreateServiceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create service params +func (o *CreateServiceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateService adds the createService to the create service params +func (o *CreateServiceParams) WithCreateService(createService *models.CreateService) *CreateServiceParams { + o.SetCreateService(createService) + return o +} + +// SetCreateService adds the createService to the create service params +func (o *CreateServiceParams) SetCreateService(createService *models.CreateService) { + o.CreateService = createService +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateService != nil { + if err := r.SetBodyParam(o.CreateService); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/create_service_responses.go b/client/catalog_entries/create_service_responses.go new file mode 100644 index 0000000..076147e --- /dev/null +++ b/client/catalog_entries/create_service_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateServiceReader is a Reader for the CreateService structure. +type CreateServiceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateServiceCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateServiceBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateServiceCreated creates a CreateServiceCreated with default headers values +func NewCreateServiceCreated() *CreateServiceCreated { + return &CreateServiceCreated{} +} + +/* +CreateServiceCreated describes a response with status code 201, with default header values. + +Creates a service for the organization, you may also create or attach functionalities to the service on create. +*/ +type CreateServiceCreated struct { + Payload *models.ServiceEntity +} + +// IsSuccess returns true when this create service created response has a 2xx status code +func (o *CreateServiceCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create service created response has a 3xx status code +func (o *CreateServiceCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create service created response has a 4xx status code +func (o *CreateServiceCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create service created response has a 5xx status code +func (o *CreateServiceCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create service created response a status code equal to that given +func (o *CreateServiceCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateServiceCreated) Error() string { + return fmt.Sprintf("[POST /v1/services][%d] createServiceCreated %+v", 201, o.Payload) +} + +func (o *CreateServiceCreated) String() string { + return fmt.Sprintf("[POST /v1/services][%d] createServiceCreated %+v", 201, o.Payload) +} + +func (o *CreateServiceCreated) GetPayload() *models.ServiceEntity { + return o.Payload +} + +func (o *CreateServiceCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateServiceBadRequest creates a CreateServiceBadRequest with default headers values +func NewCreateServiceBadRequest() *CreateServiceBadRequest { + return &CreateServiceBadRequest{} +} + +/* +CreateServiceBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type CreateServiceBadRequest struct { + Payload *models.ErrorEntity +} + +// IsSuccess returns true when this create service bad request response has a 2xx status code +func (o *CreateServiceBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create service bad request response has a 3xx status code +func (o *CreateServiceBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create service bad request response has a 4xx status code +func (o *CreateServiceBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create service bad request response has a 5xx status code +func (o *CreateServiceBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create service bad request response a status code equal to that given +func (o *CreateServiceBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *CreateServiceBadRequest) Error() string { + return fmt.Sprintf("[POST /v1/services][%d] createServiceBadRequest %+v", 400, o.Payload) +} + +func (o *CreateServiceBadRequest) String() string { + return fmt.Sprintf("[POST /v1/services][%d] createServiceBadRequest %+v", 400, o.Payload) +} + +func (o *CreateServiceBadRequest) GetPayload() *models.ErrorEntity { + return o.Payload +} + +func (o *CreateServiceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/delete_environment_parameters.go b/client/catalog_entries/delete_environment_parameters.go new file mode 100644 index 0000000..eb11155 --- /dev/null +++ b/client/catalog_entries/delete_environment_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteEnvironmentParams creates a new DeleteEnvironmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteEnvironmentParams() *DeleteEnvironmentParams { + return &DeleteEnvironmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteEnvironmentParamsWithTimeout creates a new DeleteEnvironmentParams object +// with the ability to set a timeout on a request. +func NewDeleteEnvironmentParamsWithTimeout(timeout time.Duration) *DeleteEnvironmentParams { + return &DeleteEnvironmentParams{ + timeout: timeout, + } +} + +// NewDeleteEnvironmentParamsWithContext creates a new DeleteEnvironmentParams object +// with the ability to set a context for a request. +func NewDeleteEnvironmentParamsWithContext(ctx context.Context) *DeleteEnvironmentParams { + return &DeleteEnvironmentParams{ + Context: ctx, + } +} + +// NewDeleteEnvironmentParamsWithHTTPClient creates a new DeleteEnvironmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteEnvironmentParamsWithHTTPClient(client *http.Client) *DeleteEnvironmentParams { + return &DeleteEnvironmentParams{ + HTTPClient: client, + } +} + +/* +DeleteEnvironmentParams contains all the parameters to send to the API endpoint + + for the delete environment operation. + + Typically these are written to a http.Request. +*/ +type DeleteEnvironmentParams struct { + + /* EnvironmentID. + + Environment UUID + */ + EnvironmentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteEnvironmentParams) WithDefaults() *DeleteEnvironmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteEnvironmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete environment params +func (o *DeleteEnvironmentParams) WithTimeout(timeout time.Duration) *DeleteEnvironmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete environment params +func (o *DeleteEnvironmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete environment params +func (o *DeleteEnvironmentParams) WithContext(ctx context.Context) *DeleteEnvironmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete environment params +func (o *DeleteEnvironmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete environment params +func (o *DeleteEnvironmentParams) WithHTTPClient(client *http.Client) *DeleteEnvironmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete environment params +func (o *DeleteEnvironmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEnvironmentID adds the environmentID to the delete environment params +func (o *DeleteEnvironmentParams) WithEnvironmentID(environmentID string) *DeleteEnvironmentParams { + o.SetEnvironmentID(environmentID) + return o +} + +// SetEnvironmentID adds the environmentId to the delete environment params +func (o *DeleteEnvironmentParams) SetEnvironmentID(environmentID string) { + o.EnvironmentID = environmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteEnvironmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param environment_id + if err := r.SetPathParam("environment_id", o.EnvironmentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/delete_environment_responses.go b/client/catalog_entries/delete_environment_responses.go new file mode 100644 index 0000000..a084a88 --- /dev/null +++ b/client/catalog_entries/delete_environment_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteEnvironmentReader is a Reader for the DeleteEnvironment structure. +type DeleteEnvironmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteEnvironmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteEnvironmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteEnvironmentOK creates a DeleteEnvironmentOK with default headers values +func NewDeleteEnvironmentOK() *DeleteEnvironmentOK { + return &DeleteEnvironmentOK{} +} + +/* +DeleteEnvironmentOK describes a response with status code 200, with default header values. + +Archive an environment +*/ +type DeleteEnvironmentOK struct { + Payload *models.EnvironmentEntryEntity +} + +// IsSuccess returns true when this delete environment o k response has a 2xx status code +func (o *DeleteEnvironmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete environment o k response has a 3xx status code +func (o *DeleteEnvironmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete environment o k response has a 4xx status code +func (o *DeleteEnvironmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete environment o k response has a 5xx status code +func (o *DeleteEnvironmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete environment o k response a status code equal to that given +func (o *DeleteEnvironmentOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteEnvironmentOK) Error() string { + return fmt.Sprintf("[DELETE /v1/environments/{environment_id}][%d] deleteEnvironmentOK %+v", 200, o.Payload) +} + +func (o *DeleteEnvironmentOK) String() string { + return fmt.Sprintf("[DELETE /v1/environments/{environment_id}][%d] deleteEnvironmentOK %+v", 200, o.Payload) +} + +func (o *DeleteEnvironmentOK) GetPayload() *models.EnvironmentEntryEntity { + return o.Payload +} + +func (o *DeleteEnvironmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.EnvironmentEntryEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/delete_functionality_parameters.go b/client/catalog_entries/delete_functionality_parameters.go new file mode 100644 index 0000000..0de1b91 --- /dev/null +++ b/client/catalog_entries/delete_functionality_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteFunctionalityParams creates a new DeleteFunctionalityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteFunctionalityParams() *DeleteFunctionalityParams { + return &DeleteFunctionalityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteFunctionalityParamsWithTimeout creates a new DeleteFunctionalityParams object +// with the ability to set a timeout on a request. +func NewDeleteFunctionalityParamsWithTimeout(timeout time.Duration) *DeleteFunctionalityParams { + return &DeleteFunctionalityParams{ + timeout: timeout, + } +} + +// NewDeleteFunctionalityParamsWithContext creates a new DeleteFunctionalityParams object +// with the ability to set a context for a request. +func NewDeleteFunctionalityParamsWithContext(ctx context.Context) *DeleteFunctionalityParams { + return &DeleteFunctionalityParams{ + Context: ctx, + } +} + +// NewDeleteFunctionalityParamsWithHTTPClient creates a new DeleteFunctionalityParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteFunctionalityParamsWithHTTPClient(client *http.Client) *DeleteFunctionalityParams { + return &DeleteFunctionalityParams{ + HTTPClient: client, + } +} + +/* +DeleteFunctionalityParams contains all the parameters to send to the API endpoint + + for the delete functionality operation. + + Typically these are written to a http.Request. +*/ +type DeleteFunctionalityParams struct { + + // FunctionalityID. + FunctionalityID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete functionality params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteFunctionalityParams) WithDefaults() *DeleteFunctionalityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete functionality params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteFunctionalityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete functionality params +func (o *DeleteFunctionalityParams) WithTimeout(timeout time.Duration) *DeleteFunctionalityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete functionality params +func (o *DeleteFunctionalityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete functionality params +func (o *DeleteFunctionalityParams) WithContext(ctx context.Context) *DeleteFunctionalityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete functionality params +func (o *DeleteFunctionalityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete functionality params +func (o *DeleteFunctionalityParams) WithHTTPClient(client *http.Client) *DeleteFunctionalityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete functionality params +func (o *DeleteFunctionalityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFunctionalityID adds the functionalityID to the delete functionality params +func (o *DeleteFunctionalityParams) WithFunctionalityID(functionalityID string) *DeleteFunctionalityParams { + o.SetFunctionalityID(functionalityID) + return o +} + +// SetFunctionalityID adds the functionalityId to the delete functionality params +func (o *DeleteFunctionalityParams) SetFunctionalityID(functionalityID string) { + o.FunctionalityID = functionalityID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteFunctionalityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param functionality_id + if err := r.SetPathParam("functionality_id", o.FunctionalityID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/delete_functionality_responses.go b/client/catalog_entries/delete_functionality_responses.go new file mode 100644 index 0000000..1b3bb80 --- /dev/null +++ b/client/catalog_entries/delete_functionality_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteFunctionalityReader is a Reader for the DeleteFunctionality structure. +type DeleteFunctionalityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteFunctionalityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteFunctionalityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteFunctionalityOK creates a DeleteFunctionalityOK with default headers values +func NewDeleteFunctionalityOK() *DeleteFunctionalityOK { + return &DeleteFunctionalityOK{} +} + +/* +DeleteFunctionalityOK describes a response with status code 200, with default header values. + +Archive a functionality +*/ +type DeleteFunctionalityOK struct { + Payload *models.FunctionalityEntity +} + +// IsSuccess returns true when this delete functionality o k response has a 2xx status code +func (o *DeleteFunctionalityOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete functionality o k response has a 3xx status code +func (o *DeleteFunctionalityOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete functionality o k response has a 4xx status code +func (o *DeleteFunctionalityOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete functionality o k response has a 5xx status code +func (o *DeleteFunctionalityOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete functionality o k response a status code equal to that given +func (o *DeleteFunctionalityOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteFunctionalityOK) Error() string { + return fmt.Sprintf("[DELETE /v1/functionalities/{functionality_id}][%d] deleteFunctionalityOK %+v", 200, o.Payload) +} + +func (o *DeleteFunctionalityOK) String() string { + return fmt.Sprintf("[DELETE /v1/functionalities/{functionality_id}][%d] deleteFunctionalityOK %+v", 200, o.Payload) +} + +func (o *DeleteFunctionalityOK) GetPayload() *models.FunctionalityEntity { + return o.Payload +} + +func (o *DeleteFunctionalityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FunctionalityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/delete_service_dependency_parameters.go b/client/catalog_entries/delete_service_dependency_parameters.go new file mode 100644 index 0000000..8391bfc --- /dev/null +++ b/client/catalog_entries/delete_service_dependency_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteServiceDependencyParams creates a new DeleteServiceDependencyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteServiceDependencyParams() *DeleteServiceDependencyParams { + return &DeleteServiceDependencyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteServiceDependencyParamsWithTimeout creates a new DeleteServiceDependencyParams object +// with the ability to set a timeout on a request. +func NewDeleteServiceDependencyParamsWithTimeout(timeout time.Duration) *DeleteServiceDependencyParams { + return &DeleteServiceDependencyParams{ + timeout: timeout, + } +} + +// NewDeleteServiceDependencyParamsWithContext creates a new DeleteServiceDependencyParams object +// with the ability to set a context for a request. +func NewDeleteServiceDependencyParamsWithContext(ctx context.Context) *DeleteServiceDependencyParams { + return &DeleteServiceDependencyParams{ + Context: ctx, + } +} + +// NewDeleteServiceDependencyParamsWithHTTPClient creates a new DeleteServiceDependencyParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteServiceDependencyParamsWithHTTPClient(client *http.Client) *DeleteServiceDependencyParams { + return &DeleteServiceDependencyParams{ + HTTPClient: client, + } +} + +/* +DeleteServiceDependencyParams contains all the parameters to send to the API endpoint + + for the delete service dependency operation. + + Typically these are written to a http.Request. +*/ +type DeleteServiceDependencyParams struct { + + // ServiceDependencyID. + ServiceDependencyID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete service dependency params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteServiceDependencyParams) WithDefaults() *DeleteServiceDependencyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete service dependency params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteServiceDependencyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete service dependency params +func (o *DeleteServiceDependencyParams) WithTimeout(timeout time.Duration) *DeleteServiceDependencyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete service dependency params +func (o *DeleteServiceDependencyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete service dependency params +func (o *DeleteServiceDependencyParams) WithContext(ctx context.Context) *DeleteServiceDependencyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete service dependency params +func (o *DeleteServiceDependencyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete service dependency params +func (o *DeleteServiceDependencyParams) WithHTTPClient(client *http.Client) *DeleteServiceDependencyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete service dependency params +func (o *DeleteServiceDependencyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithServiceDependencyID adds the serviceDependencyID to the delete service dependency params +func (o *DeleteServiceDependencyParams) WithServiceDependencyID(serviceDependencyID string) *DeleteServiceDependencyParams { + o.SetServiceDependencyID(serviceDependencyID) + return o +} + +// SetServiceDependencyID adds the serviceDependencyId to the delete service dependency params +func (o *DeleteServiceDependencyParams) SetServiceDependencyID(serviceDependencyID string) { + o.ServiceDependencyID = serviceDependencyID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteServiceDependencyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param service_dependency_id + if err := r.SetPathParam("service_dependency_id", o.ServiceDependencyID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/delete_service_dependency_responses.go b/client/catalog_entries/delete_service_dependency_responses.go new file mode 100644 index 0000000..b8e71aa --- /dev/null +++ b/client/catalog_entries/delete_service_dependency_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteServiceDependencyReader is a Reader for the DeleteServiceDependency structure. +type DeleteServiceDependencyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteServiceDependencyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteServiceDependencyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteServiceDependencyOK creates a DeleteServiceDependencyOK with default headers values +func NewDeleteServiceDependencyOK() *DeleteServiceDependencyOK { + return &DeleteServiceDependencyOK{} +} + +/* +DeleteServiceDependencyOK describes a response with status code 200, with default header values. + +Deletes a single service dependency +*/ +type DeleteServiceDependencyOK struct { + Payload *models.ServiceDependencyEntity +} + +// IsSuccess returns true when this delete service dependency o k response has a 2xx status code +func (o *DeleteServiceDependencyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete service dependency o k response has a 3xx status code +func (o *DeleteServiceDependencyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete service dependency o k response has a 4xx status code +func (o *DeleteServiceDependencyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete service dependency o k response has a 5xx status code +func (o *DeleteServiceDependencyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete service dependency o k response a status code equal to that given +func (o *DeleteServiceDependencyOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteServiceDependencyOK) Error() string { + return fmt.Sprintf("[DELETE /v1/service_dependencies/{service_dependency_id}][%d] deleteServiceDependencyOK %+v", 200, o.Payload) +} + +func (o *DeleteServiceDependencyOK) String() string { + return fmt.Sprintf("[DELETE /v1/service_dependencies/{service_dependency_id}][%d] deleteServiceDependencyOK %+v", 200, o.Payload) +} + +func (o *DeleteServiceDependencyOK) GetPayload() *models.ServiceDependencyEntity { + return o.Payload +} + +func (o *DeleteServiceDependencyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceDependencyEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/delete_service_link_parameters.go b/client/catalog_entries/delete_service_link_parameters.go new file mode 100644 index 0000000..c03082c --- /dev/null +++ b/client/catalog_entries/delete_service_link_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteServiceLinkParams creates a new DeleteServiceLinkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteServiceLinkParams() *DeleteServiceLinkParams { + return &DeleteServiceLinkParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteServiceLinkParamsWithTimeout creates a new DeleteServiceLinkParams object +// with the ability to set a timeout on a request. +func NewDeleteServiceLinkParamsWithTimeout(timeout time.Duration) *DeleteServiceLinkParams { + return &DeleteServiceLinkParams{ + timeout: timeout, + } +} + +// NewDeleteServiceLinkParamsWithContext creates a new DeleteServiceLinkParams object +// with the ability to set a context for a request. +func NewDeleteServiceLinkParamsWithContext(ctx context.Context) *DeleteServiceLinkParams { + return &DeleteServiceLinkParams{ + Context: ctx, + } +} + +// NewDeleteServiceLinkParamsWithHTTPClient creates a new DeleteServiceLinkParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteServiceLinkParamsWithHTTPClient(client *http.Client) *DeleteServiceLinkParams { + return &DeleteServiceLinkParams{ + HTTPClient: client, + } +} + +/* +DeleteServiceLinkParams contains all the parameters to send to the API endpoint + + for the delete service link operation. + + Typically these are written to a http.Request. +*/ +type DeleteServiceLinkParams struct { + + /* RemoteID. + + The external service ID which can be found in the JSON + from GET services/:service_id endpoint under + functionalities > external_resources > remote_id + + */ + RemoteID string + + // ServiceID. + ServiceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete service link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteServiceLinkParams) WithDefaults() *DeleteServiceLinkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete service link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteServiceLinkParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete service link params +func (o *DeleteServiceLinkParams) WithTimeout(timeout time.Duration) *DeleteServiceLinkParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete service link params +func (o *DeleteServiceLinkParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete service link params +func (o *DeleteServiceLinkParams) WithContext(ctx context.Context) *DeleteServiceLinkParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete service link params +func (o *DeleteServiceLinkParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete service link params +func (o *DeleteServiceLinkParams) WithHTTPClient(client *http.Client) *DeleteServiceLinkParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete service link params +func (o *DeleteServiceLinkParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRemoteID adds the remoteID to the delete service link params +func (o *DeleteServiceLinkParams) WithRemoteID(remoteID string) *DeleteServiceLinkParams { + o.SetRemoteID(remoteID) + return o +} + +// SetRemoteID adds the remoteId to the delete service link params +func (o *DeleteServiceLinkParams) SetRemoteID(remoteID string) { + o.RemoteID = remoteID +} + +// WithServiceID adds the serviceID to the delete service link params +func (o *DeleteServiceLinkParams) WithServiceID(serviceID string) *DeleteServiceLinkParams { + o.SetServiceID(serviceID) + return o +} + +// SetServiceID adds the serviceId to the delete service link params +func (o *DeleteServiceLinkParams) SetServiceID(serviceID string) { + o.ServiceID = serviceID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteServiceLinkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param remote_id + if err := r.SetPathParam("remote_id", o.RemoteID); err != nil { + return err + } + + // path param service_id + if err := r.SetPathParam("service_id", o.ServiceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/delete_service_link_responses.go b/client/catalog_entries/delete_service_link_responses.go new file mode 100644 index 0000000..2eefa7b --- /dev/null +++ b/client/catalog_entries/delete_service_link_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteServiceLinkReader is a Reader for the DeleteServiceLink structure. +type DeleteServiceLinkReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteServiceLinkReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteServiceLinkNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteServiceLinkNoContent creates a DeleteServiceLinkNoContent with default headers values +func NewDeleteServiceLinkNoContent() *DeleteServiceLinkNoContent { + return &DeleteServiceLinkNoContent{} +} + +/* +DeleteServiceLinkNoContent describes a response with status code 204, with default header values. + +Deletes a service link from FireHydrant. +*/ +type DeleteServiceLinkNoContent struct { +} + +// IsSuccess returns true when this delete service link no content response has a 2xx status code +func (o *DeleteServiceLinkNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete service link no content response has a 3xx status code +func (o *DeleteServiceLinkNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete service link no content response has a 4xx status code +func (o *DeleteServiceLinkNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete service link no content response has a 5xx status code +func (o *DeleteServiceLinkNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete service link no content response a status code equal to that given +func (o *DeleteServiceLinkNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteServiceLinkNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/services/{service_id}/service_links/{remote_id}][%d] deleteServiceLinkNoContent ", 204) +} + +func (o *DeleteServiceLinkNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/services/{service_id}/service_links/{remote_id}][%d] deleteServiceLinkNoContent ", 204) +} + +func (o *DeleteServiceLinkNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/catalog_entries/delete_service_parameters.go b/client/catalog_entries/delete_service_parameters.go new file mode 100644 index 0000000..d2ec47d --- /dev/null +++ b/client/catalog_entries/delete_service_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteServiceParams creates a new DeleteServiceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteServiceParams() *DeleteServiceParams { + return &DeleteServiceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteServiceParamsWithTimeout creates a new DeleteServiceParams object +// with the ability to set a timeout on a request. +func NewDeleteServiceParamsWithTimeout(timeout time.Duration) *DeleteServiceParams { + return &DeleteServiceParams{ + timeout: timeout, + } +} + +// NewDeleteServiceParamsWithContext creates a new DeleteServiceParams object +// with the ability to set a context for a request. +func NewDeleteServiceParamsWithContext(ctx context.Context) *DeleteServiceParams { + return &DeleteServiceParams{ + Context: ctx, + } +} + +// NewDeleteServiceParamsWithHTTPClient creates a new DeleteServiceParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteServiceParamsWithHTTPClient(client *http.Client) *DeleteServiceParams { + return &DeleteServiceParams{ + HTTPClient: client, + } +} + +/* +DeleteServiceParams contains all the parameters to send to the API endpoint + + for the delete service operation. + + Typically these are written to a http.Request. +*/ +type DeleteServiceParams struct { + + // ServiceID. + ServiceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteServiceParams) WithDefaults() *DeleteServiceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteServiceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete service params +func (o *DeleteServiceParams) WithTimeout(timeout time.Duration) *DeleteServiceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete service params +func (o *DeleteServiceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete service params +func (o *DeleteServiceParams) WithContext(ctx context.Context) *DeleteServiceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete service params +func (o *DeleteServiceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete service params +func (o *DeleteServiceParams) WithHTTPClient(client *http.Client) *DeleteServiceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete service params +func (o *DeleteServiceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithServiceID adds the serviceID to the delete service params +func (o *DeleteServiceParams) WithServiceID(serviceID string) *DeleteServiceParams { + o.SetServiceID(serviceID) + return o +} + +// SetServiceID adds the serviceId to the delete service params +func (o *DeleteServiceParams) SetServiceID(serviceID string) { + o.ServiceID = serviceID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param service_id + if err := r.SetPathParam("service_id", o.ServiceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/delete_service_responses.go b/client/catalog_entries/delete_service_responses.go new file mode 100644 index 0000000..ccdbc07 --- /dev/null +++ b/client/catalog_entries/delete_service_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteServiceReader is a Reader for the DeleteService structure. +type DeleteServiceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteServiceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteServiceOK creates a DeleteServiceOK with default headers values +func NewDeleteServiceOK() *DeleteServiceOK { + return &DeleteServiceOK{} +} + +/* +DeleteServiceOK describes a response with status code 200, with default header values. + +Deletes the service from FireHydrant. +*/ +type DeleteServiceOK struct { + Payload *models.ServiceEntity +} + +// IsSuccess returns true when this delete service o k response has a 2xx status code +func (o *DeleteServiceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete service o k response has a 3xx status code +func (o *DeleteServiceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete service o k response has a 4xx status code +func (o *DeleteServiceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete service o k response has a 5xx status code +func (o *DeleteServiceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete service o k response a status code equal to that given +func (o *DeleteServiceOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteServiceOK) Error() string { + return fmt.Sprintf("[DELETE /v1/services/{service_id}][%d] deleteServiceOK %+v", 200, o.Payload) +} + +func (o *DeleteServiceOK) String() string { + return fmt.Sprintf("[DELETE /v1/services/{service_id}][%d] deleteServiceOK %+v", 200, o.Payload) +} + +func (o *DeleteServiceOK) GetPayload() *models.ServiceEntity { + return o.Payload +} + +func (o *DeleteServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/get_environment_parameters.go b/client/catalog_entries/get_environment_parameters.go new file mode 100644 index 0000000..b378dae --- /dev/null +++ b/client/catalog_entries/get_environment_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetEnvironmentParams creates a new GetEnvironmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetEnvironmentParams() *GetEnvironmentParams { + return &GetEnvironmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetEnvironmentParamsWithTimeout creates a new GetEnvironmentParams object +// with the ability to set a timeout on a request. +func NewGetEnvironmentParamsWithTimeout(timeout time.Duration) *GetEnvironmentParams { + return &GetEnvironmentParams{ + timeout: timeout, + } +} + +// NewGetEnvironmentParamsWithContext creates a new GetEnvironmentParams object +// with the ability to set a context for a request. +func NewGetEnvironmentParamsWithContext(ctx context.Context) *GetEnvironmentParams { + return &GetEnvironmentParams{ + Context: ctx, + } +} + +// NewGetEnvironmentParamsWithHTTPClient creates a new GetEnvironmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetEnvironmentParamsWithHTTPClient(client *http.Client) *GetEnvironmentParams { + return &GetEnvironmentParams{ + HTTPClient: client, + } +} + +/* +GetEnvironmentParams contains all the parameters to send to the API endpoint + + for the get environment operation. + + Typically these are written to a http.Request. +*/ +type GetEnvironmentParams struct { + + /* EnvironmentID. + + Environment UUID + */ + EnvironmentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEnvironmentParams) WithDefaults() *GetEnvironmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetEnvironmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get environment params +func (o *GetEnvironmentParams) WithTimeout(timeout time.Duration) *GetEnvironmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get environment params +func (o *GetEnvironmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get environment params +func (o *GetEnvironmentParams) WithContext(ctx context.Context) *GetEnvironmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get environment params +func (o *GetEnvironmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get environment params +func (o *GetEnvironmentParams) WithHTTPClient(client *http.Client) *GetEnvironmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get environment params +func (o *GetEnvironmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEnvironmentID adds the environmentID to the get environment params +func (o *GetEnvironmentParams) WithEnvironmentID(environmentID string) *GetEnvironmentParams { + o.SetEnvironmentID(environmentID) + return o +} + +// SetEnvironmentID adds the environmentId to the get environment params +func (o *GetEnvironmentParams) SetEnvironmentID(environmentID string) { + o.EnvironmentID = environmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetEnvironmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param environment_id + if err := r.SetPathParam("environment_id", o.EnvironmentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/get_environment_responses.go b/client/catalog_entries/get_environment_responses.go new file mode 100644 index 0000000..88ebac6 --- /dev/null +++ b/client/catalog_entries/get_environment_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetEnvironmentReader is a Reader for the GetEnvironment structure. +type GetEnvironmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetEnvironmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetEnvironmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetEnvironmentOK creates a GetEnvironmentOK with default headers values +func NewGetEnvironmentOK() *GetEnvironmentOK { + return &GetEnvironmentOK{} +} + +/* +GetEnvironmentOK describes a response with status code 200, with default header values. + +Retrieves a single environment by ID +*/ +type GetEnvironmentOK struct { + Payload *models.EnvironmentEntryEntity +} + +// IsSuccess returns true when this get environment o k response has a 2xx status code +func (o *GetEnvironmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get environment o k response has a 3xx status code +func (o *GetEnvironmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get environment o k response has a 4xx status code +func (o *GetEnvironmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get environment o k response has a 5xx status code +func (o *GetEnvironmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get environment o k response a status code equal to that given +func (o *GetEnvironmentOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetEnvironmentOK) Error() string { + return fmt.Sprintf("[GET /v1/environments/{environment_id}][%d] getEnvironmentOK %+v", 200, o.Payload) +} + +func (o *GetEnvironmentOK) String() string { + return fmt.Sprintf("[GET /v1/environments/{environment_id}][%d] getEnvironmentOK %+v", 200, o.Payload) +} + +func (o *GetEnvironmentOK) GetPayload() *models.EnvironmentEntryEntity { + return o.Payload +} + +func (o *GetEnvironmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.EnvironmentEntryEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/get_functionality_parameters.go b/client/catalog_entries/get_functionality_parameters.go new file mode 100644 index 0000000..3bbab89 --- /dev/null +++ b/client/catalog_entries/get_functionality_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetFunctionalityParams creates a new GetFunctionalityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetFunctionalityParams() *GetFunctionalityParams { + return &GetFunctionalityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetFunctionalityParamsWithTimeout creates a new GetFunctionalityParams object +// with the ability to set a timeout on a request. +func NewGetFunctionalityParamsWithTimeout(timeout time.Duration) *GetFunctionalityParams { + return &GetFunctionalityParams{ + timeout: timeout, + } +} + +// NewGetFunctionalityParamsWithContext creates a new GetFunctionalityParams object +// with the ability to set a context for a request. +func NewGetFunctionalityParamsWithContext(ctx context.Context) *GetFunctionalityParams { + return &GetFunctionalityParams{ + Context: ctx, + } +} + +// NewGetFunctionalityParamsWithHTTPClient creates a new GetFunctionalityParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetFunctionalityParamsWithHTTPClient(client *http.Client) *GetFunctionalityParams { + return &GetFunctionalityParams{ + HTTPClient: client, + } +} + +/* +GetFunctionalityParams contains all the parameters to send to the API endpoint + + for the get functionality operation. + + Typically these are written to a http.Request. +*/ +type GetFunctionalityParams struct { + + // FunctionalityID. + FunctionalityID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get functionality params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFunctionalityParams) WithDefaults() *GetFunctionalityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get functionality params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFunctionalityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get functionality params +func (o *GetFunctionalityParams) WithTimeout(timeout time.Duration) *GetFunctionalityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get functionality params +func (o *GetFunctionalityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get functionality params +func (o *GetFunctionalityParams) WithContext(ctx context.Context) *GetFunctionalityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get functionality params +func (o *GetFunctionalityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get functionality params +func (o *GetFunctionalityParams) WithHTTPClient(client *http.Client) *GetFunctionalityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get functionality params +func (o *GetFunctionalityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFunctionalityID adds the functionalityID to the get functionality params +func (o *GetFunctionalityParams) WithFunctionalityID(functionalityID string) *GetFunctionalityParams { + o.SetFunctionalityID(functionalityID) + return o +} + +// SetFunctionalityID adds the functionalityId to the get functionality params +func (o *GetFunctionalityParams) SetFunctionalityID(functionalityID string) { + o.FunctionalityID = functionalityID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetFunctionalityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param functionality_id + if err := r.SetPathParam("functionality_id", o.FunctionalityID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/get_functionality_responses.go b/client/catalog_entries/get_functionality_responses.go new file mode 100644 index 0000000..2fec819 --- /dev/null +++ b/client/catalog_entries/get_functionality_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetFunctionalityReader is a Reader for the GetFunctionality structure. +type GetFunctionalityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetFunctionalityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetFunctionalityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetFunctionalityOK creates a GetFunctionalityOK with default headers values +func NewGetFunctionalityOK() *GetFunctionalityOK { + return &GetFunctionalityOK{} +} + +/* +GetFunctionalityOK describes a response with status code 200, with default header values. + +Retrieves a single functionality by ID +*/ +type GetFunctionalityOK struct { + Payload *models.FunctionalityEntity +} + +// IsSuccess returns true when this get functionality o k response has a 2xx status code +func (o *GetFunctionalityOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get functionality o k response has a 3xx status code +func (o *GetFunctionalityOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get functionality o k response has a 4xx status code +func (o *GetFunctionalityOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get functionality o k response has a 5xx status code +func (o *GetFunctionalityOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get functionality o k response a status code equal to that given +func (o *GetFunctionalityOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetFunctionalityOK) Error() string { + return fmt.Sprintf("[GET /v1/functionalities/{functionality_id}][%d] getFunctionalityOK %+v", 200, o.Payload) +} + +func (o *GetFunctionalityOK) String() string { + return fmt.Sprintf("[GET /v1/functionalities/{functionality_id}][%d] getFunctionalityOK %+v", 200, o.Payload) +} + +func (o *GetFunctionalityOK) GetPayload() *models.FunctionalityEntity { + return o.Payload +} + +func (o *GetFunctionalityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FunctionalityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/get_service_dependencies_parameters.go b/client/catalog_entries/get_service_dependencies_parameters.go new file mode 100644 index 0000000..4ca8aba --- /dev/null +++ b/client/catalog_entries/get_service_dependencies_parameters.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetServiceDependenciesParams creates a new GetServiceDependenciesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetServiceDependenciesParams() *GetServiceDependenciesParams { + return &GetServiceDependenciesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetServiceDependenciesParamsWithTimeout creates a new GetServiceDependenciesParams object +// with the ability to set a timeout on a request. +func NewGetServiceDependenciesParamsWithTimeout(timeout time.Duration) *GetServiceDependenciesParams { + return &GetServiceDependenciesParams{ + timeout: timeout, + } +} + +// NewGetServiceDependenciesParamsWithContext creates a new GetServiceDependenciesParams object +// with the ability to set a context for a request. +func NewGetServiceDependenciesParamsWithContext(ctx context.Context) *GetServiceDependenciesParams { + return &GetServiceDependenciesParams{ + Context: ctx, + } +} + +// NewGetServiceDependenciesParamsWithHTTPClient creates a new GetServiceDependenciesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetServiceDependenciesParamsWithHTTPClient(client *http.Client) *GetServiceDependenciesParams { + return &GetServiceDependenciesParams{ + HTTPClient: client, + } +} + +/* +GetServiceDependenciesParams contains all the parameters to send to the API endpoint + + for the get service dependencies operation. + + Typically these are written to a http.Request. +*/ +type GetServiceDependenciesParams struct { + + /* Flatten. + + If true, returns all dependencies in one array. If false, splits dependencies into different arrays for child and parent dependencies + */ + Flatten *bool + + // ServiceID. + ServiceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get service dependencies params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServiceDependenciesParams) WithDefaults() *GetServiceDependenciesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get service dependencies params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServiceDependenciesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get service dependencies params +func (o *GetServiceDependenciesParams) WithTimeout(timeout time.Duration) *GetServiceDependenciesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get service dependencies params +func (o *GetServiceDependenciesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get service dependencies params +func (o *GetServiceDependenciesParams) WithContext(ctx context.Context) *GetServiceDependenciesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get service dependencies params +func (o *GetServiceDependenciesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get service dependencies params +func (o *GetServiceDependenciesParams) WithHTTPClient(client *http.Client) *GetServiceDependenciesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get service dependencies params +func (o *GetServiceDependenciesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFlatten adds the flatten to the get service dependencies params +func (o *GetServiceDependenciesParams) WithFlatten(flatten *bool) *GetServiceDependenciesParams { + o.SetFlatten(flatten) + return o +} + +// SetFlatten adds the flatten to the get service dependencies params +func (o *GetServiceDependenciesParams) SetFlatten(flatten *bool) { + o.Flatten = flatten +} + +// WithServiceID adds the serviceID to the get service dependencies params +func (o *GetServiceDependenciesParams) WithServiceID(serviceID string) *GetServiceDependenciesParams { + o.SetServiceID(serviceID) + return o +} + +// SetServiceID adds the serviceId to the get service dependencies params +func (o *GetServiceDependenciesParams) SetServiceID(serviceID string) { + o.ServiceID = serviceID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetServiceDependenciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Flatten != nil { + + // query param flatten + var qrFlatten bool + + if o.Flatten != nil { + qrFlatten = *o.Flatten + } + qFlatten := swag.FormatBool(qrFlatten) + if qFlatten != "" { + + if err := r.SetQueryParam("flatten", qFlatten); err != nil { + return err + } + } + } + + // path param service_id + if err := r.SetPathParam("service_id", o.ServiceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/get_service_dependencies_responses.go b/client/catalog_entries/get_service_dependencies_responses.go new file mode 100644 index 0000000..47cd605 --- /dev/null +++ b/client/catalog_entries/get_service_dependencies_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetServiceDependenciesReader is a Reader for the GetServiceDependencies structure. +type GetServiceDependenciesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetServiceDependenciesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetServiceDependenciesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetServiceDependenciesOK creates a GetServiceDependenciesOK with default headers values +func NewGetServiceDependenciesOK() *GetServiceDependenciesOK { + return &GetServiceDependenciesOK{} +} + +/* +GetServiceDependenciesOK describes a response with status code 200, with default header values. + +Retrieves a service's dependencies +*/ +type GetServiceDependenciesOK struct { + Payload *models.ServiceWithAllDependenciesEntity +} + +// IsSuccess returns true when this get service dependencies o k response has a 2xx status code +func (o *GetServiceDependenciesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get service dependencies o k response has a 3xx status code +func (o *GetServiceDependenciesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get service dependencies o k response has a 4xx status code +func (o *GetServiceDependenciesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get service dependencies o k response has a 5xx status code +func (o *GetServiceDependenciesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get service dependencies o k response a status code equal to that given +func (o *GetServiceDependenciesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetServiceDependenciesOK) Error() string { + return fmt.Sprintf("[GET /v1/services/{service_id}/dependencies][%d] getServiceDependenciesOK %+v", 200, o.Payload) +} + +func (o *GetServiceDependenciesOK) String() string { + return fmt.Sprintf("[GET /v1/services/{service_id}/dependencies][%d] getServiceDependenciesOK %+v", 200, o.Payload) +} + +func (o *GetServiceDependenciesOK) GetPayload() *models.ServiceWithAllDependenciesEntity { + return o.Payload +} + +func (o *GetServiceDependenciesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceWithAllDependenciesEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/get_service_dependency_parameters.go b/client/catalog_entries/get_service_dependency_parameters.go new file mode 100644 index 0000000..11443ac --- /dev/null +++ b/client/catalog_entries/get_service_dependency_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetServiceDependencyParams creates a new GetServiceDependencyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetServiceDependencyParams() *GetServiceDependencyParams { + return &GetServiceDependencyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetServiceDependencyParamsWithTimeout creates a new GetServiceDependencyParams object +// with the ability to set a timeout on a request. +func NewGetServiceDependencyParamsWithTimeout(timeout time.Duration) *GetServiceDependencyParams { + return &GetServiceDependencyParams{ + timeout: timeout, + } +} + +// NewGetServiceDependencyParamsWithContext creates a new GetServiceDependencyParams object +// with the ability to set a context for a request. +func NewGetServiceDependencyParamsWithContext(ctx context.Context) *GetServiceDependencyParams { + return &GetServiceDependencyParams{ + Context: ctx, + } +} + +// NewGetServiceDependencyParamsWithHTTPClient creates a new GetServiceDependencyParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetServiceDependencyParamsWithHTTPClient(client *http.Client) *GetServiceDependencyParams { + return &GetServiceDependencyParams{ + HTTPClient: client, + } +} + +/* +GetServiceDependencyParams contains all the parameters to send to the API endpoint + + for the get service dependency operation. + + Typically these are written to a http.Request. +*/ +type GetServiceDependencyParams struct { + + // ServiceDependencyID. + ServiceDependencyID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get service dependency params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServiceDependencyParams) WithDefaults() *GetServiceDependencyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get service dependency params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServiceDependencyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get service dependency params +func (o *GetServiceDependencyParams) WithTimeout(timeout time.Duration) *GetServiceDependencyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get service dependency params +func (o *GetServiceDependencyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get service dependency params +func (o *GetServiceDependencyParams) WithContext(ctx context.Context) *GetServiceDependencyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get service dependency params +func (o *GetServiceDependencyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get service dependency params +func (o *GetServiceDependencyParams) WithHTTPClient(client *http.Client) *GetServiceDependencyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get service dependency params +func (o *GetServiceDependencyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithServiceDependencyID adds the serviceDependencyID to the get service dependency params +func (o *GetServiceDependencyParams) WithServiceDependencyID(serviceDependencyID string) *GetServiceDependencyParams { + o.SetServiceDependencyID(serviceDependencyID) + return o +} + +// SetServiceDependencyID adds the serviceDependencyId to the get service dependency params +func (o *GetServiceDependencyParams) SetServiceDependencyID(serviceDependencyID string) { + o.ServiceDependencyID = serviceDependencyID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetServiceDependencyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param service_dependency_id + if err := r.SetPathParam("service_dependency_id", o.ServiceDependencyID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/get_service_dependency_responses.go b/client/catalog_entries/get_service_dependency_responses.go new file mode 100644 index 0000000..1ea404a --- /dev/null +++ b/client/catalog_entries/get_service_dependency_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetServiceDependencyReader is a Reader for the GetServiceDependency structure. +type GetServiceDependencyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetServiceDependencyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetServiceDependencyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetServiceDependencyOK creates a GetServiceDependencyOK with default headers values +func NewGetServiceDependencyOK() *GetServiceDependencyOK { + return &GetServiceDependencyOK{} +} + +/* +GetServiceDependencyOK describes a response with status code 200, with default header values. + +Retrieves a single service dependency by ID +*/ +type GetServiceDependencyOK struct { + Payload *models.ServiceDependencyEntity +} + +// IsSuccess returns true when this get service dependency o k response has a 2xx status code +func (o *GetServiceDependencyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get service dependency o k response has a 3xx status code +func (o *GetServiceDependencyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get service dependency o k response has a 4xx status code +func (o *GetServiceDependencyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get service dependency o k response has a 5xx status code +func (o *GetServiceDependencyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get service dependency o k response a status code equal to that given +func (o *GetServiceDependencyOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetServiceDependencyOK) Error() string { + return fmt.Sprintf("[GET /v1/service_dependencies/{service_dependency_id}][%d] getServiceDependencyOK %+v", 200, o.Payload) +} + +func (o *GetServiceDependencyOK) String() string { + return fmt.Sprintf("[GET /v1/service_dependencies/{service_dependency_id}][%d] getServiceDependencyOK %+v", 200, o.Payload) +} + +func (o *GetServiceDependencyOK) GetPayload() *models.ServiceDependencyEntity { + return o.Payload +} + +func (o *GetServiceDependencyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceDependencyEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/get_service_parameters.go b/client/catalog_entries/get_service_parameters.go new file mode 100644 index 0000000..724a972 --- /dev/null +++ b/client/catalog_entries/get_service_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetServiceParams creates a new GetServiceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetServiceParams() *GetServiceParams { + return &GetServiceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetServiceParamsWithTimeout creates a new GetServiceParams object +// with the ability to set a timeout on a request. +func NewGetServiceParamsWithTimeout(timeout time.Duration) *GetServiceParams { + return &GetServiceParams{ + timeout: timeout, + } +} + +// NewGetServiceParamsWithContext creates a new GetServiceParams object +// with the ability to set a context for a request. +func NewGetServiceParamsWithContext(ctx context.Context) *GetServiceParams { + return &GetServiceParams{ + Context: ctx, + } +} + +// NewGetServiceParamsWithHTTPClient creates a new GetServiceParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetServiceParamsWithHTTPClient(client *http.Client) *GetServiceParams { + return &GetServiceParams{ + HTTPClient: client, + } +} + +/* +GetServiceParams contains all the parameters to send to the API endpoint + + for the get service operation. + + Typically these are written to a http.Request. +*/ +type GetServiceParams struct { + + // ServiceID. + ServiceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServiceParams) WithDefaults() *GetServiceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetServiceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get service params +func (o *GetServiceParams) WithTimeout(timeout time.Duration) *GetServiceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get service params +func (o *GetServiceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get service params +func (o *GetServiceParams) WithContext(ctx context.Context) *GetServiceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get service params +func (o *GetServiceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get service params +func (o *GetServiceParams) WithHTTPClient(client *http.Client) *GetServiceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get service params +func (o *GetServiceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithServiceID adds the serviceID to the get service params +func (o *GetServiceParams) WithServiceID(serviceID string) *GetServiceParams { + o.SetServiceID(serviceID) + return o +} + +// SetServiceID adds the serviceId to the get service params +func (o *GetServiceParams) SetServiceID(serviceID string) { + o.ServiceID = serviceID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param service_id + if err := r.SetPathParam("service_id", o.ServiceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/get_service_responses.go b/client/catalog_entries/get_service_responses.go new file mode 100644 index 0000000..88e1384 --- /dev/null +++ b/client/catalog_entries/get_service_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetServiceReader is a Reader for the GetService structure. +type GetServiceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetServiceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetServiceOK creates a GetServiceOK with default headers values +func NewGetServiceOK() *GetServiceOK { + return &GetServiceOK{} +} + +/* +GetServiceOK describes a response with status code 200, with default header values. + +Retrieves a single service by ID +*/ +type GetServiceOK struct { + Payload *models.ServiceEntity +} + +// IsSuccess returns true when this get service o k response has a 2xx status code +func (o *GetServiceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get service o k response has a 3xx status code +func (o *GetServiceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get service o k response has a 4xx status code +func (o *GetServiceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get service o k response has a 5xx status code +func (o *GetServiceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get service o k response a status code equal to that given +func (o *GetServiceOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetServiceOK) Error() string { + return fmt.Sprintf("[GET /v1/services/{service_id}][%d] getServiceOK %+v", 200, o.Payload) +} + +func (o *GetServiceOK) String() string { + return fmt.Sprintf("[GET /v1/services/{service_id}][%d] getServiceOK %+v", 200, o.Payload) +} + +func (o *GetServiceOK) GetPayload() *models.ServiceEntity { + return o.Payload +} + +func (o *GetServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/ingest_catalog_data_parameters.go b/client/catalog_entries/ingest_catalog_data_parameters.go new file mode 100644 index 0000000..fe29678 --- /dev/null +++ b/client/catalog_entries/ingest_catalog_data_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewIngestCatalogDataParams creates a new IngestCatalogDataParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIngestCatalogDataParams() *IngestCatalogDataParams { + return &IngestCatalogDataParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIngestCatalogDataParamsWithTimeout creates a new IngestCatalogDataParams object +// with the ability to set a timeout on a request. +func NewIngestCatalogDataParamsWithTimeout(timeout time.Duration) *IngestCatalogDataParams { + return &IngestCatalogDataParams{ + timeout: timeout, + } +} + +// NewIngestCatalogDataParamsWithContext creates a new IngestCatalogDataParams object +// with the ability to set a context for a request. +func NewIngestCatalogDataParamsWithContext(ctx context.Context) *IngestCatalogDataParams { + return &IngestCatalogDataParams{ + Context: ctx, + } +} + +// NewIngestCatalogDataParamsWithHTTPClient creates a new IngestCatalogDataParams object +// with the ability to set a custom HTTPClient for a request. +func NewIngestCatalogDataParamsWithHTTPClient(client *http.Client) *IngestCatalogDataParams { + return &IngestCatalogDataParams{ + HTTPClient: client, + } +} + +/* +IngestCatalogDataParams contains all the parameters to send to the API endpoint + + for the ingest catalog data operation. + + Typically these are written to a http.Request. +*/ +type IngestCatalogDataParams struct { + + // CatalogID. + CatalogID string + + // IngestCatalogData. + IngestCatalogData *models.IngestCatalogData + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ingest catalog data params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IngestCatalogDataParams) WithDefaults() *IngestCatalogDataParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ingest catalog data params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IngestCatalogDataParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ingest catalog data params +func (o *IngestCatalogDataParams) WithTimeout(timeout time.Duration) *IngestCatalogDataParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ingest catalog data params +func (o *IngestCatalogDataParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ingest catalog data params +func (o *IngestCatalogDataParams) WithContext(ctx context.Context) *IngestCatalogDataParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ingest catalog data params +func (o *IngestCatalogDataParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ingest catalog data params +func (o *IngestCatalogDataParams) WithHTTPClient(client *http.Client) *IngestCatalogDataParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ingest catalog data params +func (o *IngestCatalogDataParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCatalogID adds the catalogID to the ingest catalog data params +func (o *IngestCatalogDataParams) WithCatalogID(catalogID string) *IngestCatalogDataParams { + o.SetCatalogID(catalogID) + return o +} + +// SetCatalogID adds the catalogId to the ingest catalog data params +func (o *IngestCatalogDataParams) SetCatalogID(catalogID string) { + o.CatalogID = catalogID +} + +// WithIngestCatalogData adds the ingestCatalogData to the ingest catalog data params +func (o *IngestCatalogDataParams) WithIngestCatalogData(ingestCatalogData *models.IngestCatalogData) *IngestCatalogDataParams { + o.SetIngestCatalogData(ingestCatalogData) + return o +} + +// SetIngestCatalogData adds the ingestCatalogData to the ingest catalog data params +func (o *IngestCatalogDataParams) SetIngestCatalogData(ingestCatalogData *models.IngestCatalogData) { + o.IngestCatalogData = ingestCatalogData +} + +// WriteToRequest writes these params to a swagger request +func (o *IngestCatalogDataParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param catalog_id + if err := r.SetPathParam("catalog_id", o.CatalogID); err != nil { + return err + } + if o.IngestCatalogData != nil { + if err := r.SetBodyParam(o.IngestCatalogData); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/ingest_catalog_data_responses.go b/client/catalog_entries/ingest_catalog_data_responses.go new file mode 100644 index 0000000..5ab41ce --- /dev/null +++ b/client/catalog_entries/ingest_catalog_data_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// IngestCatalogDataReader is a Reader for the IngestCatalogData structure. +type IngestCatalogDataReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IngestCatalogDataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewIngestCatalogDataCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIngestCatalogDataCreated creates a IngestCatalogDataCreated with default headers values +func NewIngestCatalogDataCreated() *IngestCatalogDataCreated { + return &IngestCatalogDataCreated{} +} + +/* +IngestCatalogDataCreated describes a response with status code 201, with default header values. + +Accepts catalog data in the configured format and asyncronously processes the data to incorporate changes into service catalog. +*/ +type IngestCatalogDataCreated struct { + Payload *models.ImportsImportEntity +} + +// IsSuccess returns true when this ingest catalog data created response has a 2xx status code +func (o *IngestCatalogDataCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this ingest catalog data created response has a 3xx status code +func (o *IngestCatalogDataCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this ingest catalog data created response has a 4xx status code +func (o *IngestCatalogDataCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this ingest catalog data created response has a 5xx status code +func (o *IngestCatalogDataCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this ingest catalog data created response a status code equal to that given +func (o *IngestCatalogDataCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *IngestCatalogDataCreated) Error() string { + return fmt.Sprintf("[POST /v1/catalogs/{catalog_id}/ingest][%d] ingestCatalogDataCreated %+v", 201, o.Payload) +} + +func (o *IngestCatalogDataCreated) String() string { + return fmt.Sprintf("[POST /v1/catalogs/{catalog_id}/ingest][%d] ingestCatalogDataCreated %+v", 201, o.Payload) +} + +func (o *IngestCatalogDataCreated) GetPayload() *models.ImportsImportEntity { + return o.Payload +} + +func (o *IngestCatalogDataCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ImportsImportEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/list_environments_parameters.go b/client/catalog_entries/list_environments_parameters.go new file mode 100644 index 0000000..08b0008 --- /dev/null +++ b/client/catalog_entries/list_environments_parameters.go @@ -0,0 +1,264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListEnvironmentsParams creates a new ListEnvironmentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListEnvironmentsParams() *ListEnvironmentsParams { + return &ListEnvironmentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListEnvironmentsParamsWithTimeout creates a new ListEnvironmentsParams object +// with the ability to set a timeout on a request. +func NewListEnvironmentsParamsWithTimeout(timeout time.Duration) *ListEnvironmentsParams { + return &ListEnvironmentsParams{ + timeout: timeout, + } +} + +// NewListEnvironmentsParamsWithContext creates a new ListEnvironmentsParams object +// with the ability to set a context for a request. +func NewListEnvironmentsParamsWithContext(ctx context.Context) *ListEnvironmentsParams { + return &ListEnvironmentsParams{ + Context: ctx, + } +} + +// NewListEnvironmentsParamsWithHTTPClient creates a new ListEnvironmentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListEnvironmentsParamsWithHTTPClient(client *http.Client) *ListEnvironmentsParams { + return &ListEnvironmentsParams{ + HTTPClient: client, + } +} + +/* +ListEnvironmentsParams contains all the parameters to send to the API endpoint + + for the list environments operation. + + Typically these are written to a http.Request. +*/ +type ListEnvironmentsParams struct { + + /* Name. + + A query to search environments by their name + */ + Name *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + A query to search environments by their name or description + */ + Query *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list environments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListEnvironmentsParams) WithDefaults() *ListEnvironmentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list environments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListEnvironmentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list environments params +func (o *ListEnvironmentsParams) WithTimeout(timeout time.Duration) *ListEnvironmentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list environments params +func (o *ListEnvironmentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list environments params +func (o *ListEnvironmentsParams) WithContext(ctx context.Context) *ListEnvironmentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list environments params +func (o *ListEnvironmentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list environments params +func (o *ListEnvironmentsParams) WithHTTPClient(client *http.Client) *ListEnvironmentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list environments params +func (o *ListEnvironmentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the list environments params +func (o *ListEnvironmentsParams) WithName(name *string) *ListEnvironmentsParams { + o.SetName(name) + return o +} + +// SetName adds the name to the list environments params +func (o *ListEnvironmentsParams) SetName(name *string) { + o.Name = name +} + +// WithPage adds the page to the list environments params +func (o *ListEnvironmentsParams) WithPage(page *int32) *ListEnvironmentsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list environments params +func (o *ListEnvironmentsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list environments params +func (o *ListEnvironmentsParams) WithPerPage(perPage *int32) *ListEnvironmentsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list environments params +func (o *ListEnvironmentsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list environments params +func (o *ListEnvironmentsParams) WithQuery(query *string) *ListEnvironmentsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list environments params +func (o *ListEnvironmentsParams) SetQuery(query *string) { + o.Query = query +} + +// WriteToRequest writes these params to a swagger request +func (o *ListEnvironmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/list_environments_responses.go b/client/catalog_entries/list_environments_responses.go new file mode 100644 index 0000000..c30b48d --- /dev/null +++ b/client/catalog_entries/list_environments_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListEnvironmentsReader is a Reader for the ListEnvironments structure. +type ListEnvironmentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListEnvironmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListEnvironmentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListEnvironmentsOK creates a ListEnvironmentsOK with default headers values +func NewListEnvironmentsOK() *ListEnvironmentsOK { + return &ListEnvironmentsOK{} +} + +/* +ListEnvironmentsOK describes a response with status code 200, with default header values. + +List all of the environments that have been added to the organiation +*/ +type ListEnvironmentsOK struct { + Payload *models.EnvironmentEntryEntityPaginated +} + +// IsSuccess returns true when this list environments o k response has a 2xx status code +func (o *ListEnvironmentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list environments o k response has a 3xx status code +func (o *ListEnvironmentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list environments o k response has a 4xx status code +func (o *ListEnvironmentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list environments o k response has a 5xx status code +func (o *ListEnvironmentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list environments o k response a status code equal to that given +func (o *ListEnvironmentsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListEnvironmentsOK) Error() string { + return fmt.Sprintf("[GET /v1/environments][%d] listEnvironmentsOK %+v", 200, o.Payload) +} + +func (o *ListEnvironmentsOK) String() string { + return fmt.Sprintf("[GET /v1/environments][%d] listEnvironmentsOK %+v", 200, o.Payload) +} + +func (o *ListEnvironmentsOK) GetPayload() *models.EnvironmentEntryEntityPaginated { + return o.Payload +} + +func (o *ListEnvironmentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.EnvironmentEntryEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/list_functionalities_parameters.go b/client/catalog_entries/list_functionalities_parameters.go new file mode 100644 index 0000000..ebc345e --- /dev/null +++ b/client/catalog_entries/list_functionalities_parameters.go @@ -0,0 +1,400 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListFunctionalitiesParams creates a new ListFunctionalitiesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListFunctionalitiesParams() *ListFunctionalitiesParams { + return &ListFunctionalitiesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListFunctionalitiesParamsWithTimeout creates a new ListFunctionalitiesParams object +// with the ability to set a timeout on a request. +func NewListFunctionalitiesParamsWithTimeout(timeout time.Duration) *ListFunctionalitiesParams { + return &ListFunctionalitiesParams{ + timeout: timeout, + } +} + +// NewListFunctionalitiesParamsWithContext creates a new ListFunctionalitiesParams object +// with the ability to set a context for a request. +func NewListFunctionalitiesParamsWithContext(ctx context.Context) *ListFunctionalitiesParams { + return &ListFunctionalitiesParams{ + Context: ctx, + } +} + +// NewListFunctionalitiesParamsWithHTTPClient creates a new ListFunctionalitiesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListFunctionalitiesParamsWithHTTPClient(client *http.Client) *ListFunctionalitiesParams { + return &ListFunctionalitiesParams{ + HTTPClient: client, + } +} + +/* +ListFunctionalitiesParams contains all the parameters to send to the API endpoint + + for the list functionalities operation. + + Typically these are written to a http.Request. +*/ +type ListFunctionalitiesParams struct { + + /* Impacted. + + A query to search services by if they are impacted with active incidents + */ + Impacted *string + + /* Labels. + + A comma separated list of label key / values in the format of 'key=value,key2=value2'. To filter change events that have a key (with no specific value), omit the value + */ + Labels *string + + /* Lite. + + Boolean to determine whether to return a slimified version of the functionalities object + */ + Lite *bool + + /* Name. + + A query to search functionalities by their name + */ + Name *string + + /* Owner. + + A query to search functionalities by their owning team ID + */ + Owner *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + A query to search functionalities by their name or description + */ + Query *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list functionalities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListFunctionalitiesParams) WithDefaults() *ListFunctionalitiesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list functionalities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListFunctionalitiesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list functionalities params +func (o *ListFunctionalitiesParams) WithTimeout(timeout time.Duration) *ListFunctionalitiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list functionalities params +func (o *ListFunctionalitiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list functionalities params +func (o *ListFunctionalitiesParams) WithContext(ctx context.Context) *ListFunctionalitiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list functionalities params +func (o *ListFunctionalitiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list functionalities params +func (o *ListFunctionalitiesParams) WithHTTPClient(client *http.Client) *ListFunctionalitiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list functionalities params +func (o *ListFunctionalitiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpacted adds the impacted to the list functionalities params +func (o *ListFunctionalitiesParams) WithImpacted(impacted *string) *ListFunctionalitiesParams { + o.SetImpacted(impacted) + return o +} + +// SetImpacted adds the impacted to the list functionalities params +func (o *ListFunctionalitiesParams) SetImpacted(impacted *string) { + o.Impacted = impacted +} + +// WithLabels adds the labels to the list functionalities params +func (o *ListFunctionalitiesParams) WithLabels(labels *string) *ListFunctionalitiesParams { + o.SetLabels(labels) + return o +} + +// SetLabels adds the labels to the list functionalities params +func (o *ListFunctionalitiesParams) SetLabels(labels *string) { + o.Labels = labels +} + +// WithLite adds the lite to the list functionalities params +func (o *ListFunctionalitiesParams) WithLite(lite *bool) *ListFunctionalitiesParams { + o.SetLite(lite) + return o +} + +// SetLite adds the lite to the list functionalities params +func (o *ListFunctionalitiesParams) SetLite(lite *bool) { + o.Lite = lite +} + +// WithName adds the name to the list functionalities params +func (o *ListFunctionalitiesParams) WithName(name *string) *ListFunctionalitiesParams { + o.SetName(name) + return o +} + +// SetName adds the name to the list functionalities params +func (o *ListFunctionalitiesParams) SetName(name *string) { + o.Name = name +} + +// WithOwner adds the owner to the list functionalities params +func (o *ListFunctionalitiesParams) WithOwner(owner *string) *ListFunctionalitiesParams { + o.SetOwner(owner) + return o +} + +// SetOwner adds the owner to the list functionalities params +func (o *ListFunctionalitiesParams) SetOwner(owner *string) { + o.Owner = owner +} + +// WithPage adds the page to the list functionalities params +func (o *ListFunctionalitiesParams) WithPage(page *int32) *ListFunctionalitiesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list functionalities params +func (o *ListFunctionalitiesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list functionalities params +func (o *ListFunctionalitiesParams) WithPerPage(perPage *int32) *ListFunctionalitiesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list functionalities params +func (o *ListFunctionalitiesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list functionalities params +func (o *ListFunctionalitiesParams) WithQuery(query *string) *ListFunctionalitiesParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list functionalities params +func (o *ListFunctionalitiesParams) SetQuery(query *string) { + o.Query = query +} + +// WriteToRequest writes these params to a swagger request +func (o *ListFunctionalitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Impacted != nil { + + // query param impacted + var qrImpacted string + + if o.Impacted != nil { + qrImpacted = *o.Impacted + } + qImpacted := qrImpacted + if qImpacted != "" { + + if err := r.SetQueryParam("impacted", qImpacted); err != nil { + return err + } + } + } + + if o.Labels != nil { + + // query param labels + var qrLabels string + + if o.Labels != nil { + qrLabels = *o.Labels + } + qLabels := qrLabels + if qLabels != "" { + + if err := r.SetQueryParam("labels", qLabels); err != nil { + return err + } + } + } + + if o.Lite != nil { + + // query param lite + var qrLite bool + + if o.Lite != nil { + qrLite = *o.Lite + } + qLite := swag.FormatBool(qrLite) + if qLite != "" { + + if err := r.SetQueryParam("lite", qLite); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.Owner != nil { + + // query param owner + var qrOwner string + + if o.Owner != nil { + qrOwner = *o.Owner + } + qOwner := qrOwner + if qOwner != "" { + + if err := r.SetQueryParam("owner", qOwner); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/list_functionalities_responses.go b/client/catalog_entries/list_functionalities_responses.go new file mode 100644 index 0000000..0777c9d --- /dev/null +++ b/client/catalog_entries/list_functionalities_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListFunctionalitiesReader is a Reader for the ListFunctionalities structure. +type ListFunctionalitiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListFunctionalitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListFunctionalitiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListFunctionalitiesOK creates a ListFunctionalitiesOK with default headers values +func NewListFunctionalitiesOK() *ListFunctionalitiesOK { + return &ListFunctionalitiesOK{} +} + +/* +ListFunctionalitiesOK describes a response with status code 200, with default header values. + +List all of the functionalities that have been added to the organiation +*/ +type ListFunctionalitiesOK struct { + Payload *models.FunctionalityEntityPaginated +} + +// IsSuccess returns true when this list functionalities o k response has a 2xx status code +func (o *ListFunctionalitiesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list functionalities o k response has a 3xx status code +func (o *ListFunctionalitiesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list functionalities o k response has a 4xx status code +func (o *ListFunctionalitiesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list functionalities o k response has a 5xx status code +func (o *ListFunctionalitiesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list functionalities o k response a status code equal to that given +func (o *ListFunctionalitiesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListFunctionalitiesOK) Error() string { + return fmt.Sprintf("[GET /v1/functionalities][%d] listFunctionalitiesOK %+v", 200, o.Payload) +} + +func (o *ListFunctionalitiesOK) String() string { + return fmt.Sprintf("[GET /v1/functionalities][%d] listFunctionalitiesOK %+v", 200, o.Payload) +} + +func (o *ListFunctionalitiesOK) GetPayload() *models.FunctionalityEntityPaginated { + return o.Payload +} + +func (o *ListFunctionalitiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FunctionalityEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/list_functionality_services_parameters.go b/client/catalog_entries/list_functionality_services_parameters.go new file mode 100644 index 0000000..96c0da3 --- /dev/null +++ b/client/catalog_entries/list_functionality_services_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListFunctionalityServicesParams creates a new ListFunctionalityServicesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListFunctionalityServicesParams() *ListFunctionalityServicesParams { + return &ListFunctionalityServicesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListFunctionalityServicesParamsWithTimeout creates a new ListFunctionalityServicesParams object +// with the ability to set a timeout on a request. +func NewListFunctionalityServicesParamsWithTimeout(timeout time.Duration) *ListFunctionalityServicesParams { + return &ListFunctionalityServicesParams{ + timeout: timeout, + } +} + +// NewListFunctionalityServicesParamsWithContext creates a new ListFunctionalityServicesParams object +// with the ability to set a context for a request. +func NewListFunctionalityServicesParamsWithContext(ctx context.Context) *ListFunctionalityServicesParams { + return &ListFunctionalityServicesParams{ + Context: ctx, + } +} + +// NewListFunctionalityServicesParamsWithHTTPClient creates a new ListFunctionalityServicesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListFunctionalityServicesParamsWithHTTPClient(client *http.Client) *ListFunctionalityServicesParams { + return &ListFunctionalityServicesParams{ + HTTPClient: client, + } +} + +/* +ListFunctionalityServicesParams contains all the parameters to send to the API endpoint + + for the list functionality services operation. + + Typically these are written to a http.Request. +*/ +type ListFunctionalityServicesParams struct { + + // FunctionalityID. + FunctionalityID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list functionality services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListFunctionalityServicesParams) WithDefaults() *ListFunctionalityServicesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list functionality services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListFunctionalityServicesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list functionality services params +func (o *ListFunctionalityServicesParams) WithTimeout(timeout time.Duration) *ListFunctionalityServicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list functionality services params +func (o *ListFunctionalityServicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list functionality services params +func (o *ListFunctionalityServicesParams) WithContext(ctx context.Context) *ListFunctionalityServicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list functionality services params +func (o *ListFunctionalityServicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list functionality services params +func (o *ListFunctionalityServicesParams) WithHTTPClient(client *http.Client) *ListFunctionalityServicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list functionality services params +func (o *ListFunctionalityServicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFunctionalityID adds the functionalityID to the list functionality services params +func (o *ListFunctionalityServicesParams) WithFunctionalityID(functionalityID string) *ListFunctionalityServicesParams { + o.SetFunctionalityID(functionalityID) + return o +} + +// SetFunctionalityID adds the functionalityId to the list functionality services params +func (o *ListFunctionalityServicesParams) SetFunctionalityID(functionalityID string) { + o.FunctionalityID = functionalityID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListFunctionalityServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param functionality_id + if err := r.SetPathParam("functionality_id", o.FunctionalityID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/list_functionality_services_responses.go b/client/catalog_entries/list_functionality_services_responses.go new file mode 100644 index 0000000..c8d6963 --- /dev/null +++ b/client/catalog_entries/list_functionality_services_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListFunctionalityServicesReader is a Reader for the ListFunctionalityServices structure. +type ListFunctionalityServicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListFunctionalityServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListFunctionalityServicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListFunctionalityServicesOK creates a ListFunctionalityServicesOK with default headers values +func NewListFunctionalityServicesOK() *ListFunctionalityServicesOK { + return &ListFunctionalityServicesOK{} +} + +/* +ListFunctionalityServicesOK describes a response with status code 200, with default header values. + +List services for a functionality +*/ +type ListFunctionalityServicesOK struct { + Payload *models.FunctionalityWithAllServicesEntity +} + +// IsSuccess returns true when this list functionality services o k response has a 2xx status code +func (o *ListFunctionalityServicesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list functionality services o k response has a 3xx status code +func (o *ListFunctionalityServicesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list functionality services o k response has a 4xx status code +func (o *ListFunctionalityServicesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list functionality services o k response has a 5xx status code +func (o *ListFunctionalityServicesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list functionality services o k response a status code equal to that given +func (o *ListFunctionalityServicesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListFunctionalityServicesOK) Error() string { + return fmt.Sprintf("[GET /v1/functionalities/{functionality_id}/services][%d] listFunctionalityServicesOK %+v", 200, o.Payload) +} + +func (o *ListFunctionalityServicesOK) String() string { + return fmt.Sprintf("[GET /v1/functionalities/{functionality_id}/services][%d] listFunctionalityServicesOK %+v", 200, o.Payload) +} + +func (o *ListFunctionalityServicesOK) GetPayload() *models.FunctionalityWithAllServicesEntity { + return o.Payload +} + +func (o *ListFunctionalityServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FunctionalityWithAllServicesEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/list_infrastructures_parameters.go b/client/catalog_entries/list_infrastructures_parameters.go new file mode 100644 index 0000000..3b07cc2 --- /dev/null +++ b/client/catalog_entries/list_infrastructures_parameters.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListInfrastructuresParams creates a new ListInfrastructuresParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListInfrastructuresParams() *ListInfrastructuresParams { + return &ListInfrastructuresParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListInfrastructuresParamsWithTimeout creates a new ListInfrastructuresParams object +// with the ability to set a timeout on a request. +func NewListInfrastructuresParamsWithTimeout(timeout time.Duration) *ListInfrastructuresParams { + return &ListInfrastructuresParams{ + timeout: timeout, + } +} + +// NewListInfrastructuresParamsWithContext creates a new ListInfrastructuresParams object +// with the ability to set a context for a request. +func NewListInfrastructuresParamsWithContext(ctx context.Context) *ListInfrastructuresParams { + return &ListInfrastructuresParams{ + Context: ctx, + } +} + +// NewListInfrastructuresParamsWithHTTPClient creates a new ListInfrastructuresParams object +// with the ability to set a custom HTTPClient for a request. +func NewListInfrastructuresParamsWithHTTPClient(client *http.Client) *ListInfrastructuresParams { + return &ListInfrastructuresParams{ + HTTPClient: client, + } +} + +/* +ListInfrastructuresParams contains all the parameters to send to the API endpoint + + for the list infrastructures operation. + + Typically these are written to a http.Request. +*/ +type ListInfrastructuresParams struct { + + /* OmitFor. + + Omit for any infrastructure that is added to an incident using the format "incident/{incident_id}" + */ + OmitFor *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + A query to search infrastructures by their name + */ + Query *string + + /* Type. + + Restrict infrastructure search to given type. + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list infrastructures params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListInfrastructuresParams) WithDefaults() *ListInfrastructuresParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list infrastructures params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListInfrastructuresParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list infrastructures params +func (o *ListInfrastructuresParams) WithTimeout(timeout time.Duration) *ListInfrastructuresParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list infrastructures params +func (o *ListInfrastructuresParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list infrastructures params +func (o *ListInfrastructuresParams) WithContext(ctx context.Context) *ListInfrastructuresParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list infrastructures params +func (o *ListInfrastructuresParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list infrastructures params +func (o *ListInfrastructuresParams) WithHTTPClient(client *http.Client) *ListInfrastructuresParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list infrastructures params +func (o *ListInfrastructuresParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithOmitFor adds the omitFor to the list infrastructures params +func (o *ListInfrastructuresParams) WithOmitFor(omitFor *string) *ListInfrastructuresParams { + o.SetOmitFor(omitFor) + return o +} + +// SetOmitFor adds the omitFor to the list infrastructures params +func (o *ListInfrastructuresParams) SetOmitFor(omitFor *string) { + o.OmitFor = omitFor +} + +// WithPage adds the page to the list infrastructures params +func (o *ListInfrastructuresParams) WithPage(page *int32) *ListInfrastructuresParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list infrastructures params +func (o *ListInfrastructuresParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list infrastructures params +func (o *ListInfrastructuresParams) WithPerPage(perPage *int32) *ListInfrastructuresParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list infrastructures params +func (o *ListInfrastructuresParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list infrastructures params +func (o *ListInfrastructuresParams) WithQuery(query *string) *ListInfrastructuresParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list infrastructures params +func (o *ListInfrastructuresParams) SetQuery(query *string) { + o.Query = query +} + +// WithType adds the typeVar to the list infrastructures params +func (o *ListInfrastructuresParams) WithType(typeVar *string) *ListInfrastructuresParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the list infrastructures params +func (o *ListInfrastructuresParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ListInfrastructuresParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.OmitFor != nil { + + // query param omit_for + var qrOmitFor string + + if o.OmitFor != nil { + qrOmitFor = *o.OmitFor + } + qOmitFor := qrOmitFor + if qOmitFor != "" { + + if err := r.SetQueryParam("omit_for", qOmitFor); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/list_infrastructures_responses.go b/client/catalog_entries/list_infrastructures_responses.go new file mode 100644 index 0000000..fd480c8 --- /dev/null +++ b/client/catalog_entries/list_infrastructures_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListInfrastructuresReader is a Reader for the ListInfrastructures structure. +type ListInfrastructuresReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListInfrastructuresReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListInfrastructuresOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListInfrastructuresOK creates a ListInfrastructuresOK with default headers values +func NewListInfrastructuresOK() *ListInfrastructuresOK { + return &ListInfrastructuresOK{} +} + +/* +ListInfrastructuresOK describes a response with status code 200, with default header values. + +Lists functionality, service and environment objects +*/ +type ListInfrastructuresOK struct { + Payload *models.InfrastructureSearchEntity +} + +// IsSuccess returns true when this list infrastructures o k response has a 2xx status code +func (o *ListInfrastructuresOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list infrastructures o k response has a 3xx status code +func (o *ListInfrastructuresOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list infrastructures o k response has a 4xx status code +func (o *ListInfrastructuresOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list infrastructures o k response has a 5xx status code +func (o *ListInfrastructuresOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list infrastructures o k response a status code equal to that given +func (o *ListInfrastructuresOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListInfrastructuresOK) Error() string { + return fmt.Sprintf("[GET /v1/infrastructures][%d] listInfrastructuresOK %+v", 200, o.Payload) +} + +func (o *ListInfrastructuresOK) String() string { + return fmt.Sprintf("[GET /v1/infrastructures][%d] listInfrastructuresOK %+v", 200, o.Payload) +} + +func (o *ListInfrastructuresOK) GetPayload() *models.InfrastructureSearchEntity { + return o.Payload +} + +func (o *ListInfrastructuresOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InfrastructureSearchEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/list_service_available_downstream_dependencies_parameters.go b/client/catalog_entries/list_service_available_downstream_dependencies_parameters.go new file mode 100644 index 0000000..dfcc40b --- /dev/null +++ b/client/catalog_entries/list_service_available_downstream_dependencies_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListServiceAvailableDownstreamDependenciesParams creates a new ListServiceAvailableDownstreamDependenciesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListServiceAvailableDownstreamDependenciesParams() *ListServiceAvailableDownstreamDependenciesParams { + return &ListServiceAvailableDownstreamDependenciesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListServiceAvailableDownstreamDependenciesParamsWithTimeout creates a new ListServiceAvailableDownstreamDependenciesParams object +// with the ability to set a timeout on a request. +func NewListServiceAvailableDownstreamDependenciesParamsWithTimeout(timeout time.Duration) *ListServiceAvailableDownstreamDependenciesParams { + return &ListServiceAvailableDownstreamDependenciesParams{ + timeout: timeout, + } +} + +// NewListServiceAvailableDownstreamDependenciesParamsWithContext creates a new ListServiceAvailableDownstreamDependenciesParams object +// with the ability to set a context for a request. +func NewListServiceAvailableDownstreamDependenciesParamsWithContext(ctx context.Context) *ListServiceAvailableDownstreamDependenciesParams { + return &ListServiceAvailableDownstreamDependenciesParams{ + Context: ctx, + } +} + +// NewListServiceAvailableDownstreamDependenciesParamsWithHTTPClient creates a new ListServiceAvailableDownstreamDependenciesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListServiceAvailableDownstreamDependenciesParamsWithHTTPClient(client *http.Client) *ListServiceAvailableDownstreamDependenciesParams { + return &ListServiceAvailableDownstreamDependenciesParams{ + HTTPClient: client, + } +} + +/* +ListServiceAvailableDownstreamDependenciesParams contains all the parameters to send to the API endpoint + + for the list service available downstream dependencies operation. + + Typically these are written to a http.Request. +*/ +type ListServiceAvailableDownstreamDependenciesParams struct { + + // ServiceID. + ServiceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list service available downstream dependencies params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListServiceAvailableDownstreamDependenciesParams) WithDefaults() *ListServiceAvailableDownstreamDependenciesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list service available downstream dependencies params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListServiceAvailableDownstreamDependenciesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list service available downstream dependencies params +func (o *ListServiceAvailableDownstreamDependenciesParams) WithTimeout(timeout time.Duration) *ListServiceAvailableDownstreamDependenciesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list service available downstream dependencies params +func (o *ListServiceAvailableDownstreamDependenciesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list service available downstream dependencies params +func (o *ListServiceAvailableDownstreamDependenciesParams) WithContext(ctx context.Context) *ListServiceAvailableDownstreamDependenciesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list service available downstream dependencies params +func (o *ListServiceAvailableDownstreamDependenciesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list service available downstream dependencies params +func (o *ListServiceAvailableDownstreamDependenciesParams) WithHTTPClient(client *http.Client) *ListServiceAvailableDownstreamDependenciesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list service available downstream dependencies params +func (o *ListServiceAvailableDownstreamDependenciesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithServiceID adds the serviceID to the list service available downstream dependencies params +func (o *ListServiceAvailableDownstreamDependenciesParams) WithServiceID(serviceID string) *ListServiceAvailableDownstreamDependenciesParams { + o.SetServiceID(serviceID) + return o +} + +// SetServiceID adds the serviceId to the list service available downstream dependencies params +func (o *ListServiceAvailableDownstreamDependenciesParams) SetServiceID(serviceID string) { + o.ServiceID = serviceID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListServiceAvailableDownstreamDependenciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param service_id + if err := r.SetPathParam("service_id", o.ServiceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/list_service_available_downstream_dependencies_responses.go b/client/catalog_entries/list_service_available_downstream_dependencies_responses.go new file mode 100644 index 0000000..76571ca --- /dev/null +++ b/client/catalog_entries/list_service_available_downstream_dependencies_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListServiceAvailableDownstreamDependenciesReader is a Reader for the ListServiceAvailableDownstreamDependencies structure. +type ListServiceAvailableDownstreamDependenciesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListServiceAvailableDownstreamDependenciesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListServiceAvailableDownstreamDependenciesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListServiceAvailableDownstreamDependenciesOK creates a ListServiceAvailableDownstreamDependenciesOK with default headers values +func NewListServiceAvailableDownstreamDependenciesOK() *ListServiceAvailableDownstreamDependenciesOK { + return &ListServiceAvailableDownstreamDependenciesOK{} +} + +/* +ListServiceAvailableDownstreamDependenciesOK describes a response with status code 200, with default header values. + +Retrieves all services that are available to be downstream dependencies +*/ +type ListServiceAvailableDownstreamDependenciesOK struct { + Payload *models.ServiceEntityLite +} + +// IsSuccess returns true when this list service available downstream dependencies o k response has a 2xx status code +func (o *ListServiceAvailableDownstreamDependenciesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list service available downstream dependencies o k response has a 3xx status code +func (o *ListServiceAvailableDownstreamDependenciesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list service available downstream dependencies o k response has a 4xx status code +func (o *ListServiceAvailableDownstreamDependenciesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list service available downstream dependencies o k response has a 5xx status code +func (o *ListServiceAvailableDownstreamDependenciesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list service available downstream dependencies o k response a status code equal to that given +func (o *ListServiceAvailableDownstreamDependenciesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListServiceAvailableDownstreamDependenciesOK) Error() string { + return fmt.Sprintf("[GET /v1/services/{service_id}/available_downstream_dependencies][%d] listServiceAvailableDownstreamDependenciesOK %+v", 200, o.Payload) +} + +func (o *ListServiceAvailableDownstreamDependenciesOK) String() string { + return fmt.Sprintf("[GET /v1/services/{service_id}/available_downstream_dependencies][%d] listServiceAvailableDownstreamDependenciesOK %+v", 200, o.Payload) +} + +func (o *ListServiceAvailableDownstreamDependenciesOK) GetPayload() *models.ServiceEntityLite { + return o.Payload +} + +func (o *ListServiceAvailableDownstreamDependenciesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceEntityLite) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/list_service_available_upstream_dependencies_parameters.go b/client/catalog_entries/list_service_available_upstream_dependencies_parameters.go new file mode 100644 index 0000000..94b74dd --- /dev/null +++ b/client/catalog_entries/list_service_available_upstream_dependencies_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListServiceAvailableUpstreamDependenciesParams creates a new ListServiceAvailableUpstreamDependenciesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListServiceAvailableUpstreamDependenciesParams() *ListServiceAvailableUpstreamDependenciesParams { + return &ListServiceAvailableUpstreamDependenciesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListServiceAvailableUpstreamDependenciesParamsWithTimeout creates a new ListServiceAvailableUpstreamDependenciesParams object +// with the ability to set a timeout on a request. +func NewListServiceAvailableUpstreamDependenciesParamsWithTimeout(timeout time.Duration) *ListServiceAvailableUpstreamDependenciesParams { + return &ListServiceAvailableUpstreamDependenciesParams{ + timeout: timeout, + } +} + +// NewListServiceAvailableUpstreamDependenciesParamsWithContext creates a new ListServiceAvailableUpstreamDependenciesParams object +// with the ability to set a context for a request. +func NewListServiceAvailableUpstreamDependenciesParamsWithContext(ctx context.Context) *ListServiceAvailableUpstreamDependenciesParams { + return &ListServiceAvailableUpstreamDependenciesParams{ + Context: ctx, + } +} + +// NewListServiceAvailableUpstreamDependenciesParamsWithHTTPClient creates a new ListServiceAvailableUpstreamDependenciesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListServiceAvailableUpstreamDependenciesParamsWithHTTPClient(client *http.Client) *ListServiceAvailableUpstreamDependenciesParams { + return &ListServiceAvailableUpstreamDependenciesParams{ + HTTPClient: client, + } +} + +/* +ListServiceAvailableUpstreamDependenciesParams contains all the parameters to send to the API endpoint + + for the list service available upstream dependencies operation. + + Typically these are written to a http.Request. +*/ +type ListServiceAvailableUpstreamDependenciesParams struct { + + // ServiceID. + ServiceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list service available upstream dependencies params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListServiceAvailableUpstreamDependenciesParams) WithDefaults() *ListServiceAvailableUpstreamDependenciesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list service available upstream dependencies params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListServiceAvailableUpstreamDependenciesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list service available upstream dependencies params +func (o *ListServiceAvailableUpstreamDependenciesParams) WithTimeout(timeout time.Duration) *ListServiceAvailableUpstreamDependenciesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list service available upstream dependencies params +func (o *ListServiceAvailableUpstreamDependenciesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list service available upstream dependencies params +func (o *ListServiceAvailableUpstreamDependenciesParams) WithContext(ctx context.Context) *ListServiceAvailableUpstreamDependenciesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list service available upstream dependencies params +func (o *ListServiceAvailableUpstreamDependenciesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list service available upstream dependencies params +func (o *ListServiceAvailableUpstreamDependenciesParams) WithHTTPClient(client *http.Client) *ListServiceAvailableUpstreamDependenciesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list service available upstream dependencies params +func (o *ListServiceAvailableUpstreamDependenciesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithServiceID adds the serviceID to the list service available upstream dependencies params +func (o *ListServiceAvailableUpstreamDependenciesParams) WithServiceID(serviceID string) *ListServiceAvailableUpstreamDependenciesParams { + o.SetServiceID(serviceID) + return o +} + +// SetServiceID adds the serviceId to the list service available upstream dependencies params +func (o *ListServiceAvailableUpstreamDependenciesParams) SetServiceID(serviceID string) { + o.ServiceID = serviceID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListServiceAvailableUpstreamDependenciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param service_id + if err := r.SetPathParam("service_id", o.ServiceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/list_service_available_upstream_dependencies_responses.go b/client/catalog_entries/list_service_available_upstream_dependencies_responses.go new file mode 100644 index 0000000..c9b28fa --- /dev/null +++ b/client/catalog_entries/list_service_available_upstream_dependencies_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListServiceAvailableUpstreamDependenciesReader is a Reader for the ListServiceAvailableUpstreamDependencies structure. +type ListServiceAvailableUpstreamDependenciesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListServiceAvailableUpstreamDependenciesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListServiceAvailableUpstreamDependenciesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListServiceAvailableUpstreamDependenciesOK creates a ListServiceAvailableUpstreamDependenciesOK with default headers values +func NewListServiceAvailableUpstreamDependenciesOK() *ListServiceAvailableUpstreamDependenciesOK { + return &ListServiceAvailableUpstreamDependenciesOK{} +} + +/* +ListServiceAvailableUpstreamDependenciesOK describes a response with status code 200, with default header values. + +Retrieves all services that are available to be upstream dependencies +*/ +type ListServiceAvailableUpstreamDependenciesOK struct { + Payload *models.ServiceEntityLite +} + +// IsSuccess returns true when this list service available upstream dependencies o k response has a 2xx status code +func (o *ListServiceAvailableUpstreamDependenciesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list service available upstream dependencies o k response has a 3xx status code +func (o *ListServiceAvailableUpstreamDependenciesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list service available upstream dependencies o k response has a 4xx status code +func (o *ListServiceAvailableUpstreamDependenciesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list service available upstream dependencies o k response has a 5xx status code +func (o *ListServiceAvailableUpstreamDependenciesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list service available upstream dependencies o k response a status code equal to that given +func (o *ListServiceAvailableUpstreamDependenciesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListServiceAvailableUpstreamDependenciesOK) Error() string { + return fmt.Sprintf("[GET /v1/services/{service_id}/available_upstream_dependencies][%d] listServiceAvailableUpstreamDependenciesOK %+v", 200, o.Payload) +} + +func (o *ListServiceAvailableUpstreamDependenciesOK) String() string { + return fmt.Sprintf("[GET /v1/services/{service_id}/available_upstream_dependencies][%d] listServiceAvailableUpstreamDependenciesOK %+v", 200, o.Payload) +} + +func (o *ListServiceAvailableUpstreamDependenciesOK) GetPayload() *models.ServiceEntityLite { + return o.Payload +} + +func (o *ListServiceAvailableUpstreamDependenciesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceEntityLite) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/list_services_parameters.go b/client/catalog_entries/list_services_parameters.go new file mode 100644 index 0000000..a947763 --- /dev/null +++ b/client/catalog_entries/list_services_parameters.go @@ -0,0 +1,615 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListServicesParams creates a new ListServicesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListServicesParams() *ListServicesParams { + return &ListServicesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListServicesParamsWithTimeout creates a new ListServicesParams object +// with the ability to set a timeout on a request. +func NewListServicesParamsWithTimeout(timeout time.Duration) *ListServicesParams { + return &ListServicesParams{ + timeout: timeout, + } +} + +// NewListServicesParamsWithContext creates a new ListServicesParams object +// with the ability to set a context for a request. +func NewListServicesParamsWithContext(ctx context.Context) *ListServicesParams { + return &ListServicesParams{ + Context: ctx, + } +} + +// NewListServicesParamsWithHTTPClient creates a new ListServicesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListServicesParamsWithHTTPClient(client *http.Client) *ListServicesParams { + return &ListServicesParams{ + HTTPClient: client, + } +} + +/* +ListServicesParams contains all the parameters to send to the API endpoint + + for the list services operation. + + Typically these are written to a http.Request. +*/ +type ListServicesParams struct { + + /* AvailableDownstreamDependenciesForID. + + A query to find services that are available to be downstream dependencies for the passed service ID + */ + AvailableDownstreamDependenciesForID *string + + /* AvailableUpstreamDependenciesForID. + + A query to find services that are available to be upstream dependencies for the passed service ID + */ + AvailableUpstreamDependenciesForID *string + + /* Functionalities. + + A comma separated list of functionality ids + */ + Functionalities *string + + /* Impacted. + + A query to search services by if they are impacted with active incidents + */ + Impacted *string + + /* Include. + + Use in conjunction with lite param to specify additional attributes to include + */ + Include []string + + /* Labels. + + A comma separated list of label key / values in the format of 'key=value,key2=value2'. To filter change events that have a key (with no specific value), omit the value + */ + Labels *string + + /* Lite. + + Boolean to determine whether to return a slimified version of the services object + */ + Lite *bool + + /* Name. + + A query to search services by their name + */ + Name *string + + /* Owner. + + A query to search services by their owner + */ + Owner *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + A query to search services by their name or description + */ + Query *string + + /* RespondingTeams. + + A comma separated list of team ids + */ + RespondingTeams *string + + /* Tiers. + + A query to search services by their tier + */ + Tiers *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListServicesParams) WithDefaults() *ListServicesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListServicesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list services params +func (o *ListServicesParams) WithTimeout(timeout time.Duration) *ListServicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list services params +func (o *ListServicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list services params +func (o *ListServicesParams) WithContext(ctx context.Context) *ListServicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list services params +func (o *ListServicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list services params +func (o *ListServicesParams) WithHTTPClient(client *http.Client) *ListServicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list services params +func (o *ListServicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAvailableDownstreamDependenciesForID adds the availableDownstreamDependenciesForID to the list services params +func (o *ListServicesParams) WithAvailableDownstreamDependenciesForID(availableDownstreamDependenciesForID *string) *ListServicesParams { + o.SetAvailableDownstreamDependenciesForID(availableDownstreamDependenciesForID) + return o +} + +// SetAvailableDownstreamDependenciesForID adds the availableDownstreamDependenciesForId to the list services params +func (o *ListServicesParams) SetAvailableDownstreamDependenciesForID(availableDownstreamDependenciesForID *string) { + o.AvailableDownstreamDependenciesForID = availableDownstreamDependenciesForID +} + +// WithAvailableUpstreamDependenciesForID adds the availableUpstreamDependenciesForID to the list services params +func (o *ListServicesParams) WithAvailableUpstreamDependenciesForID(availableUpstreamDependenciesForID *string) *ListServicesParams { + o.SetAvailableUpstreamDependenciesForID(availableUpstreamDependenciesForID) + return o +} + +// SetAvailableUpstreamDependenciesForID adds the availableUpstreamDependenciesForId to the list services params +func (o *ListServicesParams) SetAvailableUpstreamDependenciesForID(availableUpstreamDependenciesForID *string) { + o.AvailableUpstreamDependenciesForID = availableUpstreamDependenciesForID +} + +// WithFunctionalities adds the functionalities to the list services params +func (o *ListServicesParams) WithFunctionalities(functionalities *string) *ListServicesParams { + o.SetFunctionalities(functionalities) + return o +} + +// SetFunctionalities adds the functionalities to the list services params +func (o *ListServicesParams) SetFunctionalities(functionalities *string) { + o.Functionalities = functionalities +} + +// WithImpacted adds the impacted to the list services params +func (o *ListServicesParams) WithImpacted(impacted *string) *ListServicesParams { + o.SetImpacted(impacted) + return o +} + +// SetImpacted adds the impacted to the list services params +func (o *ListServicesParams) SetImpacted(impacted *string) { + o.Impacted = impacted +} + +// WithInclude adds the include to the list services params +func (o *ListServicesParams) WithInclude(include []string) *ListServicesParams { + o.SetInclude(include) + return o +} + +// SetInclude adds the include to the list services params +func (o *ListServicesParams) SetInclude(include []string) { + o.Include = include +} + +// WithLabels adds the labels to the list services params +func (o *ListServicesParams) WithLabels(labels *string) *ListServicesParams { + o.SetLabels(labels) + return o +} + +// SetLabels adds the labels to the list services params +func (o *ListServicesParams) SetLabels(labels *string) { + o.Labels = labels +} + +// WithLite adds the lite to the list services params +func (o *ListServicesParams) WithLite(lite *bool) *ListServicesParams { + o.SetLite(lite) + return o +} + +// SetLite adds the lite to the list services params +func (o *ListServicesParams) SetLite(lite *bool) { + o.Lite = lite +} + +// WithName adds the name to the list services params +func (o *ListServicesParams) WithName(name *string) *ListServicesParams { + o.SetName(name) + return o +} + +// SetName adds the name to the list services params +func (o *ListServicesParams) SetName(name *string) { + o.Name = name +} + +// WithOwner adds the owner to the list services params +func (o *ListServicesParams) WithOwner(owner *string) *ListServicesParams { + o.SetOwner(owner) + return o +} + +// SetOwner adds the owner to the list services params +func (o *ListServicesParams) SetOwner(owner *string) { + o.Owner = owner +} + +// WithPage adds the page to the list services params +func (o *ListServicesParams) WithPage(page *int32) *ListServicesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list services params +func (o *ListServicesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list services params +func (o *ListServicesParams) WithPerPage(perPage *int32) *ListServicesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list services params +func (o *ListServicesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list services params +func (o *ListServicesParams) WithQuery(query *string) *ListServicesParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list services params +func (o *ListServicesParams) SetQuery(query *string) { + o.Query = query +} + +// WithRespondingTeams adds the respondingTeams to the list services params +func (o *ListServicesParams) WithRespondingTeams(respondingTeams *string) *ListServicesParams { + o.SetRespondingTeams(respondingTeams) + return o +} + +// SetRespondingTeams adds the respondingTeams to the list services params +func (o *ListServicesParams) SetRespondingTeams(respondingTeams *string) { + o.RespondingTeams = respondingTeams +} + +// WithTiers adds the tiers to the list services params +func (o *ListServicesParams) WithTiers(tiers *string) *ListServicesParams { + o.SetTiers(tiers) + return o +} + +// SetTiers adds the tiers to the list services params +func (o *ListServicesParams) SetTiers(tiers *string) { + o.Tiers = tiers +} + +// WriteToRequest writes these params to a swagger request +func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AvailableDownstreamDependenciesForID != nil { + + // query param available_downstream_dependencies_for_id + var qrAvailableDownstreamDependenciesForID string + + if o.AvailableDownstreamDependenciesForID != nil { + qrAvailableDownstreamDependenciesForID = *o.AvailableDownstreamDependenciesForID + } + qAvailableDownstreamDependenciesForID := qrAvailableDownstreamDependenciesForID + if qAvailableDownstreamDependenciesForID != "" { + + if err := r.SetQueryParam("available_downstream_dependencies_for_id", qAvailableDownstreamDependenciesForID); err != nil { + return err + } + } + } + + if o.AvailableUpstreamDependenciesForID != nil { + + // query param available_upstream_dependencies_for_id + var qrAvailableUpstreamDependenciesForID string + + if o.AvailableUpstreamDependenciesForID != nil { + qrAvailableUpstreamDependenciesForID = *o.AvailableUpstreamDependenciesForID + } + qAvailableUpstreamDependenciesForID := qrAvailableUpstreamDependenciesForID + if qAvailableUpstreamDependenciesForID != "" { + + if err := r.SetQueryParam("available_upstream_dependencies_for_id", qAvailableUpstreamDependenciesForID); err != nil { + return err + } + } + } + + if o.Functionalities != nil { + + // query param functionalities + var qrFunctionalities string + + if o.Functionalities != nil { + qrFunctionalities = *o.Functionalities + } + qFunctionalities := qrFunctionalities + if qFunctionalities != "" { + + if err := r.SetQueryParam("functionalities", qFunctionalities); err != nil { + return err + } + } + } + + if o.Impacted != nil { + + // query param impacted + var qrImpacted string + + if o.Impacted != nil { + qrImpacted = *o.Impacted + } + qImpacted := qrImpacted + if qImpacted != "" { + + if err := r.SetQueryParam("impacted", qImpacted); err != nil { + return err + } + } + } + + if o.Include != nil { + + // binding items for include + joinedInclude := o.bindParamInclude(reg) + + // query array param include + if err := r.SetQueryParam("include", joinedInclude...); err != nil { + return err + } + } + + if o.Labels != nil { + + // query param labels + var qrLabels string + + if o.Labels != nil { + qrLabels = *o.Labels + } + qLabels := qrLabels + if qLabels != "" { + + if err := r.SetQueryParam("labels", qLabels); err != nil { + return err + } + } + } + + if o.Lite != nil { + + // query param lite + var qrLite bool + + if o.Lite != nil { + qrLite = *o.Lite + } + qLite := swag.FormatBool(qrLite) + if qLite != "" { + + if err := r.SetQueryParam("lite", qLite); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.Owner != nil { + + // query param owner + var qrOwner string + + if o.Owner != nil { + qrOwner = *o.Owner + } + qOwner := qrOwner + if qOwner != "" { + + if err := r.SetQueryParam("owner", qOwner); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if o.RespondingTeams != nil { + + // query param responding_teams + var qrRespondingTeams string + + if o.RespondingTeams != nil { + qrRespondingTeams = *o.RespondingTeams + } + qRespondingTeams := qrRespondingTeams + if qRespondingTeams != "" { + + if err := r.SetQueryParam("responding_teams", qRespondingTeams); err != nil { + return err + } + } + } + + if o.Tiers != nil { + + // query param tiers + var qrTiers string + + if o.Tiers != nil { + qrTiers = *o.Tiers + } + qTiers := qrTiers + if qTiers != "" { + + if err := r.SetQueryParam("tiers", qTiers); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamListServices binds the parameter include +func (o *ListServicesParams) bindParamInclude(formats strfmt.Registry) []string { + includeIR := o.Include + + var includeIC []string + for _, includeIIR := range includeIR { // explode []string + + includeIIV := includeIIR // string as string + includeIC = append(includeIC, includeIIV) + } + + // items.CollectionFormat: "" + includeIS := swag.JoinByFormat(includeIC, "") + + return includeIS +} diff --git a/client/catalog_entries/list_services_responses.go b/client/catalog_entries/list_services_responses.go new file mode 100644 index 0000000..58d399a --- /dev/null +++ b/client/catalog_entries/list_services_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListServicesReader is a Reader for the ListServices structure. +type ListServicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListServicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListServicesOK creates a ListServicesOK with default headers values +func NewListServicesOK() *ListServicesOK { + return &ListServicesOK{} +} + +/* +ListServicesOK describes a response with status code 200, with default header values. + +List all of the services that have been added to the organization. +*/ +type ListServicesOK struct { + Payload *models.ServiceEntityPaginated +} + +// IsSuccess returns true when this list services o k response has a 2xx status code +func (o *ListServicesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list services o k response has a 3xx status code +func (o *ListServicesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list services o k response has a 4xx status code +func (o *ListServicesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list services o k response has a 5xx status code +func (o *ListServicesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list services o k response a status code equal to that given +func (o *ListServicesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListServicesOK) Error() string { + return fmt.Sprintf("[GET /v1/services][%d] listServicesOK %+v", 200, o.Payload) +} + +func (o *ListServicesOK) String() string { + return fmt.Sprintf("[GET /v1/services][%d] listServicesOK %+v", 200, o.Payload) +} + +func (o *ListServicesOK) GetPayload() *models.ServiceEntityPaginated { + return o.Payload +} + +func (o *ListServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/list_user_owned_services_parameters.go b/client/catalog_entries/list_user_owned_services_parameters.go new file mode 100644 index 0000000..f616ae4 --- /dev/null +++ b/client/catalog_entries/list_user_owned_services_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListUserOwnedServicesParams creates a new ListUserOwnedServicesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListUserOwnedServicesParams() *ListUserOwnedServicesParams { + return &ListUserOwnedServicesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListUserOwnedServicesParamsWithTimeout creates a new ListUserOwnedServicesParams object +// with the ability to set a timeout on a request. +func NewListUserOwnedServicesParamsWithTimeout(timeout time.Duration) *ListUserOwnedServicesParams { + return &ListUserOwnedServicesParams{ + timeout: timeout, + } +} + +// NewListUserOwnedServicesParamsWithContext creates a new ListUserOwnedServicesParams object +// with the ability to set a context for a request. +func NewListUserOwnedServicesParamsWithContext(ctx context.Context) *ListUserOwnedServicesParams { + return &ListUserOwnedServicesParams{ + Context: ctx, + } +} + +// NewListUserOwnedServicesParamsWithHTTPClient creates a new ListUserOwnedServicesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListUserOwnedServicesParamsWithHTTPClient(client *http.Client) *ListUserOwnedServicesParams { + return &ListUserOwnedServicesParams{ + HTTPClient: client, + } +} + +/* +ListUserOwnedServicesParams contains all the parameters to send to the API endpoint + + for the list user owned services operation. + + Typically these are written to a http.Request. +*/ +type ListUserOwnedServicesParams struct { + + // ID. + ID string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list user owned services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListUserOwnedServicesParams) WithDefaults() *ListUserOwnedServicesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list user owned services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListUserOwnedServicesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list user owned services params +func (o *ListUserOwnedServicesParams) WithTimeout(timeout time.Duration) *ListUserOwnedServicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list user owned services params +func (o *ListUserOwnedServicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list user owned services params +func (o *ListUserOwnedServicesParams) WithContext(ctx context.Context) *ListUserOwnedServicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list user owned services params +func (o *ListUserOwnedServicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list user owned services params +func (o *ListUserOwnedServicesParams) WithHTTPClient(client *http.Client) *ListUserOwnedServicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list user owned services params +func (o *ListUserOwnedServicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the list user owned services params +func (o *ListUserOwnedServicesParams) WithID(id string) *ListUserOwnedServicesParams { + o.SetID(id) + return o +} + +// SetID adds the id to the list user owned services params +func (o *ListUserOwnedServicesParams) SetID(id string) { + o.ID = id +} + +// WithPage adds the page to the list user owned services params +func (o *ListUserOwnedServicesParams) WithPage(page *int32) *ListUserOwnedServicesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list user owned services params +func (o *ListUserOwnedServicesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list user owned services params +func (o *ListUserOwnedServicesParams) WithPerPage(perPage *int32) *ListUserOwnedServicesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list user owned services params +func (o *ListUserOwnedServicesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListUserOwnedServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/list_user_owned_services_responses.go b/client/catalog_entries/list_user_owned_services_responses.go new file mode 100644 index 0000000..44dea74 --- /dev/null +++ b/client/catalog_entries/list_user_owned_services_responses.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListUserOwnedServicesReader is a Reader for the ListUserOwnedServices structure. +type ListUserOwnedServicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListUserOwnedServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListUserOwnedServicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListUserOwnedServicesOK creates a ListUserOwnedServicesOK with default headers values +func NewListUserOwnedServicesOK() *ListUserOwnedServicesOK { + return &ListUserOwnedServicesOK{} +} + +/* +ListUserOwnedServicesOK describes a response with status code 200, with default header values. + +Retrieves a list of services owned by the teams a user is on +*/ +type ListUserOwnedServicesOK struct { + Payload []*models.TeamEntityPaginated +} + +// IsSuccess returns true when this list user owned services o k response has a 2xx status code +func (o *ListUserOwnedServicesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list user owned services o k response has a 3xx status code +func (o *ListUserOwnedServicesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list user owned services o k response has a 4xx status code +func (o *ListUserOwnedServicesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list user owned services o k response has a 5xx status code +func (o *ListUserOwnedServicesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list user owned services o k response a status code equal to that given +func (o *ListUserOwnedServicesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListUserOwnedServicesOK) Error() string { + return fmt.Sprintf("[GET /v1/users/{id}/services][%d] listUserOwnedServicesOK %+v", 200, o.Payload) +} + +func (o *ListUserOwnedServicesOK) String() string { + return fmt.Sprintf("[GET /v1/users/{id}/services][%d] listUserOwnedServicesOK %+v", 200, o.Payload) +} + +func (o *ListUserOwnedServicesOK) GetPayload() []*models.TeamEntityPaginated { + return o.Payload +} + +func (o *ListUserOwnedServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/refresh_catalog_parameters.go b/client/catalog_entries/refresh_catalog_parameters.go new file mode 100644 index 0000000..583d52d --- /dev/null +++ b/client/catalog_entries/refresh_catalog_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewRefreshCatalogParams creates a new RefreshCatalogParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRefreshCatalogParams() *RefreshCatalogParams { + return &RefreshCatalogParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRefreshCatalogParamsWithTimeout creates a new RefreshCatalogParams object +// with the ability to set a timeout on a request. +func NewRefreshCatalogParamsWithTimeout(timeout time.Duration) *RefreshCatalogParams { + return &RefreshCatalogParams{ + timeout: timeout, + } +} + +// NewRefreshCatalogParamsWithContext creates a new RefreshCatalogParams object +// with the ability to set a context for a request. +func NewRefreshCatalogParamsWithContext(ctx context.Context) *RefreshCatalogParams { + return &RefreshCatalogParams{ + Context: ctx, + } +} + +// NewRefreshCatalogParamsWithHTTPClient creates a new RefreshCatalogParams object +// with the ability to set a custom HTTPClient for a request. +func NewRefreshCatalogParamsWithHTTPClient(client *http.Client) *RefreshCatalogParams { + return &RefreshCatalogParams{ + HTTPClient: client, + } +} + +/* +RefreshCatalogParams contains all the parameters to send to the API endpoint + + for the refresh catalog operation. + + Typically these are written to a http.Request. +*/ +type RefreshCatalogParams struct { + + // CatalogID. + CatalogID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the refresh catalog params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RefreshCatalogParams) WithDefaults() *RefreshCatalogParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the refresh catalog params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RefreshCatalogParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the refresh catalog params +func (o *RefreshCatalogParams) WithTimeout(timeout time.Duration) *RefreshCatalogParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the refresh catalog params +func (o *RefreshCatalogParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the refresh catalog params +func (o *RefreshCatalogParams) WithContext(ctx context.Context) *RefreshCatalogParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the refresh catalog params +func (o *RefreshCatalogParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the refresh catalog params +func (o *RefreshCatalogParams) WithHTTPClient(client *http.Client) *RefreshCatalogParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the refresh catalog params +func (o *RefreshCatalogParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCatalogID adds the catalogID to the refresh catalog params +func (o *RefreshCatalogParams) WithCatalogID(catalogID string) *RefreshCatalogParams { + o.SetCatalogID(catalogID) + return o +} + +// SetCatalogID adds the catalogId to the refresh catalog params +func (o *RefreshCatalogParams) SetCatalogID(catalogID string) { + o.CatalogID = catalogID +} + +// WriteToRequest writes these params to a swagger request +func (o *RefreshCatalogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param catalog_id + if err := r.SetPathParam("catalog_id", o.CatalogID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/refresh_catalog_responses.go b/client/catalog_entries/refresh_catalog_responses.go new file mode 100644 index 0000000..f025535 --- /dev/null +++ b/client/catalog_entries/refresh_catalog_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// RefreshCatalogReader is a Reader for the RefreshCatalog structure. +type RefreshCatalogReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RefreshCatalogReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRefreshCatalogOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewRefreshCatalogOK creates a RefreshCatalogOK with default headers values +func NewRefreshCatalogOK() *RefreshCatalogOK { + return &RefreshCatalogOK{} +} + +/* +RefreshCatalogOK describes a response with status code 200, with default header values. + +Schedules an async task to re-import catalog info and update catalog data accordingly. +*/ +type RefreshCatalogOK struct { +} + +// IsSuccess returns true when this refresh catalog o k response has a 2xx status code +func (o *RefreshCatalogOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this refresh catalog o k response has a 3xx status code +func (o *RefreshCatalogOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this refresh catalog o k response has a 4xx status code +func (o *RefreshCatalogOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this refresh catalog o k response has a 5xx status code +func (o *RefreshCatalogOK) IsServerError() bool { + return false +} + +// IsCode returns true when this refresh catalog o k response a status code equal to that given +func (o *RefreshCatalogOK) IsCode(code int) bool { + return code == 200 +} + +func (o *RefreshCatalogOK) Error() string { + return fmt.Sprintf("[GET /v1/catalogs/{catalog_id}/refresh][%d] refreshCatalogOK ", 200) +} + +func (o *RefreshCatalogOK) String() string { + return fmt.Sprintf("[GET /v1/catalogs/{catalog_id}/refresh][%d] refreshCatalogOK ", 200) +} + +func (o *RefreshCatalogOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/catalog_entries/update_environment_parameters.go b/client/catalog_entries/update_environment_parameters.go new file mode 100644 index 0000000..f8a025d --- /dev/null +++ b/client/catalog_entries/update_environment_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateEnvironmentParams creates a new UpdateEnvironmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateEnvironmentParams() *UpdateEnvironmentParams { + return &UpdateEnvironmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateEnvironmentParamsWithTimeout creates a new UpdateEnvironmentParams object +// with the ability to set a timeout on a request. +func NewUpdateEnvironmentParamsWithTimeout(timeout time.Duration) *UpdateEnvironmentParams { + return &UpdateEnvironmentParams{ + timeout: timeout, + } +} + +// NewUpdateEnvironmentParamsWithContext creates a new UpdateEnvironmentParams object +// with the ability to set a context for a request. +func NewUpdateEnvironmentParamsWithContext(ctx context.Context) *UpdateEnvironmentParams { + return &UpdateEnvironmentParams{ + Context: ctx, + } +} + +// NewUpdateEnvironmentParamsWithHTTPClient creates a new UpdateEnvironmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateEnvironmentParamsWithHTTPClient(client *http.Client) *UpdateEnvironmentParams { + return &UpdateEnvironmentParams{ + HTTPClient: client, + } +} + +/* +UpdateEnvironmentParams contains all the parameters to send to the API endpoint + + for the update environment operation. + + Typically these are written to a http.Request. +*/ +type UpdateEnvironmentParams struct { + + /* EnvironmentID. + + Environment UUID + */ + EnvironmentID string + + // UpdateEnvironment. + UpdateEnvironment *models.UpdateEnvironment + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateEnvironmentParams) WithDefaults() *UpdateEnvironmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateEnvironmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update environment params +func (o *UpdateEnvironmentParams) WithTimeout(timeout time.Duration) *UpdateEnvironmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update environment params +func (o *UpdateEnvironmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update environment params +func (o *UpdateEnvironmentParams) WithContext(ctx context.Context) *UpdateEnvironmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update environment params +func (o *UpdateEnvironmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update environment params +func (o *UpdateEnvironmentParams) WithHTTPClient(client *http.Client) *UpdateEnvironmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update environment params +func (o *UpdateEnvironmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEnvironmentID adds the environmentID to the update environment params +func (o *UpdateEnvironmentParams) WithEnvironmentID(environmentID string) *UpdateEnvironmentParams { + o.SetEnvironmentID(environmentID) + return o +} + +// SetEnvironmentID adds the environmentId to the update environment params +func (o *UpdateEnvironmentParams) SetEnvironmentID(environmentID string) { + o.EnvironmentID = environmentID +} + +// WithUpdateEnvironment adds the updateEnvironment to the update environment params +func (o *UpdateEnvironmentParams) WithUpdateEnvironment(updateEnvironment *models.UpdateEnvironment) *UpdateEnvironmentParams { + o.SetUpdateEnvironment(updateEnvironment) + return o +} + +// SetUpdateEnvironment adds the updateEnvironment to the update environment params +func (o *UpdateEnvironmentParams) SetUpdateEnvironment(updateEnvironment *models.UpdateEnvironment) { + o.UpdateEnvironment = updateEnvironment +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateEnvironmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param environment_id + if err := r.SetPathParam("environment_id", o.EnvironmentID); err != nil { + return err + } + if o.UpdateEnvironment != nil { + if err := r.SetBodyParam(o.UpdateEnvironment); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/update_environment_responses.go b/client/catalog_entries/update_environment_responses.go new file mode 100644 index 0000000..4ba728c --- /dev/null +++ b/client/catalog_entries/update_environment_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateEnvironmentReader is a Reader for the UpdateEnvironment structure. +type UpdateEnvironmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateEnvironmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateEnvironmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateEnvironmentOK creates a UpdateEnvironmentOK with default headers values +func NewUpdateEnvironmentOK() *UpdateEnvironmentOK { + return &UpdateEnvironmentOK{} +} + +/* +UpdateEnvironmentOK describes a response with status code 200, with default header values. + +Update a environments attributes +*/ +type UpdateEnvironmentOK struct { + Payload *models.EnvironmentEntryEntity +} + +// IsSuccess returns true when this update environment o k response has a 2xx status code +func (o *UpdateEnvironmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update environment o k response has a 3xx status code +func (o *UpdateEnvironmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update environment o k response has a 4xx status code +func (o *UpdateEnvironmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update environment o k response has a 5xx status code +func (o *UpdateEnvironmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update environment o k response a status code equal to that given +func (o *UpdateEnvironmentOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateEnvironmentOK) Error() string { + return fmt.Sprintf("[PATCH /v1/environments/{environment_id}][%d] updateEnvironmentOK %+v", 200, o.Payload) +} + +func (o *UpdateEnvironmentOK) String() string { + return fmt.Sprintf("[PATCH /v1/environments/{environment_id}][%d] updateEnvironmentOK %+v", 200, o.Payload) +} + +func (o *UpdateEnvironmentOK) GetPayload() *models.EnvironmentEntryEntity { + return o.Payload +} + +func (o *UpdateEnvironmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.EnvironmentEntryEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/update_functionality_parameters.go b/client/catalog_entries/update_functionality_parameters.go new file mode 100644 index 0000000..eda359b --- /dev/null +++ b/client/catalog_entries/update_functionality_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateFunctionalityParams creates a new UpdateFunctionalityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateFunctionalityParams() *UpdateFunctionalityParams { + return &UpdateFunctionalityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateFunctionalityParamsWithTimeout creates a new UpdateFunctionalityParams object +// with the ability to set a timeout on a request. +func NewUpdateFunctionalityParamsWithTimeout(timeout time.Duration) *UpdateFunctionalityParams { + return &UpdateFunctionalityParams{ + timeout: timeout, + } +} + +// NewUpdateFunctionalityParamsWithContext creates a new UpdateFunctionalityParams object +// with the ability to set a context for a request. +func NewUpdateFunctionalityParamsWithContext(ctx context.Context) *UpdateFunctionalityParams { + return &UpdateFunctionalityParams{ + Context: ctx, + } +} + +// NewUpdateFunctionalityParamsWithHTTPClient creates a new UpdateFunctionalityParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateFunctionalityParamsWithHTTPClient(client *http.Client) *UpdateFunctionalityParams { + return &UpdateFunctionalityParams{ + HTTPClient: client, + } +} + +/* +UpdateFunctionalityParams contains all the parameters to send to the API endpoint + + for the update functionality operation. + + Typically these are written to a http.Request. +*/ +type UpdateFunctionalityParams struct { + + // FunctionalityID. + FunctionalityID string + + // UpdateFunctionality. + UpdateFunctionality *models.UpdateFunctionality + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update functionality params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateFunctionalityParams) WithDefaults() *UpdateFunctionalityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update functionality params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateFunctionalityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update functionality params +func (o *UpdateFunctionalityParams) WithTimeout(timeout time.Duration) *UpdateFunctionalityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update functionality params +func (o *UpdateFunctionalityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update functionality params +func (o *UpdateFunctionalityParams) WithContext(ctx context.Context) *UpdateFunctionalityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update functionality params +func (o *UpdateFunctionalityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update functionality params +func (o *UpdateFunctionalityParams) WithHTTPClient(client *http.Client) *UpdateFunctionalityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update functionality params +func (o *UpdateFunctionalityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFunctionalityID adds the functionalityID to the update functionality params +func (o *UpdateFunctionalityParams) WithFunctionalityID(functionalityID string) *UpdateFunctionalityParams { + o.SetFunctionalityID(functionalityID) + return o +} + +// SetFunctionalityID adds the functionalityId to the update functionality params +func (o *UpdateFunctionalityParams) SetFunctionalityID(functionalityID string) { + o.FunctionalityID = functionalityID +} + +// WithUpdateFunctionality adds the updateFunctionality to the update functionality params +func (o *UpdateFunctionalityParams) WithUpdateFunctionality(updateFunctionality *models.UpdateFunctionality) *UpdateFunctionalityParams { + o.SetUpdateFunctionality(updateFunctionality) + return o +} + +// SetUpdateFunctionality adds the updateFunctionality to the update functionality params +func (o *UpdateFunctionalityParams) SetUpdateFunctionality(updateFunctionality *models.UpdateFunctionality) { + o.UpdateFunctionality = updateFunctionality +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateFunctionalityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param functionality_id + if err := r.SetPathParam("functionality_id", o.FunctionalityID); err != nil { + return err + } + if o.UpdateFunctionality != nil { + if err := r.SetBodyParam(o.UpdateFunctionality); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/update_functionality_responses.go b/client/catalog_entries/update_functionality_responses.go new file mode 100644 index 0000000..f6cb9c6 --- /dev/null +++ b/client/catalog_entries/update_functionality_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateFunctionalityReader is a Reader for the UpdateFunctionality structure. +type UpdateFunctionalityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateFunctionalityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateFunctionalityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateFunctionalityOK creates a UpdateFunctionalityOK with default headers values +func NewUpdateFunctionalityOK() *UpdateFunctionalityOK { + return &UpdateFunctionalityOK{} +} + +/* +UpdateFunctionalityOK describes a response with status code 200, with default header values. + +Update a functionalities attributes +*/ +type UpdateFunctionalityOK struct { + Payload *models.FunctionalityEntity +} + +// IsSuccess returns true when this update functionality o k response has a 2xx status code +func (o *UpdateFunctionalityOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update functionality o k response has a 3xx status code +func (o *UpdateFunctionalityOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update functionality o k response has a 4xx status code +func (o *UpdateFunctionalityOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update functionality o k response has a 5xx status code +func (o *UpdateFunctionalityOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update functionality o k response a status code equal to that given +func (o *UpdateFunctionalityOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateFunctionalityOK) Error() string { + return fmt.Sprintf("[PATCH /v1/functionalities/{functionality_id}][%d] updateFunctionalityOK %+v", 200, o.Payload) +} + +func (o *UpdateFunctionalityOK) String() string { + return fmt.Sprintf("[PATCH /v1/functionalities/{functionality_id}][%d] updateFunctionalityOK %+v", 200, o.Payload) +} + +func (o *UpdateFunctionalityOK) GetPayload() *models.FunctionalityEntity { + return o.Payload +} + +func (o *UpdateFunctionalityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FunctionalityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/update_service_dependency_parameters.go b/client/catalog_entries/update_service_dependency_parameters.go new file mode 100644 index 0000000..7724771 --- /dev/null +++ b/client/catalog_entries/update_service_dependency_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateServiceDependencyParams creates a new UpdateServiceDependencyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateServiceDependencyParams() *UpdateServiceDependencyParams { + return &UpdateServiceDependencyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateServiceDependencyParamsWithTimeout creates a new UpdateServiceDependencyParams object +// with the ability to set a timeout on a request. +func NewUpdateServiceDependencyParamsWithTimeout(timeout time.Duration) *UpdateServiceDependencyParams { + return &UpdateServiceDependencyParams{ + timeout: timeout, + } +} + +// NewUpdateServiceDependencyParamsWithContext creates a new UpdateServiceDependencyParams object +// with the ability to set a context for a request. +func NewUpdateServiceDependencyParamsWithContext(ctx context.Context) *UpdateServiceDependencyParams { + return &UpdateServiceDependencyParams{ + Context: ctx, + } +} + +// NewUpdateServiceDependencyParamsWithHTTPClient creates a new UpdateServiceDependencyParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateServiceDependencyParamsWithHTTPClient(client *http.Client) *UpdateServiceDependencyParams { + return &UpdateServiceDependencyParams{ + HTTPClient: client, + } +} + +/* +UpdateServiceDependencyParams contains all the parameters to send to the API endpoint + + for the update service dependency operation. + + Typically these are written to a http.Request. +*/ +type UpdateServiceDependencyParams struct { + + // ServiceDependencyID. + ServiceDependencyID string + + // UpdateServiceDependency. + UpdateServiceDependency *models.UpdateServiceDependency + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update service dependency params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateServiceDependencyParams) WithDefaults() *UpdateServiceDependencyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update service dependency params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateServiceDependencyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update service dependency params +func (o *UpdateServiceDependencyParams) WithTimeout(timeout time.Duration) *UpdateServiceDependencyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update service dependency params +func (o *UpdateServiceDependencyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update service dependency params +func (o *UpdateServiceDependencyParams) WithContext(ctx context.Context) *UpdateServiceDependencyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update service dependency params +func (o *UpdateServiceDependencyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update service dependency params +func (o *UpdateServiceDependencyParams) WithHTTPClient(client *http.Client) *UpdateServiceDependencyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update service dependency params +func (o *UpdateServiceDependencyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithServiceDependencyID adds the serviceDependencyID to the update service dependency params +func (o *UpdateServiceDependencyParams) WithServiceDependencyID(serviceDependencyID string) *UpdateServiceDependencyParams { + o.SetServiceDependencyID(serviceDependencyID) + return o +} + +// SetServiceDependencyID adds the serviceDependencyId to the update service dependency params +func (o *UpdateServiceDependencyParams) SetServiceDependencyID(serviceDependencyID string) { + o.ServiceDependencyID = serviceDependencyID +} + +// WithUpdateServiceDependency adds the updateServiceDependency to the update service dependency params +func (o *UpdateServiceDependencyParams) WithUpdateServiceDependency(updateServiceDependency *models.UpdateServiceDependency) *UpdateServiceDependencyParams { + o.SetUpdateServiceDependency(updateServiceDependency) + return o +} + +// SetUpdateServiceDependency adds the updateServiceDependency to the update service dependency params +func (o *UpdateServiceDependencyParams) SetUpdateServiceDependency(updateServiceDependency *models.UpdateServiceDependency) { + o.UpdateServiceDependency = updateServiceDependency +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateServiceDependencyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param service_dependency_id + if err := r.SetPathParam("service_dependency_id", o.ServiceDependencyID); err != nil { + return err + } + if o.UpdateServiceDependency != nil { + if err := r.SetBodyParam(o.UpdateServiceDependency); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/update_service_dependency_responses.go b/client/catalog_entries/update_service_dependency_responses.go new file mode 100644 index 0000000..2e4137a --- /dev/null +++ b/client/catalog_entries/update_service_dependency_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateServiceDependencyReader is a Reader for the UpdateServiceDependency structure. +type UpdateServiceDependencyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateServiceDependencyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateServiceDependencyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateServiceDependencyOK creates a UpdateServiceDependencyOK with default headers values +func NewUpdateServiceDependencyOK() *UpdateServiceDependencyOK { + return &UpdateServiceDependencyOK{} +} + +/* +UpdateServiceDependencyOK describes a response with status code 200, with default header values. + +Update the notes of the service dependency +*/ +type UpdateServiceDependencyOK struct { + Payload *models.ServiceDependencyEntity +} + +// IsSuccess returns true when this update service dependency o k response has a 2xx status code +func (o *UpdateServiceDependencyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update service dependency o k response has a 3xx status code +func (o *UpdateServiceDependencyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update service dependency o k response has a 4xx status code +func (o *UpdateServiceDependencyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update service dependency o k response has a 5xx status code +func (o *UpdateServiceDependencyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update service dependency o k response a status code equal to that given +func (o *UpdateServiceDependencyOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateServiceDependencyOK) Error() string { + return fmt.Sprintf("[PATCH /v1/service_dependencies/{service_dependency_id}][%d] updateServiceDependencyOK %+v", 200, o.Payload) +} + +func (o *UpdateServiceDependencyOK) String() string { + return fmt.Sprintf("[PATCH /v1/service_dependencies/{service_dependency_id}][%d] updateServiceDependencyOK %+v", 200, o.Payload) +} + +func (o *UpdateServiceDependencyOK) GetPayload() *models.ServiceDependencyEntity { + return o.Payload +} + +func (o *UpdateServiceDependencyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceDependencyEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/catalog_entries/update_service_parameters.go b/client/catalog_entries/update_service_parameters.go new file mode 100644 index 0000000..86e124d --- /dev/null +++ b/client/catalog_entries/update_service_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateServiceParams creates a new UpdateServiceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateServiceParams() *UpdateServiceParams { + return &UpdateServiceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateServiceParamsWithTimeout creates a new UpdateServiceParams object +// with the ability to set a timeout on a request. +func NewUpdateServiceParamsWithTimeout(timeout time.Duration) *UpdateServiceParams { + return &UpdateServiceParams{ + timeout: timeout, + } +} + +// NewUpdateServiceParamsWithContext creates a new UpdateServiceParams object +// with the ability to set a context for a request. +func NewUpdateServiceParamsWithContext(ctx context.Context) *UpdateServiceParams { + return &UpdateServiceParams{ + Context: ctx, + } +} + +// NewUpdateServiceParamsWithHTTPClient creates a new UpdateServiceParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateServiceParamsWithHTTPClient(client *http.Client) *UpdateServiceParams { + return &UpdateServiceParams{ + HTTPClient: client, + } +} + +/* +UpdateServiceParams contains all the parameters to send to the API endpoint + + for the update service operation. + + Typically these are written to a http.Request. +*/ +type UpdateServiceParams struct { + + // ServiceID. + ServiceID string + + // UpdateService. + UpdateService *models.UpdateService + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateServiceParams) WithDefaults() *UpdateServiceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update service params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateServiceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update service params +func (o *UpdateServiceParams) WithTimeout(timeout time.Duration) *UpdateServiceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update service params +func (o *UpdateServiceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update service params +func (o *UpdateServiceParams) WithContext(ctx context.Context) *UpdateServiceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update service params +func (o *UpdateServiceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update service params +func (o *UpdateServiceParams) WithHTTPClient(client *http.Client) *UpdateServiceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update service params +func (o *UpdateServiceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithServiceID adds the serviceID to the update service params +func (o *UpdateServiceParams) WithServiceID(serviceID string) *UpdateServiceParams { + o.SetServiceID(serviceID) + return o +} + +// SetServiceID adds the serviceId to the update service params +func (o *UpdateServiceParams) SetServiceID(serviceID string) { + o.ServiceID = serviceID +} + +// WithUpdateService adds the updateService to the update service params +func (o *UpdateServiceParams) WithUpdateService(updateService *models.UpdateService) *UpdateServiceParams { + o.SetUpdateService(updateService) + return o +} + +// SetUpdateService adds the updateService to the update service params +func (o *UpdateServiceParams) SetUpdateService(updateService *models.UpdateService) { + o.UpdateService = updateService +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param service_id + if err := r.SetPathParam("service_id", o.ServiceID); err != nil { + return err + } + if o.UpdateService != nil { + if err := r.SetBodyParam(o.UpdateService); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/catalog_entries/update_service_responses.go b/client/catalog_entries/update_service_responses.go new file mode 100644 index 0000000..f5b23a3 --- /dev/null +++ b/client/catalog_entries/update_service_responses.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package catalog_entries + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateServiceReader is a Reader for the UpdateService structure. +type UpdateServiceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateServiceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateServiceOK creates a UpdateServiceOK with default headers values +func NewUpdateServiceOK() *UpdateServiceOK { + return &UpdateServiceOK{} +} + +/* + UpdateServiceOK describes a response with status code 200, with default header values. + + Update a services attributes, you may also add or remove functionalities from the service as well. + +Note: You may not remove or add individual label key/value pairs. You must include the entire object to override label values. +*/ +type UpdateServiceOK struct { + Payload *models.ServiceEntity +} + +// IsSuccess returns true when this update service o k response has a 2xx status code +func (o *UpdateServiceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update service o k response has a 3xx status code +func (o *UpdateServiceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update service o k response has a 4xx status code +func (o *UpdateServiceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update service o k response has a 5xx status code +func (o *UpdateServiceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update service o k response a status code equal to that given +func (o *UpdateServiceOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateServiceOK) Error() string { + return fmt.Sprintf("[PATCH /v1/services/{service_id}][%d] updateServiceOK %+v", 200, o.Payload) +} + +func (o *UpdateServiceOK) String() string { + return fmt.Sprintf("[PATCH /v1/services/{service_id}][%d] updateServiceOK %+v", 200, o.Payload) +} + +func (o *UpdateServiceOK) GetPayload() *models.ServiceEntity { + return o.Payload +} + +func (o *UpdateServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ServiceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/changes/changes_client.go b/client/changes/changes_client.go index b1c89d6..3e3b3ae 100644 --- a/client/changes/changes_client.go +++ b/client/changes/changes_client.go @@ -30,56 +30,56 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1ChangesChangeID(params *DeleteV1ChangesChangeIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ChangesChangeIDNoContent, error) + CreateChange(params *CreateChangeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateChangeCreated, error) - DeleteV1ChangesChangeIDIdentitiesIdentityID(params *DeleteV1ChangesChangeIDIdentitiesIdentityIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ChangesChangeIDIdentitiesIdentityIDNoContent, error) + CreateChangeEvent(params *CreateChangeEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateChangeEventCreated, error) - DeleteV1ChangesEventsChangeEventID(params *DeleteV1ChangesEventsChangeEventIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ChangesEventsChangeEventIDNoContent, error) + CreateChangeIdentity(params *CreateChangeIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateChangeIdentityCreated, error) - GetV1ChangeTypes(params *GetV1ChangeTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ChangeTypesOK, error) + DeleteChange(params *DeleteChangeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteChangeNoContent, error) - GetV1Changes(params *GetV1ChangesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ChangesOK, error) + DeleteChangeEvent(params *DeleteChangeEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteChangeEventNoContent, error) - GetV1ChangesChangeIDIdentities(params *GetV1ChangesChangeIDIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ChangesChangeIDIdentitiesOK, error) + DeleteChangeIdentity(params *DeleteChangeIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteChangeIdentityNoContent, error) - GetV1ChangesEvents(params *GetV1ChangesEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ChangesEventsOK, error) + GetChangeEvent(params *GetChangeEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetChangeEventOK, error) - GetV1ChangesEventsChangeEventID(params *GetV1ChangesEventsChangeEventIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ChangesEventsChangeEventIDOK, error) + ListChangeEvents(params *ListChangeEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListChangeEventsOK, error) - PatchV1ChangesChangeID(params *PatchV1ChangesChangeIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1ChangesChangeIDOK, error) + ListChangeIdentities(params *ListChangeIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListChangeIdentitiesOK, error) - PatchV1ChangesChangeIDIdentitiesIdentityID(params *PatchV1ChangesChangeIDIdentitiesIdentityIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1ChangesChangeIDIdentitiesIdentityIDOK, error) + ListChangeTypes(params *ListChangeTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListChangeTypesOK, error) - PatchV1ChangesEventsChangeEventID(params *PatchV1ChangesEventsChangeEventIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1ChangesEventsChangeEventIDOK, error) + ListChanges(params *ListChangesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListChangesOK, error) - PostV1Changes(params *PostV1ChangesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ChangesCreated, error) + UpdateChange(params *UpdateChangeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateChangeOK, error) - PostV1ChangesChangeIDIdentities(params *PostV1ChangesChangeIDIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ChangesChangeIDIdentitiesCreated, error) + UpdateChangeEvent(params *UpdateChangeEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateChangeEventOK, error) - PostV1ChangesEvents(params *PostV1ChangesEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ChangesEventsCreated, error) + UpdateChangeIdentity(params *UpdateChangeIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateChangeIdentityOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1ChangesChangeID archives a change entry +CreateChange creates a new change entry -Archive a change entry +Create a new change entry */ -func (a *Client) DeleteV1ChangesChangeID(params *DeleteV1ChangesChangeIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ChangesChangeIDNoContent, error) { +func (a *Client) CreateChange(params *CreateChangeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateChangeCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1ChangesChangeIDParams() + params = NewCreateChangeParams() } op := &runtime.ClientOperation{ - ID: "deleteV1ChangesChangeId", - Method: "DELETE", - PathPattern: "/v1/changes/{change_id}", + ID: "create_change", + Method: "POST", + PathPattern: "/v1/changes", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1ChangesChangeIDReader{formats: a.formats}, + Reader: &CreateChangeReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -92,35 +92,35 @@ func (a *Client) DeleteV1ChangesChangeID(params *DeleteV1ChangesChangeIDParams, if err != nil { return nil, err } - success, ok := result.(*DeleteV1ChangesChangeIDNoContent) + success, ok := result.(*CreateChangeCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1ChangesChangeId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_change: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1ChangesChangeIDIdentitiesIdentityID deletes an identity from a change entry +CreateChangeEvent creates a change event -Delete an identity from the change entry +Create a change event */ -func (a *Client) DeleteV1ChangesChangeIDIdentitiesIdentityID(params *DeleteV1ChangesChangeIDIdentitiesIdentityIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ChangesChangeIDIdentitiesIdentityIDNoContent, error) { +func (a *Client) CreateChangeEvent(params *CreateChangeEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateChangeEventCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1ChangesChangeIDIdentitiesIdentityIDParams() + params = NewCreateChangeEventParams() } op := &runtime.ClientOperation{ - ID: "deleteV1ChangesChangeIdIdentitiesIdentityId", - Method: "DELETE", - PathPattern: "/v1/changes/{change_id}/identities/{identity_id}", + ID: "create_change_event", + Method: "POST", + PathPattern: "/v1/changes/events", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1ChangesChangeIDIdentitiesIdentityIDReader{formats: a.formats}, + Reader: &CreateChangeEventReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -133,35 +133,35 @@ func (a *Client) DeleteV1ChangesChangeIDIdentitiesIdentityID(params *DeleteV1Cha if err != nil { return nil, err } - success, ok := result.(*DeleteV1ChangesChangeIDIdentitiesIdentityIDNoContent) + success, ok := result.(*CreateChangeEventCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1ChangesChangeIdIdentitiesIdentityId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_change_event: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1ChangesEventsChangeEventID deletes a change event +CreateChangeIdentity creates an identity for a change entry -Delete a change event +Create an identity for the change entry */ -func (a *Client) DeleteV1ChangesEventsChangeEventID(params *DeleteV1ChangesEventsChangeEventIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ChangesEventsChangeEventIDNoContent, error) { +func (a *Client) CreateChangeIdentity(params *CreateChangeIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateChangeIdentityCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1ChangesEventsChangeEventIDParams() + params = NewCreateChangeIdentityParams() } op := &runtime.ClientOperation{ - ID: "deleteV1ChangesEventsChangeEventId", - Method: "DELETE", - PathPattern: "/v1/changes/events/{change_event_id}", + ID: "create_change_identity", + Method: "POST", + PathPattern: "/v1/changes/{change_id}/identities", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1ChangesEventsChangeEventIDReader{formats: a.formats}, + Reader: &CreateChangeIdentityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -174,35 +174,35 @@ func (a *Client) DeleteV1ChangesEventsChangeEventID(params *DeleteV1ChangesEvent if err != nil { return nil, err } - success, ok := result.(*DeleteV1ChangesEventsChangeEventIDNoContent) + success, ok := result.(*CreateChangeIdentityCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1ChangesEventsChangeEventId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_change_identity: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ChangeTypes lists change types +DeleteChange archives a change entry -List change types for the organization +Archive a change entry */ -func (a *Client) GetV1ChangeTypes(params *GetV1ChangeTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ChangeTypesOK, error) { +func (a *Client) DeleteChange(params *DeleteChangeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteChangeNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ChangeTypesParams() + params = NewDeleteChangeParams() } op := &runtime.ClientOperation{ - ID: "getV1ChangeTypes", - Method: "GET", - PathPattern: "/v1/change_types", + ID: "delete_change", + Method: "DELETE", + PathPattern: "/v1/changes/{change_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ChangeTypesReader{formats: a.formats}, + Reader: &DeleteChangeReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -215,35 +215,35 @@ func (a *Client) GetV1ChangeTypes(params *GetV1ChangeTypesParams, authInfo runti if err != nil { return nil, err } - success, ok := result.(*GetV1ChangeTypesOK) + success, ok := result.(*DeleteChangeNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ChangeTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_change: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Changes lists changes +DeleteChangeEvent deletes a change event -List changes for the organization +Delete a change event */ -func (a *Client) GetV1Changes(params *GetV1ChangesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ChangesOK, error) { +func (a *Client) DeleteChangeEvent(params *DeleteChangeEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteChangeEventNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ChangesParams() + params = NewDeleteChangeEventParams() } op := &runtime.ClientOperation{ - ID: "getV1Changes", - Method: "GET", - PathPattern: "/v1/changes", + ID: "delete_change_event", + Method: "DELETE", + PathPattern: "/v1/changes/events/{change_event_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ChangesReader{formats: a.formats}, + Reader: &DeleteChangeEventReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -256,35 +256,35 @@ func (a *Client) GetV1Changes(params *GetV1ChangesParams, authInfo runtime.Clien if err != nil { return nil, err } - success, ok := result.(*GetV1ChangesOK) + success, ok := result.(*DeleteChangeEventNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Changes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_change_event: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ChangesChangeIDIdentities lists identities for a change entry +DeleteChangeIdentity deletes an identity from a change entry -Retrieve all identities for the change entry +Delete an identity from the change entry */ -func (a *Client) GetV1ChangesChangeIDIdentities(params *GetV1ChangesChangeIDIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ChangesChangeIDIdentitiesOK, error) { +func (a *Client) DeleteChangeIdentity(params *DeleteChangeIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteChangeIdentityNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ChangesChangeIDIdentitiesParams() + params = NewDeleteChangeIdentityParams() } op := &runtime.ClientOperation{ - ID: "getV1ChangesChangeIdIdentities", - Method: "GET", - PathPattern: "/v1/changes/{change_id}/identities", + ID: "delete_change_identity", + Method: "DELETE", + PathPattern: "/v1/changes/{change_id}/identities/{identity_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ChangesChangeIDIdentitiesReader{formats: a.formats}, + Reader: &DeleteChangeIdentityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -297,35 +297,35 @@ func (a *Client) GetV1ChangesChangeIDIdentities(params *GetV1ChangesChangeIDIden if err != nil { return nil, err } - success, ok := result.(*GetV1ChangesChangeIDIdentitiesOK) + success, ok := result.(*DeleteChangeIdentityNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ChangesChangeIdIdentities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_change_identity: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ChangesEvents lists change events +GetChangeEvent gets a change event -List change events for the organization. Note: Not all information is included on a change event like attachments and related changes. You must fetch a change event separately to retrieve all of the information about it +Retrieve a change event */ -func (a *Client) GetV1ChangesEvents(params *GetV1ChangesEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ChangesEventsOK, error) { +func (a *Client) GetChangeEvent(params *GetChangeEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetChangeEventOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ChangesEventsParams() + params = NewGetChangeEventParams() } op := &runtime.ClientOperation{ - ID: "getV1ChangesEvents", + ID: "get_change_event", Method: "GET", - PathPattern: "/v1/changes/events", + PathPattern: "/v1/changes/events/{change_event_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ChangesEventsReader{formats: a.formats}, + Reader: &GetChangeEventReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -338,35 +338,35 @@ func (a *Client) GetV1ChangesEvents(params *GetV1ChangesEventsParams, authInfo r if err != nil { return nil, err } - success, ok := result.(*GetV1ChangesEventsOK) + success, ok := result.(*GetChangeEventOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ChangesEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_change_event: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ChangesEventsChangeEventID gets a change event +ListChangeEvents lists change events -Retrieve a change event +List change events for the organization. Note: Not all information is included on a change event like attachments and related changes. You must fetch a change event separately to retrieve all of the information about it */ -func (a *Client) GetV1ChangesEventsChangeEventID(params *GetV1ChangesEventsChangeEventIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ChangesEventsChangeEventIDOK, error) { +func (a *Client) ListChangeEvents(params *ListChangeEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListChangeEventsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ChangesEventsChangeEventIDParams() + params = NewListChangeEventsParams() } op := &runtime.ClientOperation{ - ID: "getV1ChangesEventsChangeEventId", + ID: "list_change_events", Method: "GET", - PathPattern: "/v1/changes/events/{change_event_id}", + PathPattern: "/v1/changes/events", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ChangesEventsChangeEventIDReader{formats: a.formats}, + Reader: &ListChangeEventsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -379,35 +379,35 @@ func (a *Client) GetV1ChangesEventsChangeEventID(params *GetV1ChangesEventsChang if err != nil { return nil, err } - success, ok := result.(*GetV1ChangesEventsChangeEventIDOK) + success, ok := result.(*ListChangeEventsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ChangesEventsChangeEventId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_change_events: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1ChangesChangeID updates a change entry +ListChangeIdentities lists identities for a change entry -Update a change entry +Retrieve all identities for the change entry */ -func (a *Client) PatchV1ChangesChangeID(params *PatchV1ChangesChangeIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1ChangesChangeIDOK, error) { +func (a *Client) ListChangeIdentities(params *ListChangeIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListChangeIdentitiesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1ChangesChangeIDParams() + params = NewListChangeIdentitiesParams() } op := &runtime.ClientOperation{ - ID: "patchV1ChangesChangeId", - Method: "PATCH", - PathPattern: "/v1/changes/{change_id}", + ID: "list_change_identities", + Method: "GET", + PathPattern: "/v1/changes/{change_id}/identities", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1ChangesChangeIDReader{formats: a.formats}, + Reader: &ListChangeIdentitiesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -420,35 +420,35 @@ func (a *Client) PatchV1ChangesChangeID(params *PatchV1ChangesChangeIDParams, au if err != nil { return nil, err } - success, ok := result.(*PatchV1ChangesChangeIDOK) + success, ok := result.(*ListChangeIdentitiesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1ChangesChangeId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_change_identities: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1ChangesChangeIDIdentitiesIdentityID updates an identity for a change entry +ListChangeTypes lists change types -Update an identity for the change entry +List change types for the organization */ -func (a *Client) PatchV1ChangesChangeIDIdentitiesIdentityID(params *PatchV1ChangesChangeIDIdentitiesIdentityIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1ChangesChangeIDIdentitiesIdentityIDOK, error) { +func (a *Client) ListChangeTypes(params *ListChangeTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListChangeTypesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1ChangesChangeIDIdentitiesIdentityIDParams() + params = NewListChangeTypesParams() } op := &runtime.ClientOperation{ - ID: "patchV1ChangesChangeIdIdentitiesIdentityId", - Method: "PATCH", - PathPattern: "/v1/changes/{change_id}/identities/{identity_id}", + ID: "list_change_types", + Method: "GET", + PathPattern: "/v1/change_types", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1ChangesChangeIDIdentitiesIdentityIDReader{formats: a.formats}, + Reader: &ListChangeTypesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -461,35 +461,35 @@ func (a *Client) PatchV1ChangesChangeIDIdentitiesIdentityID(params *PatchV1Chang if err != nil { return nil, err } - success, ok := result.(*PatchV1ChangesChangeIDIdentitiesIdentityIDOK) + success, ok := result.(*ListChangeTypesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1ChangesChangeIdIdentitiesIdentityId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_change_types: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1ChangesEventsChangeEventID updates a change event +ListChanges lists changes -Update a change event +List changes for the organization */ -func (a *Client) PatchV1ChangesEventsChangeEventID(params *PatchV1ChangesEventsChangeEventIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1ChangesEventsChangeEventIDOK, error) { +func (a *Client) ListChanges(params *ListChangesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListChangesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1ChangesEventsChangeEventIDParams() + params = NewListChangesParams() } op := &runtime.ClientOperation{ - ID: "patchV1ChangesEventsChangeEventId", - Method: "PATCH", - PathPattern: "/v1/changes/events/{change_event_id}", + ID: "list_changes", + Method: "GET", + PathPattern: "/v1/changes", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1ChangesEventsChangeEventIDReader{formats: a.formats}, + Reader: &ListChangesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -502,35 +502,35 @@ func (a *Client) PatchV1ChangesEventsChangeEventID(params *PatchV1ChangesEventsC if err != nil { return nil, err } - success, ok := result.(*PatchV1ChangesEventsChangeEventIDOK) + success, ok := result.(*ListChangesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1ChangesEventsChangeEventId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_changes: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1Changes creates a new change entry +UpdateChange updates a change entry -Create a new change entry +Update a change entry */ -func (a *Client) PostV1Changes(params *PostV1ChangesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ChangesCreated, error) { +func (a *Client) UpdateChange(params *UpdateChangeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateChangeOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1ChangesParams() + params = NewUpdateChangeParams() } op := &runtime.ClientOperation{ - ID: "postV1Changes", - Method: "POST", - PathPattern: "/v1/changes", + ID: "update_change", + Method: "PATCH", + PathPattern: "/v1/changes/{change_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1ChangesReader{formats: a.formats}, + Reader: &UpdateChangeReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -543,35 +543,35 @@ func (a *Client) PostV1Changes(params *PostV1ChangesParams, authInfo runtime.Cli if err != nil { return nil, err } - success, ok := result.(*PostV1ChangesCreated) + success, ok := result.(*UpdateChangeOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1Changes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_change: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1ChangesChangeIDIdentities creates an identity for a change entry +UpdateChangeEvent updates a change event -Create an identity for the change entry +Update a change event */ -func (a *Client) PostV1ChangesChangeIDIdentities(params *PostV1ChangesChangeIDIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ChangesChangeIDIdentitiesCreated, error) { +func (a *Client) UpdateChangeEvent(params *UpdateChangeEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateChangeEventOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1ChangesChangeIDIdentitiesParams() + params = NewUpdateChangeEventParams() } op := &runtime.ClientOperation{ - ID: "postV1ChangesChangeIdIdentities", - Method: "POST", - PathPattern: "/v1/changes/{change_id}/identities", + ID: "update_change_event", + Method: "PATCH", + PathPattern: "/v1/changes/events/{change_event_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1ChangesChangeIDIdentitiesReader{formats: a.formats}, + Reader: &UpdateChangeEventReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -584,35 +584,35 @@ func (a *Client) PostV1ChangesChangeIDIdentities(params *PostV1ChangesChangeIDId if err != nil { return nil, err } - success, ok := result.(*PostV1ChangesChangeIDIdentitiesCreated) + success, ok := result.(*UpdateChangeEventOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1ChangesChangeIdIdentities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_change_event: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1ChangesEvents creates a change event +UpdateChangeIdentity updates an identity for a change entry -Create a change event +Update an identity for the change entry */ -func (a *Client) PostV1ChangesEvents(params *PostV1ChangesEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ChangesEventsCreated, error) { +func (a *Client) UpdateChangeIdentity(params *UpdateChangeIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateChangeIdentityOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1ChangesEventsParams() + params = NewUpdateChangeIdentityParams() } op := &runtime.ClientOperation{ - ID: "postV1ChangesEvents", - Method: "POST", - PathPattern: "/v1/changes/events", + ID: "update_change_identity", + Method: "PATCH", + PathPattern: "/v1/changes/{change_id}/identities/{identity_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1ChangesEventsReader{formats: a.formats}, + Reader: &UpdateChangeIdentityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -625,13 +625,13 @@ func (a *Client) PostV1ChangesEvents(params *PostV1ChangesEventsParams, authInfo if err != nil { return nil, err } - success, ok := result.(*PostV1ChangesEventsCreated) + success, ok := result.(*UpdateChangeIdentityOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1ChangesEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_change_identity: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/changes/create_change_event_parameters.go b/client/changes/create_change_event_parameters.go new file mode 100644 index 0000000..3a88926 --- /dev/null +++ b/client/changes/create_change_event_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateChangeEventParams creates a new CreateChangeEventParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateChangeEventParams() *CreateChangeEventParams { + return &CreateChangeEventParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateChangeEventParamsWithTimeout creates a new CreateChangeEventParams object +// with the ability to set a timeout on a request. +func NewCreateChangeEventParamsWithTimeout(timeout time.Duration) *CreateChangeEventParams { + return &CreateChangeEventParams{ + timeout: timeout, + } +} + +// NewCreateChangeEventParamsWithContext creates a new CreateChangeEventParams object +// with the ability to set a context for a request. +func NewCreateChangeEventParamsWithContext(ctx context.Context) *CreateChangeEventParams { + return &CreateChangeEventParams{ + Context: ctx, + } +} + +// NewCreateChangeEventParamsWithHTTPClient creates a new CreateChangeEventParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateChangeEventParamsWithHTTPClient(client *http.Client) *CreateChangeEventParams { + return &CreateChangeEventParams{ + HTTPClient: client, + } +} + +/* +CreateChangeEventParams contains all the parameters to send to the API endpoint + + for the create change event operation. + + Typically these are written to a http.Request. +*/ +type CreateChangeEventParams struct { + + // CreateChangeEvent. + CreateChangeEvent *models.CreateChangeEvent + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create change event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateChangeEventParams) WithDefaults() *CreateChangeEventParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create change event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateChangeEventParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create change event params +func (o *CreateChangeEventParams) WithTimeout(timeout time.Duration) *CreateChangeEventParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create change event params +func (o *CreateChangeEventParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create change event params +func (o *CreateChangeEventParams) WithContext(ctx context.Context) *CreateChangeEventParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create change event params +func (o *CreateChangeEventParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create change event params +func (o *CreateChangeEventParams) WithHTTPClient(client *http.Client) *CreateChangeEventParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create change event params +func (o *CreateChangeEventParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateChangeEvent adds the createChangeEvent to the create change event params +func (o *CreateChangeEventParams) WithCreateChangeEvent(createChangeEvent *models.CreateChangeEvent) *CreateChangeEventParams { + o.SetCreateChangeEvent(createChangeEvent) + return o +} + +// SetCreateChangeEvent adds the createChangeEvent to the create change event params +func (o *CreateChangeEventParams) SetCreateChangeEvent(createChangeEvent *models.CreateChangeEvent) { + o.CreateChangeEvent = createChangeEvent +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateChangeEventParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateChangeEvent != nil { + if err := r.SetBodyParam(o.CreateChangeEvent); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/changes/create_change_event_responses.go b/client/changes/create_change_event_responses.go new file mode 100644 index 0000000..d51c0f2 --- /dev/null +++ b/client/changes/create_change_event_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateChangeEventReader is a Reader for the CreateChangeEvent structure. +type CreateChangeEventReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateChangeEventReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateChangeEventCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateChangeEventCreated creates a CreateChangeEventCreated with default headers values +func NewCreateChangeEventCreated() *CreateChangeEventCreated { + return &CreateChangeEventCreated{} +} + +/* +CreateChangeEventCreated describes a response with status code 201, with default header values. + +Create a change event +*/ +type CreateChangeEventCreated struct { + Payload *models.ChangeEventEntity +} + +// IsSuccess returns true when this create change event created response has a 2xx status code +func (o *CreateChangeEventCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create change event created response has a 3xx status code +func (o *CreateChangeEventCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create change event created response has a 4xx status code +func (o *CreateChangeEventCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create change event created response has a 5xx status code +func (o *CreateChangeEventCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create change event created response a status code equal to that given +func (o *CreateChangeEventCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateChangeEventCreated) Error() string { + return fmt.Sprintf("[POST /v1/changes/events][%d] createChangeEventCreated %+v", 201, o.Payload) +} + +func (o *CreateChangeEventCreated) String() string { + return fmt.Sprintf("[POST /v1/changes/events][%d] createChangeEventCreated %+v", 201, o.Payload) +} + +func (o *CreateChangeEventCreated) GetPayload() *models.ChangeEventEntity { + return o.Payload +} + +func (o *CreateChangeEventCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChangeEventEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/changes/create_change_identity_parameters.go b/client/changes/create_change_identity_parameters.go new file mode 100644 index 0000000..748aced --- /dev/null +++ b/client/changes/create_change_identity_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateChangeIdentityParams creates a new CreateChangeIdentityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateChangeIdentityParams() *CreateChangeIdentityParams { + return &CreateChangeIdentityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateChangeIdentityParamsWithTimeout creates a new CreateChangeIdentityParams object +// with the ability to set a timeout on a request. +func NewCreateChangeIdentityParamsWithTimeout(timeout time.Duration) *CreateChangeIdentityParams { + return &CreateChangeIdentityParams{ + timeout: timeout, + } +} + +// NewCreateChangeIdentityParamsWithContext creates a new CreateChangeIdentityParams object +// with the ability to set a context for a request. +func NewCreateChangeIdentityParamsWithContext(ctx context.Context) *CreateChangeIdentityParams { + return &CreateChangeIdentityParams{ + Context: ctx, + } +} + +// NewCreateChangeIdentityParamsWithHTTPClient creates a new CreateChangeIdentityParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateChangeIdentityParamsWithHTTPClient(client *http.Client) *CreateChangeIdentityParams { + return &CreateChangeIdentityParams{ + HTTPClient: client, + } +} + +/* +CreateChangeIdentityParams contains all the parameters to send to the API endpoint + + for the create change identity operation. + + Typically these are written to a http.Request. +*/ +type CreateChangeIdentityParams struct { + + // ChangeID. + ChangeID string + + // CreateChangeIdentity. + CreateChangeIdentity *models.CreateChangeIdentity + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create change identity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateChangeIdentityParams) WithDefaults() *CreateChangeIdentityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create change identity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateChangeIdentityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create change identity params +func (o *CreateChangeIdentityParams) WithTimeout(timeout time.Duration) *CreateChangeIdentityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create change identity params +func (o *CreateChangeIdentityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create change identity params +func (o *CreateChangeIdentityParams) WithContext(ctx context.Context) *CreateChangeIdentityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create change identity params +func (o *CreateChangeIdentityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create change identity params +func (o *CreateChangeIdentityParams) WithHTTPClient(client *http.Client) *CreateChangeIdentityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create change identity params +func (o *CreateChangeIdentityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithChangeID adds the changeID to the create change identity params +func (o *CreateChangeIdentityParams) WithChangeID(changeID string) *CreateChangeIdentityParams { + o.SetChangeID(changeID) + return o +} + +// SetChangeID adds the changeId to the create change identity params +func (o *CreateChangeIdentityParams) SetChangeID(changeID string) { + o.ChangeID = changeID +} + +// WithCreateChangeIdentity adds the createChangeIdentity to the create change identity params +func (o *CreateChangeIdentityParams) WithCreateChangeIdentity(createChangeIdentity *models.CreateChangeIdentity) *CreateChangeIdentityParams { + o.SetCreateChangeIdentity(createChangeIdentity) + return o +} + +// SetCreateChangeIdentity adds the createChangeIdentity to the create change identity params +func (o *CreateChangeIdentityParams) SetCreateChangeIdentity(createChangeIdentity *models.CreateChangeIdentity) { + o.CreateChangeIdentity = createChangeIdentity +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateChangeIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param change_id + if err := r.SetPathParam("change_id", o.ChangeID); err != nil { + return err + } + if o.CreateChangeIdentity != nil { + if err := r.SetBodyParam(o.CreateChangeIdentity); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/changes/create_change_identity_responses.go b/client/changes/create_change_identity_responses.go new file mode 100644 index 0000000..79cbf0b --- /dev/null +++ b/client/changes/create_change_identity_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateChangeIdentityReader is a Reader for the CreateChangeIdentity structure. +type CreateChangeIdentityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateChangeIdentityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateChangeIdentityCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateChangeIdentityBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateChangeIdentityCreated creates a CreateChangeIdentityCreated with default headers values +func NewCreateChangeIdentityCreated() *CreateChangeIdentityCreated { + return &CreateChangeIdentityCreated{} +} + +/* +CreateChangeIdentityCreated describes a response with status code 201, with default header values. + +Create an identity for the change entry +*/ +type CreateChangeIdentityCreated struct { + Payload *models.ChangeIdentityEntity +} + +// IsSuccess returns true when this create change identity created response has a 2xx status code +func (o *CreateChangeIdentityCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create change identity created response has a 3xx status code +func (o *CreateChangeIdentityCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create change identity created response has a 4xx status code +func (o *CreateChangeIdentityCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create change identity created response has a 5xx status code +func (o *CreateChangeIdentityCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create change identity created response a status code equal to that given +func (o *CreateChangeIdentityCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateChangeIdentityCreated) Error() string { + return fmt.Sprintf("[POST /v1/changes/{change_id}/identities][%d] createChangeIdentityCreated %+v", 201, o.Payload) +} + +func (o *CreateChangeIdentityCreated) String() string { + return fmt.Sprintf("[POST /v1/changes/{change_id}/identities][%d] createChangeIdentityCreated %+v", 201, o.Payload) +} + +func (o *CreateChangeIdentityCreated) GetPayload() *models.ChangeIdentityEntity { + return o.Payload +} + +func (o *CreateChangeIdentityCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChangeIdentityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateChangeIdentityBadRequest creates a CreateChangeIdentityBadRequest with default headers values +func NewCreateChangeIdentityBadRequest() *CreateChangeIdentityBadRequest { + return &CreateChangeIdentityBadRequest{} +} + +/* +CreateChangeIdentityBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type CreateChangeIdentityBadRequest struct { + Payload *models.ErrorEntity +} + +// IsSuccess returns true when this create change identity bad request response has a 2xx status code +func (o *CreateChangeIdentityBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create change identity bad request response has a 3xx status code +func (o *CreateChangeIdentityBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create change identity bad request response has a 4xx status code +func (o *CreateChangeIdentityBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create change identity bad request response has a 5xx status code +func (o *CreateChangeIdentityBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create change identity bad request response a status code equal to that given +func (o *CreateChangeIdentityBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *CreateChangeIdentityBadRequest) Error() string { + return fmt.Sprintf("[POST /v1/changes/{change_id}/identities][%d] createChangeIdentityBadRequest %+v", 400, o.Payload) +} + +func (o *CreateChangeIdentityBadRequest) String() string { + return fmt.Sprintf("[POST /v1/changes/{change_id}/identities][%d] createChangeIdentityBadRequest %+v", 400, o.Payload) +} + +func (o *CreateChangeIdentityBadRequest) GetPayload() *models.ErrorEntity { + return o.Payload +} + +func (o *CreateChangeIdentityBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/changes/create_change_parameters.go b/client/changes/create_change_parameters.go new file mode 100644 index 0000000..acc5a8c --- /dev/null +++ b/client/changes/create_change_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateChangeParams creates a new CreateChangeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateChangeParams() *CreateChangeParams { + return &CreateChangeParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateChangeParamsWithTimeout creates a new CreateChangeParams object +// with the ability to set a timeout on a request. +func NewCreateChangeParamsWithTimeout(timeout time.Duration) *CreateChangeParams { + return &CreateChangeParams{ + timeout: timeout, + } +} + +// NewCreateChangeParamsWithContext creates a new CreateChangeParams object +// with the ability to set a context for a request. +func NewCreateChangeParamsWithContext(ctx context.Context) *CreateChangeParams { + return &CreateChangeParams{ + Context: ctx, + } +} + +// NewCreateChangeParamsWithHTTPClient creates a new CreateChangeParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateChangeParamsWithHTTPClient(client *http.Client) *CreateChangeParams { + return &CreateChangeParams{ + HTTPClient: client, + } +} + +/* +CreateChangeParams contains all the parameters to send to the API endpoint + + for the create change operation. + + Typically these are written to a http.Request. +*/ +type CreateChangeParams struct { + + // CreateChange. + CreateChange *models.CreateChange + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create change params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateChangeParams) WithDefaults() *CreateChangeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create change params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateChangeParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create change params +func (o *CreateChangeParams) WithTimeout(timeout time.Duration) *CreateChangeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create change params +func (o *CreateChangeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create change params +func (o *CreateChangeParams) WithContext(ctx context.Context) *CreateChangeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create change params +func (o *CreateChangeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create change params +func (o *CreateChangeParams) WithHTTPClient(client *http.Client) *CreateChangeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create change params +func (o *CreateChangeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateChange adds the createChange to the create change params +func (o *CreateChangeParams) WithCreateChange(createChange *models.CreateChange) *CreateChangeParams { + o.SetCreateChange(createChange) + return o +} + +// SetCreateChange adds the createChange to the create change params +func (o *CreateChangeParams) SetCreateChange(createChange *models.CreateChange) { + o.CreateChange = createChange +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateChangeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateChange != nil { + if err := r.SetBodyParam(o.CreateChange); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/changes/create_change_responses.go b/client/changes/create_change_responses.go new file mode 100644 index 0000000..eb13b23 --- /dev/null +++ b/client/changes/create_change_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateChangeReader is a Reader for the CreateChange structure. +type CreateChangeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateChangeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateChangeCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateChangeBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateChangeCreated creates a CreateChangeCreated with default headers values +func NewCreateChangeCreated() *CreateChangeCreated { + return &CreateChangeCreated{} +} + +/* +CreateChangeCreated describes a response with status code 201, with default header values. + +Create a new change entry +*/ +type CreateChangeCreated struct { + Payload *models.ChangeEntity +} + +// IsSuccess returns true when this create change created response has a 2xx status code +func (o *CreateChangeCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create change created response has a 3xx status code +func (o *CreateChangeCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create change created response has a 4xx status code +func (o *CreateChangeCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create change created response has a 5xx status code +func (o *CreateChangeCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create change created response a status code equal to that given +func (o *CreateChangeCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateChangeCreated) Error() string { + return fmt.Sprintf("[POST /v1/changes][%d] createChangeCreated %+v", 201, o.Payload) +} + +func (o *CreateChangeCreated) String() string { + return fmt.Sprintf("[POST /v1/changes][%d] createChangeCreated %+v", 201, o.Payload) +} + +func (o *CreateChangeCreated) GetPayload() *models.ChangeEntity { + return o.Payload +} + +func (o *CreateChangeCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChangeEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateChangeBadRequest creates a CreateChangeBadRequest with default headers values +func NewCreateChangeBadRequest() *CreateChangeBadRequest { + return &CreateChangeBadRequest{} +} + +/* +CreateChangeBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type CreateChangeBadRequest struct { + Payload *models.ErrorEntity +} + +// IsSuccess returns true when this create change bad request response has a 2xx status code +func (o *CreateChangeBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create change bad request response has a 3xx status code +func (o *CreateChangeBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create change bad request response has a 4xx status code +func (o *CreateChangeBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create change bad request response has a 5xx status code +func (o *CreateChangeBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create change bad request response a status code equal to that given +func (o *CreateChangeBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *CreateChangeBadRequest) Error() string { + return fmt.Sprintf("[POST /v1/changes][%d] createChangeBadRequest %+v", 400, o.Payload) +} + +func (o *CreateChangeBadRequest) String() string { + return fmt.Sprintf("[POST /v1/changes][%d] createChangeBadRequest %+v", 400, o.Payload) +} + +func (o *CreateChangeBadRequest) GetPayload() *models.ErrorEntity { + return o.Payload +} + +func (o *CreateChangeBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/changes/delete_change_event_parameters.go b/client/changes/delete_change_event_parameters.go new file mode 100644 index 0000000..9405b39 --- /dev/null +++ b/client/changes/delete_change_event_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteChangeEventParams creates a new DeleteChangeEventParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteChangeEventParams() *DeleteChangeEventParams { + return &DeleteChangeEventParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteChangeEventParamsWithTimeout creates a new DeleteChangeEventParams object +// with the ability to set a timeout on a request. +func NewDeleteChangeEventParamsWithTimeout(timeout time.Duration) *DeleteChangeEventParams { + return &DeleteChangeEventParams{ + timeout: timeout, + } +} + +// NewDeleteChangeEventParamsWithContext creates a new DeleteChangeEventParams object +// with the ability to set a context for a request. +func NewDeleteChangeEventParamsWithContext(ctx context.Context) *DeleteChangeEventParams { + return &DeleteChangeEventParams{ + Context: ctx, + } +} + +// NewDeleteChangeEventParamsWithHTTPClient creates a new DeleteChangeEventParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteChangeEventParamsWithHTTPClient(client *http.Client) *DeleteChangeEventParams { + return &DeleteChangeEventParams{ + HTTPClient: client, + } +} + +/* +DeleteChangeEventParams contains all the parameters to send to the API endpoint + + for the delete change event operation. + + Typically these are written to a http.Request. +*/ +type DeleteChangeEventParams struct { + + // ChangeEventID. + ChangeEventID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete change event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteChangeEventParams) WithDefaults() *DeleteChangeEventParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete change event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteChangeEventParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete change event params +func (o *DeleteChangeEventParams) WithTimeout(timeout time.Duration) *DeleteChangeEventParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete change event params +func (o *DeleteChangeEventParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete change event params +func (o *DeleteChangeEventParams) WithContext(ctx context.Context) *DeleteChangeEventParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete change event params +func (o *DeleteChangeEventParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete change event params +func (o *DeleteChangeEventParams) WithHTTPClient(client *http.Client) *DeleteChangeEventParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete change event params +func (o *DeleteChangeEventParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithChangeEventID adds the changeEventID to the delete change event params +func (o *DeleteChangeEventParams) WithChangeEventID(changeEventID string) *DeleteChangeEventParams { + o.SetChangeEventID(changeEventID) + return o +} + +// SetChangeEventID adds the changeEventId to the delete change event params +func (o *DeleteChangeEventParams) SetChangeEventID(changeEventID string) { + o.ChangeEventID = changeEventID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteChangeEventParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param change_event_id + if err := r.SetPathParam("change_event_id", o.ChangeEventID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/changes/delete_change_event_responses.go b/client/changes/delete_change_event_responses.go new file mode 100644 index 0000000..2a5f95b --- /dev/null +++ b/client/changes/delete_change_event_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteChangeEventReader is a Reader for the DeleteChangeEvent structure. +type DeleteChangeEventReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteChangeEventReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteChangeEventNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteChangeEventNoContent creates a DeleteChangeEventNoContent with default headers values +func NewDeleteChangeEventNoContent() *DeleteChangeEventNoContent { + return &DeleteChangeEventNoContent{} +} + +/* +DeleteChangeEventNoContent describes a response with status code 204, with default header values. + +Delete a change event +*/ +type DeleteChangeEventNoContent struct { +} + +// IsSuccess returns true when this delete change event no content response has a 2xx status code +func (o *DeleteChangeEventNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete change event no content response has a 3xx status code +func (o *DeleteChangeEventNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete change event no content response has a 4xx status code +func (o *DeleteChangeEventNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete change event no content response has a 5xx status code +func (o *DeleteChangeEventNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete change event no content response a status code equal to that given +func (o *DeleteChangeEventNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteChangeEventNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/changes/events/{change_event_id}][%d] deleteChangeEventNoContent ", 204) +} + +func (o *DeleteChangeEventNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/changes/events/{change_event_id}][%d] deleteChangeEventNoContent ", 204) +} + +func (o *DeleteChangeEventNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/changes/delete_change_identity_parameters.go b/client/changes/delete_change_identity_parameters.go new file mode 100644 index 0000000..83dd5b3 --- /dev/null +++ b/client/changes/delete_change_identity_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteChangeIdentityParams creates a new DeleteChangeIdentityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteChangeIdentityParams() *DeleteChangeIdentityParams { + return &DeleteChangeIdentityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteChangeIdentityParamsWithTimeout creates a new DeleteChangeIdentityParams object +// with the ability to set a timeout on a request. +func NewDeleteChangeIdentityParamsWithTimeout(timeout time.Duration) *DeleteChangeIdentityParams { + return &DeleteChangeIdentityParams{ + timeout: timeout, + } +} + +// NewDeleteChangeIdentityParamsWithContext creates a new DeleteChangeIdentityParams object +// with the ability to set a context for a request. +func NewDeleteChangeIdentityParamsWithContext(ctx context.Context) *DeleteChangeIdentityParams { + return &DeleteChangeIdentityParams{ + Context: ctx, + } +} + +// NewDeleteChangeIdentityParamsWithHTTPClient creates a new DeleteChangeIdentityParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteChangeIdentityParamsWithHTTPClient(client *http.Client) *DeleteChangeIdentityParams { + return &DeleteChangeIdentityParams{ + HTTPClient: client, + } +} + +/* +DeleteChangeIdentityParams contains all the parameters to send to the API endpoint + + for the delete change identity operation. + + Typically these are written to a http.Request. +*/ +type DeleteChangeIdentityParams struct { + + // ChangeID. + ChangeID string + + // IdentityID. + IdentityID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete change identity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteChangeIdentityParams) WithDefaults() *DeleteChangeIdentityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete change identity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteChangeIdentityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete change identity params +func (o *DeleteChangeIdentityParams) WithTimeout(timeout time.Duration) *DeleteChangeIdentityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete change identity params +func (o *DeleteChangeIdentityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete change identity params +func (o *DeleteChangeIdentityParams) WithContext(ctx context.Context) *DeleteChangeIdentityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete change identity params +func (o *DeleteChangeIdentityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete change identity params +func (o *DeleteChangeIdentityParams) WithHTTPClient(client *http.Client) *DeleteChangeIdentityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete change identity params +func (o *DeleteChangeIdentityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithChangeID adds the changeID to the delete change identity params +func (o *DeleteChangeIdentityParams) WithChangeID(changeID string) *DeleteChangeIdentityParams { + o.SetChangeID(changeID) + return o +} + +// SetChangeID adds the changeId to the delete change identity params +func (o *DeleteChangeIdentityParams) SetChangeID(changeID string) { + o.ChangeID = changeID +} + +// WithIdentityID adds the identityID to the delete change identity params +func (o *DeleteChangeIdentityParams) WithIdentityID(identityID string) *DeleteChangeIdentityParams { + o.SetIdentityID(identityID) + return o +} + +// SetIdentityID adds the identityId to the delete change identity params +func (o *DeleteChangeIdentityParams) SetIdentityID(identityID string) { + o.IdentityID = identityID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteChangeIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param change_id + if err := r.SetPathParam("change_id", o.ChangeID); err != nil { + return err + } + + // path param identity_id + if err := r.SetPathParam("identity_id", o.IdentityID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/changes/delete_change_identity_responses.go b/client/changes/delete_change_identity_responses.go new file mode 100644 index 0000000..df09533 --- /dev/null +++ b/client/changes/delete_change_identity_responses.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteChangeIdentityReader is a Reader for the DeleteChangeIdentity structure. +type DeleteChangeIdentityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteChangeIdentityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteChangeIdentityNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDeleteChangeIdentityBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteChangeIdentityNoContent creates a DeleteChangeIdentityNoContent with default headers values +func NewDeleteChangeIdentityNoContent() *DeleteChangeIdentityNoContent { + return &DeleteChangeIdentityNoContent{} +} + +/* +DeleteChangeIdentityNoContent describes a response with status code 204, with default header values. + +Delete an identity from the change entry +*/ +type DeleteChangeIdentityNoContent struct { +} + +// IsSuccess returns true when this delete change identity no content response has a 2xx status code +func (o *DeleteChangeIdentityNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete change identity no content response has a 3xx status code +func (o *DeleteChangeIdentityNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete change identity no content response has a 4xx status code +func (o *DeleteChangeIdentityNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete change identity no content response has a 5xx status code +func (o *DeleteChangeIdentityNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete change identity no content response a status code equal to that given +func (o *DeleteChangeIdentityNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteChangeIdentityNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/changes/{change_id}/identities/{identity_id}][%d] deleteChangeIdentityNoContent ", 204) +} + +func (o *DeleteChangeIdentityNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/changes/{change_id}/identities/{identity_id}][%d] deleteChangeIdentityNoContent ", 204) +} + +func (o *DeleteChangeIdentityNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteChangeIdentityBadRequest creates a DeleteChangeIdentityBadRequest with default headers values +func NewDeleteChangeIdentityBadRequest() *DeleteChangeIdentityBadRequest { + return &DeleteChangeIdentityBadRequest{} +} + +/* +DeleteChangeIdentityBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type DeleteChangeIdentityBadRequest struct { + Payload *models.ErrorEntity +} + +// IsSuccess returns true when this delete change identity bad request response has a 2xx status code +func (o *DeleteChangeIdentityBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete change identity bad request response has a 3xx status code +func (o *DeleteChangeIdentityBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete change identity bad request response has a 4xx status code +func (o *DeleteChangeIdentityBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete change identity bad request response has a 5xx status code +func (o *DeleteChangeIdentityBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this delete change identity bad request response a status code equal to that given +func (o *DeleteChangeIdentityBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *DeleteChangeIdentityBadRequest) Error() string { + return fmt.Sprintf("[DELETE /v1/changes/{change_id}/identities/{identity_id}][%d] deleteChangeIdentityBadRequest %+v", 400, o.Payload) +} + +func (o *DeleteChangeIdentityBadRequest) String() string { + return fmt.Sprintf("[DELETE /v1/changes/{change_id}/identities/{identity_id}][%d] deleteChangeIdentityBadRequest %+v", 400, o.Payload) +} + +func (o *DeleteChangeIdentityBadRequest) GetPayload() *models.ErrorEntity { + return o.Payload +} + +func (o *DeleteChangeIdentityBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/changes/delete_change_parameters.go b/client/changes/delete_change_parameters.go new file mode 100644 index 0000000..8a8c610 --- /dev/null +++ b/client/changes/delete_change_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteChangeParams creates a new DeleteChangeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteChangeParams() *DeleteChangeParams { + return &DeleteChangeParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteChangeParamsWithTimeout creates a new DeleteChangeParams object +// with the ability to set a timeout on a request. +func NewDeleteChangeParamsWithTimeout(timeout time.Duration) *DeleteChangeParams { + return &DeleteChangeParams{ + timeout: timeout, + } +} + +// NewDeleteChangeParamsWithContext creates a new DeleteChangeParams object +// with the ability to set a context for a request. +func NewDeleteChangeParamsWithContext(ctx context.Context) *DeleteChangeParams { + return &DeleteChangeParams{ + Context: ctx, + } +} + +// NewDeleteChangeParamsWithHTTPClient creates a new DeleteChangeParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteChangeParamsWithHTTPClient(client *http.Client) *DeleteChangeParams { + return &DeleteChangeParams{ + HTTPClient: client, + } +} + +/* +DeleteChangeParams contains all the parameters to send to the API endpoint + + for the delete change operation. + + Typically these are written to a http.Request. +*/ +type DeleteChangeParams struct { + + // ChangeID. + ChangeID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete change params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteChangeParams) WithDefaults() *DeleteChangeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete change params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteChangeParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete change params +func (o *DeleteChangeParams) WithTimeout(timeout time.Duration) *DeleteChangeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete change params +func (o *DeleteChangeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete change params +func (o *DeleteChangeParams) WithContext(ctx context.Context) *DeleteChangeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete change params +func (o *DeleteChangeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete change params +func (o *DeleteChangeParams) WithHTTPClient(client *http.Client) *DeleteChangeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete change params +func (o *DeleteChangeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithChangeID adds the changeID to the delete change params +func (o *DeleteChangeParams) WithChangeID(changeID string) *DeleteChangeParams { + o.SetChangeID(changeID) + return o +} + +// SetChangeID adds the changeId to the delete change params +func (o *DeleteChangeParams) SetChangeID(changeID string) { + o.ChangeID = changeID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteChangeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param change_id + if err := r.SetPathParam("change_id", o.ChangeID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/changes/delete_change_responses.go b/client/changes/delete_change_responses.go new file mode 100644 index 0000000..863a146 --- /dev/null +++ b/client/changes/delete_change_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteChangeReader is a Reader for the DeleteChange structure. +type DeleteChangeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteChangeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteChangeNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteChangeNoContent creates a DeleteChangeNoContent with default headers values +func NewDeleteChangeNoContent() *DeleteChangeNoContent { + return &DeleteChangeNoContent{} +} + +/* +DeleteChangeNoContent describes a response with status code 204, with default header values. + +Archive a change entry +*/ +type DeleteChangeNoContent struct { +} + +// IsSuccess returns true when this delete change no content response has a 2xx status code +func (o *DeleteChangeNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete change no content response has a 3xx status code +func (o *DeleteChangeNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete change no content response has a 4xx status code +func (o *DeleteChangeNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete change no content response has a 5xx status code +func (o *DeleteChangeNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete change no content response a status code equal to that given +func (o *DeleteChangeNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteChangeNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/changes/{change_id}][%d] deleteChangeNoContent ", 204) +} + +func (o *DeleteChangeNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/changes/{change_id}][%d] deleteChangeNoContent ", 204) +} + +func (o *DeleteChangeNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/changes/get_change_event_parameters.go b/client/changes/get_change_event_parameters.go new file mode 100644 index 0000000..00d03e2 --- /dev/null +++ b/client/changes/get_change_event_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetChangeEventParams creates a new GetChangeEventParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetChangeEventParams() *GetChangeEventParams { + return &GetChangeEventParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetChangeEventParamsWithTimeout creates a new GetChangeEventParams object +// with the ability to set a timeout on a request. +func NewGetChangeEventParamsWithTimeout(timeout time.Duration) *GetChangeEventParams { + return &GetChangeEventParams{ + timeout: timeout, + } +} + +// NewGetChangeEventParamsWithContext creates a new GetChangeEventParams object +// with the ability to set a context for a request. +func NewGetChangeEventParamsWithContext(ctx context.Context) *GetChangeEventParams { + return &GetChangeEventParams{ + Context: ctx, + } +} + +// NewGetChangeEventParamsWithHTTPClient creates a new GetChangeEventParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetChangeEventParamsWithHTTPClient(client *http.Client) *GetChangeEventParams { + return &GetChangeEventParams{ + HTTPClient: client, + } +} + +/* +GetChangeEventParams contains all the parameters to send to the API endpoint + + for the get change event operation. + + Typically these are written to a http.Request. +*/ +type GetChangeEventParams struct { + + // ChangeEventID. + ChangeEventID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get change event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetChangeEventParams) WithDefaults() *GetChangeEventParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get change event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetChangeEventParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get change event params +func (o *GetChangeEventParams) WithTimeout(timeout time.Duration) *GetChangeEventParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get change event params +func (o *GetChangeEventParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get change event params +func (o *GetChangeEventParams) WithContext(ctx context.Context) *GetChangeEventParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get change event params +func (o *GetChangeEventParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get change event params +func (o *GetChangeEventParams) WithHTTPClient(client *http.Client) *GetChangeEventParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get change event params +func (o *GetChangeEventParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithChangeEventID adds the changeEventID to the get change event params +func (o *GetChangeEventParams) WithChangeEventID(changeEventID string) *GetChangeEventParams { + o.SetChangeEventID(changeEventID) + return o +} + +// SetChangeEventID adds the changeEventId to the get change event params +func (o *GetChangeEventParams) SetChangeEventID(changeEventID string) { + o.ChangeEventID = changeEventID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetChangeEventParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param change_event_id + if err := r.SetPathParam("change_event_id", o.ChangeEventID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/changes/get_change_event_responses.go b/client/changes/get_change_event_responses.go new file mode 100644 index 0000000..b9520b2 --- /dev/null +++ b/client/changes/get_change_event_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetChangeEventReader is a Reader for the GetChangeEvent structure. +type GetChangeEventReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetChangeEventReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetChangeEventOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetChangeEventOK creates a GetChangeEventOK with default headers values +func NewGetChangeEventOK() *GetChangeEventOK { + return &GetChangeEventOK{} +} + +/* +GetChangeEventOK describes a response with status code 200, with default header values. + +Retrieve a change event +*/ +type GetChangeEventOK struct { + Payload *models.ChangeEventEntity +} + +// IsSuccess returns true when this get change event o k response has a 2xx status code +func (o *GetChangeEventOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get change event o k response has a 3xx status code +func (o *GetChangeEventOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get change event o k response has a 4xx status code +func (o *GetChangeEventOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get change event o k response has a 5xx status code +func (o *GetChangeEventOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get change event o k response a status code equal to that given +func (o *GetChangeEventOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetChangeEventOK) Error() string { + return fmt.Sprintf("[GET /v1/changes/events/{change_event_id}][%d] getChangeEventOK %+v", 200, o.Payload) +} + +func (o *GetChangeEventOK) String() string { + return fmt.Sprintf("[GET /v1/changes/events/{change_event_id}][%d] getChangeEventOK %+v", 200, o.Payload) +} + +func (o *GetChangeEventOK) GetPayload() *models.ChangeEventEntity { + return o.Payload +} + +func (o *GetChangeEventOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChangeEventEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/changes/list_change_events_parameters.go b/client/changes/list_change_events_parameters.go new file mode 100644 index 0000000..1abfb42 --- /dev/null +++ b/client/changes/list_change_events_parameters.go @@ -0,0 +1,436 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListChangeEventsParams creates a new ListChangeEventsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListChangeEventsParams() *ListChangeEventsParams { + return &ListChangeEventsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListChangeEventsParamsWithTimeout creates a new ListChangeEventsParams object +// with the ability to set a timeout on a request. +func NewListChangeEventsParamsWithTimeout(timeout time.Duration) *ListChangeEventsParams { + return &ListChangeEventsParams{ + timeout: timeout, + } +} + +// NewListChangeEventsParamsWithContext creates a new ListChangeEventsParams object +// with the ability to set a context for a request. +func NewListChangeEventsParamsWithContext(ctx context.Context) *ListChangeEventsParams { + return &ListChangeEventsParams{ + Context: ctx, + } +} + +// NewListChangeEventsParamsWithHTTPClient creates a new ListChangeEventsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListChangeEventsParamsWithHTTPClient(client *http.Client) *ListChangeEventsParams { + return &ListChangeEventsParams{ + HTTPClient: client, + } +} + +/* +ListChangeEventsParams contains all the parameters to send to the API endpoint + + for the list change events operation. + + Typically these are written to a http.Request. +*/ +type ListChangeEventsParams struct { + + /* EndsAt. + + The end time to return change events up to + + Format: date-time + */ + EndsAt *strfmt.DateTime + + /* Environments. + + A comma separated list of environment IDs + */ + Environments *string + + /* Labels. + + A comma separated list of label key / values in the format of "key=value,key2=value2". To filter change events that have a key (with no specific value), omit the value + */ + Labels *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + A text query for change events + */ + Query *string + + /* SavedSearchID. + + The id of a previously saved search. + */ + SavedSearchID *string + + /* Services. + + A comma separated list of service IDs + */ + Services *string + + /* StartsAt. + + The start time to start returning change events from + */ + StartsAt *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list change events params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListChangeEventsParams) WithDefaults() *ListChangeEventsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list change events params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListChangeEventsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list change events params +func (o *ListChangeEventsParams) WithTimeout(timeout time.Duration) *ListChangeEventsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list change events params +func (o *ListChangeEventsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list change events params +func (o *ListChangeEventsParams) WithContext(ctx context.Context) *ListChangeEventsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list change events params +func (o *ListChangeEventsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list change events params +func (o *ListChangeEventsParams) WithHTTPClient(client *http.Client) *ListChangeEventsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list change events params +func (o *ListChangeEventsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndsAt adds the endsAt to the list change events params +func (o *ListChangeEventsParams) WithEndsAt(endsAt *strfmt.DateTime) *ListChangeEventsParams { + o.SetEndsAt(endsAt) + return o +} + +// SetEndsAt adds the endsAt to the list change events params +func (o *ListChangeEventsParams) SetEndsAt(endsAt *strfmt.DateTime) { + o.EndsAt = endsAt +} + +// WithEnvironments adds the environments to the list change events params +func (o *ListChangeEventsParams) WithEnvironments(environments *string) *ListChangeEventsParams { + o.SetEnvironments(environments) + return o +} + +// SetEnvironments adds the environments to the list change events params +func (o *ListChangeEventsParams) SetEnvironments(environments *string) { + o.Environments = environments +} + +// WithLabels adds the labels to the list change events params +func (o *ListChangeEventsParams) WithLabels(labels *string) *ListChangeEventsParams { + o.SetLabels(labels) + return o +} + +// SetLabels adds the labels to the list change events params +func (o *ListChangeEventsParams) SetLabels(labels *string) { + o.Labels = labels +} + +// WithPage adds the page to the list change events params +func (o *ListChangeEventsParams) WithPage(page *int32) *ListChangeEventsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list change events params +func (o *ListChangeEventsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list change events params +func (o *ListChangeEventsParams) WithPerPage(perPage *int32) *ListChangeEventsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list change events params +func (o *ListChangeEventsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list change events params +func (o *ListChangeEventsParams) WithQuery(query *string) *ListChangeEventsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list change events params +func (o *ListChangeEventsParams) SetQuery(query *string) { + o.Query = query +} + +// WithSavedSearchID adds the savedSearchID to the list change events params +func (o *ListChangeEventsParams) WithSavedSearchID(savedSearchID *string) *ListChangeEventsParams { + o.SetSavedSearchID(savedSearchID) + return o +} + +// SetSavedSearchID adds the savedSearchId to the list change events params +func (o *ListChangeEventsParams) SetSavedSearchID(savedSearchID *string) { + o.SavedSearchID = savedSearchID +} + +// WithServices adds the services to the list change events params +func (o *ListChangeEventsParams) WithServices(services *string) *ListChangeEventsParams { + o.SetServices(services) + return o +} + +// SetServices adds the services to the list change events params +func (o *ListChangeEventsParams) SetServices(services *string) { + o.Services = services +} + +// WithStartsAt adds the startsAt to the list change events params +func (o *ListChangeEventsParams) WithStartsAt(startsAt *string) *ListChangeEventsParams { + o.SetStartsAt(startsAt) + return o +} + +// SetStartsAt adds the startsAt to the list change events params +func (o *ListChangeEventsParams) SetStartsAt(startsAt *string) { + o.StartsAt = startsAt +} + +// WriteToRequest writes these params to a swagger request +func (o *ListChangeEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EndsAt != nil { + + // query param ends_at + var qrEndsAt strfmt.DateTime + + if o.EndsAt != nil { + qrEndsAt = *o.EndsAt + } + qEndsAt := qrEndsAt.String() + if qEndsAt != "" { + + if err := r.SetQueryParam("ends_at", qEndsAt); err != nil { + return err + } + } + } + + if o.Environments != nil { + + // query param environments + var qrEnvironments string + + if o.Environments != nil { + qrEnvironments = *o.Environments + } + qEnvironments := qrEnvironments + if qEnvironments != "" { + + if err := r.SetQueryParam("environments", qEnvironments); err != nil { + return err + } + } + } + + if o.Labels != nil { + + // query param labels + var qrLabels string + + if o.Labels != nil { + qrLabels = *o.Labels + } + qLabels := qrLabels + if qLabels != "" { + + if err := r.SetQueryParam("labels", qLabels); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if o.SavedSearchID != nil { + + // query param saved_search_id + var qrSavedSearchID string + + if o.SavedSearchID != nil { + qrSavedSearchID = *o.SavedSearchID + } + qSavedSearchID := qrSavedSearchID + if qSavedSearchID != "" { + + if err := r.SetQueryParam("saved_search_id", qSavedSearchID); err != nil { + return err + } + } + } + + if o.Services != nil { + + // query param services + var qrServices string + + if o.Services != nil { + qrServices = *o.Services + } + qServices := qrServices + if qServices != "" { + + if err := r.SetQueryParam("services", qServices); err != nil { + return err + } + } + } + + if o.StartsAt != nil { + + // query param starts_at + var qrStartsAt string + + if o.StartsAt != nil { + qrStartsAt = *o.StartsAt + } + qStartsAt := qrStartsAt + if qStartsAt != "" { + + if err := r.SetQueryParam("starts_at", qStartsAt); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/changes/list_change_events_responses.go b/client/changes/list_change_events_responses.go new file mode 100644 index 0000000..0022d52 --- /dev/null +++ b/client/changes/list_change_events_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListChangeEventsReader is a Reader for the ListChangeEvents structure. +type ListChangeEventsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListChangeEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListChangeEventsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListChangeEventsOK creates a ListChangeEventsOK with default headers values +func NewListChangeEventsOK() *ListChangeEventsOK { + return &ListChangeEventsOK{} +} + +/* +ListChangeEventsOK describes a response with status code 200, with default header values. + +List change events for the organization. Note: Not all information is included on a change event like attachments and related changes. You must fetch a change event separately to retrieve all of the information about it +*/ +type ListChangeEventsOK struct { + Payload *models.ChangeEventSlimEntityPaginated +} + +// IsSuccess returns true when this list change events o k response has a 2xx status code +func (o *ListChangeEventsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list change events o k response has a 3xx status code +func (o *ListChangeEventsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list change events o k response has a 4xx status code +func (o *ListChangeEventsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list change events o k response has a 5xx status code +func (o *ListChangeEventsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list change events o k response a status code equal to that given +func (o *ListChangeEventsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListChangeEventsOK) Error() string { + return fmt.Sprintf("[GET /v1/changes/events][%d] listChangeEventsOK %+v", 200, o.Payload) +} + +func (o *ListChangeEventsOK) String() string { + return fmt.Sprintf("[GET /v1/changes/events][%d] listChangeEventsOK %+v", 200, o.Payload) +} + +func (o *ListChangeEventsOK) GetPayload() *models.ChangeEventSlimEntityPaginated { + return o.Payload +} + +func (o *ListChangeEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChangeEventSlimEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/changes/list_change_identities_parameters.go b/client/changes/list_change_identities_parameters.go new file mode 100644 index 0000000..ecf427b --- /dev/null +++ b/client/changes/list_change_identities_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListChangeIdentitiesParams creates a new ListChangeIdentitiesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListChangeIdentitiesParams() *ListChangeIdentitiesParams { + return &ListChangeIdentitiesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListChangeIdentitiesParamsWithTimeout creates a new ListChangeIdentitiesParams object +// with the ability to set a timeout on a request. +func NewListChangeIdentitiesParamsWithTimeout(timeout time.Duration) *ListChangeIdentitiesParams { + return &ListChangeIdentitiesParams{ + timeout: timeout, + } +} + +// NewListChangeIdentitiesParamsWithContext creates a new ListChangeIdentitiesParams object +// with the ability to set a context for a request. +func NewListChangeIdentitiesParamsWithContext(ctx context.Context) *ListChangeIdentitiesParams { + return &ListChangeIdentitiesParams{ + Context: ctx, + } +} + +// NewListChangeIdentitiesParamsWithHTTPClient creates a new ListChangeIdentitiesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListChangeIdentitiesParamsWithHTTPClient(client *http.Client) *ListChangeIdentitiesParams { + return &ListChangeIdentitiesParams{ + HTTPClient: client, + } +} + +/* +ListChangeIdentitiesParams contains all the parameters to send to the API endpoint + + for the list change identities operation. + + Typically these are written to a http.Request. +*/ +type ListChangeIdentitiesParams struct { + + // ChangeID. + ChangeID string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list change identities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListChangeIdentitiesParams) WithDefaults() *ListChangeIdentitiesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list change identities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListChangeIdentitiesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list change identities params +func (o *ListChangeIdentitiesParams) WithTimeout(timeout time.Duration) *ListChangeIdentitiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list change identities params +func (o *ListChangeIdentitiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list change identities params +func (o *ListChangeIdentitiesParams) WithContext(ctx context.Context) *ListChangeIdentitiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list change identities params +func (o *ListChangeIdentitiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list change identities params +func (o *ListChangeIdentitiesParams) WithHTTPClient(client *http.Client) *ListChangeIdentitiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list change identities params +func (o *ListChangeIdentitiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithChangeID adds the changeID to the list change identities params +func (o *ListChangeIdentitiesParams) WithChangeID(changeID string) *ListChangeIdentitiesParams { + o.SetChangeID(changeID) + return o +} + +// SetChangeID adds the changeId to the list change identities params +func (o *ListChangeIdentitiesParams) SetChangeID(changeID string) { + o.ChangeID = changeID +} + +// WithPage adds the page to the list change identities params +func (o *ListChangeIdentitiesParams) WithPage(page *int32) *ListChangeIdentitiesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list change identities params +func (o *ListChangeIdentitiesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list change identities params +func (o *ListChangeIdentitiesParams) WithPerPage(perPage *int32) *ListChangeIdentitiesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list change identities params +func (o *ListChangeIdentitiesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListChangeIdentitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param change_id + if err := r.SetPathParam("change_id", o.ChangeID); err != nil { + return err + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/changes/list_change_identities_responses.go b/client/changes/list_change_identities_responses.go new file mode 100644 index 0000000..8f9967e --- /dev/null +++ b/client/changes/list_change_identities_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListChangeIdentitiesReader is a Reader for the ListChangeIdentities structure. +type ListChangeIdentitiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListChangeIdentitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListChangeIdentitiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListChangeIdentitiesOK creates a ListChangeIdentitiesOK with default headers values +func NewListChangeIdentitiesOK() *ListChangeIdentitiesOK { + return &ListChangeIdentitiesOK{} +} + +/* +ListChangeIdentitiesOK describes a response with status code 200, with default header values. + +Retrieve all identities for the change entry +*/ +type ListChangeIdentitiesOK struct { + Payload *models.ChangeIdentityEntityPaginated +} + +// IsSuccess returns true when this list change identities o k response has a 2xx status code +func (o *ListChangeIdentitiesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list change identities o k response has a 3xx status code +func (o *ListChangeIdentitiesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list change identities o k response has a 4xx status code +func (o *ListChangeIdentitiesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list change identities o k response has a 5xx status code +func (o *ListChangeIdentitiesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list change identities o k response a status code equal to that given +func (o *ListChangeIdentitiesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListChangeIdentitiesOK) Error() string { + return fmt.Sprintf("[GET /v1/changes/{change_id}/identities][%d] listChangeIdentitiesOK %+v", 200, o.Payload) +} + +func (o *ListChangeIdentitiesOK) String() string { + return fmt.Sprintf("[GET /v1/changes/{change_id}/identities][%d] listChangeIdentitiesOK %+v", 200, o.Payload) +} + +func (o *ListChangeIdentitiesOK) GetPayload() *models.ChangeIdentityEntityPaginated { + return o.Payload +} + +func (o *ListChangeIdentitiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChangeIdentityEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/changes/list_change_types_parameters.go b/client/changes/list_change_types_parameters.go new file mode 100644 index 0000000..a1679fc --- /dev/null +++ b/client/changes/list_change_types_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListChangeTypesParams creates a new ListChangeTypesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListChangeTypesParams() *ListChangeTypesParams { + return &ListChangeTypesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListChangeTypesParamsWithTimeout creates a new ListChangeTypesParams object +// with the ability to set a timeout on a request. +func NewListChangeTypesParamsWithTimeout(timeout time.Duration) *ListChangeTypesParams { + return &ListChangeTypesParams{ + timeout: timeout, + } +} + +// NewListChangeTypesParamsWithContext creates a new ListChangeTypesParams object +// with the ability to set a context for a request. +func NewListChangeTypesParamsWithContext(ctx context.Context) *ListChangeTypesParams { + return &ListChangeTypesParams{ + Context: ctx, + } +} + +// NewListChangeTypesParamsWithHTTPClient creates a new ListChangeTypesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListChangeTypesParamsWithHTTPClient(client *http.Client) *ListChangeTypesParams { + return &ListChangeTypesParams{ + HTTPClient: client, + } +} + +/* +ListChangeTypesParams contains all the parameters to send to the API endpoint + + for the list change types operation. + + Typically these are written to a http.Request. +*/ +type ListChangeTypesParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list change types params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListChangeTypesParams) WithDefaults() *ListChangeTypesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list change types params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListChangeTypesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list change types params +func (o *ListChangeTypesParams) WithTimeout(timeout time.Duration) *ListChangeTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list change types params +func (o *ListChangeTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list change types params +func (o *ListChangeTypesParams) WithContext(ctx context.Context) *ListChangeTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list change types params +func (o *ListChangeTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list change types params +func (o *ListChangeTypesParams) WithHTTPClient(client *http.Client) *ListChangeTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list change types params +func (o *ListChangeTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list change types params +func (o *ListChangeTypesParams) WithPage(page *int32) *ListChangeTypesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list change types params +func (o *ListChangeTypesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list change types params +func (o *ListChangeTypesParams) WithPerPage(perPage *int32) *ListChangeTypesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list change types params +func (o *ListChangeTypesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListChangeTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/changes/list_change_types_responses.go b/client/changes/list_change_types_responses.go new file mode 100644 index 0000000..ffd0112 --- /dev/null +++ b/client/changes/list_change_types_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListChangeTypesReader is a Reader for the ListChangeTypes structure. +type ListChangeTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListChangeTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListChangeTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListChangeTypesOK creates a ListChangeTypesOK with default headers values +func NewListChangeTypesOK() *ListChangeTypesOK { + return &ListChangeTypesOK{} +} + +/* +ListChangeTypesOK describes a response with status code 200, with default header values. + +List change types for the organization +*/ +type ListChangeTypesOK struct { + Payload *models.ChangeTypeEntityPaginated +} + +// IsSuccess returns true when this list change types o k response has a 2xx status code +func (o *ListChangeTypesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list change types o k response has a 3xx status code +func (o *ListChangeTypesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list change types o k response has a 4xx status code +func (o *ListChangeTypesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list change types o k response has a 5xx status code +func (o *ListChangeTypesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list change types o k response a status code equal to that given +func (o *ListChangeTypesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListChangeTypesOK) Error() string { + return fmt.Sprintf("[GET /v1/change_types][%d] listChangeTypesOK %+v", 200, o.Payload) +} + +func (o *ListChangeTypesOK) String() string { + return fmt.Sprintf("[GET /v1/change_types][%d] listChangeTypesOK %+v", 200, o.Payload) +} + +func (o *ListChangeTypesOK) GetPayload() *models.ChangeTypeEntityPaginated { + return o.Payload +} + +func (o *ListChangeTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChangeTypeEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/changes/list_changes_parameters.go b/client/changes/list_changes_parameters.go new file mode 100644 index 0000000..f223368 --- /dev/null +++ b/client/changes/list_changes_parameters.go @@ -0,0 +1,230 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListChangesParams creates a new ListChangesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListChangesParams() *ListChangesParams { + return &ListChangesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListChangesParamsWithTimeout creates a new ListChangesParams object +// with the ability to set a timeout on a request. +func NewListChangesParamsWithTimeout(timeout time.Duration) *ListChangesParams { + return &ListChangesParams{ + timeout: timeout, + } +} + +// NewListChangesParamsWithContext creates a new ListChangesParams object +// with the ability to set a context for a request. +func NewListChangesParamsWithContext(ctx context.Context) *ListChangesParams { + return &ListChangesParams{ + Context: ctx, + } +} + +// NewListChangesParamsWithHTTPClient creates a new ListChangesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListChangesParamsWithHTTPClient(client *http.Client) *ListChangesParams { + return &ListChangesParams{ + HTTPClient: client, + } +} + +/* +ListChangesParams contains all the parameters to send to the API endpoint + + for the list changes operation. + + Typically these are written to a http.Request. +*/ +type ListChangesParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + Filter changes by summary + */ + Query *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list changes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListChangesParams) WithDefaults() *ListChangesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list changes params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListChangesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list changes params +func (o *ListChangesParams) WithTimeout(timeout time.Duration) *ListChangesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list changes params +func (o *ListChangesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list changes params +func (o *ListChangesParams) WithContext(ctx context.Context) *ListChangesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list changes params +func (o *ListChangesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list changes params +func (o *ListChangesParams) WithHTTPClient(client *http.Client) *ListChangesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list changes params +func (o *ListChangesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list changes params +func (o *ListChangesParams) WithPage(page *int32) *ListChangesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list changes params +func (o *ListChangesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list changes params +func (o *ListChangesParams) WithPerPage(perPage *int32) *ListChangesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list changes params +func (o *ListChangesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list changes params +func (o *ListChangesParams) WithQuery(query *string) *ListChangesParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list changes params +func (o *ListChangesParams) SetQuery(query *string) { + o.Query = query +} + +// WriteToRequest writes these params to a swagger request +func (o *ListChangesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/changes/list_changes_responses.go b/client/changes/list_changes_responses.go new file mode 100644 index 0000000..4e7f937 --- /dev/null +++ b/client/changes/list_changes_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListChangesReader is a Reader for the ListChanges structure. +type ListChangesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListChangesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListChangesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListChangesOK creates a ListChangesOK with default headers values +func NewListChangesOK() *ListChangesOK { + return &ListChangesOK{} +} + +/* +ListChangesOK describes a response with status code 200, with default header values. + +List changes for the organization +*/ +type ListChangesOK struct { +} + +// IsSuccess returns true when this list changes o k response has a 2xx status code +func (o *ListChangesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list changes o k response has a 3xx status code +func (o *ListChangesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list changes o k response has a 4xx status code +func (o *ListChangesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list changes o k response has a 5xx status code +func (o *ListChangesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list changes o k response a status code equal to that given +func (o *ListChangesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListChangesOK) Error() string { + return fmt.Sprintf("[GET /v1/changes][%d] listChangesOK ", 200) +} + +func (o *ListChangesOK) String() string { + return fmt.Sprintf("[GET /v1/changes][%d] listChangesOK ", 200) +} + +func (o *ListChangesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/changes/update_change_event_parameters.go b/client/changes/update_change_event_parameters.go new file mode 100644 index 0000000..a1704b5 --- /dev/null +++ b/client/changes/update_change_event_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateChangeEventParams creates a new UpdateChangeEventParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateChangeEventParams() *UpdateChangeEventParams { + return &UpdateChangeEventParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateChangeEventParamsWithTimeout creates a new UpdateChangeEventParams object +// with the ability to set a timeout on a request. +func NewUpdateChangeEventParamsWithTimeout(timeout time.Duration) *UpdateChangeEventParams { + return &UpdateChangeEventParams{ + timeout: timeout, + } +} + +// NewUpdateChangeEventParamsWithContext creates a new UpdateChangeEventParams object +// with the ability to set a context for a request. +func NewUpdateChangeEventParamsWithContext(ctx context.Context) *UpdateChangeEventParams { + return &UpdateChangeEventParams{ + Context: ctx, + } +} + +// NewUpdateChangeEventParamsWithHTTPClient creates a new UpdateChangeEventParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateChangeEventParamsWithHTTPClient(client *http.Client) *UpdateChangeEventParams { + return &UpdateChangeEventParams{ + HTTPClient: client, + } +} + +/* +UpdateChangeEventParams contains all the parameters to send to the API endpoint + + for the update change event operation. + + Typically these are written to a http.Request. +*/ +type UpdateChangeEventParams struct { + + // ChangeEventID. + ChangeEventID string + + // UpdateChangeEvent. + UpdateChangeEvent *models.UpdateChangeEvent + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update change event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateChangeEventParams) WithDefaults() *UpdateChangeEventParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update change event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateChangeEventParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update change event params +func (o *UpdateChangeEventParams) WithTimeout(timeout time.Duration) *UpdateChangeEventParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update change event params +func (o *UpdateChangeEventParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update change event params +func (o *UpdateChangeEventParams) WithContext(ctx context.Context) *UpdateChangeEventParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update change event params +func (o *UpdateChangeEventParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update change event params +func (o *UpdateChangeEventParams) WithHTTPClient(client *http.Client) *UpdateChangeEventParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update change event params +func (o *UpdateChangeEventParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithChangeEventID adds the changeEventID to the update change event params +func (o *UpdateChangeEventParams) WithChangeEventID(changeEventID string) *UpdateChangeEventParams { + o.SetChangeEventID(changeEventID) + return o +} + +// SetChangeEventID adds the changeEventId to the update change event params +func (o *UpdateChangeEventParams) SetChangeEventID(changeEventID string) { + o.ChangeEventID = changeEventID +} + +// WithUpdateChangeEvent adds the updateChangeEvent to the update change event params +func (o *UpdateChangeEventParams) WithUpdateChangeEvent(updateChangeEvent *models.UpdateChangeEvent) *UpdateChangeEventParams { + o.SetUpdateChangeEvent(updateChangeEvent) + return o +} + +// SetUpdateChangeEvent adds the updateChangeEvent to the update change event params +func (o *UpdateChangeEventParams) SetUpdateChangeEvent(updateChangeEvent *models.UpdateChangeEvent) { + o.UpdateChangeEvent = updateChangeEvent +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateChangeEventParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param change_event_id + if err := r.SetPathParam("change_event_id", o.ChangeEventID); err != nil { + return err + } + if o.UpdateChangeEvent != nil { + if err := r.SetBodyParam(o.UpdateChangeEvent); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/changes/update_change_event_responses.go b/client/changes/update_change_event_responses.go new file mode 100644 index 0000000..9e77305 --- /dev/null +++ b/client/changes/update_change_event_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateChangeEventReader is a Reader for the UpdateChangeEvent structure. +type UpdateChangeEventReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateChangeEventReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateChangeEventOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateChangeEventOK creates a UpdateChangeEventOK with default headers values +func NewUpdateChangeEventOK() *UpdateChangeEventOK { + return &UpdateChangeEventOK{} +} + +/* +UpdateChangeEventOK describes a response with status code 200, with default header values. + +Update a change event +*/ +type UpdateChangeEventOK struct { + Payload *models.ChangeEventEntity +} + +// IsSuccess returns true when this update change event o k response has a 2xx status code +func (o *UpdateChangeEventOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update change event o k response has a 3xx status code +func (o *UpdateChangeEventOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update change event o k response has a 4xx status code +func (o *UpdateChangeEventOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update change event o k response has a 5xx status code +func (o *UpdateChangeEventOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update change event o k response a status code equal to that given +func (o *UpdateChangeEventOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateChangeEventOK) Error() string { + return fmt.Sprintf("[PATCH /v1/changes/events/{change_event_id}][%d] updateChangeEventOK %+v", 200, o.Payload) +} + +func (o *UpdateChangeEventOK) String() string { + return fmt.Sprintf("[PATCH /v1/changes/events/{change_event_id}][%d] updateChangeEventOK %+v", 200, o.Payload) +} + +func (o *UpdateChangeEventOK) GetPayload() *models.ChangeEventEntity { + return o.Payload +} + +func (o *UpdateChangeEventOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChangeEventEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/changes/update_change_identity_parameters.go b/client/changes/update_change_identity_parameters.go new file mode 100644 index 0000000..6fda7ae --- /dev/null +++ b/client/changes/update_change_identity_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateChangeIdentityParams creates a new UpdateChangeIdentityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateChangeIdentityParams() *UpdateChangeIdentityParams { + return &UpdateChangeIdentityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateChangeIdentityParamsWithTimeout creates a new UpdateChangeIdentityParams object +// with the ability to set a timeout on a request. +func NewUpdateChangeIdentityParamsWithTimeout(timeout time.Duration) *UpdateChangeIdentityParams { + return &UpdateChangeIdentityParams{ + timeout: timeout, + } +} + +// NewUpdateChangeIdentityParamsWithContext creates a new UpdateChangeIdentityParams object +// with the ability to set a context for a request. +func NewUpdateChangeIdentityParamsWithContext(ctx context.Context) *UpdateChangeIdentityParams { + return &UpdateChangeIdentityParams{ + Context: ctx, + } +} + +// NewUpdateChangeIdentityParamsWithHTTPClient creates a new UpdateChangeIdentityParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateChangeIdentityParamsWithHTTPClient(client *http.Client) *UpdateChangeIdentityParams { + return &UpdateChangeIdentityParams{ + HTTPClient: client, + } +} + +/* +UpdateChangeIdentityParams contains all the parameters to send to the API endpoint + + for the update change identity operation. + + Typically these are written to a http.Request. +*/ +type UpdateChangeIdentityParams struct { + + // ChangeID. + ChangeID string + + // IdentityID. + IdentityID string + + // UpdateChangeIdentity. + UpdateChangeIdentity *models.UpdateChangeIdentity + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update change identity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateChangeIdentityParams) WithDefaults() *UpdateChangeIdentityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update change identity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateChangeIdentityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update change identity params +func (o *UpdateChangeIdentityParams) WithTimeout(timeout time.Duration) *UpdateChangeIdentityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update change identity params +func (o *UpdateChangeIdentityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update change identity params +func (o *UpdateChangeIdentityParams) WithContext(ctx context.Context) *UpdateChangeIdentityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update change identity params +func (o *UpdateChangeIdentityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update change identity params +func (o *UpdateChangeIdentityParams) WithHTTPClient(client *http.Client) *UpdateChangeIdentityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update change identity params +func (o *UpdateChangeIdentityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithChangeID adds the changeID to the update change identity params +func (o *UpdateChangeIdentityParams) WithChangeID(changeID string) *UpdateChangeIdentityParams { + o.SetChangeID(changeID) + return o +} + +// SetChangeID adds the changeId to the update change identity params +func (o *UpdateChangeIdentityParams) SetChangeID(changeID string) { + o.ChangeID = changeID +} + +// WithIdentityID adds the identityID to the update change identity params +func (o *UpdateChangeIdentityParams) WithIdentityID(identityID string) *UpdateChangeIdentityParams { + o.SetIdentityID(identityID) + return o +} + +// SetIdentityID adds the identityId to the update change identity params +func (o *UpdateChangeIdentityParams) SetIdentityID(identityID string) { + o.IdentityID = identityID +} + +// WithUpdateChangeIdentity adds the updateChangeIdentity to the update change identity params +func (o *UpdateChangeIdentityParams) WithUpdateChangeIdentity(updateChangeIdentity *models.UpdateChangeIdentity) *UpdateChangeIdentityParams { + o.SetUpdateChangeIdentity(updateChangeIdentity) + return o +} + +// SetUpdateChangeIdentity adds the updateChangeIdentity to the update change identity params +func (o *UpdateChangeIdentityParams) SetUpdateChangeIdentity(updateChangeIdentity *models.UpdateChangeIdentity) { + o.UpdateChangeIdentity = updateChangeIdentity +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateChangeIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param change_id + if err := r.SetPathParam("change_id", o.ChangeID); err != nil { + return err + } + + // path param identity_id + if err := r.SetPathParam("identity_id", o.IdentityID); err != nil { + return err + } + if o.UpdateChangeIdentity != nil { + if err := r.SetBodyParam(o.UpdateChangeIdentity); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/changes/update_change_identity_responses.go b/client/changes/update_change_identity_responses.go new file mode 100644 index 0000000..0e4d678 --- /dev/null +++ b/client/changes/update_change_identity_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateChangeIdentityReader is a Reader for the UpdateChangeIdentity structure. +type UpdateChangeIdentityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateChangeIdentityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateChangeIdentityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateChangeIdentityBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateChangeIdentityOK creates a UpdateChangeIdentityOK with default headers values +func NewUpdateChangeIdentityOK() *UpdateChangeIdentityOK { + return &UpdateChangeIdentityOK{} +} + +/* +UpdateChangeIdentityOK describes a response with status code 200, with default header values. + +Update an identity for the change entry +*/ +type UpdateChangeIdentityOK struct { + Payload *models.ChangeIdentityEntity +} + +// IsSuccess returns true when this update change identity o k response has a 2xx status code +func (o *UpdateChangeIdentityOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update change identity o k response has a 3xx status code +func (o *UpdateChangeIdentityOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update change identity o k response has a 4xx status code +func (o *UpdateChangeIdentityOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update change identity o k response has a 5xx status code +func (o *UpdateChangeIdentityOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update change identity o k response a status code equal to that given +func (o *UpdateChangeIdentityOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateChangeIdentityOK) Error() string { + return fmt.Sprintf("[PATCH /v1/changes/{change_id}/identities/{identity_id}][%d] updateChangeIdentityOK %+v", 200, o.Payload) +} + +func (o *UpdateChangeIdentityOK) String() string { + return fmt.Sprintf("[PATCH /v1/changes/{change_id}/identities/{identity_id}][%d] updateChangeIdentityOK %+v", 200, o.Payload) +} + +func (o *UpdateChangeIdentityOK) GetPayload() *models.ChangeIdentityEntity { + return o.Payload +} + +func (o *UpdateChangeIdentityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChangeIdentityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateChangeIdentityBadRequest creates a UpdateChangeIdentityBadRequest with default headers values +func NewUpdateChangeIdentityBadRequest() *UpdateChangeIdentityBadRequest { + return &UpdateChangeIdentityBadRequest{} +} + +/* +UpdateChangeIdentityBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type UpdateChangeIdentityBadRequest struct { + Payload *models.ErrorEntity +} + +// IsSuccess returns true when this update change identity bad request response has a 2xx status code +func (o *UpdateChangeIdentityBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update change identity bad request response has a 3xx status code +func (o *UpdateChangeIdentityBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update change identity bad request response has a 4xx status code +func (o *UpdateChangeIdentityBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update change identity bad request response has a 5xx status code +func (o *UpdateChangeIdentityBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update change identity bad request response a status code equal to that given +func (o *UpdateChangeIdentityBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *UpdateChangeIdentityBadRequest) Error() string { + return fmt.Sprintf("[PATCH /v1/changes/{change_id}/identities/{identity_id}][%d] updateChangeIdentityBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateChangeIdentityBadRequest) String() string { + return fmt.Sprintf("[PATCH /v1/changes/{change_id}/identities/{identity_id}][%d] updateChangeIdentityBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateChangeIdentityBadRequest) GetPayload() *models.ErrorEntity { + return o.Payload +} + +func (o *UpdateChangeIdentityBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/changes/update_change_parameters.go b/client/changes/update_change_parameters.go new file mode 100644 index 0000000..5bbf7ad --- /dev/null +++ b/client/changes/update_change_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateChangeParams creates a new UpdateChangeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateChangeParams() *UpdateChangeParams { + return &UpdateChangeParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateChangeParamsWithTimeout creates a new UpdateChangeParams object +// with the ability to set a timeout on a request. +func NewUpdateChangeParamsWithTimeout(timeout time.Duration) *UpdateChangeParams { + return &UpdateChangeParams{ + timeout: timeout, + } +} + +// NewUpdateChangeParamsWithContext creates a new UpdateChangeParams object +// with the ability to set a context for a request. +func NewUpdateChangeParamsWithContext(ctx context.Context) *UpdateChangeParams { + return &UpdateChangeParams{ + Context: ctx, + } +} + +// NewUpdateChangeParamsWithHTTPClient creates a new UpdateChangeParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateChangeParamsWithHTTPClient(client *http.Client) *UpdateChangeParams { + return &UpdateChangeParams{ + HTTPClient: client, + } +} + +/* +UpdateChangeParams contains all the parameters to send to the API endpoint + + for the update change operation. + + Typically these are written to a http.Request. +*/ +type UpdateChangeParams struct { + + // ChangeID. + ChangeID string + + // UpdateChange. + UpdateChange *models.UpdateChange + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update change params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateChangeParams) WithDefaults() *UpdateChangeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update change params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateChangeParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update change params +func (o *UpdateChangeParams) WithTimeout(timeout time.Duration) *UpdateChangeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update change params +func (o *UpdateChangeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update change params +func (o *UpdateChangeParams) WithContext(ctx context.Context) *UpdateChangeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update change params +func (o *UpdateChangeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update change params +func (o *UpdateChangeParams) WithHTTPClient(client *http.Client) *UpdateChangeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update change params +func (o *UpdateChangeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithChangeID adds the changeID to the update change params +func (o *UpdateChangeParams) WithChangeID(changeID string) *UpdateChangeParams { + o.SetChangeID(changeID) + return o +} + +// SetChangeID adds the changeId to the update change params +func (o *UpdateChangeParams) SetChangeID(changeID string) { + o.ChangeID = changeID +} + +// WithUpdateChange adds the updateChange to the update change params +func (o *UpdateChangeParams) WithUpdateChange(updateChange *models.UpdateChange) *UpdateChangeParams { + o.SetUpdateChange(updateChange) + return o +} + +// SetUpdateChange adds the updateChange to the update change params +func (o *UpdateChangeParams) SetUpdateChange(updateChange *models.UpdateChange) { + o.UpdateChange = updateChange +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateChangeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param change_id + if err := r.SetPathParam("change_id", o.ChangeID); err != nil { + return err + } + if o.UpdateChange != nil { + if err := r.SetBodyParam(o.UpdateChange); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/changes/update_change_responses.go b/client/changes/update_change_responses.go new file mode 100644 index 0000000..69bcef7 --- /dev/null +++ b/client/changes/update_change_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package changes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateChangeReader is a Reader for the UpdateChange structure. +type UpdateChangeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateChangeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateChangeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateChangeOK creates a UpdateChangeOK with default headers values +func NewUpdateChangeOK() *UpdateChangeOK { + return &UpdateChangeOK{} +} + +/* +UpdateChangeOK describes a response with status code 200, with default header values. + +Update a change entry +*/ +type UpdateChangeOK struct { + Payload *models.ChangeEntity +} + +// IsSuccess returns true when this update change o k response has a 2xx status code +func (o *UpdateChangeOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update change o k response has a 3xx status code +func (o *UpdateChangeOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update change o k response has a 4xx status code +func (o *UpdateChangeOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update change o k response has a 5xx status code +func (o *UpdateChangeOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update change o k response a status code equal to that given +func (o *UpdateChangeOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateChangeOK) Error() string { + return fmt.Sprintf("[PATCH /v1/changes/{change_id}][%d] updateChangeOK %+v", 200, o.Payload) +} + +func (o *UpdateChangeOK) String() string { + return fmt.Sprintf("[PATCH /v1/changes/{change_id}][%d] updateChangeOK %+v", 200, o.Payload) +} + +func (o *UpdateChangeOK) GetPayload() *models.ChangeEntity { + return o.Payload +} + +func (o *UpdateChangeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChangeEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/communication/communication_client.go b/client/communication/communication_client.go index 32ddab8..f1d5130 100644 --- a/client/communication/communication_client.go +++ b/client/communication/communication_client.go @@ -30,38 +30,38 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1StatusUpdateTemplatesStatusUpdateTemplateID(params *DeleteV1StatusUpdateTemplatesStatusUpdateTemplateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1StatusUpdateTemplatesStatusUpdateTemplateIDOK, error) + CreateStatusUpdateTemplate(params *CreateStatusUpdateTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateStatusUpdateTemplateCreated, error) - GetV1StatusUpdateTemplates(params *GetV1StatusUpdateTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1StatusUpdateTemplatesOK, error) + DeleteStatusUpdateTemplate(params *DeleteStatusUpdateTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteStatusUpdateTemplateOK, error) - GetV1StatusUpdateTemplatesStatusUpdateTemplateID(params *GetV1StatusUpdateTemplatesStatusUpdateTemplateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1StatusUpdateTemplatesStatusUpdateTemplateIDOK, error) + GetStatusUpdateTemplate(params *GetStatusUpdateTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetStatusUpdateTemplateOK, error) - PatchV1StatusUpdateTemplatesStatusUpdateTemplateID(params *PatchV1StatusUpdateTemplatesStatusUpdateTemplateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1StatusUpdateTemplatesStatusUpdateTemplateIDOK, error) + ListStatusUpdateTemplates(params *ListStatusUpdateTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListStatusUpdateTemplatesOK, error) - PostV1StatusUpdateTemplates(params *PostV1StatusUpdateTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1StatusUpdateTemplatesCreated, error) + UpdateStatusUpdateTemplate(params *UpdateStatusUpdateTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateStatusUpdateTemplateOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1StatusUpdateTemplatesStatusUpdateTemplateID deletes a status update template +CreateStatusUpdateTemplate creates a status update template -Delete a single status update template +Create a status update template for your organization */ -func (a *Client) DeleteV1StatusUpdateTemplatesStatusUpdateTemplateID(params *DeleteV1StatusUpdateTemplatesStatusUpdateTemplateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1StatusUpdateTemplatesStatusUpdateTemplateIDOK, error) { +func (a *Client) CreateStatusUpdateTemplate(params *CreateStatusUpdateTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateStatusUpdateTemplateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1StatusUpdateTemplatesStatusUpdateTemplateIDParams() + params = NewCreateStatusUpdateTemplateParams() } op := &runtime.ClientOperation{ - ID: "deleteV1StatusUpdateTemplatesStatusUpdateTemplateId", - Method: "DELETE", - PathPattern: "/v1/status_update_templates/{status_update_template_id}", + ID: "create_status_update_template", + Method: "POST", + PathPattern: "/v1/status_update_templates", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1StatusUpdateTemplatesStatusUpdateTemplateIDReader{formats: a.formats}, + Reader: &CreateStatusUpdateTemplateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -74,35 +74,35 @@ func (a *Client) DeleteV1StatusUpdateTemplatesStatusUpdateTemplateID(params *Del if err != nil { return nil, err } - success, ok := result.(*DeleteV1StatusUpdateTemplatesStatusUpdateTemplateIDOK) + success, ok := result.(*CreateStatusUpdateTemplateCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1StatusUpdateTemplatesStatusUpdateTemplateId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_status_update_template: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1StatusUpdateTemplates lists status update templates +DeleteStatusUpdateTemplate deletes a status update template -List all status update templates for your organization +Delete a single status update template */ -func (a *Client) GetV1StatusUpdateTemplates(params *GetV1StatusUpdateTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1StatusUpdateTemplatesOK, error) { +func (a *Client) DeleteStatusUpdateTemplate(params *DeleteStatusUpdateTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteStatusUpdateTemplateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1StatusUpdateTemplatesParams() + params = NewDeleteStatusUpdateTemplateParams() } op := &runtime.ClientOperation{ - ID: "getV1StatusUpdateTemplates", - Method: "GET", - PathPattern: "/v1/status_update_templates", + ID: "delete_status_update_template", + Method: "DELETE", + PathPattern: "/v1/status_update_templates/{status_update_template_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1StatusUpdateTemplatesReader{formats: a.formats}, + Reader: &DeleteStatusUpdateTemplateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -115,35 +115,35 @@ func (a *Client) GetV1StatusUpdateTemplates(params *GetV1StatusUpdateTemplatesPa if err != nil { return nil, err } - success, ok := result.(*GetV1StatusUpdateTemplatesOK) + success, ok := result.(*DeleteStatusUpdateTemplateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1StatusUpdateTemplates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_status_update_template: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1StatusUpdateTemplatesStatusUpdateTemplateID gets a status update template +GetStatusUpdateTemplate gets a status update template Get a single status update template by ID */ -func (a *Client) GetV1StatusUpdateTemplatesStatusUpdateTemplateID(params *GetV1StatusUpdateTemplatesStatusUpdateTemplateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1StatusUpdateTemplatesStatusUpdateTemplateIDOK, error) { +func (a *Client) GetStatusUpdateTemplate(params *GetStatusUpdateTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetStatusUpdateTemplateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1StatusUpdateTemplatesStatusUpdateTemplateIDParams() + params = NewGetStatusUpdateTemplateParams() } op := &runtime.ClientOperation{ - ID: "getV1StatusUpdateTemplatesStatusUpdateTemplateId", + ID: "get_status_update_template", Method: "GET", PathPattern: "/v1/status_update_templates/{status_update_template_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1StatusUpdateTemplatesStatusUpdateTemplateIDReader{formats: a.formats}, + Reader: &GetStatusUpdateTemplateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -156,35 +156,35 @@ func (a *Client) GetV1StatusUpdateTemplatesStatusUpdateTemplateID(params *GetV1S if err != nil { return nil, err } - success, ok := result.(*GetV1StatusUpdateTemplatesStatusUpdateTemplateIDOK) + success, ok := result.(*GetStatusUpdateTemplateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1StatusUpdateTemplatesStatusUpdateTemplateId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_status_update_template: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1StatusUpdateTemplatesStatusUpdateTemplateID updates a status update template +ListStatusUpdateTemplates lists status update templates -Update a single status update template +List all status update templates for your organization */ -func (a *Client) PatchV1StatusUpdateTemplatesStatusUpdateTemplateID(params *PatchV1StatusUpdateTemplatesStatusUpdateTemplateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1StatusUpdateTemplatesStatusUpdateTemplateIDOK, error) { +func (a *Client) ListStatusUpdateTemplates(params *ListStatusUpdateTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListStatusUpdateTemplatesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1StatusUpdateTemplatesStatusUpdateTemplateIDParams() + params = NewListStatusUpdateTemplatesParams() } op := &runtime.ClientOperation{ - ID: "patchV1StatusUpdateTemplatesStatusUpdateTemplateId", - Method: "PATCH", - PathPattern: "/v1/status_update_templates/{status_update_template_id}", + ID: "list_status_update_templates", + Method: "GET", + PathPattern: "/v1/status_update_templates", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1StatusUpdateTemplatesStatusUpdateTemplateIDReader{formats: a.formats}, + Reader: &ListStatusUpdateTemplatesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -197,35 +197,35 @@ func (a *Client) PatchV1StatusUpdateTemplatesStatusUpdateTemplateID(params *Patc if err != nil { return nil, err } - success, ok := result.(*PatchV1StatusUpdateTemplatesStatusUpdateTemplateIDOK) + success, ok := result.(*ListStatusUpdateTemplatesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1StatusUpdateTemplatesStatusUpdateTemplateId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_status_update_templates: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1StatusUpdateTemplates creates a status update template +UpdateStatusUpdateTemplate updates a status update template -Create a status update template for your organization +Update a single status update template */ -func (a *Client) PostV1StatusUpdateTemplates(params *PostV1StatusUpdateTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1StatusUpdateTemplatesCreated, error) { +func (a *Client) UpdateStatusUpdateTemplate(params *UpdateStatusUpdateTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateStatusUpdateTemplateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1StatusUpdateTemplatesParams() + params = NewUpdateStatusUpdateTemplateParams() } op := &runtime.ClientOperation{ - ID: "postV1StatusUpdateTemplates", - Method: "POST", - PathPattern: "/v1/status_update_templates", + ID: "update_status_update_template", + Method: "PATCH", + PathPattern: "/v1/status_update_templates/{status_update_template_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1StatusUpdateTemplatesReader{formats: a.formats}, + Reader: &UpdateStatusUpdateTemplateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -238,13 +238,13 @@ func (a *Client) PostV1StatusUpdateTemplates(params *PostV1StatusUpdateTemplates if err != nil { return nil, err } - success, ok := result.(*PostV1StatusUpdateTemplatesCreated) + success, ok := result.(*UpdateStatusUpdateTemplateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1StatusUpdateTemplates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_status_update_template: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/communication/create_status_update_template_parameters.go b/client/communication/create_status_update_template_parameters.go new file mode 100644 index 0000000..83ba8a0 --- /dev/null +++ b/client/communication/create_status_update_template_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package communication + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateStatusUpdateTemplateParams creates a new CreateStatusUpdateTemplateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateStatusUpdateTemplateParams() *CreateStatusUpdateTemplateParams { + return &CreateStatusUpdateTemplateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateStatusUpdateTemplateParamsWithTimeout creates a new CreateStatusUpdateTemplateParams object +// with the ability to set a timeout on a request. +func NewCreateStatusUpdateTemplateParamsWithTimeout(timeout time.Duration) *CreateStatusUpdateTemplateParams { + return &CreateStatusUpdateTemplateParams{ + timeout: timeout, + } +} + +// NewCreateStatusUpdateTemplateParamsWithContext creates a new CreateStatusUpdateTemplateParams object +// with the ability to set a context for a request. +func NewCreateStatusUpdateTemplateParamsWithContext(ctx context.Context) *CreateStatusUpdateTemplateParams { + return &CreateStatusUpdateTemplateParams{ + Context: ctx, + } +} + +// NewCreateStatusUpdateTemplateParamsWithHTTPClient creates a new CreateStatusUpdateTemplateParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateStatusUpdateTemplateParamsWithHTTPClient(client *http.Client) *CreateStatusUpdateTemplateParams { + return &CreateStatusUpdateTemplateParams{ + HTTPClient: client, + } +} + +/* +CreateStatusUpdateTemplateParams contains all the parameters to send to the API endpoint + + for the create status update template operation. + + Typically these are written to a http.Request. +*/ +type CreateStatusUpdateTemplateParams struct { + + // CreateStatusUpdateTemplate. + CreateStatusUpdateTemplate *models.CreateStatusUpdateTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create status update template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateStatusUpdateTemplateParams) WithDefaults() *CreateStatusUpdateTemplateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create status update template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateStatusUpdateTemplateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create status update template params +func (o *CreateStatusUpdateTemplateParams) WithTimeout(timeout time.Duration) *CreateStatusUpdateTemplateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create status update template params +func (o *CreateStatusUpdateTemplateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create status update template params +func (o *CreateStatusUpdateTemplateParams) WithContext(ctx context.Context) *CreateStatusUpdateTemplateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create status update template params +func (o *CreateStatusUpdateTemplateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create status update template params +func (o *CreateStatusUpdateTemplateParams) WithHTTPClient(client *http.Client) *CreateStatusUpdateTemplateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create status update template params +func (o *CreateStatusUpdateTemplateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateStatusUpdateTemplate adds the createStatusUpdateTemplate to the create status update template params +func (o *CreateStatusUpdateTemplateParams) WithCreateStatusUpdateTemplate(createStatusUpdateTemplate *models.CreateStatusUpdateTemplate) *CreateStatusUpdateTemplateParams { + o.SetCreateStatusUpdateTemplate(createStatusUpdateTemplate) + return o +} + +// SetCreateStatusUpdateTemplate adds the createStatusUpdateTemplate to the create status update template params +func (o *CreateStatusUpdateTemplateParams) SetCreateStatusUpdateTemplate(createStatusUpdateTemplate *models.CreateStatusUpdateTemplate) { + o.CreateStatusUpdateTemplate = createStatusUpdateTemplate +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateStatusUpdateTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateStatusUpdateTemplate != nil { + if err := r.SetBodyParam(o.CreateStatusUpdateTemplate); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/communication/create_status_update_template_responses.go b/client/communication/create_status_update_template_responses.go new file mode 100644 index 0000000..9dc6f75 --- /dev/null +++ b/client/communication/create_status_update_template_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package communication + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateStatusUpdateTemplateReader is a Reader for the CreateStatusUpdateTemplate structure. +type CreateStatusUpdateTemplateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateStatusUpdateTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateStatusUpdateTemplateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateStatusUpdateTemplateCreated creates a CreateStatusUpdateTemplateCreated with default headers values +func NewCreateStatusUpdateTemplateCreated() *CreateStatusUpdateTemplateCreated { + return &CreateStatusUpdateTemplateCreated{} +} + +/* +CreateStatusUpdateTemplateCreated describes a response with status code 201, with default header values. + +Create a status update template for your organization +*/ +type CreateStatusUpdateTemplateCreated struct { + Payload *models.StatusUpdateTemplateEntity +} + +// IsSuccess returns true when this create status update template created response has a 2xx status code +func (o *CreateStatusUpdateTemplateCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create status update template created response has a 3xx status code +func (o *CreateStatusUpdateTemplateCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create status update template created response has a 4xx status code +func (o *CreateStatusUpdateTemplateCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create status update template created response has a 5xx status code +func (o *CreateStatusUpdateTemplateCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create status update template created response a status code equal to that given +func (o *CreateStatusUpdateTemplateCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateStatusUpdateTemplateCreated) Error() string { + return fmt.Sprintf("[POST /v1/status_update_templates][%d] createStatusUpdateTemplateCreated %+v", 201, o.Payload) +} + +func (o *CreateStatusUpdateTemplateCreated) String() string { + return fmt.Sprintf("[POST /v1/status_update_templates][%d] createStatusUpdateTemplateCreated %+v", 201, o.Payload) +} + +func (o *CreateStatusUpdateTemplateCreated) GetPayload() *models.StatusUpdateTemplateEntity { + return o.Payload +} + +func (o *CreateStatusUpdateTemplateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.StatusUpdateTemplateEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/communication/delete_status_update_template_parameters.go b/client/communication/delete_status_update_template_parameters.go new file mode 100644 index 0000000..8fa7c30 --- /dev/null +++ b/client/communication/delete_status_update_template_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package communication + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteStatusUpdateTemplateParams creates a new DeleteStatusUpdateTemplateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteStatusUpdateTemplateParams() *DeleteStatusUpdateTemplateParams { + return &DeleteStatusUpdateTemplateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteStatusUpdateTemplateParamsWithTimeout creates a new DeleteStatusUpdateTemplateParams object +// with the ability to set a timeout on a request. +func NewDeleteStatusUpdateTemplateParamsWithTimeout(timeout time.Duration) *DeleteStatusUpdateTemplateParams { + return &DeleteStatusUpdateTemplateParams{ + timeout: timeout, + } +} + +// NewDeleteStatusUpdateTemplateParamsWithContext creates a new DeleteStatusUpdateTemplateParams object +// with the ability to set a context for a request. +func NewDeleteStatusUpdateTemplateParamsWithContext(ctx context.Context) *DeleteStatusUpdateTemplateParams { + return &DeleteStatusUpdateTemplateParams{ + Context: ctx, + } +} + +// NewDeleteStatusUpdateTemplateParamsWithHTTPClient creates a new DeleteStatusUpdateTemplateParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteStatusUpdateTemplateParamsWithHTTPClient(client *http.Client) *DeleteStatusUpdateTemplateParams { + return &DeleteStatusUpdateTemplateParams{ + HTTPClient: client, + } +} + +/* +DeleteStatusUpdateTemplateParams contains all the parameters to send to the API endpoint + + for the delete status update template operation. + + Typically these are written to a http.Request. +*/ +type DeleteStatusUpdateTemplateParams struct { + + // StatusUpdateTemplateID. + StatusUpdateTemplateID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete status update template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteStatusUpdateTemplateParams) WithDefaults() *DeleteStatusUpdateTemplateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete status update template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteStatusUpdateTemplateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete status update template params +func (o *DeleteStatusUpdateTemplateParams) WithTimeout(timeout time.Duration) *DeleteStatusUpdateTemplateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete status update template params +func (o *DeleteStatusUpdateTemplateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete status update template params +func (o *DeleteStatusUpdateTemplateParams) WithContext(ctx context.Context) *DeleteStatusUpdateTemplateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete status update template params +func (o *DeleteStatusUpdateTemplateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete status update template params +func (o *DeleteStatusUpdateTemplateParams) WithHTTPClient(client *http.Client) *DeleteStatusUpdateTemplateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete status update template params +func (o *DeleteStatusUpdateTemplateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithStatusUpdateTemplateID adds the statusUpdateTemplateID to the delete status update template params +func (o *DeleteStatusUpdateTemplateParams) WithStatusUpdateTemplateID(statusUpdateTemplateID string) *DeleteStatusUpdateTemplateParams { + o.SetStatusUpdateTemplateID(statusUpdateTemplateID) + return o +} + +// SetStatusUpdateTemplateID adds the statusUpdateTemplateId to the delete status update template params +func (o *DeleteStatusUpdateTemplateParams) SetStatusUpdateTemplateID(statusUpdateTemplateID string) { + o.StatusUpdateTemplateID = statusUpdateTemplateID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteStatusUpdateTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param status_update_template_id + if err := r.SetPathParam("status_update_template_id", o.StatusUpdateTemplateID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/communication/delete_status_update_template_responses.go b/client/communication/delete_status_update_template_responses.go new file mode 100644 index 0000000..1416dc9 --- /dev/null +++ b/client/communication/delete_status_update_template_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package communication + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteStatusUpdateTemplateReader is a Reader for the DeleteStatusUpdateTemplate structure. +type DeleteStatusUpdateTemplateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteStatusUpdateTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteStatusUpdateTemplateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteStatusUpdateTemplateOK creates a DeleteStatusUpdateTemplateOK with default headers values +func NewDeleteStatusUpdateTemplateOK() *DeleteStatusUpdateTemplateOK { + return &DeleteStatusUpdateTemplateOK{} +} + +/* +DeleteStatusUpdateTemplateOK describes a response with status code 200, with default header values. + +Delete a single status update template +*/ +type DeleteStatusUpdateTemplateOK struct { + Payload *models.StatusUpdateTemplateEntity +} + +// IsSuccess returns true when this delete status update template o k response has a 2xx status code +func (o *DeleteStatusUpdateTemplateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete status update template o k response has a 3xx status code +func (o *DeleteStatusUpdateTemplateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete status update template o k response has a 4xx status code +func (o *DeleteStatusUpdateTemplateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete status update template o k response has a 5xx status code +func (o *DeleteStatusUpdateTemplateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete status update template o k response a status code equal to that given +func (o *DeleteStatusUpdateTemplateOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteStatusUpdateTemplateOK) Error() string { + return fmt.Sprintf("[DELETE /v1/status_update_templates/{status_update_template_id}][%d] deleteStatusUpdateTemplateOK %+v", 200, o.Payload) +} + +func (o *DeleteStatusUpdateTemplateOK) String() string { + return fmt.Sprintf("[DELETE /v1/status_update_templates/{status_update_template_id}][%d] deleteStatusUpdateTemplateOK %+v", 200, o.Payload) +} + +func (o *DeleteStatusUpdateTemplateOK) GetPayload() *models.StatusUpdateTemplateEntity { + return o.Payload +} + +func (o *DeleteStatusUpdateTemplateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.StatusUpdateTemplateEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/communication/get_status_update_template_parameters.go b/client/communication/get_status_update_template_parameters.go new file mode 100644 index 0000000..54be66f --- /dev/null +++ b/client/communication/get_status_update_template_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package communication + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetStatusUpdateTemplateParams creates a new GetStatusUpdateTemplateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetStatusUpdateTemplateParams() *GetStatusUpdateTemplateParams { + return &GetStatusUpdateTemplateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetStatusUpdateTemplateParamsWithTimeout creates a new GetStatusUpdateTemplateParams object +// with the ability to set a timeout on a request. +func NewGetStatusUpdateTemplateParamsWithTimeout(timeout time.Duration) *GetStatusUpdateTemplateParams { + return &GetStatusUpdateTemplateParams{ + timeout: timeout, + } +} + +// NewGetStatusUpdateTemplateParamsWithContext creates a new GetStatusUpdateTemplateParams object +// with the ability to set a context for a request. +func NewGetStatusUpdateTemplateParamsWithContext(ctx context.Context) *GetStatusUpdateTemplateParams { + return &GetStatusUpdateTemplateParams{ + Context: ctx, + } +} + +// NewGetStatusUpdateTemplateParamsWithHTTPClient creates a new GetStatusUpdateTemplateParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetStatusUpdateTemplateParamsWithHTTPClient(client *http.Client) *GetStatusUpdateTemplateParams { + return &GetStatusUpdateTemplateParams{ + HTTPClient: client, + } +} + +/* +GetStatusUpdateTemplateParams contains all the parameters to send to the API endpoint + + for the get status update template operation. + + Typically these are written to a http.Request. +*/ +type GetStatusUpdateTemplateParams struct { + + // StatusUpdateTemplateID. + StatusUpdateTemplateID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get status update template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetStatusUpdateTemplateParams) WithDefaults() *GetStatusUpdateTemplateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get status update template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetStatusUpdateTemplateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get status update template params +func (o *GetStatusUpdateTemplateParams) WithTimeout(timeout time.Duration) *GetStatusUpdateTemplateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get status update template params +func (o *GetStatusUpdateTemplateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get status update template params +func (o *GetStatusUpdateTemplateParams) WithContext(ctx context.Context) *GetStatusUpdateTemplateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get status update template params +func (o *GetStatusUpdateTemplateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get status update template params +func (o *GetStatusUpdateTemplateParams) WithHTTPClient(client *http.Client) *GetStatusUpdateTemplateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get status update template params +func (o *GetStatusUpdateTemplateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithStatusUpdateTemplateID adds the statusUpdateTemplateID to the get status update template params +func (o *GetStatusUpdateTemplateParams) WithStatusUpdateTemplateID(statusUpdateTemplateID string) *GetStatusUpdateTemplateParams { + o.SetStatusUpdateTemplateID(statusUpdateTemplateID) + return o +} + +// SetStatusUpdateTemplateID adds the statusUpdateTemplateId to the get status update template params +func (o *GetStatusUpdateTemplateParams) SetStatusUpdateTemplateID(statusUpdateTemplateID string) { + o.StatusUpdateTemplateID = statusUpdateTemplateID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetStatusUpdateTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param status_update_template_id + if err := r.SetPathParam("status_update_template_id", o.StatusUpdateTemplateID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/communication/get_status_update_template_responses.go b/client/communication/get_status_update_template_responses.go new file mode 100644 index 0000000..0857330 --- /dev/null +++ b/client/communication/get_status_update_template_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package communication + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetStatusUpdateTemplateReader is a Reader for the GetStatusUpdateTemplate structure. +type GetStatusUpdateTemplateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetStatusUpdateTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetStatusUpdateTemplateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetStatusUpdateTemplateOK creates a GetStatusUpdateTemplateOK with default headers values +func NewGetStatusUpdateTemplateOK() *GetStatusUpdateTemplateOK { + return &GetStatusUpdateTemplateOK{} +} + +/* +GetStatusUpdateTemplateOK describes a response with status code 200, with default header values. + +Get a single status update template by ID +*/ +type GetStatusUpdateTemplateOK struct { + Payload *models.StatusUpdateTemplateEntity +} + +// IsSuccess returns true when this get status update template o k response has a 2xx status code +func (o *GetStatusUpdateTemplateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get status update template o k response has a 3xx status code +func (o *GetStatusUpdateTemplateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get status update template o k response has a 4xx status code +func (o *GetStatusUpdateTemplateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get status update template o k response has a 5xx status code +func (o *GetStatusUpdateTemplateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get status update template o k response a status code equal to that given +func (o *GetStatusUpdateTemplateOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetStatusUpdateTemplateOK) Error() string { + return fmt.Sprintf("[GET /v1/status_update_templates/{status_update_template_id}][%d] getStatusUpdateTemplateOK %+v", 200, o.Payload) +} + +func (o *GetStatusUpdateTemplateOK) String() string { + return fmt.Sprintf("[GET /v1/status_update_templates/{status_update_template_id}][%d] getStatusUpdateTemplateOK %+v", 200, o.Payload) +} + +func (o *GetStatusUpdateTemplateOK) GetPayload() *models.StatusUpdateTemplateEntity { + return o.Payload +} + +func (o *GetStatusUpdateTemplateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.StatusUpdateTemplateEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/communication/list_status_update_templates_parameters.go b/client/communication/list_status_update_templates_parameters.go new file mode 100644 index 0000000..e444dc0 --- /dev/null +++ b/client/communication/list_status_update_templates_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package communication + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListStatusUpdateTemplatesParams creates a new ListStatusUpdateTemplatesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListStatusUpdateTemplatesParams() *ListStatusUpdateTemplatesParams { + return &ListStatusUpdateTemplatesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListStatusUpdateTemplatesParamsWithTimeout creates a new ListStatusUpdateTemplatesParams object +// with the ability to set a timeout on a request. +func NewListStatusUpdateTemplatesParamsWithTimeout(timeout time.Duration) *ListStatusUpdateTemplatesParams { + return &ListStatusUpdateTemplatesParams{ + timeout: timeout, + } +} + +// NewListStatusUpdateTemplatesParamsWithContext creates a new ListStatusUpdateTemplatesParams object +// with the ability to set a context for a request. +func NewListStatusUpdateTemplatesParamsWithContext(ctx context.Context) *ListStatusUpdateTemplatesParams { + return &ListStatusUpdateTemplatesParams{ + Context: ctx, + } +} + +// NewListStatusUpdateTemplatesParamsWithHTTPClient creates a new ListStatusUpdateTemplatesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListStatusUpdateTemplatesParamsWithHTTPClient(client *http.Client) *ListStatusUpdateTemplatesParams { + return &ListStatusUpdateTemplatesParams{ + HTTPClient: client, + } +} + +/* +ListStatusUpdateTemplatesParams contains all the parameters to send to the API endpoint + + for the list status update templates operation. + + Typically these are written to a http.Request. +*/ +type ListStatusUpdateTemplatesParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list status update templates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListStatusUpdateTemplatesParams) WithDefaults() *ListStatusUpdateTemplatesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list status update templates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListStatusUpdateTemplatesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list status update templates params +func (o *ListStatusUpdateTemplatesParams) WithTimeout(timeout time.Duration) *ListStatusUpdateTemplatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list status update templates params +func (o *ListStatusUpdateTemplatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list status update templates params +func (o *ListStatusUpdateTemplatesParams) WithContext(ctx context.Context) *ListStatusUpdateTemplatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list status update templates params +func (o *ListStatusUpdateTemplatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list status update templates params +func (o *ListStatusUpdateTemplatesParams) WithHTTPClient(client *http.Client) *ListStatusUpdateTemplatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list status update templates params +func (o *ListStatusUpdateTemplatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list status update templates params +func (o *ListStatusUpdateTemplatesParams) WithPage(page *int32) *ListStatusUpdateTemplatesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list status update templates params +func (o *ListStatusUpdateTemplatesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list status update templates params +func (o *ListStatusUpdateTemplatesParams) WithPerPage(perPage *int32) *ListStatusUpdateTemplatesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list status update templates params +func (o *ListStatusUpdateTemplatesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListStatusUpdateTemplatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/communication/list_status_update_templates_responses.go b/client/communication/list_status_update_templates_responses.go new file mode 100644 index 0000000..ed277b3 --- /dev/null +++ b/client/communication/list_status_update_templates_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package communication + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListStatusUpdateTemplatesReader is a Reader for the ListStatusUpdateTemplates structure. +type ListStatusUpdateTemplatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListStatusUpdateTemplatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListStatusUpdateTemplatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListStatusUpdateTemplatesOK creates a ListStatusUpdateTemplatesOK with default headers values +func NewListStatusUpdateTemplatesOK() *ListStatusUpdateTemplatesOK { + return &ListStatusUpdateTemplatesOK{} +} + +/* +ListStatusUpdateTemplatesOK describes a response with status code 200, with default header values. + +List all status update templates for your organization +*/ +type ListStatusUpdateTemplatesOK struct { + Payload *models.StatusUpdateTemplateEntity +} + +// IsSuccess returns true when this list status update templates o k response has a 2xx status code +func (o *ListStatusUpdateTemplatesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list status update templates o k response has a 3xx status code +func (o *ListStatusUpdateTemplatesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list status update templates o k response has a 4xx status code +func (o *ListStatusUpdateTemplatesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list status update templates o k response has a 5xx status code +func (o *ListStatusUpdateTemplatesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list status update templates o k response a status code equal to that given +func (o *ListStatusUpdateTemplatesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListStatusUpdateTemplatesOK) Error() string { + return fmt.Sprintf("[GET /v1/status_update_templates][%d] listStatusUpdateTemplatesOK %+v", 200, o.Payload) +} + +func (o *ListStatusUpdateTemplatesOK) String() string { + return fmt.Sprintf("[GET /v1/status_update_templates][%d] listStatusUpdateTemplatesOK %+v", 200, o.Payload) +} + +func (o *ListStatusUpdateTemplatesOK) GetPayload() *models.StatusUpdateTemplateEntity { + return o.Payload +} + +func (o *ListStatusUpdateTemplatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.StatusUpdateTemplateEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/communication/update_status_update_template_parameters.go b/client/communication/update_status_update_template_parameters.go new file mode 100644 index 0000000..db1a3d7 --- /dev/null +++ b/client/communication/update_status_update_template_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package communication + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateStatusUpdateTemplateParams creates a new UpdateStatusUpdateTemplateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateStatusUpdateTemplateParams() *UpdateStatusUpdateTemplateParams { + return &UpdateStatusUpdateTemplateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateStatusUpdateTemplateParamsWithTimeout creates a new UpdateStatusUpdateTemplateParams object +// with the ability to set a timeout on a request. +func NewUpdateStatusUpdateTemplateParamsWithTimeout(timeout time.Duration) *UpdateStatusUpdateTemplateParams { + return &UpdateStatusUpdateTemplateParams{ + timeout: timeout, + } +} + +// NewUpdateStatusUpdateTemplateParamsWithContext creates a new UpdateStatusUpdateTemplateParams object +// with the ability to set a context for a request. +func NewUpdateStatusUpdateTemplateParamsWithContext(ctx context.Context) *UpdateStatusUpdateTemplateParams { + return &UpdateStatusUpdateTemplateParams{ + Context: ctx, + } +} + +// NewUpdateStatusUpdateTemplateParamsWithHTTPClient creates a new UpdateStatusUpdateTemplateParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateStatusUpdateTemplateParamsWithHTTPClient(client *http.Client) *UpdateStatusUpdateTemplateParams { + return &UpdateStatusUpdateTemplateParams{ + HTTPClient: client, + } +} + +/* +UpdateStatusUpdateTemplateParams contains all the parameters to send to the API endpoint + + for the update status update template operation. + + Typically these are written to a http.Request. +*/ +type UpdateStatusUpdateTemplateParams struct { + + // StatusUpdateTemplateID. + StatusUpdateTemplateID string + + // UpdateStatusUpdateTemplate. + UpdateStatusUpdateTemplate *models.UpdateStatusUpdateTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update status update template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateStatusUpdateTemplateParams) WithDefaults() *UpdateStatusUpdateTemplateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update status update template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateStatusUpdateTemplateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update status update template params +func (o *UpdateStatusUpdateTemplateParams) WithTimeout(timeout time.Duration) *UpdateStatusUpdateTemplateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update status update template params +func (o *UpdateStatusUpdateTemplateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update status update template params +func (o *UpdateStatusUpdateTemplateParams) WithContext(ctx context.Context) *UpdateStatusUpdateTemplateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update status update template params +func (o *UpdateStatusUpdateTemplateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update status update template params +func (o *UpdateStatusUpdateTemplateParams) WithHTTPClient(client *http.Client) *UpdateStatusUpdateTemplateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update status update template params +func (o *UpdateStatusUpdateTemplateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithStatusUpdateTemplateID adds the statusUpdateTemplateID to the update status update template params +func (o *UpdateStatusUpdateTemplateParams) WithStatusUpdateTemplateID(statusUpdateTemplateID string) *UpdateStatusUpdateTemplateParams { + o.SetStatusUpdateTemplateID(statusUpdateTemplateID) + return o +} + +// SetStatusUpdateTemplateID adds the statusUpdateTemplateId to the update status update template params +func (o *UpdateStatusUpdateTemplateParams) SetStatusUpdateTemplateID(statusUpdateTemplateID string) { + o.StatusUpdateTemplateID = statusUpdateTemplateID +} + +// WithUpdateStatusUpdateTemplate adds the updateStatusUpdateTemplate to the update status update template params +func (o *UpdateStatusUpdateTemplateParams) WithUpdateStatusUpdateTemplate(updateStatusUpdateTemplate *models.UpdateStatusUpdateTemplate) *UpdateStatusUpdateTemplateParams { + o.SetUpdateStatusUpdateTemplate(updateStatusUpdateTemplate) + return o +} + +// SetUpdateStatusUpdateTemplate adds the updateStatusUpdateTemplate to the update status update template params +func (o *UpdateStatusUpdateTemplateParams) SetUpdateStatusUpdateTemplate(updateStatusUpdateTemplate *models.UpdateStatusUpdateTemplate) { + o.UpdateStatusUpdateTemplate = updateStatusUpdateTemplate +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateStatusUpdateTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param status_update_template_id + if err := r.SetPathParam("status_update_template_id", o.StatusUpdateTemplateID); err != nil { + return err + } + if o.UpdateStatusUpdateTemplate != nil { + if err := r.SetBodyParam(o.UpdateStatusUpdateTemplate); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/communication/update_status_update_template_responses.go b/client/communication/update_status_update_template_responses.go new file mode 100644 index 0000000..7d854bd --- /dev/null +++ b/client/communication/update_status_update_template_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package communication + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateStatusUpdateTemplateReader is a Reader for the UpdateStatusUpdateTemplate structure. +type UpdateStatusUpdateTemplateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateStatusUpdateTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateStatusUpdateTemplateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateStatusUpdateTemplateOK creates a UpdateStatusUpdateTemplateOK with default headers values +func NewUpdateStatusUpdateTemplateOK() *UpdateStatusUpdateTemplateOK { + return &UpdateStatusUpdateTemplateOK{} +} + +/* +UpdateStatusUpdateTemplateOK describes a response with status code 200, with default header values. + +Update a single status update template +*/ +type UpdateStatusUpdateTemplateOK struct { + Payload *models.StatusUpdateTemplateEntity +} + +// IsSuccess returns true when this update status update template o k response has a 2xx status code +func (o *UpdateStatusUpdateTemplateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update status update template o k response has a 3xx status code +func (o *UpdateStatusUpdateTemplateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update status update template o k response has a 4xx status code +func (o *UpdateStatusUpdateTemplateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update status update template o k response has a 5xx status code +func (o *UpdateStatusUpdateTemplateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update status update template o k response a status code equal to that given +func (o *UpdateStatusUpdateTemplateOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateStatusUpdateTemplateOK) Error() string { + return fmt.Sprintf("[PATCH /v1/status_update_templates/{status_update_template_id}][%d] updateStatusUpdateTemplateOK %+v", 200, o.Payload) +} + +func (o *UpdateStatusUpdateTemplateOK) String() string { + return fmt.Sprintf("[PATCH /v1/status_update_templates/{status_update_template_id}][%d] updateStatusUpdateTemplateOK %+v", 200, o.Payload) +} + +func (o *UpdateStatusUpdateTemplateOK) GetPayload() *models.StatusUpdateTemplateEntity { + return o.Payload +} + +func (o *UpdateStatusUpdateTemplateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.StatusUpdateTemplateEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/conversations/conversations_client.go b/client/conversations/conversations_client.go index 0f1dc16..7fe307b 100644 --- a/client/conversations/conversations_client.go +++ b/client/conversations/conversations_client.go @@ -30,56 +30,48 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1ConversationsConversationIDCommentsCommentID(params *DeleteV1ConversationsConversationIDCommentsCommentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ConversationsConversationIDCommentsCommentIDNoContent, error) + CreateComment(params *CreateCommentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCommentCreated, error) - DeleteV1ConversationsConversationIDCommentsCommentIDReactionsReactionID(params *DeleteV1ConversationsConversationIDCommentsCommentIDReactionsReactionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ConversationsConversationIDCommentsCommentIDReactionsReactionIDNoContent, error) + CreateCommentReaction(params *CreateCommentReactionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCommentReactionCreated, error) - GetV1ConversationsConversationIDComments(params *GetV1ConversationsConversationIDCommentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ConversationsConversationIDCommentsOK, error) + DeleteComment(params *DeleteCommentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCommentNoContent, error) - GetV1ConversationsConversationIDCommentsCommentID(params *GetV1ConversationsConversationIDCommentsCommentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ConversationsConversationIDCommentsCommentIDOK, error) + DeleteCommentReaction(params *DeleteCommentReactionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCommentReactionNoContent, error) - GetV1ConversationsConversationIDCommentsCommentIDReactions(params *GetV1ConversationsConversationIDCommentsCommentIDReactionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ConversationsConversationIDCommentsCommentIDReactionsOK, error) + GetComment(params *GetCommentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCommentOK, error) - GetV1IncidentsIncidentIDEventsEventIDVotesStatus(params *GetV1IncidentsIncidentIDEventsEventIDVotesStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDEventsEventIDVotesStatusOK, error) + GetVoteStatus(params *GetVoteStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetVoteStatusOK, error) - GetV1RunbooksExecutionsExecutionIDStepsStepIDVotesStatus(params *GetV1RunbooksExecutionsExecutionIDStepsStepIDVotesStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksExecutionsExecutionIDStepsStepIDVotesStatusOK, error) + ListCommentReactions(params *ListCommentReactionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCommentReactionsOK, error) - GetV1RunbooksExecutionsExecutionIDVotesStatus(params *GetV1RunbooksExecutionsExecutionIDVotesStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksExecutionsExecutionIDVotesStatusOK, error) + ListComments(params *ListCommentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCommentsOK, error) - PatchV1ConversationsConversationIDCommentsCommentID(params *PatchV1ConversationsConversationIDCommentsCommentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1ConversationsConversationIDCommentsCommentIDOK, error) + UpdateComment(params *UpdateCommentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCommentOK, error) - PatchV1IncidentsIncidentIDEventsEventIDVotes(params *PatchV1IncidentsIncidentIDEventsEventIDVotesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDEventsEventIDVotesOK, error) - - PatchV1RunbooksExecutionsExecutionIDStepsStepIDVotes(params *PatchV1RunbooksExecutionsExecutionIDStepsStepIDVotesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1RunbooksExecutionsExecutionIDStepsStepIDVotesOK, error) - - PatchV1RunbooksExecutionsExecutionIDVotes(params *PatchV1RunbooksExecutionsExecutionIDVotesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1RunbooksExecutionsExecutionIDVotesOK, error) - - PostV1ConversationsConversationIDComments(params *PostV1ConversationsConversationIDCommentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ConversationsConversationIDCommentsCreated, error) - - PostV1ConversationsConversationIDCommentsCommentIDReactions(params *PostV1ConversationsConversationIDCommentsCommentIDReactionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ConversationsConversationIDCommentsCommentIDReactionsCreated, error) + UpdateVote(params *UpdateVoteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateVoteOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1ConversationsConversationIDCommentsCommentID archives a conversation comment +CreateComment creates a conversation comment -ALPHA - Archive a comment +ALPHA - Creates a comment for a project */ -func (a *Client) DeleteV1ConversationsConversationIDCommentsCommentID(params *DeleteV1ConversationsConversationIDCommentsCommentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ConversationsConversationIDCommentsCommentIDNoContent, error) { +func (a *Client) CreateComment(params *CreateCommentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCommentCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1ConversationsConversationIDCommentsCommentIDParams() + params = NewCreateCommentParams() } op := &runtime.ClientOperation{ - ID: "deleteV1ConversationsConversationIdCommentsCommentId", - Method: "DELETE", - PathPattern: "/v1/conversations/{conversation_id}/comments/{comment_id}", + ID: "create_comment", + Method: "POST", + PathPattern: "/v1/conversations/{conversation_id}/comments", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1ConversationsConversationIDCommentsCommentIDReader{formats: a.formats}, + Reader: &CreateCommentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -92,35 +84,35 @@ func (a *Client) DeleteV1ConversationsConversationIDCommentsCommentID(params *De if err != nil { return nil, err } - success, ok := result.(*DeleteV1ConversationsConversationIDCommentsCommentIDNoContent) + success, ok := result.(*CreateCommentCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1ConversationsConversationIdCommentsCommentId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_comment: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1ConversationsConversationIDCommentsCommentIDReactionsReactionID deletes a reaction from a conversation comment +CreateCommentReaction creates a reaction for a conversation comment -ALPHA - Archive a reaction +ALPHA - Create a reaction on a comment */ -func (a *Client) DeleteV1ConversationsConversationIDCommentsCommentIDReactionsReactionID(params *DeleteV1ConversationsConversationIDCommentsCommentIDReactionsReactionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ConversationsConversationIDCommentsCommentIDReactionsReactionIDNoContent, error) { +func (a *Client) CreateCommentReaction(params *CreateCommentReactionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCommentReactionCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1ConversationsConversationIDCommentsCommentIDReactionsReactionIDParams() + params = NewCreateCommentReactionParams() } op := &runtime.ClientOperation{ - ID: "deleteV1ConversationsConversationIdCommentsCommentIdReactionsReactionId", - Method: "DELETE", - PathPattern: "/v1/conversations/{conversation_id}/comments/{comment_id}/reactions/{reaction_id}", + ID: "create_comment_reaction", + Method: "POST", + PathPattern: "/v1/conversations/{conversation_id}/comments/{comment_id}/reactions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1ConversationsConversationIDCommentsCommentIDReactionsReactionIDReader{formats: a.formats}, + Reader: &CreateCommentReactionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -133,35 +125,35 @@ func (a *Client) DeleteV1ConversationsConversationIDCommentsCommentIDReactionsRe if err != nil { return nil, err } - success, ok := result.(*DeleteV1ConversationsConversationIDCommentsCommentIDReactionsReactionIDNoContent) + success, ok := result.(*CreateCommentReactionCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1ConversationsConversationIdCommentsCommentIdReactionsReactionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_comment_reaction: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ConversationsConversationIDComments lists comments for a conversation +DeleteComment archives a conversation comment -ALPHA - List all of the comments that have been added to the organization +ALPHA - Archive a comment */ -func (a *Client) GetV1ConversationsConversationIDComments(params *GetV1ConversationsConversationIDCommentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ConversationsConversationIDCommentsOK, error) { +func (a *Client) DeleteComment(params *DeleteCommentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCommentNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ConversationsConversationIDCommentsParams() + params = NewDeleteCommentParams() } op := &runtime.ClientOperation{ - ID: "getV1ConversationsConversationIdComments", - Method: "GET", - PathPattern: "/v1/conversations/{conversation_id}/comments", + ID: "delete_comment", + Method: "DELETE", + PathPattern: "/v1/conversations/{conversation_id}/comments/{comment_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ConversationsConversationIDCommentsReader{formats: a.formats}, + Reader: &DeleteCommentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -174,35 +166,35 @@ func (a *Client) GetV1ConversationsConversationIDComments(params *GetV1Conversat if err != nil { return nil, err } - success, ok := result.(*GetV1ConversationsConversationIDCommentsOK) + success, ok := result.(*DeleteCommentNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ConversationsConversationIdComments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_comment: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ConversationsConversationIDCommentsCommentID gets a conversation comment +DeleteCommentReaction deletes a reaction from a conversation comment -ALPHA - Retrieves a single comment by ID +ALPHA - Archive a reaction */ -func (a *Client) GetV1ConversationsConversationIDCommentsCommentID(params *GetV1ConversationsConversationIDCommentsCommentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ConversationsConversationIDCommentsCommentIDOK, error) { +func (a *Client) DeleteCommentReaction(params *DeleteCommentReactionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCommentReactionNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ConversationsConversationIDCommentsCommentIDParams() + params = NewDeleteCommentReactionParams() } op := &runtime.ClientOperation{ - ID: "getV1ConversationsConversationIdCommentsCommentId", - Method: "GET", - PathPattern: "/v1/conversations/{conversation_id}/comments/{comment_id}", + ID: "delete_comment_reaction", + Method: "DELETE", + PathPattern: "/v1/conversations/{conversation_id}/comments/{comment_id}/reactions/{reaction_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ConversationsConversationIDCommentsCommentIDReader{formats: a.formats}, + Reader: &DeleteCommentReactionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -215,35 +207,35 @@ func (a *Client) GetV1ConversationsConversationIDCommentsCommentID(params *GetV1 if err != nil { return nil, err } - success, ok := result.(*GetV1ConversationsConversationIDCommentsCommentIDOK) + success, ok := result.(*DeleteCommentReactionNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ConversationsConversationIdCommentsCommentId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_comment_reaction: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ConversationsConversationIDCommentsCommentIDReactions lists reactions for a conversation comment +GetComment gets a conversation comment -ALPHA - List all of the reactions that have been added to a comment +ALPHA - Retrieves a single comment by ID */ -func (a *Client) GetV1ConversationsConversationIDCommentsCommentIDReactions(params *GetV1ConversationsConversationIDCommentsCommentIDReactionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ConversationsConversationIDCommentsCommentIDReactionsOK, error) { +func (a *Client) GetComment(params *GetCommentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCommentOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ConversationsConversationIDCommentsCommentIDReactionsParams() + params = NewGetCommentParams() } op := &runtime.ClientOperation{ - ID: "getV1ConversationsConversationIdCommentsCommentIdReactions", + ID: "get_comment", Method: "GET", - PathPattern: "/v1/conversations/{conversation_id}/comments/{comment_id}/reactions", + PathPattern: "/v1/conversations/{conversation_id}/comments/{comment_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ConversationsConversationIDCommentsCommentIDReactionsReader{formats: a.formats}, + Reader: &GetCommentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -256,35 +248,35 @@ func (a *Client) GetV1ConversationsConversationIDCommentsCommentIDReactions(para if err != nil { return nil, err } - success, ok := result.(*GetV1ConversationsConversationIDCommentsCommentIDReactionsOK) + success, ok := result.(*GetCommentOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ConversationsConversationIdCommentsCommentIdReactions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_comment: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDEventsEventIDVotesStatus gets votes +GetVoteStatus gets votes Get an object's current vote counts */ -func (a *Client) GetV1IncidentsIncidentIDEventsEventIDVotesStatus(params *GetV1IncidentsIncidentIDEventsEventIDVotesStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDEventsEventIDVotesStatusOK, error) { +func (a *Client) GetVoteStatus(params *GetVoteStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetVoteStatusOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDEventsEventIDVotesStatusParams() + params = NewGetVoteStatusParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdEventsEventIdVotesStatus", + ID: "get_vote_status", Method: "GET", PathPattern: "/v1/incidents/{incident_id}/events/{event_id}/votes/status", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDEventsEventIDVotesStatusReader{formats: a.formats}, + Reader: &GetVoteStatusReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -297,35 +289,35 @@ func (a *Client) GetV1IncidentsIncidentIDEventsEventIDVotesStatus(params *GetV1I if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDEventsEventIDVotesStatusOK) + success, ok := result.(*GetVoteStatusOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdEventsEventIdVotesStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_vote_status: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1RunbooksExecutionsExecutionIDStepsStepIDVotesStatus gets votes +ListCommentReactions lists reactions for a conversation comment -Get an object's current vote counts +ALPHA - List all of the reactions that have been added to a comment */ -func (a *Client) GetV1RunbooksExecutionsExecutionIDStepsStepIDVotesStatus(params *GetV1RunbooksExecutionsExecutionIDStepsStepIDVotesStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksExecutionsExecutionIDStepsStepIDVotesStatusOK, error) { +func (a *Client) ListCommentReactions(params *ListCommentReactionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCommentReactionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1RunbooksExecutionsExecutionIDStepsStepIDVotesStatusParams() + params = NewListCommentReactionsParams() } op := &runtime.ClientOperation{ - ID: "getV1RunbooksExecutionsExecutionIdStepsStepIdVotesStatus", + ID: "list_comment_reactions", Method: "GET", - PathPattern: "/v1/runbooks/executions/{execution_id}/steps/{step_id}/votes/status", + PathPattern: "/v1/conversations/{conversation_id}/comments/{comment_id}/reactions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1RunbooksExecutionsExecutionIDStepsStepIDVotesStatusReader{formats: a.formats}, + Reader: &ListCommentReactionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -338,35 +330,35 @@ func (a *Client) GetV1RunbooksExecutionsExecutionIDStepsStepIDVotesStatus(params if err != nil { return nil, err } - success, ok := result.(*GetV1RunbooksExecutionsExecutionIDStepsStepIDVotesStatusOK) + success, ok := result.(*ListCommentReactionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1RunbooksExecutionsExecutionIdStepsStepIdVotesStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_comment_reactions: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1RunbooksExecutionsExecutionIDVotesStatus gets votes +ListComments lists comments for a conversation -Get an object's current vote counts +ALPHA - List all of the comments that have been added to the organization */ -func (a *Client) GetV1RunbooksExecutionsExecutionIDVotesStatus(params *GetV1RunbooksExecutionsExecutionIDVotesStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksExecutionsExecutionIDVotesStatusOK, error) { +func (a *Client) ListComments(params *ListCommentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCommentsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1RunbooksExecutionsExecutionIDVotesStatusParams() + params = NewListCommentsParams() } op := &runtime.ClientOperation{ - ID: "getV1RunbooksExecutionsExecutionIdVotesStatus", + ID: "list_comments", Method: "GET", - PathPattern: "/v1/runbooks/executions/{execution_id}/votes/status", + PathPattern: "/v1/conversations/{conversation_id}/comments", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1RunbooksExecutionsExecutionIDVotesStatusReader{formats: a.formats}, + Reader: &ListCommentsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -379,35 +371,35 @@ func (a *Client) GetV1RunbooksExecutionsExecutionIDVotesStatus(params *GetV1Runb if err != nil { return nil, err } - success, ok := result.(*GetV1RunbooksExecutionsExecutionIDVotesStatusOK) + success, ok := result.(*ListCommentsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1RunbooksExecutionsExecutionIdVotesStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_comments: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1ConversationsConversationIDCommentsCommentID updates a conversation comment +UpdateComment updates a conversation comment ALPHA - Update a comment's attributes */ -func (a *Client) PatchV1ConversationsConversationIDCommentsCommentID(params *PatchV1ConversationsConversationIDCommentsCommentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1ConversationsConversationIDCommentsCommentIDOK, error) { +func (a *Client) UpdateComment(params *UpdateCommentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCommentOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1ConversationsConversationIDCommentsCommentIDParams() + params = NewUpdateCommentParams() } op := &runtime.ClientOperation{ - ID: "patchV1ConversationsConversationIdCommentsCommentId", + ID: "update_comment", Method: "PATCH", PathPattern: "/v1/conversations/{conversation_id}/comments/{comment_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1ConversationsConversationIDCommentsCommentIDReader{formats: a.formats}, + Reader: &UpdateCommentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -420,199 +412,35 @@ func (a *Client) PatchV1ConversationsConversationIDCommentsCommentID(params *Pat if err != nil { return nil, err } - success, ok := result.(*PatchV1ConversationsConversationIDCommentsCommentIDOK) + success, ok := result.(*UpdateCommentOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1ConversationsConversationIdCommentsCommentId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_comment: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IncidentsIncidentIDEventsEventIDVotes updates votes +UpdateVote updates votes Upvote or downvote an object */ -func (a *Client) PatchV1IncidentsIncidentIDEventsEventIDVotes(params *PatchV1IncidentsIncidentIDEventsEventIDVotesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDEventsEventIDVotesOK, error) { +func (a *Client) UpdateVote(params *UpdateVoteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateVoteOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IncidentsIncidentIDEventsEventIDVotesParams() + params = NewUpdateVoteParams() } op := &runtime.ClientOperation{ - ID: "patchV1IncidentsIncidentIdEventsEventIdVotes", + ID: "update_vote", Method: "PATCH", PathPattern: "/v1/incidents/{incident_id}/events/{event_id}/votes", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IncidentsIncidentIDEventsEventIDVotesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchV1IncidentsIncidentIDEventsEventIDVotesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IncidentsIncidentIdEventsEventIdVotes: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PatchV1RunbooksExecutionsExecutionIDStepsStepIDVotes updates votes - -Upvote or downvote an object -*/ -func (a *Client) PatchV1RunbooksExecutionsExecutionIDStepsStepIDVotes(params *PatchV1RunbooksExecutionsExecutionIDStepsStepIDVotesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1RunbooksExecutionsExecutionIDStepsStepIDVotesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchV1RunbooksExecutionsExecutionIDStepsStepIDVotesParams() - } - op := &runtime.ClientOperation{ - ID: "patchV1RunbooksExecutionsExecutionIdStepsStepIdVotes", - Method: "PATCH", - PathPattern: "/v1/runbooks/executions/{execution_id}/steps/{step_id}/votes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchV1RunbooksExecutionsExecutionIDStepsStepIDVotesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchV1RunbooksExecutionsExecutionIDStepsStepIDVotesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1RunbooksExecutionsExecutionIdStepsStepIdVotes: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PatchV1RunbooksExecutionsExecutionIDVotes updates votes - -Upvote or downvote an object -*/ -func (a *Client) PatchV1RunbooksExecutionsExecutionIDVotes(params *PatchV1RunbooksExecutionsExecutionIDVotesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1RunbooksExecutionsExecutionIDVotesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchV1RunbooksExecutionsExecutionIDVotesParams() - } - op := &runtime.ClientOperation{ - ID: "patchV1RunbooksExecutionsExecutionIdVotes", - Method: "PATCH", - PathPattern: "/v1/runbooks/executions/{execution_id}/votes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchV1RunbooksExecutionsExecutionIDVotesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchV1RunbooksExecutionsExecutionIDVotesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1RunbooksExecutionsExecutionIdVotes: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PostV1ConversationsConversationIDComments creates a conversation comment - -ALPHA - Creates a comment for a project -*/ -func (a *Client) PostV1ConversationsConversationIDComments(params *PostV1ConversationsConversationIDCommentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ConversationsConversationIDCommentsCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPostV1ConversationsConversationIDCommentsParams() - } - op := &runtime.ClientOperation{ - ID: "postV1ConversationsConversationIdComments", - Method: "POST", - PathPattern: "/v1/conversations/{conversation_id}/comments", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PostV1ConversationsConversationIDCommentsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PostV1ConversationsConversationIDCommentsCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1ConversationsConversationIdComments: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -PostV1ConversationsConversationIDCommentsCommentIDReactions creates a reaction for a conversation comment - -ALPHA - Create a reaction on a comment -*/ -func (a *Client) PostV1ConversationsConversationIDCommentsCommentIDReactions(params *PostV1ConversationsConversationIDCommentsCommentIDReactionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ConversationsConversationIDCommentsCommentIDReactionsCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPostV1ConversationsConversationIDCommentsCommentIDReactionsParams() - } - op := &runtime.ClientOperation{ - ID: "postV1ConversationsConversationIdCommentsCommentIdReactions", - Method: "POST", - PathPattern: "/v1/conversations/{conversation_id}/comments/{comment_id}/reactions", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PostV1ConversationsConversationIDCommentsCommentIDReactionsReader{formats: a.formats}, + Reader: &UpdateVoteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -625,13 +453,13 @@ func (a *Client) PostV1ConversationsConversationIDCommentsCommentIDReactions(par if err != nil { return nil, err } - success, ok := result.(*PostV1ConversationsConversationIDCommentsCommentIDReactionsCreated) + success, ok := result.(*UpdateVoteOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1ConversationsConversationIdCommentsCommentIdReactions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_vote: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/conversations/create_comment_parameters.go b/client/conversations/create_comment_parameters.go new file mode 100644 index 0000000..c6381c1 --- /dev/null +++ b/client/conversations/create_comment_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateCommentParams creates a new CreateCommentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateCommentParams() *CreateCommentParams { + return &CreateCommentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateCommentParamsWithTimeout creates a new CreateCommentParams object +// with the ability to set a timeout on a request. +func NewCreateCommentParamsWithTimeout(timeout time.Duration) *CreateCommentParams { + return &CreateCommentParams{ + timeout: timeout, + } +} + +// NewCreateCommentParamsWithContext creates a new CreateCommentParams object +// with the ability to set a context for a request. +func NewCreateCommentParamsWithContext(ctx context.Context) *CreateCommentParams { + return &CreateCommentParams{ + Context: ctx, + } +} + +// NewCreateCommentParamsWithHTTPClient creates a new CreateCommentParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateCommentParamsWithHTTPClient(client *http.Client) *CreateCommentParams { + return &CreateCommentParams{ + HTTPClient: client, + } +} + +/* +CreateCommentParams contains all the parameters to send to the API endpoint + + for the create comment operation. + + Typically these are written to a http.Request. +*/ +type CreateCommentParams struct { + + // ConversationID. + ConversationID string + + // CreateComment. + CreateComment *models.CreateComment + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create comment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateCommentParams) WithDefaults() *CreateCommentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create comment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateCommentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create comment params +func (o *CreateCommentParams) WithTimeout(timeout time.Duration) *CreateCommentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create comment params +func (o *CreateCommentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create comment params +func (o *CreateCommentParams) WithContext(ctx context.Context) *CreateCommentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create comment params +func (o *CreateCommentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create comment params +func (o *CreateCommentParams) WithHTTPClient(client *http.Client) *CreateCommentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create comment params +func (o *CreateCommentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConversationID adds the conversationID to the create comment params +func (o *CreateCommentParams) WithConversationID(conversationID string) *CreateCommentParams { + o.SetConversationID(conversationID) + return o +} + +// SetConversationID adds the conversationId to the create comment params +func (o *CreateCommentParams) SetConversationID(conversationID string) { + o.ConversationID = conversationID +} + +// WithCreateComment adds the createComment to the create comment params +func (o *CreateCommentParams) WithCreateComment(createComment *models.CreateComment) *CreateCommentParams { + o.SetCreateComment(createComment) + return o +} + +// SetCreateComment adds the createComment to the create comment params +func (o *CreateCommentParams) SetCreateComment(createComment *models.CreateComment) { + o.CreateComment = createComment +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateCommentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param conversation_id + if err := r.SetPathParam("conversation_id", o.ConversationID); err != nil { + return err + } + if o.CreateComment != nil { + if err := r.SetBodyParam(o.CreateComment); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/conversations/create_comment_reaction_parameters.go b/client/conversations/create_comment_reaction_parameters.go new file mode 100644 index 0000000..0fdb5a9 --- /dev/null +++ b/client/conversations/create_comment_reaction_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateCommentReactionParams creates a new CreateCommentReactionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateCommentReactionParams() *CreateCommentReactionParams { + return &CreateCommentReactionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateCommentReactionParamsWithTimeout creates a new CreateCommentReactionParams object +// with the ability to set a timeout on a request. +func NewCreateCommentReactionParamsWithTimeout(timeout time.Duration) *CreateCommentReactionParams { + return &CreateCommentReactionParams{ + timeout: timeout, + } +} + +// NewCreateCommentReactionParamsWithContext creates a new CreateCommentReactionParams object +// with the ability to set a context for a request. +func NewCreateCommentReactionParamsWithContext(ctx context.Context) *CreateCommentReactionParams { + return &CreateCommentReactionParams{ + Context: ctx, + } +} + +// NewCreateCommentReactionParamsWithHTTPClient creates a new CreateCommentReactionParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateCommentReactionParamsWithHTTPClient(client *http.Client) *CreateCommentReactionParams { + return &CreateCommentReactionParams{ + HTTPClient: client, + } +} + +/* +CreateCommentReactionParams contains all the parameters to send to the API endpoint + + for the create comment reaction operation. + + Typically these are written to a http.Request. +*/ +type CreateCommentReactionParams struct { + + // CommentID. + CommentID string + + // ConversationID. + ConversationID string + + // CreateCommentReaction. + CreateCommentReaction *models.CreateCommentReaction + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create comment reaction params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateCommentReactionParams) WithDefaults() *CreateCommentReactionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create comment reaction params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateCommentReactionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create comment reaction params +func (o *CreateCommentReactionParams) WithTimeout(timeout time.Duration) *CreateCommentReactionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create comment reaction params +func (o *CreateCommentReactionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create comment reaction params +func (o *CreateCommentReactionParams) WithContext(ctx context.Context) *CreateCommentReactionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create comment reaction params +func (o *CreateCommentReactionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create comment reaction params +func (o *CreateCommentReactionParams) WithHTTPClient(client *http.Client) *CreateCommentReactionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create comment reaction params +func (o *CreateCommentReactionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCommentID adds the commentID to the create comment reaction params +func (o *CreateCommentReactionParams) WithCommentID(commentID string) *CreateCommentReactionParams { + o.SetCommentID(commentID) + return o +} + +// SetCommentID adds the commentId to the create comment reaction params +func (o *CreateCommentReactionParams) SetCommentID(commentID string) { + o.CommentID = commentID +} + +// WithConversationID adds the conversationID to the create comment reaction params +func (o *CreateCommentReactionParams) WithConversationID(conversationID string) *CreateCommentReactionParams { + o.SetConversationID(conversationID) + return o +} + +// SetConversationID adds the conversationId to the create comment reaction params +func (o *CreateCommentReactionParams) SetConversationID(conversationID string) { + o.ConversationID = conversationID +} + +// WithCreateCommentReaction adds the createCommentReaction to the create comment reaction params +func (o *CreateCommentReactionParams) WithCreateCommentReaction(createCommentReaction *models.CreateCommentReaction) *CreateCommentReactionParams { + o.SetCreateCommentReaction(createCommentReaction) + return o +} + +// SetCreateCommentReaction adds the createCommentReaction to the create comment reaction params +func (o *CreateCommentReactionParams) SetCreateCommentReaction(createCommentReaction *models.CreateCommentReaction) { + o.CreateCommentReaction = createCommentReaction +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateCommentReactionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param comment_id + if err := r.SetPathParam("comment_id", o.CommentID); err != nil { + return err + } + + // path param conversation_id + if err := r.SetPathParam("conversation_id", o.ConversationID); err != nil { + return err + } + if o.CreateCommentReaction != nil { + if err := r.SetBodyParam(o.CreateCommentReaction); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/conversations/create_comment_reaction_responses.go b/client/conversations/create_comment_reaction_responses.go new file mode 100644 index 0000000..3a71687 --- /dev/null +++ b/client/conversations/create_comment_reaction_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateCommentReactionReader is a Reader for the CreateCommentReaction structure. +type CreateCommentReactionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateCommentReactionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateCommentReactionCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateCommentReactionCreated creates a CreateCommentReactionCreated with default headers values +func NewCreateCommentReactionCreated() *CreateCommentReactionCreated { + return &CreateCommentReactionCreated{} +} + +/* +CreateCommentReactionCreated describes a response with status code 201, with default header values. + +ALPHA - Create a reaction on a comment +*/ +type CreateCommentReactionCreated struct { +} + +// IsSuccess returns true when this create comment reaction created response has a 2xx status code +func (o *CreateCommentReactionCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create comment reaction created response has a 3xx status code +func (o *CreateCommentReactionCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create comment reaction created response has a 4xx status code +func (o *CreateCommentReactionCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create comment reaction created response has a 5xx status code +func (o *CreateCommentReactionCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create comment reaction created response a status code equal to that given +func (o *CreateCommentReactionCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateCommentReactionCreated) Error() string { + return fmt.Sprintf("[POST /v1/conversations/{conversation_id}/comments/{comment_id}/reactions][%d] createCommentReactionCreated ", 201) +} + +func (o *CreateCommentReactionCreated) String() string { + return fmt.Sprintf("[POST /v1/conversations/{conversation_id}/comments/{comment_id}/reactions][%d] createCommentReactionCreated ", 201) +} + +func (o *CreateCommentReactionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/conversations/create_comment_responses.go b/client/conversations/create_comment_responses.go new file mode 100644 index 0000000..76c5405 --- /dev/null +++ b/client/conversations/create_comment_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateCommentReader is a Reader for the CreateComment structure. +type CreateCommentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateCommentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateCommentCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateCommentCreated creates a CreateCommentCreated with default headers values +func NewCreateCommentCreated() *CreateCommentCreated { + return &CreateCommentCreated{} +} + +/* +CreateCommentCreated describes a response with status code 201, with default header values. + +ALPHA - Creates a comment for a project +*/ +type CreateCommentCreated struct { +} + +// IsSuccess returns true when this create comment created response has a 2xx status code +func (o *CreateCommentCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create comment created response has a 3xx status code +func (o *CreateCommentCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create comment created response has a 4xx status code +func (o *CreateCommentCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create comment created response has a 5xx status code +func (o *CreateCommentCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create comment created response a status code equal to that given +func (o *CreateCommentCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateCommentCreated) Error() string { + return fmt.Sprintf("[POST /v1/conversations/{conversation_id}/comments][%d] createCommentCreated ", 201) +} + +func (o *CreateCommentCreated) String() string { + return fmt.Sprintf("[POST /v1/conversations/{conversation_id}/comments][%d] createCommentCreated ", 201) +} + +func (o *CreateCommentCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/conversations/delete_comment_parameters.go b/client/conversations/delete_comment_parameters.go new file mode 100644 index 0000000..f28f4ac --- /dev/null +++ b/client/conversations/delete_comment_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteCommentParams creates a new DeleteCommentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteCommentParams() *DeleteCommentParams { + return &DeleteCommentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteCommentParamsWithTimeout creates a new DeleteCommentParams object +// with the ability to set a timeout on a request. +func NewDeleteCommentParamsWithTimeout(timeout time.Duration) *DeleteCommentParams { + return &DeleteCommentParams{ + timeout: timeout, + } +} + +// NewDeleteCommentParamsWithContext creates a new DeleteCommentParams object +// with the ability to set a context for a request. +func NewDeleteCommentParamsWithContext(ctx context.Context) *DeleteCommentParams { + return &DeleteCommentParams{ + Context: ctx, + } +} + +// NewDeleteCommentParamsWithHTTPClient creates a new DeleteCommentParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteCommentParamsWithHTTPClient(client *http.Client) *DeleteCommentParams { + return &DeleteCommentParams{ + HTTPClient: client, + } +} + +/* +DeleteCommentParams contains all the parameters to send to the API endpoint + + for the delete comment operation. + + Typically these are written to a http.Request. +*/ +type DeleteCommentParams struct { + + // CommentID. + CommentID string + + // ConversationID. + ConversationID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete comment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteCommentParams) WithDefaults() *DeleteCommentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete comment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteCommentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete comment params +func (o *DeleteCommentParams) WithTimeout(timeout time.Duration) *DeleteCommentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete comment params +func (o *DeleteCommentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete comment params +func (o *DeleteCommentParams) WithContext(ctx context.Context) *DeleteCommentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete comment params +func (o *DeleteCommentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete comment params +func (o *DeleteCommentParams) WithHTTPClient(client *http.Client) *DeleteCommentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete comment params +func (o *DeleteCommentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCommentID adds the commentID to the delete comment params +func (o *DeleteCommentParams) WithCommentID(commentID string) *DeleteCommentParams { + o.SetCommentID(commentID) + return o +} + +// SetCommentID adds the commentId to the delete comment params +func (o *DeleteCommentParams) SetCommentID(commentID string) { + o.CommentID = commentID +} + +// WithConversationID adds the conversationID to the delete comment params +func (o *DeleteCommentParams) WithConversationID(conversationID string) *DeleteCommentParams { + o.SetConversationID(conversationID) + return o +} + +// SetConversationID adds the conversationId to the delete comment params +func (o *DeleteCommentParams) SetConversationID(conversationID string) { + o.ConversationID = conversationID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteCommentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param comment_id + if err := r.SetPathParam("comment_id", o.CommentID); err != nil { + return err + } + + // path param conversation_id + if err := r.SetPathParam("conversation_id", o.ConversationID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/conversations/delete_comment_reaction_parameters.go b/client/conversations/delete_comment_reaction_parameters.go new file mode 100644 index 0000000..f3779db --- /dev/null +++ b/client/conversations/delete_comment_reaction_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteCommentReactionParams creates a new DeleteCommentReactionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteCommentReactionParams() *DeleteCommentReactionParams { + return &DeleteCommentReactionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteCommentReactionParamsWithTimeout creates a new DeleteCommentReactionParams object +// with the ability to set a timeout on a request. +func NewDeleteCommentReactionParamsWithTimeout(timeout time.Duration) *DeleteCommentReactionParams { + return &DeleteCommentReactionParams{ + timeout: timeout, + } +} + +// NewDeleteCommentReactionParamsWithContext creates a new DeleteCommentReactionParams object +// with the ability to set a context for a request. +func NewDeleteCommentReactionParamsWithContext(ctx context.Context) *DeleteCommentReactionParams { + return &DeleteCommentReactionParams{ + Context: ctx, + } +} + +// NewDeleteCommentReactionParamsWithHTTPClient creates a new DeleteCommentReactionParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteCommentReactionParamsWithHTTPClient(client *http.Client) *DeleteCommentReactionParams { + return &DeleteCommentReactionParams{ + HTTPClient: client, + } +} + +/* +DeleteCommentReactionParams contains all the parameters to send to the API endpoint + + for the delete comment reaction operation. + + Typically these are written to a http.Request. +*/ +type DeleteCommentReactionParams struct { + + // CommentID. + CommentID string + + // ConversationID. + ConversationID string + + // ReactionID. + ReactionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete comment reaction params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteCommentReactionParams) WithDefaults() *DeleteCommentReactionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete comment reaction params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteCommentReactionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete comment reaction params +func (o *DeleteCommentReactionParams) WithTimeout(timeout time.Duration) *DeleteCommentReactionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete comment reaction params +func (o *DeleteCommentReactionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete comment reaction params +func (o *DeleteCommentReactionParams) WithContext(ctx context.Context) *DeleteCommentReactionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete comment reaction params +func (o *DeleteCommentReactionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete comment reaction params +func (o *DeleteCommentReactionParams) WithHTTPClient(client *http.Client) *DeleteCommentReactionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete comment reaction params +func (o *DeleteCommentReactionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCommentID adds the commentID to the delete comment reaction params +func (o *DeleteCommentReactionParams) WithCommentID(commentID string) *DeleteCommentReactionParams { + o.SetCommentID(commentID) + return o +} + +// SetCommentID adds the commentId to the delete comment reaction params +func (o *DeleteCommentReactionParams) SetCommentID(commentID string) { + o.CommentID = commentID +} + +// WithConversationID adds the conversationID to the delete comment reaction params +func (o *DeleteCommentReactionParams) WithConversationID(conversationID string) *DeleteCommentReactionParams { + o.SetConversationID(conversationID) + return o +} + +// SetConversationID adds the conversationId to the delete comment reaction params +func (o *DeleteCommentReactionParams) SetConversationID(conversationID string) { + o.ConversationID = conversationID +} + +// WithReactionID adds the reactionID to the delete comment reaction params +func (o *DeleteCommentReactionParams) WithReactionID(reactionID string) *DeleteCommentReactionParams { + o.SetReactionID(reactionID) + return o +} + +// SetReactionID adds the reactionId to the delete comment reaction params +func (o *DeleteCommentReactionParams) SetReactionID(reactionID string) { + o.ReactionID = reactionID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteCommentReactionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param comment_id + if err := r.SetPathParam("comment_id", o.CommentID); err != nil { + return err + } + + // path param conversation_id + if err := r.SetPathParam("conversation_id", o.ConversationID); err != nil { + return err + } + + // path param reaction_id + if err := r.SetPathParam("reaction_id", o.ReactionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/conversations/delete_comment_reaction_responses.go b/client/conversations/delete_comment_reaction_responses.go new file mode 100644 index 0000000..48cc419 --- /dev/null +++ b/client/conversations/delete_comment_reaction_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteCommentReactionReader is a Reader for the DeleteCommentReaction structure. +type DeleteCommentReactionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteCommentReactionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteCommentReactionNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteCommentReactionNoContent creates a DeleteCommentReactionNoContent with default headers values +func NewDeleteCommentReactionNoContent() *DeleteCommentReactionNoContent { + return &DeleteCommentReactionNoContent{} +} + +/* +DeleteCommentReactionNoContent describes a response with status code 204, with default header values. + +ALPHA - Archive a reaction +*/ +type DeleteCommentReactionNoContent struct { +} + +// IsSuccess returns true when this delete comment reaction no content response has a 2xx status code +func (o *DeleteCommentReactionNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete comment reaction no content response has a 3xx status code +func (o *DeleteCommentReactionNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete comment reaction no content response has a 4xx status code +func (o *DeleteCommentReactionNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete comment reaction no content response has a 5xx status code +func (o *DeleteCommentReactionNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete comment reaction no content response a status code equal to that given +func (o *DeleteCommentReactionNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteCommentReactionNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/conversations/{conversation_id}/comments/{comment_id}/reactions/{reaction_id}][%d] deleteCommentReactionNoContent ", 204) +} + +func (o *DeleteCommentReactionNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/conversations/{conversation_id}/comments/{comment_id}/reactions/{reaction_id}][%d] deleteCommentReactionNoContent ", 204) +} + +func (o *DeleteCommentReactionNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/conversations/delete_comment_responses.go b/client/conversations/delete_comment_responses.go new file mode 100644 index 0000000..db7ee95 --- /dev/null +++ b/client/conversations/delete_comment_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteCommentReader is a Reader for the DeleteComment structure. +type DeleteCommentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteCommentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteCommentNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteCommentNoContent creates a DeleteCommentNoContent with default headers values +func NewDeleteCommentNoContent() *DeleteCommentNoContent { + return &DeleteCommentNoContent{} +} + +/* +DeleteCommentNoContent describes a response with status code 204, with default header values. + +ALPHA - Archive a comment +*/ +type DeleteCommentNoContent struct { +} + +// IsSuccess returns true when this delete comment no content response has a 2xx status code +func (o *DeleteCommentNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete comment no content response has a 3xx status code +func (o *DeleteCommentNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete comment no content response has a 4xx status code +func (o *DeleteCommentNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete comment no content response has a 5xx status code +func (o *DeleteCommentNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete comment no content response a status code equal to that given +func (o *DeleteCommentNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteCommentNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/conversations/{conversation_id}/comments/{comment_id}][%d] deleteCommentNoContent ", 204) +} + +func (o *DeleteCommentNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/conversations/{conversation_id}/comments/{comment_id}][%d] deleteCommentNoContent ", 204) +} + +func (o *DeleteCommentNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/conversations/get_comment_parameters.go b/client/conversations/get_comment_parameters.go new file mode 100644 index 0000000..4d0d561 --- /dev/null +++ b/client/conversations/get_comment_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetCommentParams creates a new GetCommentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetCommentParams() *GetCommentParams { + return &GetCommentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetCommentParamsWithTimeout creates a new GetCommentParams object +// with the ability to set a timeout on a request. +func NewGetCommentParamsWithTimeout(timeout time.Duration) *GetCommentParams { + return &GetCommentParams{ + timeout: timeout, + } +} + +// NewGetCommentParamsWithContext creates a new GetCommentParams object +// with the ability to set a context for a request. +func NewGetCommentParamsWithContext(ctx context.Context) *GetCommentParams { + return &GetCommentParams{ + Context: ctx, + } +} + +// NewGetCommentParamsWithHTTPClient creates a new GetCommentParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetCommentParamsWithHTTPClient(client *http.Client) *GetCommentParams { + return &GetCommentParams{ + HTTPClient: client, + } +} + +/* +GetCommentParams contains all the parameters to send to the API endpoint + + for the get comment operation. + + Typically these are written to a http.Request. +*/ +type GetCommentParams struct { + + // CommentID. + CommentID string + + // ConversationID. + ConversationID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get comment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCommentParams) WithDefaults() *GetCommentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get comment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCommentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get comment params +func (o *GetCommentParams) WithTimeout(timeout time.Duration) *GetCommentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get comment params +func (o *GetCommentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get comment params +func (o *GetCommentParams) WithContext(ctx context.Context) *GetCommentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get comment params +func (o *GetCommentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get comment params +func (o *GetCommentParams) WithHTTPClient(client *http.Client) *GetCommentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get comment params +func (o *GetCommentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCommentID adds the commentID to the get comment params +func (o *GetCommentParams) WithCommentID(commentID string) *GetCommentParams { + o.SetCommentID(commentID) + return o +} + +// SetCommentID adds the commentId to the get comment params +func (o *GetCommentParams) SetCommentID(commentID string) { + o.CommentID = commentID +} + +// WithConversationID adds the conversationID to the get comment params +func (o *GetCommentParams) WithConversationID(conversationID string) *GetCommentParams { + o.SetConversationID(conversationID) + return o +} + +// SetConversationID adds the conversationId to the get comment params +func (o *GetCommentParams) SetConversationID(conversationID string) { + o.ConversationID = conversationID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCommentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param comment_id + if err := r.SetPathParam("comment_id", o.CommentID); err != nil { + return err + } + + // path param conversation_id + if err := r.SetPathParam("conversation_id", o.ConversationID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/conversations/get_comment_responses.go b/client/conversations/get_comment_responses.go new file mode 100644 index 0000000..96fa633 --- /dev/null +++ b/client/conversations/get_comment_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetCommentReader is a Reader for the GetComment structure. +type GetCommentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCommentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCommentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetCommentOK creates a GetCommentOK with default headers values +func NewGetCommentOK() *GetCommentOK { + return &GetCommentOK{} +} + +/* +GetCommentOK describes a response with status code 200, with default header values. + +ALPHA - Retrieves a single comment by ID +*/ +type GetCommentOK struct { +} + +// IsSuccess returns true when this get comment o k response has a 2xx status code +func (o *GetCommentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get comment o k response has a 3xx status code +func (o *GetCommentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get comment o k response has a 4xx status code +func (o *GetCommentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get comment o k response has a 5xx status code +func (o *GetCommentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get comment o k response a status code equal to that given +func (o *GetCommentOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetCommentOK) Error() string { + return fmt.Sprintf("[GET /v1/conversations/{conversation_id}/comments/{comment_id}][%d] getCommentOK ", 200) +} + +func (o *GetCommentOK) String() string { + return fmt.Sprintf("[GET /v1/conversations/{conversation_id}/comments/{comment_id}][%d] getCommentOK ", 200) +} + +func (o *GetCommentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/conversations/get_vote_status_parameters.go b/client/conversations/get_vote_status_parameters.go new file mode 100644 index 0000000..abc0b99 --- /dev/null +++ b/client/conversations/get_vote_status_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetVoteStatusParams creates a new GetVoteStatusParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetVoteStatusParams() *GetVoteStatusParams { + return &GetVoteStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetVoteStatusParamsWithTimeout creates a new GetVoteStatusParams object +// with the ability to set a timeout on a request. +func NewGetVoteStatusParamsWithTimeout(timeout time.Duration) *GetVoteStatusParams { + return &GetVoteStatusParams{ + timeout: timeout, + } +} + +// NewGetVoteStatusParamsWithContext creates a new GetVoteStatusParams object +// with the ability to set a context for a request. +func NewGetVoteStatusParamsWithContext(ctx context.Context) *GetVoteStatusParams { + return &GetVoteStatusParams{ + Context: ctx, + } +} + +// NewGetVoteStatusParamsWithHTTPClient creates a new GetVoteStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetVoteStatusParamsWithHTTPClient(client *http.Client) *GetVoteStatusParams { + return &GetVoteStatusParams{ + HTTPClient: client, + } +} + +/* +GetVoteStatusParams contains all the parameters to send to the API endpoint + + for the get vote status operation. + + Typically these are written to a http.Request. +*/ +type GetVoteStatusParams struct { + + // EventID. + EventID string + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get vote status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVoteStatusParams) WithDefaults() *GetVoteStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get vote status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVoteStatusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get vote status params +func (o *GetVoteStatusParams) WithTimeout(timeout time.Duration) *GetVoteStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get vote status params +func (o *GetVoteStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get vote status params +func (o *GetVoteStatusParams) WithContext(ctx context.Context) *GetVoteStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get vote status params +func (o *GetVoteStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get vote status params +func (o *GetVoteStatusParams) WithHTTPClient(client *http.Client) *GetVoteStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get vote status params +func (o *GetVoteStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEventID adds the eventID to the get vote status params +func (o *GetVoteStatusParams) WithEventID(eventID string) *GetVoteStatusParams { + o.SetEventID(eventID) + return o +} + +// SetEventID adds the eventId to the get vote status params +func (o *GetVoteStatusParams) SetEventID(eventID string) { + o.EventID = eventID +} + +// WithIncidentID adds the incidentID to the get vote status params +func (o *GetVoteStatusParams) WithIncidentID(incidentID string) *GetVoteStatusParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the get vote status params +func (o *GetVoteStatusParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetVoteStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param event_id + if err := r.SetPathParam("event_id", o.EventID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/conversations/get_vote_status_responses.go b/client/conversations/get_vote_status_responses.go new file mode 100644 index 0000000..d9593d8 --- /dev/null +++ b/client/conversations/get_vote_status_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetVoteStatusReader is a Reader for the GetVoteStatus structure. +type GetVoteStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetVoteStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetVoteStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetVoteStatusOK creates a GetVoteStatusOK with default headers values +func NewGetVoteStatusOK() *GetVoteStatusOK { + return &GetVoteStatusOK{} +} + +/* +GetVoteStatusOK describes a response with status code 200, with default header values. + +Get an object's current vote counts +*/ +type GetVoteStatusOK struct { + Payload *models.VotesEntity +} + +// IsSuccess returns true when this get vote status o k response has a 2xx status code +func (o *GetVoteStatusOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get vote status o k response has a 3xx status code +func (o *GetVoteStatusOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get vote status o k response has a 4xx status code +func (o *GetVoteStatusOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get vote status o k response has a 5xx status code +func (o *GetVoteStatusOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get vote status o k response a status code equal to that given +func (o *GetVoteStatusOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetVoteStatusOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/events/{event_id}/votes/status][%d] getVoteStatusOK %+v", 200, o.Payload) +} + +func (o *GetVoteStatusOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/events/{event_id}/votes/status][%d] getVoteStatusOK %+v", 200, o.Payload) +} + +func (o *GetVoteStatusOK) GetPayload() *models.VotesEntity { + return o.Payload +} + +func (o *GetVoteStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VotesEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/conversations/list_comment_reactions_parameters.go b/client/conversations/list_comment_reactions_parameters.go new file mode 100644 index 0000000..6aca38c --- /dev/null +++ b/client/conversations/list_comment_reactions_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListCommentReactionsParams creates a new ListCommentReactionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListCommentReactionsParams() *ListCommentReactionsParams { + return &ListCommentReactionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListCommentReactionsParamsWithTimeout creates a new ListCommentReactionsParams object +// with the ability to set a timeout on a request. +func NewListCommentReactionsParamsWithTimeout(timeout time.Duration) *ListCommentReactionsParams { + return &ListCommentReactionsParams{ + timeout: timeout, + } +} + +// NewListCommentReactionsParamsWithContext creates a new ListCommentReactionsParams object +// with the ability to set a context for a request. +func NewListCommentReactionsParamsWithContext(ctx context.Context) *ListCommentReactionsParams { + return &ListCommentReactionsParams{ + Context: ctx, + } +} + +// NewListCommentReactionsParamsWithHTTPClient creates a new ListCommentReactionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListCommentReactionsParamsWithHTTPClient(client *http.Client) *ListCommentReactionsParams { + return &ListCommentReactionsParams{ + HTTPClient: client, + } +} + +/* +ListCommentReactionsParams contains all the parameters to send to the API endpoint + + for the list comment reactions operation. + + Typically these are written to a http.Request. +*/ +type ListCommentReactionsParams struct { + + // CommentID. + CommentID string + + // ConversationID. + ConversationID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list comment reactions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListCommentReactionsParams) WithDefaults() *ListCommentReactionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list comment reactions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListCommentReactionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list comment reactions params +func (o *ListCommentReactionsParams) WithTimeout(timeout time.Duration) *ListCommentReactionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list comment reactions params +func (o *ListCommentReactionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list comment reactions params +func (o *ListCommentReactionsParams) WithContext(ctx context.Context) *ListCommentReactionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list comment reactions params +func (o *ListCommentReactionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list comment reactions params +func (o *ListCommentReactionsParams) WithHTTPClient(client *http.Client) *ListCommentReactionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list comment reactions params +func (o *ListCommentReactionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCommentID adds the commentID to the list comment reactions params +func (o *ListCommentReactionsParams) WithCommentID(commentID string) *ListCommentReactionsParams { + o.SetCommentID(commentID) + return o +} + +// SetCommentID adds the commentId to the list comment reactions params +func (o *ListCommentReactionsParams) SetCommentID(commentID string) { + o.CommentID = commentID +} + +// WithConversationID adds the conversationID to the list comment reactions params +func (o *ListCommentReactionsParams) WithConversationID(conversationID string) *ListCommentReactionsParams { + o.SetConversationID(conversationID) + return o +} + +// SetConversationID adds the conversationId to the list comment reactions params +func (o *ListCommentReactionsParams) SetConversationID(conversationID string) { + o.ConversationID = conversationID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListCommentReactionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param comment_id + if err := r.SetPathParam("comment_id", o.CommentID); err != nil { + return err + } + + // path param conversation_id + if err := r.SetPathParam("conversation_id", o.ConversationID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/conversations/list_comment_reactions_responses.go b/client/conversations/list_comment_reactions_responses.go new file mode 100644 index 0000000..162ca90 --- /dev/null +++ b/client/conversations/list_comment_reactions_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListCommentReactionsReader is a Reader for the ListCommentReactions structure. +type ListCommentReactionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListCommentReactionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListCommentReactionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListCommentReactionsOK creates a ListCommentReactionsOK with default headers values +func NewListCommentReactionsOK() *ListCommentReactionsOK { + return &ListCommentReactionsOK{} +} + +/* +ListCommentReactionsOK describes a response with status code 200, with default header values. + +ALPHA - List all of the reactions that have been added to a comment +*/ +type ListCommentReactionsOK struct { +} + +// IsSuccess returns true when this list comment reactions o k response has a 2xx status code +func (o *ListCommentReactionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list comment reactions o k response has a 3xx status code +func (o *ListCommentReactionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list comment reactions o k response has a 4xx status code +func (o *ListCommentReactionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list comment reactions o k response has a 5xx status code +func (o *ListCommentReactionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list comment reactions o k response a status code equal to that given +func (o *ListCommentReactionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListCommentReactionsOK) Error() string { + return fmt.Sprintf("[GET /v1/conversations/{conversation_id}/comments/{comment_id}/reactions][%d] listCommentReactionsOK ", 200) +} + +func (o *ListCommentReactionsOK) String() string { + return fmt.Sprintf("[GET /v1/conversations/{conversation_id}/comments/{comment_id}/reactions][%d] listCommentReactionsOK ", 200) +} + +func (o *ListCommentReactionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/conversations/list_comments_parameters.go b/client/conversations/list_comments_parameters.go new file mode 100644 index 0000000..634b1e7 --- /dev/null +++ b/client/conversations/list_comments_parameters.go @@ -0,0 +1,267 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListCommentsParams creates a new ListCommentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListCommentsParams() *ListCommentsParams { + return &ListCommentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListCommentsParamsWithTimeout creates a new ListCommentsParams object +// with the ability to set a timeout on a request. +func NewListCommentsParamsWithTimeout(timeout time.Duration) *ListCommentsParams { + return &ListCommentsParams{ + timeout: timeout, + } +} + +// NewListCommentsParamsWithContext creates a new ListCommentsParams object +// with the ability to set a context for a request. +func NewListCommentsParamsWithContext(ctx context.Context) *ListCommentsParams { + return &ListCommentsParams{ + Context: ctx, + } +} + +// NewListCommentsParamsWithHTTPClient creates a new ListCommentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListCommentsParamsWithHTTPClient(client *http.Client) *ListCommentsParams { + return &ListCommentsParams{ + HTTPClient: client, + } +} + +/* +ListCommentsParams contains all the parameters to send to the API endpoint + + for the list comments operation. + + Typically these are written to a http.Request. +*/ +type ListCommentsParams struct { + + /* After. + + An ISO8601 timestamp that allows filtering for comments posted after the provided time. + + Format: date-time + */ + After *strfmt.DateTime + + /* Before. + + An ISO8601 timestamp that allows filtering for comments posted before the provided time. + + Format: date-time + */ + Before *strfmt.DateTime + + // ConversationID. + ConversationID string + + /* Sort. + + Allows sorting comments by the time they were posted, ascending or descending. + + Default: "asc" + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list comments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListCommentsParams) WithDefaults() *ListCommentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list comments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListCommentsParams) SetDefaults() { + var ( + sortDefault = string("asc") + ) + + val := ListCommentsParams{ + Sort: &sortDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the list comments params +func (o *ListCommentsParams) WithTimeout(timeout time.Duration) *ListCommentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list comments params +func (o *ListCommentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list comments params +func (o *ListCommentsParams) WithContext(ctx context.Context) *ListCommentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list comments params +func (o *ListCommentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list comments params +func (o *ListCommentsParams) WithHTTPClient(client *http.Client) *ListCommentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list comments params +func (o *ListCommentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAfter adds the after to the list comments params +func (o *ListCommentsParams) WithAfter(after *strfmt.DateTime) *ListCommentsParams { + o.SetAfter(after) + return o +} + +// SetAfter adds the after to the list comments params +func (o *ListCommentsParams) SetAfter(after *strfmt.DateTime) { + o.After = after +} + +// WithBefore adds the before to the list comments params +func (o *ListCommentsParams) WithBefore(before *strfmt.DateTime) *ListCommentsParams { + o.SetBefore(before) + return o +} + +// SetBefore adds the before to the list comments params +func (o *ListCommentsParams) SetBefore(before *strfmt.DateTime) { + o.Before = before +} + +// WithConversationID adds the conversationID to the list comments params +func (o *ListCommentsParams) WithConversationID(conversationID string) *ListCommentsParams { + o.SetConversationID(conversationID) + return o +} + +// SetConversationID adds the conversationId to the list comments params +func (o *ListCommentsParams) SetConversationID(conversationID string) { + o.ConversationID = conversationID +} + +// WithSort adds the sort to the list comments params +func (o *ListCommentsParams) WithSort(sort *string) *ListCommentsParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the list comments params +func (o *ListCommentsParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *ListCommentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.After != nil { + + // query param after + var qrAfter strfmt.DateTime + + if o.After != nil { + qrAfter = *o.After + } + qAfter := qrAfter.String() + if qAfter != "" { + + if err := r.SetQueryParam("after", qAfter); err != nil { + return err + } + } + } + + if o.Before != nil { + + // query param before + var qrBefore strfmt.DateTime + + if o.Before != nil { + qrBefore = *o.Before + } + qBefore := qrBefore.String() + if qBefore != "" { + + if err := r.SetQueryParam("before", qBefore); err != nil { + return err + } + } + } + + // path param conversation_id + if err := r.SetPathParam("conversation_id", o.ConversationID); err != nil { + return err + } + + if o.Sort != nil { + + // query param sort + var qrSort string + + if o.Sort != nil { + qrSort = *o.Sort + } + qSort := qrSort + if qSort != "" { + + if err := r.SetQueryParam("sort", qSort); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/conversations/list_comments_responses.go b/client/conversations/list_comments_responses.go new file mode 100644 index 0000000..54a5a00 --- /dev/null +++ b/client/conversations/list_comments_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListCommentsReader is a Reader for the ListComments structure. +type ListCommentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListCommentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListCommentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListCommentsOK creates a ListCommentsOK with default headers values +func NewListCommentsOK() *ListCommentsOK { + return &ListCommentsOK{} +} + +/* +ListCommentsOK describes a response with status code 200, with default header values. + +ALPHA - List all of the comments that have been added to the organization +*/ +type ListCommentsOK struct { +} + +// IsSuccess returns true when this list comments o k response has a 2xx status code +func (o *ListCommentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list comments o k response has a 3xx status code +func (o *ListCommentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list comments o k response has a 4xx status code +func (o *ListCommentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list comments o k response has a 5xx status code +func (o *ListCommentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list comments o k response a status code equal to that given +func (o *ListCommentsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListCommentsOK) Error() string { + return fmt.Sprintf("[GET /v1/conversations/{conversation_id}/comments][%d] listCommentsOK ", 200) +} + +func (o *ListCommentsOK) String() string { + return fmt.Sprintf("[GET /v1/conversations/{conversation_id}/comments][%d] listCommentsOK ", 200) +} + +func (o *ListCommentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/conversations/update_comment_parameters.go b/client/conversations/update_comment_parameters.go new file mode 100644 index 0000000..3b0854e --- /dev/null +++ b/client/conversations/update_comment_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateCommentParams creates a new UpdateCommentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateCommentParams() *UpdateCommentParams { + return &UpdateCommentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateCommentParamsWithTimeout creates a new UpdateCommentParams object +// with the ability to set a timeout on a request. +func NewUpdateCommentParamsWithTimeout(timeout time.Duration) *UpdateCommentParams { + return &UpdateCommentParams{ + timeout: timeout, + } +} + +// NewUpdateCommentParamsWithContext creates a new UpdateCommentParams object +// with the ability to set a context for a request. +func NewUpdateCommentParamsWithContext(ctx context.Context) *UpdateCommentParams { + return &UpdateCommentParams{ + Context: ctx, + } +} + +// NewUpdateCommentParamsWithHTTPClient creates a new UpdateCommentParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateCommentParamsWithHTTPClient(client *http.Client) *UpdateCommentParams { + return &UpdateCommentParams{ + HTTPClient: client, + } +} + +/* +UpdateCommentParams contains all the parameters to send to the API endpoint + + for the update comment operation. + + Typically these are written to a http.Request. +*/ +type UpdateCommentParams struct { + + // CommentID. + CommentID string + + // ConversationID. + ConversationID string + + // UpdateComment. + UpdateComment *models.UpdateComment + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update comment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateCommentParams) WithDefaults() *UpdateCommentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update comment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateCommentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update comment params +func (o *UpdateCommentParams) WithTimeout(timeout time.Duration) *UpdateCommentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update comment params +func (o *UpdateCommentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update comment params +func (o *UpdateCommentParams) WithContext(ctx context.Context) *UpdateCommentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update comment params +func (o *UpdateCommentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update comment params +func (o *UpdateCommentParams) WithHTTPClient(client *http.Client) *UpdateCommentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update comment params +func (o *UpdateCommentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCommentID adds the commentID to the update comment params +func (o *UpdateCommentParams) WithCommentID(commentID string) *UpdateCommentParams { + o.SetCommentID(commentID) + return o +} + +// SetCommentID adds the commentId to the update comment params +func (o *UpdateCommentParams) SetCommentID(commentID string) { + o.CommentID = commentID +} + +// WithConversationID adds the conversationID to the update comment params +func (o *UpdateCommentParams) WithConversationID(conversationID string) *UpdateCommentParams { + o.SetConversationID(conversationID) + return o +} + +// SetConversationID adds the conversationId to the update comment params +func (o *UpdateCommentParams) SetConversationID(conversationID string) { + o.ConversationID = conversationID +} + +// WithUpdateComment adds the updateComment to the update comment params +func (o *UpdateCommentParams) WithUpdateComment(updateComment *models.UpdateComment) *UpdateCommentParams { + o.SetUpdateComment(updateComment) + return o +} + +// SetUpdateComment adds the updateComment to the update comment params +func (o *UpdateCommentParams) SetUpdateComment(updateComment *models.UpdateComment) { + o.UpdateComment = updateComment +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateCommentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param comment_id + if err := r.SetPathParam("comment_id", o.CommentID); err != nil { + return err + } + + // path param conversation_id + if err := r.SetPathParam("conversation_id", o.ConversationID); err != nil { + return err + } + if o.UpdateComment != nil { + if err := r.SetBodyParam(o.UpdateComment); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/conversations/update_comment_responses.go b/client/conversations/update_comment_responses.go new file mode 100644 index 0000000..9e39ce1 --- /dev/null +++ b/client/conversations/update_comment_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateCommentReader is a Reader for the UpdateComment structure. +type UpdateCommentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateCommentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateCommentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateCommentOK creates a UpdateCommentOK with default headers values +func NewUpdateCommentOK() *UpdateCommentOK { + return &UpdateCommentOK{} +} + +/* +UpdateCommentOK describes a response with status code 200, with default header values. + +ALPHA - Update a comment's attributes +*/ +type UpdateCommentOK struct { +} + +// IsSuccess returns true when this update comment o k response has a 2xx status code +func (o *UpdateCommentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update comment o k response has a 3xx status code +func (o *UpdateCommentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update comment o k response has a 4xx status code +func (o *UpdateCommentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update comment o k response has a 5xx status code +func (o *UpdateCommentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update comment o k response a status code equal to that given +func (o *UpdateCommentOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateCommentOK) Error() string { + return fmt.Sprintf("[PATCH /v1/conversations/{conversation_id}/comments/{comment_id}][%d] updateCommentOK ", 200) +} + +func (o *UpdateCommentOK) String() string { + return fmt.Sprintf("[PATCH /v1/conversations/{conversation_id}/comments/{comment_id}][%d] updateCommentOK ", 200) +} + +func (o *UpdateCommentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/conversations/update_vote_parameters.go b/client/conversations/update_vote_parameters.go new file mode 100644 index 0000000..6b37067 --- /dev/null +++ b/client/conversations/update_vote_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateVoteParams creates a new UpdateVoteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateVoteParams() *UpdateVoteParams { + return &UpdateVoteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateVoteParamsWithTimeout creates a new UpdateVoteParams object +// with the ability to set a timeout on a request. +func NewUpdateVoteParamsWithTimeout(timeout time.Duration) *UpdateVoteParams { + return &UpdateVoteParams{ + timeout: timeout, + } +} + +// NewUpdateVoteParamsWithContext creates a new UpdateVoteParams object +// with the ability to set a context for a request. +func NewUpdateVoteParamsWithContext(ctx context.Context) *UpdateVoteParams { + return &UpdateVoteParams{ + Context: ctx, + } +} + +// NewUpdateVoteParamsWithHTTPClient creates a new UpdateVoteParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateVoteParamsWithHTTPClient(client *http.Client) *UpdateVoteParams { + return &UpdateVoteParams{ + HTTPClient: client, + } +} + +/* +UpdateVoteParams contains all the parameters to send to the API endpoint + + for the update vote operation. + + Typically these are written to a http.Request. +*/ +type UpdateVoteParams struct { + + // EventID. + EventID string + + // IncidentID. + IncidentID string + + // UpdateVote. + UpdateVote *models.UpdateVote + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update vote params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateVoteParams) WithDefaults() *UpdateVoteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update vote params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateVoteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update vote params +func (o *UpdateVoteParams) WithTimeout(timeout time.Duration) *UpdateVoteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update vote params +func (o *UpdateVoteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update vote params +func (o *UpdateVoteParams) WithContext(ctx context.Context) *UpdateVoteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update vote params +func (o *UpdateVoteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update vote params +func (o *UpdateVoteParams) WithHTTPClient(client *http.Client) *UpdateVoteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update vote params +func (o *UpdateVoteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEventID adds the eventID to the update vote params +func (o *UpdateVoteParams) WithEventID(eventID string) *UpdateVoteParams { + o.SetEventID(eventID) + return o +} + +// SetEventID adds the eventId to the update vote params +func (o *UpdateVoteParams) SetEventID(eventID string) { + o.EventID = eventID +} + +// WithIncidentID adds the incidentID to the update vote params +func (o *UpdateVoteParams) WithIncidentID(incidentID string) *UpdateVoteParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the update vote params +func (o *UpdateVoteParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithUpdateVote adds the updateVote to the update vote params +func (o *UpdateVoteParams) WithUpdateVote(updateVote *models.UpdateVote) *UpdateVoteParams { + o.SetUpdateVote(updateVote) + return o +} + +// SetUpdateVote adds the updateVote to the update vote params +func (o *UpdateVoteParams) SetUpdateVote(updateVote *models.UpdateVote) { + o.UpdateVote = updateVote +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateVoteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param event_id + if err := r.SetPathParam("event_id", o.EventID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + if o.UpdateVote != nil { + if err := r.SetBodyParam(o.UpdateVote); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/conversations/update_vote_responses.go b/client/conversations/update_vote_responses.go new file mode 100644 index 0000000..d947424 --- /dev/null +++ b/client/conversations/update_vote_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package conversations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateVoteReader is a Reader for the UpdateVote structure. +type UpdateVoteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateVoteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateVoteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateVoteOK creates a UpdateVoteOK with default headers values +func NewUpdateVoteOK() *UpdateVoteOK { + return &UpdateVoteOK{} +} + +/* +UpdateVoteOK describes a response with status code 200, with default header values. + +Upvote or downvote an object +*/ +type UpdateVoteOK struct { + Payload *models.VotesEntity +} + +// IsSuccess returns true when this update vote o k response has a 2xx status code +func (o *UpdateVoteOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update vote o k response has a 3xx status code +func (o *UpdateVoteOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update vote o k response has a 4xx status code +func (o *UpdateVoteOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update vote o k response has a 5xx status code +func (o *UpdateVoteOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update vote o k response a status code equal to that given +func (o *UpdateVoteOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateVoteOK) Error() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/events/{event_id}/votes][%d] updateVoteOK %+v", 200, o.Payload) +} + +func (o *UpdateVoteOK) String() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/events/{event_id}/votes][%d] updateVoteOK %+v", 200, o.Payload) +} + +func (o *UpdateVoteOK) GetPayload() *models.VotesEntity { + return o.Payload +} + +func (o *UpdateVoteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VotesEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/fire_hydrant_api_client.go b/client/fire_hydrant_api_client.go index 6a227ee..5c34e33 100644 --- a/client/fire_hydrant_api_client.go +++ b/client/fire_hydrant_api_client.go @@ -13,11 +13,10 @@ import ( "github.com/firehydrant/api-client-go/client/account_settings" "github.com/firehydrant/api-client-go/client/alerts" "github.com/firehydrant/api-client-go/client/audiences" + "github.com/firehydrant/api-client-go/client/catalog_entries" "github.com/firehydrant/api-client-go/client/changes" "github.com/firehydrant/api-client-go/client/communication" "github.com/firehydrant/api-client-go/client/conversations" - "github.com/firehydrant/api-client-go/client/environments" - "github.com/firehydrant/api-client-go/client/functionalities" "github.com/firehydrant/api-client-go/client/incident_settings" "github.com/firehydrant/api-client-go/client/incidents" "github.com/firehydrant/api-client-go/client/integrations" @@ -25,7 +24,6 @@ import ( "github.com/firehydrant/api-client-go/client/retrospectives" "github.com/firehydrant/api-client-go/client/runbooks" "github.com/firehydrant/api-client-go/client/s_c_i_m" - "github.com/firehydrant/api-client-go/client/services" "github.com/firehydrant/api-client-go/client/signals" "github.com/firehydrant/api-client-go/client/status_pages" "github.com/firehydrant/api-client-go/client/tasks" @@ -80,11 +78,10 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *FireHydran cli.AccountSettings = account_settings.New(transport, formats) cli.Alerts = alerts.New(transport, formats) cli.Audiences = audiences.New(transport, formats) + cli.CatalogEntries = catalog_entries.New(transport, formats) cli.Changes = changes.New(transport, formats) cli.Communication = communication.New(transport, formats) cli.Conversations = conversations.New(transport, formats) - cli.Environments = environments.New(transport, formats) - cli.Functionalities = functionalities.New(transport, formats) cli.IncidentSettings = incident_settings.New(transport, formats) cli.Incidents = incidents.New(transport, formats) cli.Integrations = integrations.New(transport, formats) @@ -92,7 +89,6 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *FireHydran cli.Retrospectives = retrospectives.New(transport, formats) cli.Runbooks = runbooks.New(transport, formats) cli.Scim = s_c_i_m.New(transport, formats) - cli.Services = services.New(transport, formats) cli.Signals = signals.New(transport, formats) cli.StatusPages = status_pages.New(transport, formats) cli.Tasks = tasks.New(transport, formats) @@ -150,16 +146,14 @@ type FireHydrantAPI struct { Audiences audiences.ClientService + CatalogEntries catalog_entries.ClientService + Changes changes.ClientService Communication communication.ClientService Conversations conversations.ClientService - Environments environments.ClientService - - Functionalities functionalities.ClientService - IncidentSettings incident_settings.ClientService Incidents incidents.ClientService @@ -174,8 +168,6 @@ type FireHydrantAPI struct { Scim s_c_i_m.ClientService - Services services.ClientService - Signals signals.ClientService StatusPages status_pages.ClientService @@ -199,11 +191,10 @@ func (c *FireHydrantAPI) SetTransport(transport runtime.ClientTransport) { c.AccountSettings.SetTransport(transport) c.Alerts.SetTransport(transport) c.Audiences.SetTransport(transport) + c.CatalogEntries.SetTransport(transport) c.Changes.SetTransport(transport) c.Communication.SetTransport(transport) c.Conversations.SetTransport(transport) - c.Environments.SetTransport(transport) - c.Functionalities.SetTransport(transport) c.IncidentSettings.SetTransport(transport) c.Incidents.SetTransport(transport) c.Integrations.SetTransport(transport) @@ -211,7 +202,6 @@ func (c *FireHydrantAPI) SetTransport(transport runtime.ClientTransport) { c.Retrospectives.SetTransport(transport) c.Runbooks.SetTransport(transport) c.Scim.SetTransport(transport) - c.Services.SetTransport(transport) c.Signals.SetTransport(transport) c.StatusPages.SetTransport(transport) c.Tasks.SetTransport(transport) diff --git a/client/incident_settings/create_custom_field_definition_parameters.go b/client/incident_settings/create_custom_field_definition_parameters.go new file mode 100644 index 0000000..29e4d67 --- /dev/null +++ b/client/incident_settings/create_custom_field_definition_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateCustomFieldDefinitionParams creates a new CreateCustomFieldDefinitionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateCustomFieldDefinitionParams() *CreateCustomFieldDefinitionParams { + return &CreateCustomFieldDefinitionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateCustomFieldDefinitionParamsWithTimeout creates a new CreateCustomFieldDefinitionParams object +// with the ability to set a timeout on a request. +func NewCreateCustomFieldDefinitionParamsWithTimeout(timeout time.Duration) *CreateCustomFieldDefinitionParams { + return &CreateCustomFieldDefinitionParams{ + timeout: timeout, + } +} + +// NewCreateCustomFieldDefinitionParamsWithContext creates a new CreateCustomFieldDefinitionParams object +// with the ability to set a context for a request. +func NewCreateCustomFieldDefinitionParamsWithContext(ctx context.Context) *CreateCustomFieldDefinitionParams { + return &CreateCustomFieldDefinitionParams{ + Context: ctx, + } +} + +// NewCreateCustomFieldDefinitionParamsWithHTTPClient creates a new CreateCustomFieldDefinitionParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateCustomFieldDefinitionParamsWithHTTPClient(client *http.Client) *CreateCustomFieldDefinitionParams { + return &CreateCustomFieldDefinitionParams{ + HTTPClient: client, + } +} + +/* +CreateCustomFieldDefinitionParams contains all the parameters to send to the API endpoint + + for the create custom field definition operation. + + Typically these are written to a http.Request. +*/ +type CreateCustomFieldDefinitionParams struct { + + // CreateCustomFieldDefinition. + CreateCustomFieldDefinition *models.CreateCustomFieldDefinition + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create custom field definition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateCustomFieldDefinitionParams) WithDefaults() *CreateCustomFieldDefinitionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create custom field definition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateCustomFieldDefinitionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create custom field definition params +func (o *CreateCustomFieldDefinitionParams) WithTimeout(timeout time.Duration) *CreateCustomFieldDefinitionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create custom field definition params +func (o *CreateCustomFieldDefinitionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create custom field definition params +func (o *CreateCustomFieldDefinitionParams) WithContext(ctx context.Context) *CreateCustomFieldDefinitionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create custom field definition params +func (o *CreateCustomFieldDefinitionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create custom field definition params +func (o *CreateCustomFieldDefinitionParams) WithHTTPClient(client *http.Client) *CreateCustomFieldDefinitionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create custom field definition params +func (o *CreateCustomFieldDefinitionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateCustomFieldDefinition adds the createCustomFieldDefinition to the create custom field definition params +func (o *CreateCustomFieldDefinitionParams) WithCreateCustomFieldDefinition(createCustomFieldDefinition *models.CreateCustomFieldDefinition) *CreateCustomFieldDefinitionParams { + o.SetCreateCustomFieldDefinition(createCustomFieldDefinition) + return o +} + +// SetCreateCustomFieldDefinition adds the createCustomFieldDefinition to the create custom field definition params +func (o *CreateCustomFieldDefinitionParams) SetCreateCustomFieldDefinition(createCustomFieldDefinition *models.CreateCustomFieldDefinition) { + o.CreateCustomFieldDefinition = createCustomFieldDefinition +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateCustomFieldDefinitionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateCustomFieldDefinition != nil { + if err := r.SetBodyParam(o.CreateCustomFieldDefinition); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/create_custom_field_definition_responses.go b/client/incident_settings/create_custom_field_definition_responses.go new file mode 100644 index 0000000..4e9b4dd --- /dev/null +++ b/client/incident_settings/create_custom_field_definition_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateCustomFieldDefinitionReader is a Reader for the CreateCustomFieldDefinition structure. +type CreateCustomFieldDefinitionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateCustomFieldDefinitionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateCustomFieldDefinitionCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateCustomFieldDefinitionCreated creates a CreateCustomFieldDefinitionCreated with default headers values +func NewCreateCustomFieldDefinitionCreated() *CreateCustomFieldDefinitionCreated { + return &CreateCustomFieldDefinitionCreated{} +} + +/* +CreateCustomFieldDefinitionCreated describes a response with status code 201, with default header values. + +Create a new custom field definition +*/ +type CreateCustomFieldDefinitionCreated struct { + Payload *models.OrganizationsCustomFieldDefinitionEntity +} + +// IsSuccess returns true when this create custom field definition created response has a 2xx status code +func (o *CreateCustomFieldDefinitionCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create custom field definition created response has a 3xx status code +func (o *CreateCustomFieldDefinitionCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create custom field definition created response has a 4xx status code +func (o *CreateCustomFieldDefinitionCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create custom field definition created response has a 5xx status code +func (o *CreateCustomFieldDefinitionCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create custom field definition created response a status code equal to that given +func (o *CreateCustomFieldDefinitionCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateCustomFieldDefinitionCreated) Error() string { + return fmt.Sprintf("[POST /v1/custom_fields/definitions][%d] createCustomFieldDefinitionCreated %+v", 201, o.Payload) +} + +func (o *CreateCustomFieldDefinitionCreated) String() string { + return fmt.Sprintf("[POST /v1/custom_fields/definitions][%d] createCustomFieldDefinitionCreated %+v", 201, o.Payload) +} + +func (o *CreateCustomFieldDefinitionCreated) GetPayload() *models.OrganizationsCustomFieldDefinitionEntity { + return o.Payload +} + +func (o *CreateCustomFieldDefinitionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OrganizationsCustomFieldDefinitionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/create_incident_role_parameters.go b/client/incident_settings/create_incident_role_parameters.go new file mode 100644 index 0000000..5920ac1 --- /dev/null +++ b/client/incident_settings/create_incident_role_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateIncidentRoleParams creates a new CreateIncidentRoleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentRoleParams() *CreateIncidentRoleParams { + return &CreateIncidentRoleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentRoleParamsWithTimeout creates a new CreateIncidentRoleParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentRoleParamsWithTimeout(timeout time.Duration) *CreateIncidentRoleParams { + return &CreateIncidentRoleParams{ + timeout: timeout, + } +} + +// NewCreateIncidentRoleParamsWithContext creates a new CreateIncidentRoleParams object +// with the ability to set a context for a request. +func NewCreateIncidentRoleParamsWithContext(ctx context.Context) *CreateIncidentRoleParams { + return &CreateIncidentRoleParams{ + Context: ctx, + } +} + +// NewCreateIncidentRoleParamsWithHTTPClient creates a new CreateIncidentRoleParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentRoleParamsWithHTTPClient(client *http.Client) *CreateIncidentRoleParams { + return &CreateIncidentRoleParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentRoleParams contains all the parameters to send to the API endpoint + + for the create incident role operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentRoleParams struct { + + // CreateIncidentRole. + CreateIncidentRole *models.CreateIncidentRole + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident role params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentRoleParams) WithDefaults() *CreateIncidentRoleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident role params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentRoleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident role params +func (o *CreateIncidentRoleParams) WithTimeout(timeout time.Duration) *CreateIncidentRoleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident role params +func (o *CreateIncidentRoleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident role params +func (o *CreateIncidentRoleParams) WithContext(ctx context.Context) *CreateIncidentRoleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident role params +func (o *CreateIncidentRoleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident role params +func (o *CreateIncidentRoleParams) WithHTTPClient(client *http.Client) *CreateIncidentRoleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident role params +func (o *CreateIncidentRoleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateIncidentRole adds the createIncidentRole to the create incident role params +func (o *CreateIncidentRoleParams) WithCreateIncidentRole(createIncidentRole *models.CreateIncidentRole) *CreateIncidentRoleParams { + o.SetCreateIncidentRole(createIncidentRole) + return o +} + +// SetCreateIncidentRole adds the createIncidentRole to the create incident role params +func (o *CreateIncidentRoleParams) SetCreateIncidentRole(createIncidentRole *models.CreateIncidentRole) { + o.CreateIncidentRole = createIncidentRole +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentRoleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateIncidentRole != nil { + if err := r.SetBodyParam(o.CreateIncidentRole); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/create_incident_role_responses.go b/client/incident_settings/create_incident_role_responses.go new file mode 100644 index 0000000..c6ebd50 --- /dev/null +++ b/client/incident_settings/create_incident_role_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentRoleReader is a Reader for the CreateIncidentRole structure. +type CreateIncidentRoleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentRoleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentRoleCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentRoleCreated creates a CreateIncidentRoleCreated with default headers values +func NewCreateIncidentRoleCreated() *CreateIncidentRoleCreated { + return &CreateIncidentRoleCreated{} +} + +/* +CreateIncidentRoleCreated describes a response with status code 201, with default header values. + +Create a new incident role +*/ +type CreateIncidentRoleCreated struct { + Payload *models.IncidentRoleEntity +} + +// IsSuccess returns true when this create incident role created response has a 2xx status code +func (o *CreateIncidentRoleCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident role created response has a 3xx status code +func (o *CreateIncidentRoleCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident role created response has a 4xx status code +func (o *CreateIncidentRoleCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident role created response has a 5xx status code +func (o *CreateIncidentRoleCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident role created response a status code equal to that given +func (o *CreateIncidentRoleCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentRoleCreated) Error() string { + return fmt.Sprintf("[POST /v1/incident_roles][%d] createIncidentRoleCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentRoleCreated) String() string { + return fmt.Sprintf("[POST /v1/incident_roles][%d] createIncidentRoleCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentRoleCreated) GetPayload() *models.IncidentRoleEntity { + return o.Payload +} + +func (o *CreateIncidentRoleCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentRoleEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/create_incident_type_parameters.go b/client/incident_settings/create_incident_type_parameters.go new file mode 100644 index 0000000..b7142db --- /dev/null +++ b/client/incident_settings/create_incident_type_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateIncidentTypeParams creates a new CreateIncidentTypeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentTypeParams() *CreateIncidentTypeParams { + return &CreateIncidentTypeParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentTypeParamsWithTimeout creates a new CreateIncidentTypeParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentTypeParamsWithTimeout(timeout time.Duration) *CreateIncidentTypeParams { + return &CreateIncidentTypeParams{ + timeout: timeout, + } +} + +// NewCreateIncidentTypeParamsWithContext creates a new CreateIncidentTypeParams object +// with the ability to set a context for a request. +func NewCreateIncidentTypeParamsWithContext(ctx context.Context) *CreateIncidentTypeParams { + return &CreateIncidentTypeParams{ + Context: ctx, + } +} + +// NewCreateIncidentTypeParamsWithHTTPClient creates a new CreateIncidentTypeParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentTypeParamsWithHTTPClient(client *http.Client) *CreateIncidentTypeParams { + return &CreateIncidentTypeParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentTypeParams contains all the parameters to send to the API endpoint + + for the create incident type operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentTypeParams struct { + + // CreateIncidentType. + CreateIncidentType *models.CreateIncidentType + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident type params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentTypeParams) WithDefaults() *CreateIncidentTypeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident type params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentTypeParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident type params +func (o *CreateIncidentTypeParams) WithTimeout(timeout time.Duration) *CreateIncidentTypeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident type params +func (o *CreateIncidentTypeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident type params +func (o *CreateIncidentTypeParams) WithContext(ctx context.Context) *CreateIncidentTypeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident type params +func (o *CreateIncidentTypeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident type params +func (o *CreateIncidentTypeParams) WithHTTPClient(client *http.Client) *CreateIncidentTypeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident type params +func (o *CreateIncidentTypeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateIncidentType adds the createIncidentType to the create incident type params +func (o *CreateIncidentTypeParams) WithCreateIncidentType(createIncidentType *models.CreateIncidentType) *CreateIncidentTypeParams { + o.SetCreateIncidentType(createIncidentType) + return o +} + +// SetCreateIncidentType adds the createIncidentType to the create incident type params +func (o *CreateIncidentTypeParams) SetCreateIncidentType(createIncidentType *models.CreateIncidentType) { + o.CreateIncidentType = createIncidentType +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateIncidentType != nil { + if err := r.SetBodyParam(o.CreateIncidentType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/create_incident_type_responses.go b/client/incident_settings/create_incident_type_responses.go new file mode 100644 index 0000000..b5cf3bd --- /dev/null +++ b/client/incident_settings/create_incident_type_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentTypeReader is a Reader for the CreateIncidentType structure. +type CreateIncidentTypeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentTypeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentTypeCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentTypeCreated creates a CreateIncidentTypeCreated with default headers values +func NewCreateIncidentTypeCreated() *CreateIncidentTypeCreated { + return &CreateIncidentTypeCreated{} +} + +/* +CreateIncidentTypeCreated describes a response with status code 201, with default header values. + +Create a new incident type +*/ +type CreateIncidentTypeCreated struct { + Payload *models.IncidentTypeEntity +} + +// IsSuccess returns true when this create incident type created response has a 2xx status code +func (o *CreateIncidentTypeCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident type created response has a 3xx status code +func (o *CreateIncidentTypeCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident type created response has a 4xx status code +func (o *CreateIncidentTypeCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident type created response has a 5xx status code +func (o *CreateIncidentTypeCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident type created response a status code equal to that given +func (o *CreateIncidentTypeCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentTypeCreated) Error() string { + return fmt.Sprintf("[POST /v1/incident_types][%d] createIncidentTypeCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentTypeCreated) String() string { + return fmt.Sprintf("[POST /v1/incident_types][%d] createIncidentTypeCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentTypeCreated) GetPayload() *models.IncidentTypeEntity { + return o.Payload +} + +func (o *CreateIncidentTypeCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentTypeEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/create_lifecycle_measurement_definition_parameters.go b/client/incident_settings/create_lifecycle_measurement_definition_parameters.go new file mode 100644 index 0000000..d51d866 --- /dev/null +++ b/client/incident_settings/create_lifecycle_measurement_definition_parameters.go @@ -0,0 +1,256 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateLifecycleMeasurementDefinitionParams creates a new CreateLifecycleMeasurementDefinitionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateLifecycleMeasurementDefinitionParams() *CreateLifecycleMeasurementDefinitionParams { + return &CreateLifecycleMeasurementDefinitionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateLifecycleMeasurementDefinitionParamsWithTimeout creates a new CreateLifecycleMeasurementDefinitionParams object +// with the ability to set a timeout on a request. +func NewCreateLifecycleMeasurementDefinitionParamsWithTimeout(timeout time.Duration) *CreateLifecycleMeasurementDefinitionParams { + return &CreateLifecycleMeasurementDefinitionParams{ + timeout: timeout, + } +} + +// NewCreateLifecycleMeasurementDefinitionParamsWithContext creates a new CreateLifecycleMeasurementDefinitionParams object +// with the ability to set a context for a request. +func NewCreateLifecycleMeasurementDefinitionParamsWithContext(ctx context.Context) *CreateLifecycleMeasurementDefinitionParams { + return &CreateLifecycleMeasurementDefinitionParams{ + Context: ctx, + } +} + +// NewCreateLifecycleMeasurementDefinitionParamsWithHTTPClient creates a new CreateLifecycleMeasurementDefinitionParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateLifecycleMeasurementDefinitionParamsWithHTTPClient(client *http.Client) *CreateLifecycleMeasurementDefinitionParams { + return &CreateLifecycleMeasurementDefinitionParams{ + HTTPClient: client, + } +} + +/* +CreateLifecycleMeasurementDefinitionParams contains all the parameters to send to the API endpoint + + for the create lifecycle measurement definition operation. + + Typically these are written to a http.Request. +*/ +type CreateLifecycleMeasurementDefinitionParams struct { + + // Description. + Description *string + + // EndsAtMilestoneID. + EndsAtMilestoneID string + + // Name. + Name string + + // Slug. + Slug *string + + // StartsAtMilestoneID. + StartsAtMilestoneID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create lifecycle measurement definition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateLifecycleMeasurementDefinitionParams) WithDefaults() *CreateLifecycleMeasurementDefinitionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create lifecycle measurement definition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateLifecycleMeasurementDefinitionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) WithTimeout(timeout time.Duration) *CreateLifecycleMeasurementDefinitionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) WithContext(ctx context.Context) *CreateLifecycleMeasurementDefinitionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) WithHTTPClient(client *http.Client) *CreateLifecycleMeasurementDefinitionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDescription adds the description to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) WithDescription(description *string) *CreateLifecycleMeasurementDefinitionParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) SetDescription(description *string) { + o.Description = description +} + +// WithEndsAtMilestoneID adds the endsAtMilestoneID to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) WithEndsAtMilestoneID(endsAtMilestoneID string) *CreateLifecycleMeasurementDefinitionParams { + o.SetEndsAtMilestoneID(endsAtMilestoneID) + return o +} + +// SetEndsAtMilestoneID adds the endsAtMilestoneId to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) SetEndsAtMilestoneID(endsAtMilestoneID string) { + o.EndsAtMilestoneID = endsAtMilestoneID +} + +// WithName adds the name to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) WithName(name string) *CreateLifecycleMeasurementDefinitionParams { + o.SetName(name) + return o +} + +// SetName adds the name to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) SetName(name string) { + o.Name = name +} + +// WithSlug adds the slug to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) WithSlug(slug *string) *CreateLifecycleMeasurementDefinitionParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WithStartsAtMilestoneID adds the startsAtMilestoneID to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) WithStartsAtMilestoneID(startsAtMilestoneID string) *CreateLifecycleMeasurementDefinitionParams { + o.SetStartsAtMilestoneID(startsAtMilestoneID) + return o +} + +// SetStartsAtMilestoneID adds the startsAtMilestoneId to the create lifecycle measurement definition params +func (o *CreateLifecycleMeasurementDefinitionParams) SetStartsAtMilestoneID(startsAtMilestoneID string) { + o.StartsAtMilestoneID = startsAtMilestoneID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateLifecycleMeasurementDefinitionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Description != nil { + + // form param description + var frDescription string + if o.Description != nil { + frDescription = *o.Description + } + fDescription := frDescription + if fDescription != "" { + if err := r.SetFormParam("description", fDescription); err != nil { + return err + } + } + } + + // form param ends_at_milestone_id + frEndsAtMilestoneID := o.EndsAtMilestoneID + fEndsAtMilestoneID := frEndsAtMilestoneID + if fEndsAtMilestoneID != "" { + if err := r.SetFormParam("ends_at_milestone_id", fEndsAtMilestoneID); err != nil { + return err + } + } + + // form param name + frName := o.Name + fName := frName + if fName != "" { + if err := r.SetFormParam("name", fName); err != nil { + return err + } + } + + if o.Slug != nil { + + // form param slug + var frSlug string + if o.Slug != nil { + frSlug = *o.Slug + } + fSlug := frSlug + if fSlug != "" { + if err := r.SetFormParam("slug", fSlug); err != nil { + return err + } + } + } + + // form param starts_at_milestone_id + frStartsAtMilestoneID := o.StartsAtMilestoneID + fStartsAtMilestoneID := frStartsAtMilestoneID + if fStartsAtMilestoneID != "" { + if err := r.SetFormParam("starts_at_milestone_id", fStartsAtMilestoneID); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/create_lifecycle_measurement_definition_responses.go b/client/incident_settings/create_lifecycle_measurement_definition_responses.go new file mode 100644 index 0000000..824d794 --- /dev/null +++ b/client/incident_settings/create_lifecycle_measurement_definition_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateLifecycleMeasurementDefinitionReader is a Reader for the CreateLifecycleMeasurementDefinition structure. +type CreateLifecycleMeasurementDefinitionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateLifecycleMeasurementDefinitionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateLifecycleMeasurementDefinitionCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateLifecycleMeasurementDefinitionCreated creates a CreateLifecycleMeasurementDefinitionCreated with default headers values +func NewCreateLifecycleMeasurementDefinitionCreated() *CreateLifecycleMeasurementDefinitionCreated { + return &CreateLifecycleMeasurementDefinitionCreated{} +} + +/* +CreateLifecycleMeasurementDefinitionCreated describes a response with status code 201, with default header values. + +Create a new measurement definition +*/ +type CreateLifecycleMeasurementDefinitionCreated struct { +} + +// IsSuccess returns true when this create lifecycle measurement definition created response has a 2xx status code +func (o *CreateLifecycleMeasurementDefinitionCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create lifecycle measurement definition created response has a 3xx status code +func (o *CreateLifecycleMeasurementDefinitionCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create lifecycle measurement definition created response has a 4xx status code +func (o *CreateLifecycleMeasurementDefinitionCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create lifecycle measurement definition created response has a 5xx status code +func (o *CreateLifecycleMeasurementDefinitionCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create lifecycle measurement definition created response a status code equal to that given +func (o *CreateLifecycleMeasurementDefinitionCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateLifecycleMeasurementDefinitionCreated) Error() string { + return fmt.Sprintf("[POST /v1/lifecycles/measurement_definitions][%d] createLifecycleMeasurementDefinitionCreated ", 201) +} + +func (o *CreateLifecycleMeasurementDefinitionCreated) String() string { + return fmt.Sprintf("[POST /v1/lifecycles/measurement_definitions][%d] createLifecycleMeasurementDefinitionCreated ", 201) +} + +func (o *CreateLifecycleMeasurementDefinitionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/incident_settings/create_lifecycle_milestone_parameters.go b/client/incident_settings/create_lifecycle_milestone_parameters.go new file mode 100644 index 0000000..7167287 --- /dev/null +++ b/client/incident_settings/create_lifecycle_milestone_parameters.go @@ -0,0 +1,338 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCreateLifecycleMilestoneParams creates a new CreateLifecycleMilestoneParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateLifecycleMilestoneParams() *CreateLifecycleMilestoneParams { + return &CreateLifecycleMilestoneParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateLifecycleMilestoneParamsWithTimeout creates a new CreateLifecycleMilestoneParams object +// with the ability to set a timeout on a request. +func NewCreateLifecycleMilestoneParamsWithTimeout(timeout time.Duration) *CreateLifecycleMilestoneParams { + return &CreateLifecycleMilestoneParams{ + timeout: timeout, + } +} + +// NewCreateLifecycleMilestoneParamsWithContext creates a new CreateLifecycleMilestoneParams object +// with the ability to set a context for a request. +func NewCreateLifecycleMilestoneParamsWithContext(ctx context.Context) *CreateLifecycleMilestoneParams { + return &CreateLifecycleMilestoneParams{ + Context: ctx, + } +} + +// NewCreateLifecycleMilestoneParamsWithHTTPClient creates a new CreateLifecycleMilestoneParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateLifecycleMilestoneParamsWithHTTPClient(client *http.Client) *CreateLifecycleMilestoneParams { + return &CreateLifecycleMilestoneParams{ + HTTPClient: client, + } +} + +/* +CreateLifecycleMilestoneParams contains all the parameters to send to the API endpoint + + for the create lifecycle milestone operation. + + Typically these are written to a http.Request. +*/ +type CreateLifecycleMilestoneParams struct { + + /* AutoAssignTimestampOnCreate. + + The setting for auto-assigning the milestone's timestamp during incident declaration + */ + AutoAssignTimestampOnCreate *string + + /* Description. + + A long-form description of the milestone's purpose + */ + Description string + + /* Name. + + The name of the milestone + */ + Name string + + /* PhaseID. + + The ID of the phase to which the milestone should belong + */ + PhaseID string + + /* Position. + + The position of the milestone within the phase. If not provided, the milestone will be added as the last milestone in the phase. + + Format: int32 + */ + Position *int32 + + /* RequiredAtMilestoneID. + + The ID of a later milestone that cannot be started until this milestone has a timestamp populated + */ + RequiredAtMilestoneID *string + + /* Slug. + + A unique identifier for the milestone. If not provided, one will be generated from the name. + */ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create lifecycle milestone params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateLifecycleMilestoneParams) WithDefaults() *CreateLifecycleMilestoneParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create lifecycle milestone params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateLifecycleMilestoneParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) WithTimeout(timeout time.Duration) *CreateLifecycleMilestoneParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) WithContext(ctx context.Context) *CreateLifecycleMilestoneParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) WithHTTPClient(client *http.Client) *CreateLifecycleMilestoneParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAutoAssignTimestampOnCreate adds the autoAssignTimestampOnCreate to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) WithAutoAssignTimestampOnCreate(autoAssignTimestampOnCreate *string) *CreateLifecycleMilestoneParams { + o.SetAutoAssignTimestampOnCreate(autoAssignTimestampOnCreate) + return o +} + +// SetAutoAssignTimestampOnCreate adds the autoAssignTimestampOnCreate to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) SetAutoAssignTimestampOnCreate(autoAssignTimestampOnCreate *string) { + o.AutoAssignTimestampOnCreate = autoAssignTimestampOnCreate +} + +// WithDescription adds the description to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) WithDescription(description string) *CreateLifecycleMilestoneParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) SetDescription(description string) { + o.Description = description +} + +// WithName adds the name to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) WithName(name string) *CreateLifecycleMilestoneParams { + o.SetName(name) + return o +} + +// SetName adds the name to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) SetName(name string) { + o.Name = name +} + +// WithPhaseID adds the phaseID to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) WithPhaseID(phaseID string) *CreateLifecycleMilestoneParams { + o.SetPhaseID(phaseID) + return o +} + +// SetPhaseID adds the phaseId to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) SetPhaseID(phaseID string) { + o.PhaseID = phaseID +} + +// WithPosition adds the position to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) WithPosition(position *int32) *CreateLifecycleMilestoneParams { + o.SetPosition(position) + return o +} + +// SetPosition adds the position to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) SetPosition(position *int32) { + o.Position = position +} + +// WithRequiredAtMilestoneID adds the requiredAtMilestoneID to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) WithRequiredAtMilestoneID(requiredAtMilestoneID *string) *CreateLifecycleMilestoneParams { + o.SetRequiredAtMilestoneID(requiredAtMilestoneID) + return o +} + +// SetRequiredAtMilestoneID adds the requiredAtMilestoneId to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) SetRequiredAtMilestoneID(requiredAtMilestoneID *string) { + o.RequiredAtMilestoneID = requiredAtMilestoneID +} + +// WithSlug adds the slug to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) WithSlug(slug *string) *CreateLifecycleMilestoneParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the create lifecycle milestone params +func (o *CreateLifecycleMilestoneParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateLifecycleMilestoneParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AutoAssignTimestampOnCreate != nil { + + // form param auto_assign_timestamp_on_create + var frAutoAssignTimestampOnCreate string + if o.AutoAssignTimestampOnCreate != nil { + frAutoAssignTimestampOnCreate = *o.AutoAssignTimestampOnCreate + } + fAutoAssignTimestampOnCreate := frAutoAssignTimestampOnCreate + if fAutoAssignTimestampOnCreate != "" { + if err := r.SetFormParam("auto_assign_timestamp_on_create", fAutoAssignTimestampOnCreate); err != nil { + return err + } + } + } + + // form param description + frDescription := o.Description + fDescription := frDescription + if fDescription != "" { + if err := r.SetFormParam("description", fDescription); err != nil { + return err + } + } + + // form param name + frName := o.Name + fName := frName + if fName != "" { + if err := r.SetFormParam("name", fName); err != nil { + return err + } + } + + // form param phase_id + frPhaseID := o.PhaseID + fPhaseID := frPhaseID + if fPhaseID != "" { + if err := r.SetFormParam("phase_id", fPhaseID); err != nil { + return err + } + } + + if o.Position != nil { + + // form param position + var frPosition int32 + if o.Position != nil { + frPosition = *o.Position + } + fPosition := swag.FormatInt32(frPosition) + if fPosition != "" { + if err := r.SetFormParam("position", fPosition); err != nil { + return err + } + } + } + + if o.RequiredAtMilestoneID != nil { + + // form param required_at_milestone_id + var frRequiredAtMilestoneID string + if o.RequiredAtMilestoneID != nil { + frRequiredAtMilestoneID = *o.RequiredAtMilestoneID + } + fRequiredAtMilestoneID := frRequiredAtMilestoneID + if fRequiredAtMilestoneID != "" { + if err := r.SetFormParam("required_at_milestone_id", fRequiredAtMilestoneID); err != nil { + return err + } + } + } + + if o.Slug != nil { + + // form param slug + var frSlug string + if o.Slug != nil { + frSlug = *o.Slug + } + fSlug := frSlug + if fSlug != "" { + if err := r.SetFormParam("slug", fSlug); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/create_lifecycle_milestone_responses.go b/client/incident_settings/create_lifecycle_milestone_responses.go new file mode 100644 index 0000000..d4539dd --- /dev/null +++ b/client/incident_settings/create_lifecycle_milestone_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateLifecycleMilestoneReader is a Reader for the CreateLifecycleMilestone structure. +type CreateLifecycleMilestoneReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateLifecycleMilestoneReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateLifecycleMilestoneCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateLifecycleMilestoneCreated creates a CreateLifecycleMilestoneCreated with default headers values +func NewCreateLifecycleMilestoneCreated() *CreateLifecycleMilestoneCreated { + return &CreateLifecycleMilestoneCreated{} +} + +/* +CreateLifecycleMilestoneCreated describes a response with status code 201, with default header values. + +Create a new milestone +*/ +type CreateLifecycleMilestoneCreated struct { + Payload *models.LifecyclesPhaseEntityList +} + +// IsSuccess returns true when this create lifecycle milestone created response has a 2xx status code +func (o *CreateLifecycleMilestoneCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create lifecycle milestone created response has a 3xx status code +func (o *CreateLifecycleMilestoneCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create lifecycle milestone created response has a 4xx status code +func (o *CreateLifecycleMilestoneCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create lifecycle milestone created response has a 5xx status code +func (o *CreateLifecycleMilestoneCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create lifecycle milestone created response a status code equal to that given +func (o *CreateLifecycleMilestoneCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateLifecycleMilestoneCreated) Error() string { + return fmt.Sprintf("[POST /v1/lifecycles/milestones][%d] createLifecycleMilestoneCreated %+v", 201, o.Payload) +} + +func (o *CreateLifecycleMilestoneCreated) String() string { + return fmt.Sprintf("[POST /v1/lifecycles/milestones][%d] createLifecycleMilestoneCreated %+v", 201, o.Payload) +} + +func (o *CreateLifecycleMilestoneCreated) GetPayload() *models.LifecyclesPhaseEntityList { + return o.Payload +} + +func (o *CreateLifecycleMilestoneCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.LifecyclesPhaseEntityList) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/create_priority_parameters.go b/client/incident_settings/create_priority_parameters.go new file mode 100644 index 0000000..a80c697 --- /dev/null +++ b/client/incident_settings/create_priority_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreatePriorityParams creates a new CreatePriorityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreatePriorityParams() *CreatePriorityParams { + return &CreatePriorityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreatePriorityParamsWithTimeout creates a new CreatePriorityParams object +// with the ability to set a timeout on a request. +func NewCreatePriorityParamsWithTimeout(timeout time.Duration) *CreatePriorityParams { + return &CreatePriorityParams{ + timeout: timeout, + } +} + +// NewCreatePriorityParamsWithContext creates a new CreatePriorityParams object +// with the ability to set a context for a request. +func NewCreatePriorityParamsWithContext(ctx context.Context) *CreatePriorityParams { + return &CreatePriorityParams{ + Context: ctx, + } +} + +// NewCreatePriorityParamsWithHTTPClient creates a new CreatePriorityParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreatePriorityParamsWithHTTPClient(client *http.Client) *CreatePriorityParams { + return &CreatePriorityParams{ + HTTPClient: client, + } +} + +/* +CreatePriorityParams contains all the parameters to send to the API endpoint + + for the create priority operation. + + Typically these are written to a http.Request. +*/ +type CreatePriorityParams struct { + + // CreatePriority. + CreatePriority *models.CreatePriority + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePriorityParams) WithDefaults() *CreatePriorityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePriorityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create priority params +func (o *CreatePriorityParams) WithTimeout(timeout time.Duration) *CreatePriorityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create priority params +func (o *CreatePriorityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create priority params +func (o *CreatePriorityParams) WithContext(ctx context.Context) *CreatePriorityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create priority params +func (o *CreatePriorityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create priority params +func (o *CreatePriorityParams) WithHTTPClient(client *http.Client) *CreatePriorityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create priority params +func (o *CreatePriorityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreatePriority adds the createPriority to the create priority params +func (o *CreatePriorityParams) WithCreatePriority(createPriority *models.CreatePriority) *CreatePriorityParams { + o.SetCreatePriority(createPriority) + return o +} + +// SetCreatePriority adds the createPriority to the create priority params +func (o *CreatePriorityParams) SetCreatePriority(createPriority *models.CreatePriority) { + o.CreatePriority = createPriority +} + +// WriteToRequest writes these params to a swagger request +func (o *CreatePriorityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreatePriority != nil { + if err := r.SetBodyParam(o.CreatePriority); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/create_priority_responses.go b/client/incident_settings/create_priority_responses.go new file mode 100644 index 0000000..570d2c2 --- /dev/null +++ b/client/incident_settings/create_priority_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreatePriorityReader is a Reader for the CreatePriority structure. +type CreatePriorityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreatePriorityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreatePriorityCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreatePriorityCreated creates a CreatePriorityCreated with default headers values +func NewCreatePriorityCreated() *CreatePriorityCreated { + return &CreatePriorityCreated{} +} + +/* +CreatePriorityCreated describes a response with status code 201, with default header values. + +Create a new priority +*/ +type CreatePriorityCreated struct { + Payload *models.PriorityEntity +} + +// IsSuccess returns true when this create priority created response has a 2xx status code +func (o *CreatePriorityCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create priority created response has a 3xx status code +func (o *CreatePriorityCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create priority created response has a 4xx status code +func (o *CreatePriorityCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create priority created response has a 5xx status code +func (o *CreatePriorityCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create priority created response a status code equal to that given +func (o *CreatePriorityCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreatePriorityCreated) Error() string { + return fmt.Sprintf("[POST /v1/priorities][%d] createPriorityCreated %+v", 201, o.Payload) +} + +func (o *CreatePriorityCreated) String() string { + return fmt.Sprintf("[POST /v1/priorities][%d] createPriorityCreated %+v", 201, o.Payload) +} + +func (o *CreatePriorityCreated) GetPayload() *models.PriorityEntity { + return o.Payload +} + +func (o *CreatePriorityCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PriorityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/create_severity_matrix_condition_parameters.go b/client/incident_settings/create_severity_matrix_condition_parameters.go new file mode 100644 index 0000000..5186729 --- /dev/null +++ b/client/incident_settings/create_severity_matrix_condition_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateSeverityMatrixConditionParams creates a new CreateSeverityMatrixConditionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateSeverityMatrixConditionParams() *CreateSeverityMatrixConditionParams { + return &CreateSeverityMatrixConditionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateSeverityMatrixConditionParamsWithTimeout creates a new CreateSeverityMatrixConditionParams object +// with the ability to set a timeout on a request. +func NewCreateSeverityMatrixConditionParamsWithTimeout(timeout time.Duration) *CreateSeverityMatrixConditionParams { + return &CreateSeverityMatrixConditionParams{ + timeout: timeout, + } +} + +// NewCreateSeverityMatrixConditionParamsWithContext creates a new CreateSeverityMatrixConditionParams object +// with the ability to set a context for a request. +func NewCreateSeverityMatrixConditionParamsWithContext(ctx context.Context) *CreateSeverityMatrixConditionParams { + return &CreateSeverityMatrixConditionParams{ + Context: ctx, + } +} + +// NewCreateSeverityMatrixConditionParamsWithHTTPClient creates a new CreateSeverityMatrixConditionParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateSeverityMatrixConditionParamsWithHTTPClient(client *http.Client) *CreateSeverityMatrixConditionParams { + return &CreateSeverityMatrixConditionParams{ + HTTPClient: client, + } +} + +/* +CreateSeverityMatrixConditionParams contains all the parameters to send to the API endpoint + + for the create severity matrix condition operation. + + Typically these are written to a http.Request. +*/ +type CreateSeverityMatrixConditionParams struct { + + // CreateSeverityMatrixCondition. + CreateSeverityMatrixCondition *models.CreateSeverityMatrixCondition + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create severity matrix condition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSeverityMatrixConditionParams) WithDefaults() *CreateSeverityMatrixConditionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create severity matrix condition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSeverityMatrixConditionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create severity matrix condition params +func (o *CreateSeverityMatrixConditionParams) WithTimeout(timeout time.Duration) *CreateSeverityMatrixConditionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create severity matrix condition params +func (o *CreateSeverityMatrixConditionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create severity matrix condition params +func (o *CreateSeverityMatrixConditionParams) WithContext(ctx context.Context) *CreateSeverityMatrixConditionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create severity matrix condition params +func (o *CreateSeverityMatrixConditionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create severity matrix condition params +func (o *CreateSeverityMatrixConditionParams) WithHTTPClient(client *http.Client) *CreateSeverityMatrixConditionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create severity matrix condition params +func (o *CreateSeverityMatrixConditionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateSeverityMatrixCondition adds the createSeverityMatrixCondition to the create severity matrix condition params +func (o *CreateSeverityMatrixConditionParams) WithCreateSeverityMatrixCondition(createSeverityMatrixCondition *models.CreateSeverityMatrixCondition) *CreateSeverityMatrixConditionParams { + o.SetCreateSeverityMatrixCondition(createSeverityMatrixCondition) + return o +} + +// SetCreateSeverityMatrixCondition adds the createSeverityMatrixCondition to the create severity matrix condition params +func (o *CreateSeverityMatrixConditionParams) SetCreateSeverityMatrixCondition(createSeverityMatrixCondition *models.CreateSeverityMatrixCondition) { + o.CreateSeverityMatrixCondition = createSeverityMatrixCondition +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateSeverityMatrixConditionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateSeverityMatrixCondition != nil { + if err := r.SetBodyParam(o.CreateSeverityMatrixCondition); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/create_severity_matrix_condition_responses.go b/client/incident_settings/create_severity_matrix_condition_responses.go new file mode 100644 index 0000000..e752e80 --- /dev/null +++ b/client/incident_settings/create_severity_matrix_condition_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateSeverityMatrixConditionReader is a Reader for the CreateSeverityMatrixCondition structure. +type CreateSeverityMatrixConditionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateSeverityMatrixConditionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateSeverityMatrixConditionCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateSeverityMatrixConditionCreated creates a CreateSeverityMatrixConditionCreated with default headers values +func NewCreateSeverityMatrixConditionCreated() *CreateSeverityMatrixConditionCreated { + return &CreateSeverityMatrixConditionCreated{} +} + +/* +CreateSeverityMatrixConditionCreated describes a response with status code 201, with default header values. + +Create a new condition +*/ +type CreateSeverityMatrixConditionCreated struct { + Payload *models.SeverityMatrixConditionEntity +} + +// IsSuccess returns true when this create severity matrix condition created response has a 2xx status code +func (o *CreateSeverityMatrixConditionCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create severity matrix condition created response has a 3xx status code +func (o *CreateSeverityMatrixConditionCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create severity matrix condition created response has a 4xx status code +func (o *CreateSeverityMatrixConditionCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create severity matrix condition created response has a 5xx status code +func (o *CreateSeverityMatrixConditionCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create severity matrix condition created response a status code equal to that given +func (o *CreateSeverityMatrixConditionCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateSeverityMatrixConditionCreated) Error() string { + return fmt.Sprintf("[POST /v1/severity_matrix/conditions][%d] createSeverityMatrixConditionCreated %+v", 201, o.Payload) +} + +func (o *CreateSeverityMatrixConditionCreated) String() string { + return fmt.Sprintf("[POST /v1/severity_matrix/conditions][%d] createSeverityMatrixConditionCreated %+v", 201, o.Payload) +} + +func (o *CreateSeverityMatrixConditionCreated) GetPayload() *models.SeverityMatrixConditionEntity { + return o.Payload +} + +func (o *CreateSeverityMatrixConditionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityMatrixConditionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/create_severity_matrix_impact_parameters.go b/client/incident_settings/create_severity_matrix_impact_parameters.go new file mode 100644 index 0000000..e363677 --- /dev/null +++ b/client/incident_settings/create_severity_matrix_impact_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateSeverityMatrixImpactParams creates a new CreateSeverityMatrixImpactParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateSeverityMatrixImpactParams() *CreateSeverityMatrixImpactParams { + return &CreateSeverityMatrixImpactParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateSeverityMatrixImpactParamsWithTimeout creates a new CreateSeverityMatrixImpactParams object +// with the ability to set a timeout on a request. +func NewCreateSeverityMatrixImpactParamsWithTimeout(timeout time.Duration) *CreateSeverityMatrixImpactParams { + return &CreateSeverityMatrixImpactParams{ + timeout: timeout, + } +} + +// NewCreateSeverityMatrixImpactParamsWithContext creates a new CreateSeverityMatrixImpactParams object +// with the ability to set a context for a request. +func NewCreateSeverityMatrixImpactParamsWithContext(ctx context.Context) *CreateSeverityMatrixImpactParams { + return &CreateSeverityMatrixImpactParams{ + Context: ctx, + } +} + +// NewCreateSeverityMatrixImpactParamsWithHTTPClient creates a new CreateSeverityMatrixImpactParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateSeverityMatrixImpactParamsWithHTTPClient(client *http.Client) *CreateSeverityMatrixImpactParams { + return &CreateSeverityMatrixImpactParams{ + HTTPClient: client, + } +} + +/* +CreateSeverityMatrixImpactParams contains all the parameters to send to the API endpoint + + for the create severity matrix impact operation. + + Typically these are written to a http.Request. +*/ +type CreateSeverityMatrixImpactParams struct { + + // CreateSeverityMatrixImpact. + CreateSeverityMatrixImpact *models.CreateSeverityMatrixImpact + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create severity matrix impact params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSeverityMatrixImpactParams) WithDefaults() *CreateSeverityMatrixImpactParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create severity matrix impact params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSeverityMatrixImpactParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create severity matrix impact params +func (o *CreateSeverityMatrixImpactParams) WithTimeout(timeout time.Duration) *CreateSeverityMatrixImpactParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create severity matrix impact params +func (o *CreateSeverityMatrixImpactParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create severity matrix impact params +func (o *CreateSeverityMatrixImpactParams) WithContext(ctx context.Context) *CreateSeverityMatrixImpactParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create severity matrix impact params +func (o *CreateSeverityMatrixImpactParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create severity matrix impact params +func (o *CreateSeverityMatrixImpactParams) WithHTTPClient(client *http.Client) *CreateSeverityMatrixImpactParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create severity matrix impact params +func (o *CreateSeverityMatrixImpactParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateSeverityMatrixImpact adds the createSeverityMatrixImpact to the create severity matrix impact params +func (o *CreateSeverityMatrixImpactParams) WithCreateSeverityMatrixImpact(createSeverityMatrixImpact *models.CreateSeverityMatrixImpact) *CreateSeverityMatrixImpactParams { + o.SetCreateSeverityMatrixImpact(createSeverityMatrixImpact) + return o +} + +// SetCreateSeverityMatrixImpact adds the createSeverityMatrixImpact to the create severity matrix impact params +func (o *CreateSeverityMatrixImpactParams) SetCreateSeverityMatrixImpact(createSeverityMatrixImpact *models.CreateSeverityMatrixImpact) { + o.CreateSeverityMatrixImpact = createSeverityMatrixImpact +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateSeverityMatrixImpactParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateSeverityMatrixImpact != nil { + if err := r.SetBodyParam(o.CreateSeverityMatrixImpact); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/create_severity_matrix_impact_responses.go b/client/incident_settings/create_severity_matrix_impact_responses.go new file mode 100644 index 0000000..e65bb22 --- /dev/null +++ b/client/incident_settings/create_severity_matrix_impact_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateSeverityMatrixImpactReader is a Reader for the CreateSeverityMatrixImpact structure. +type CreateSeverityMatrixImpactReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateSeverityMatrixImpactReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateSeverityMatrixImpactCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateSeverityMatrixImpactCreated creates a CreateSeverityMatrixImpactCreated with default headers values +func NewCreateSeverityMatrixImpactCreated() *CreateSeverityMatrixImpactCreated { + return &CreateSeverityMatrixImpactCreated{} +} + +/* +CreateSeverityMatrixImpactCreated describes a response with status code 201, with default header values. + +Create a new impact +*/ +type CreateSeverityMatrixImpactCreated struct { + Payload *models.SeverityMatrixImpactEntity +} + +// IsSuccess returns true when this create severity matrix impact created response has a 2xx status code +func (o *CreateSeverityMatrixImpactCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create severity matrix impact created response has a 3xx status code +func (o *CreateSeverityMatrixImpactCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create severity matrix impact created response has a 4xx status code +func (o *CreateSeverityMatrixImpactCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create severity matrix impact created response has a 5xx status code +func (o *CreateSeverityMatrixImpactCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create severity matrix impact created response a status code equal to that given +func (o *CreateSeverityMatrixImpactCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateSeverityMatrixImpactCreated) Error() string { + return fmt.Sprintf("[POST /v1/severity_matrix/impacts][%d] createSeverityMatrixImpactCreated %+v", 201, o.Payload) +} + +func (o *CreateSeverityMatrixImpactCreated) String() string { + return fmt.Sprintf("[POST /v1/severity_matrix/impacts][%d] createSeverityMatrixImpactCreated %+v", 201, o.Payload) +} + +func (o *CreateSeverityMatrixImpactCreated) GetPayload() *models.SeverityMatrixImpactEntity { + return o.Payload +} + +func (o *CreateSeverityMatrixImpactCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityMatrixImpactEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/create_severity_parameters.go b/client/incident_settings/create_severity_parameters.go new file mode 100644 index 0000000..af28b29 --- /dev/null +++ b/client/incident_settings/create_severity_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateSeverityParams creates a new CreateSeverityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateSeverityParams() *CreateSeverityParams { + return &CreateSeverityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateSeverityParamsWithTimeout creates a new CreateSeverityParams object +// with the ability to set a timeout on a request. +func NewCreateSeverityParamsWithTimeout(timeout time.Duration) *CreateSeverityParams { + return &CreateSeverityParams{ + timeout: timeout, + } +} + +// NewCreateSeverityParamsWithContext creates a new CreateSeverityParams object +// with the ability to set a context for a request. +func NewCreateSeverityParamsWithContext(ctx context.Context) *CreateSeverityParams { + return &CreateSeverityParams{ + Context: ctx, + } +} + +// NewCreateSeverityParamsWithHTTPClient creates a new CreateSeverityParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateSeverityParamsWithHTTPClient(client *http.Client) *CreateSeverityParams { + return &CreateSeverityParams{ + HTTPClient: client, + } +} + +/* +CreateSeverityParams contains all the parameters to send to the API endpoint + + for the create severity operation. + + Typically these are written to a http.Request. +*/ +type CreateSeverityParams struct { + + // CreateSeverity. + CreateSeverity *models.CreateSeverity + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create severity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSeverityParams) WithDefaults() *CreateSeverityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create severity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSeverityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create severity params +func (o *CreateSeverityParams) WithTimeout(timeout time.Duration) *CreateSeverityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create severity params +func (o *CreateSeverityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create severity params +func (o *CreateSeverityParams) WithContext(ctx context.Context) *CreateSeverityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create severity params +func (o *CreateSeverityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create severity params +func (o *CreateSeverityParams) WithHTTPClient(client *http.Client) *CreateSeverityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create severity params +func (o *CreateSeverityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateSeverity adds the createSeverity to the create severity params +func (o *CreateSeverityParams) WithCreateSeverity(createSeverity *models.CreateSeverity) *CreateSeverityParams { + o.SetCreateSeverity(createSeverity) + return o +} + +// SetCreateSeverity adds the createSeverity to the create severity params +func (o *CreateSeverityParams) SetCreateSeverity(createSeverity *models.CreateSeverity) { + o.CreateSeverity = createSeverity +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateSeverityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateSeverity != nil { + if err := r.SetBodyParam(o.CreateSeverity); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/create_severity_responses.go b/client/incident_settings/create_severity_responses.go new file mode 100644 index 0000000..4c73509 --- /dev/null +++ b/client/incident_settings/create_severity_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateSeverityReader is a Reader for the CreateSeverity structure. +type CreateSeverityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateSeverityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateSeverityCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateSeverityCreated creates a CreateSeverityCreated with default headers values +func NewCreateSeverityCreated() *CreateSeverityCreated { + return &CreateSeverityCreated{} +} + +/* +CreateSeverityCreated describes a response with status code 201, with default header values. + +Create a new severity +*/ +type CreateSeverityCreated struct { + Payload *models.SeverityEntity +} + +// IsSuccess returns true when this create severity created response has a 2xx status code +func (o *CreateSeverityCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create severity created response has a 3xx status code +func (o *CreateSeverityCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create severity created response has a 4xx status code +func (o *CreateSeverityCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create severity created response has a 5xx status code +func (o *CreateSeverityCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create severity created response a status code equal to that given +func (o *CreateSeverityCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateSeverityCreated) Error() string { + return fmt.Sprintf("[POST /v1/severities][%d] createSeverityCreated %+v", 201, o.Payload) +} + +func (o *CreateSeverityCreated) String() string { + return fmt.Sprintf("[POST /v1/severities][%d] createSeverityCreated %+v", 201, o.Payload) +} + +func (o *CreateSeverityCreated) GetPayload() *models.SeverityEntity { + return o.Payload +} + +func (o *CreateSeverityCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/delete_custom_field_definition_parameters.go b/client/incident_settings/delete_custom_field_definition_parameters.go new file mode 100644 index 0000000..5077869 --- /dev/null +++ b/client/incident_settings/delete_custom_field_definition_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteCustomFieldDefinitionParams creates a new DeleteCustomFieldDefinitionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteCustomFieldDefinitionParams() *DeleteCustomFieldDefinitionParams { + return &DeleteCustomFieldDefinitionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteCustomFieldDefinitionParamsWithTimeout creates a new DeleteCustomFieldDefinitionParams object +// with the ability to set a timeout on a request. +func NewDeleteCustomFieldDefinitionParamsWithTimeout(timeout time.Duration) *DeleteCustomFieldDefinitionParams { + return &DeleteCustomFieldDefinitionParams{ + timeout: timeout, + } +} + +// NewDeleteCustomFieldDefinitionParamsWithContext creates a new DeleteCustomFieldDefinitionParams object +// with the ability to set a context for a request. +func NewDeleteCustomFieldDefinitionParamsWithContext(ctx context.Context) *DeleteCustomFieldDefinitionParams { + return &DeleteCustomFieldDefinitionParams{ + Context: ctx, + } +} + +// NewDeleteCustomFieldDefinitionParamsWithHTTPClient creates a new DeleteCustomFieldDefinitionParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteCustomFieldDefinitionParamsWithHTTPClient(client *http.Client) *DeleteCustomFieldDefinitionParams { + return &DeleteCustomFieldDefinitionParams{ + HTTPClient: client, + } +} + +/* +DeleteCustomFieldDefinitionParams contains all the parameters to send to the API endpoint + + for the delete custom field definition operation. + + Typically these are written to a http.Request. +*/ +type DeleteCustomFieldDefinitionParams struct { + + // FieldID. + FieldID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete custom field definition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteCustomFieldDefinitionParams) WithDefaults() *DeleteCustomFieldDefinitionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete custom field definition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteCustomFieldDefinitionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete custom field definition params +func (o *DeleteCustomFieldDefinitionParams) WithTimeout(timeout time.Duration) *DeleteCustomFieldDefinitionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete custom field definition params +func (o *DeleteCustomFieldDefinitionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete custom field definition params +func (o *DeleteCustomFieldDefinitionParams) WithContext(ctx context.Context) *DeleteCustomFieldDefinitionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete custom field definition params +func (o *DeleteCustomFieldDefinitionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete custom field definition params +func (o *DeleteCustomFieldDefinitionParams) WithHTTPClient(client *http.Client) *DeleteCustomFieldDefinitionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete custom field definition params +func (o *DeleteCustomFieldDefinitionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFieldID adds the fieldID to the delete custom field definition params +func (o *DeleteCustomFieldDefinitionParams) WithFieldID(fieldID string) *DeleteCustomFieldDefinitionParams { + o.SetFieldID(fieldID) + return o +} + +// SetFieldID adds the fieldId to the delete custom field definition params +func (o *DeleteCustomFieldDefinitionParams) SetFieldID(fieldID string) { + o.FieldID = fieldID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteCustomFieldDefinitionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param field_id + if err := r.SetPathParam("field_id", o.FieldID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/delete_custom_field_definition_responses.go b/client/incident_settings/delete_custom_field_definition_responses.go new file mode 100644 index 0000000..7e0e800 --- /dev/null +++ b/client/incident_settings/delete_custom_field_definition_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteCustomFieldDefinitionReader is a Reader for the DeleteCustomFieldDefinition structure. +type DeleteCustomFieldDefinitionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteCustomFieldDefinitionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteCustomFieldDefinitionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteCustomFieldDefinitionOK creates a DeleteCustomFieldDefinitionOK with default headers values +func NewDeleteCustomFieldDefinitionOK() *DeleteCustomFieldDefinitionOK { + return &DeleteCustomFieldDefinitionOK{} +} + +/* +DeleteCustomFieldDefinitionOK describes a response with status code 200, with default header values. + +Delete a custom field definition +*/ +type DeleteCustomFieldDefinitionOK struct { + Payload *models.OrganizationsCustomFieldDefinitionEntity +} + +// IsSuccess returns true when this delete custom field definition o k response has a 2xx status code +func (o *DeleteCustomFieldDefinitionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete custom field definition o k response has a 3xx status code +func (o *DeleteCustomFieldDefinitionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete custom field definition o k response has a 4xx status code +func (o *DeleteCustomFieldDefinitionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete custom field definition o k response has a 5xx status code +func (o *DeleteCustomFieldDefinitionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete custom field definition o k response a status code equal to that given +func (o *DeleteCustomFieldDefinitionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteCustomFieldDefinitionOK) Error() string { + return fmt.Sprintf("[DELETE /v1/custom_fields/definitions/{field_id}][%d] deleteCustomFieldDefinitionOK %+v", 200, o.Payload) +} + +func (o *DeleteCustomFieldDefinitionOK) String() string { + return fmt.Sprintf("[DELETE /v1/custom_fields/definitions/{field_id}][%d] deleteCustomFieldDefinitionOK %+v", 200, o.Payload) +} + +func (o *DeleteCustomFieldDefinitionOK) GetPayload() *models.OrganizationsCustomFieldDefinitionEntity { + return o.Payload +} + +func (o *DeleteCustomFieldDefinitionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OrganizationsCustomFieldDefinitionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/delete_incident_role_parameters.go b/client/incident_settings/delete_incident_role_parameters.go new file mode 100644 index 0000000..890f0ba --- /dev/null +++ b/client/incident_settings/delete_incident_role_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteIncidentRoleParams creates a new DeleteIncidentRoleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteIncidentRoleParams() *DeleteIncidentRoleParams { + return &DeleteIncidentRoleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteIncidentRoleParamsWithTimeout creates a new DeleteIncidentRoleParams object +// with the ability to set a timeout on a request. +func NewDeleteIncidentRoleParamsWithTimeout(timeout time.Duration) *DeleteIncidentRoleParams { + return &DeleteIncidentRoleParams{ + timeout: timeout, + } +} + +// NewDeleteIncidentRoleParamsWithContext creates a new DeleteIncidentRoleParams object +// with the ability to set a context for a request. +func NewDeleteIncidentRoleParamsWithContext(ctx context.Context) *DeleteIncidentRoleParams { + return &DeleteIncidentRoleParams{ + Context: ctx, + } +} + +// NewDeleteIncidentRoleParamsWithHTTPClient creates a new DeleteIncidentRoleParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteIncidentRoleParamsWithHTTPClient(client *http.Client) *DeleteIncidentRoleParams { + return &DeleteIncidentRoleParams{ + HTTPClient: client, + } +} + +/* +DeleteIncidentRoleParams contains all the parameters to send to the API endpoint + + for the delete incident role operation. + + Typically these are written to a http.Request. +*/ +type DeleteIncidentRoleParams struct { + + // IncidentRoleID. + IncidentRoleID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete incident role params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentRoleParams) WithDefaults() *DeleteIncidentRoleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete incident role params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentRoleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete incident role params +func (o *DeleteIncidentRoleParams) WithTimeout(timeout time.Duration) *DeleteIncidentRoleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete incident role params +func (o *DeleteIncidentRoleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete incident role params +func (o *DeleteIncidentRoleParams) WithContext(ctx context.Context) *DeleteIncidentRoleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete incident role params +func (o *DeleteIncidentRoleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete incident role params +func (o *DeleteIncidentRoleParams) WithHTTPClient(client *http.Client) *DeleteIncidentRoleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete incident role params +func (o *DeleteIncidentRoleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentRoleID adds the incidentRoleID to the delete incident role params +func (o *DeleteIncidentRoleParams) WithIncidentRoleID(incidentRoleID string) *DeleteIncidentRoleParams { + o.SetIncidentRoleID(incidentRoleID) + return o +} + +// SetIncidentRoleID adds the incidentRoleId to the delete incident role params +func (o *DeleteIncidentRoleParams) SetIncidentRoleID(incidentRoleID string) { + o.IncidentRoleID = incidentRoleID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteIncidentRoleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_role_id + if err := r.SetPathParam("incident_role_id", o.IncidentRoleID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/delete_incident_role_responses.go b/client/incident_settings/delete_incident_role_responses.go new file mode 100644 index 0000000..ce5eaf1 --- /dev/null +++ b/client/incident_settings/delete_incident_role_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteIncidentRoleReader is a Reader for the DeleteIncidentRole structure. +type DeleteIncidentRoleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteIncidentRoleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteIncidentRoleOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteIncidentRoleOK creates a DeleteIncidentRoleOK with default headers values +func NewDeleteIncidentRoleOK() *DeleteIncidentRoleOK { + return &DeleteIncidentRoleOK{} +} + +/* +DeleteIncidentRoleOK describes a response with status code 200, with default header values. + +Archives an incident role which will hide it from lists and metrics +*/ +type DeleteIncidentRoleOK struct { + Payload *models.IncidentRoleEntity +} + +// IsSuccess returns true when this delete incident role o k response has a 2xx status code +func (o *DeleteIncidentRoleOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete incident role o k response has a 3xx status code +func (o *DeleteIncidentRoleOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete incident role o k response has a 4xx status code +func (o *DeleteIncidentRoleOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete incident role o k response has a 5xx status code +func (o *DeleteIncidentRoleOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete incident role o k response a status code equal to that given +func (o *DeleteIncidentRoleOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteIncidentRoleOK) Error() string { + return fmt.Sprintf("[DELETE /v1/incident_roles/{incident_role_id}][%d] deleteIncidentRoleOK %+v", 200, o.Payload) +} + +func (o *DeleteIncidentRoleOK) String() string { + return fmt.Sprintf("[DELETE /v1/incident_roles/{incident_role_id}][%d] deleteIncidentRoleOK %+v", 200, o.Payload) +} + +func (o *DeleteIncidentRoleOK) GetPayload() *models.IncidentRoleEntity { + return o.Payload +} + +func (o *DeleteIncidentRoleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentRoleEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/delete_incident_type_parameters.go b/client/incident_settings/delete_incident_type_parameters.go new file mode 100644 index 0000000..0208430 --- /dev/null +++ b/client/incident_settings/delete_incident_type_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteIncidentTypeParams creates a new DeleteIncidentTypeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteIncidentTypeParams() *DeleteIncidentTypeParams { + return &DeleteIncidentTypeParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteIncidentTypeParamsWithTimeout creates a new DeleteIncidentTypeParams object +// with the ability to set a timeout on a request. +func NewDeleteIncidentTypeParamsWithTimeout(timeout time.Duration) *DeleteIncidentTypeParams { + return &DeleteIncidentTypeParams{ + timeout: timeout, + } +} + +// NewDeleteIncidentTypeParamsWithContext creates a new DeleteIncidentTypeParams object +// with the ability to set a context for a request. +func NewDeleteIncidentTypeParamsWithContext(ctx context.Context) *DeleteIncidentTypeParams { + return &DeleteIncidentTypeParams{ + Context: ctx, + } +} + +// NewDeleteIncidentTypeParamsWithHTTPClient creates a new DeleteIncidentTypeParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteIncidentTypeParamsWithHTTPClient(client *http.Client) *DeleteIncidentTypeParams { + return &DeleteIncidentTypeParams{ + HTTPClient: client, + } +} + +/* +DeleteIncidentTypeParams contains all the parameters to send to the API endpoint + + for the delete incident type operation. + + Typically these are written to a http.Request. +*/ +type DeleteIncidentTypeParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete incident type params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentTypeParams) WithDefaults() *DeleteIncidentTypeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete incident type params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentTypeParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete incident type params +func (o *DeleteIncidentTypeParams) WithTimeout(timeout time.Duration) *DeleteIncidentTypeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete incident type params +func (o *DeleteIncidentTypeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete incident type params +func (o *DeleteIncidentTypeParams) WithContext(ctx context.Context) *DeleteIncidentTypeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete incident type params +func (o *DeleteIncidentTypeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete incident type params +func (o *DeleteIncidentTypeParams) WithHTTPClient(client *http.Client) *DeleteIncidentTypeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete incident type params +func (o *DeleteIncidentTypeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete incident type params +func (o *DeleteIncidentTypeParams) WithID(id string) *DeleteIncidentTypeParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete incident type params +func (o *DeleteIncidentTypeParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteIncidentTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/delete_incident_type_responses.go b/client/incident_settings/delete_incident_type_responses.go new file mode 100644 index 0000000..435c791 --- /dev/null +++ b/client/incident_settings/delete_incident_type_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteIncidentTypeReader is a Reader for the DeleteIncidentType structure. +type DeleteIncidentTypeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteIncidentTypeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteIncidentTypeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteIncidentTypeOK creates a DeleteIncidentTypeOK with default headers values +func NewDeleteIncidentTypeOK() *DeleteIncidentTypeOK { + return &DeleteIncidentTypeOK{} +} + +/* +DeleteIncidentTypeOK describes a response with status code 200, with default header values. + +Archives an incident type which will hide it from lists and metrics +*/ +type DeleteIncidentTypeOK struct { + Payload *models.IncidentTypeEntity +} + +// IsSuccess returns true when this delete incident type o k response has a 2xx status code +func (o *DeleteIncidentTypeOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete incident type o k response has a 3xx status code +func (o *DeleteIncidentTypeOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete incident type o k response has a 4xx status code +func (o *DeleteIncidentTypeOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete incident type o k response has a 5xx status code +func (o *DeleteIncidentTypeOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete incident type o k response a status code equal to that given +func (o *DeleteIncidentTypeOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteIncidentTypeOK) Error() string { + return fmt.Sprintf("[DELETE /v1/incident_types/{id}][%d] deleteIncidentTypeOK %+v", 200, o.Payload) +} + +func (o *DeleteIncidentTypeOK) String() string { + return fmt.Sprintf("[DELETE /v1/incident_types/{id}][%d] deleteIncidentTypeOK %+v", 200, o.Payload) +} + +func (o *DeleteIncidentTypeOK) GetPayload() *models.IncidentTypeEntity { + return o.Payload +} + +func (o *DeleteIncidentTypeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentTypeEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/delete_lifecycle_measurement_definition_parameters.go b/client/incident_settings/delete_lifecycle_measurement_definition_parameters.go new file mode 100644 index 0000000..eabaeee --- /dev/null +++ b/client/incident_settings/delete_lifecycle_measurement_definition_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteLifecycleMeasurementDefinitionParams creates a new DeleteLifecycleMeasurementDefinitionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteLifecycleMeasurementDefinitionParams() *DeleteLifecycleMeasurementDefinitionParams { + return &DeleteLifecycleMeasurementDefinitionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteLifecycleMeasurementDefinitionParamsWithTimeout creates a new DeleteLifecycleMeasurementDefinitionParams object +// with the ability to set a timeout on a request. +func NewDeleteLifecycleMeasurementDefinitionParamsWithTimeout(timeout time.Duration) *DeleteLifecycleMeasurementDefinitionParams { + return &DeleteLifecycleMeasurementDefinitionParams{ + timeout: timeout, + } +} + +// NewDeleteLifecycleMeasurementDefinitionParamsWithContext creates a new DeleteLifecycleMeasurementDefinitionParams object +// with the ability to set a context for a request. +func NewDeleteLifecycleMeasurementDefinitionParamsWithContext(ctx context.Context) *DeleteLifecycleMeasurementDefinitionParams { + return &DeleteLifecycleMeasurementDefinitionParams{ + Context: ctx, + } +} + +// NewDeleteLifecycleMeasurementDefinitionParamsWithHTTPClient creates a new DeleteLifecycleMeasurementDefinitionParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteLifecycleMeasurementDefinitionParamsWithHTTPClient(client *http.Client) *DeleteLifecycleMeasurementDefinitionParams { + return &DeleteLifecycleMeasurementDefinitionParams{ + HTTPClient: client, + } +} + +/* +DeleteLifecycleMeasurementDefinitionParams contains all the parameters to send to the API endpoint + + for the delete lifecycle measurement definition operation. + + Typically these are written to a http.Request. +*/ +type DeleteLifecycleMeasurementDefinitionParams struct { + + // MeasurementDefinitionID. + MeasurementDefinitionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete lifecycle measurement definition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteLifecycleMeasurementDefinitionParams) WithDefaults() *DeleteLifecycleMeasurementDefinitionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete lifecycle measurement definition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteLifecycleMeasurementDefinitionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete lifecycle measurement definition params +func (o *DeleteLifecycleMeasurementDefinitionParams) WithTimeout(timeout time.Duration) *DeleteLifecycleMeasurementDefinitionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete lifecycle measurement definition params +func (o *DeleteLifecycleMeasurementDefinitionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete lifecycle measurement definition params +func (o *DeleteLifecycleMeasurementDefinitionParams) WithContext(ctx context.Context) *DeleteLifecycleMeasurementDefinitionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete lifecycle measurement definition params +func (o *DeleteLifecycleMeasurementDefinitionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete lifecycle measurement definition params +func (o *DeleteLifecycleMeasurementDefinitionParams) WithHTTPClient(client *http.Client) *DeleteLifecycleMeasurementDefinitionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete lifecycle measurement definition params +func (o *DeleteLifecycleMeasurementDefinitionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMeasurementDefinitionID adds the measurementDefinitionID to the delete lifecycle measurement definition params +func (o *DeleteLifecycleMeasurementDefinitionParams) WithMeasurementDefinitionID(measurementDefinitionID string) *DeleteLifecycleMeasurementDefinitionParams { + o.SetMeasurementDefinitionID(measurementDefinitionID) + return o +} + +// SetMeasurementDefinitionID adds the measurementDefinitionId to the delete lifecycle measurement definition params +func (o *DeleteLifecycleMeasurementDefinitionParams) SetMeasurementDefinitionID(measurementDefinitionID string) { + o.MeasurementDefinitionID = measurementDefinitionID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteLifecycleMeasurementDefinitionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param measurement_definition_id + if err := r.SetPathParam("measurement_definition_id", o.MeasurementDefinitionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/delete_lifecycle_measurement_definition_responses.go b/client/incident_settings/delete_lifecycle_measurement_definition_responses.go new file mode 100644 index 0000000..eee3f94 --- /dev/null +++ b/client/incident_settings/delete_lifecycle_measurement_definition_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteLifecycleMeasurementDefinitionReader is a Reader for the DeleteLifecycleMeasurementDefinition structure. +type DeleteLifecycleMeasurementDefinitionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteLifecycleMeasurementDefinitionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteLifecycleMeasurementDefinitionNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteLifecycleMeasurementDefinitionNoContent creates a DeleteLifecycleMeasurementDefinitionNoContent with default headers values +func NewDeleteLifecycleMeasurementDefinitionNoContent() *DeleteLifecycleMeasurementDefinitionNoContent { + return &DeleteLifecycleMeasurementDefinitionNoContent{} +} + +/* +DeleteLifecycleMeasurementDefinitionNoContent describes a response with status code 204, with default header values. + +Archives a measurement definition which will hide it from lists and metrics +*/ +type DeleteLifecycleMeasurementDefinitionNoContent struct { +} + +// IsSuccess returns true when this delete lifecycle measurement definition no content response has a 2xx status code +func (o *DeleteLifecycleMeasurementDefinitionNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete lifecycle measurement definition no content response has a 3xx status code +func (o *DeleteLifecycleMeasurementDefinitionNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete lifecycle measurement definition no content response has a 4xx status code +func (o *DeleteLifecycleMeasurementDefinitionNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete lifecycle measurement definition no content response has a 5xx status code +func (o *DeleteLifecycleMeasurementDefinitionNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete lifecycle measurement definition no content response a status code equal to that given +func (o *DeleteLifecycleMeasurementDefinitionNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteLifecycleMeasurementDefinitionNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/lifecycles/measurement_definitions/{measurement_definition_id}][%d] deleteLifecycleMeasurementDefinitionNoContent ", 204) +} + +func (o *DeleteLifecycleMeasurementDefinitionNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/lifecycles/measurement_definitions/{measurement_definition_id}][%d] deleteLifecycleMeasurementDefinitionNoContent ", 204) +} + +func (o *DeleteLifecycleMeasurementDefinitionNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/incident_settings/delete_lifecycle_milestone_parameters.go b/client/incident_settings/delete_lifecycle_milestone_parameters.go new file mode 100644 index 0000000..278e43e --- /dev/null +++ b/client/incident_settings/delete_lifecycle_milestone_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteLifecycleMilestoneParams creates a new DeleteLifecycleMilestoneParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteLifecycleMilestoneParams() *DeleteLifecycleMilestoneParams { + return &DeleteLifecycleMilestoneParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteLifecycleMilestoneParamsWithTimeout creates a new DeleteLifecycleMilestoneParams object +// with the ability to set a timeout on a request. +func NewDeleteLifecycleMilestoneParamsWithTimeout(timeout time.Duration) *DeleteLifecycleMilestoneParams { + return &DeleteLifecycleMilestoneParams{ + timeout: timeout, + } +} + +// NewDeleteLifecycleMilestoneParamsWithContext creates a new DeleteLifecycleMilestoneParams object +// with the ability to set a context for a request. +func NewDeleteLifecycleMilestoneParamsWithContext(ctx context.Context) *DeleteLifecycleMilestoneParams { + return &DeleteLifecycleMilestoneParams{ + Context: ctx, + } +} + +// NewDeleteLifecycleMilestoneParamsWithHTTPClient creates a new DeleteLifecycleMilestoneParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteLifecycleMilestoneParamsWithHTTPClient(client *http.Client) *DeleteLifecycleMilestoneParams { + return &DeleteLifecycleMilestoneParams{ + HTTPClient: client, + } +} + +/* +DeleteLifecycleMilestoneParams contains all the parameters to send to the API endpoint + + for the delete lifecycle milestone operation. + + Typically these are written to a http.Request. +*/ +type DeleteLifecycleMilestoneParams struct { + + // MilestoneID. + MilestoneID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete lifecycle milestone params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteLifecycleMilestoneParams) WithDefaults() *DeleteLifecycleMilestoneParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete lifecycle milestone params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteLifecycleMilestoneParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete lifecycle milestone params +func (o *DeleteLifecycleMilestoneParams) WithTimeout(timeout time.Duration) *DeleteLifecycleMilestoneParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete lifecycle milestone params +func (o *DeleteLifecycleMilestoneParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete lifecycle milestone params +func (o *DeleteLifecycleMilestoneParams) WithContext(ctx context.Context) *DeleteLifecycleMilestoneParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete lifecycle milestone params +func (o *DeleteLifecycleMilestoneParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete lifecycle milestone params +func (o *DeleteLifecycleMilestoneParams) WithHTTPClient(client *http.Client) *DeleteLifecycleMilestoneParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete lifecycle milestone params +func (o *DeleteLifecycleMilestoneParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMilestoneID adds the milestoneID to the delete lifecycle milestone params +func (o *DeleteLifecycleMilestoneParams) WithMilestoneID(milestoneID string) *DeleteLifecycleMilestoneParams { + o.SetMilestoneID(milestoneID) + return o +} + +// SetMilestoneID adds the milestoneId to the delete lifecycle milestone params +func (o *DeleteLifecycleMilestoneParams) SetMilestoneID(milestoneID string) { + o.MilestoneID = milestoneID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteLifecycleMilestoneParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param milestone_id + if err := r.SetPathParam("milestone_id", o.MilestoneID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/delete_lifecycle_milestone_responses.go b/client/incident_settings/delete_lifecycle_milestone_responses.go new file mode 100644 index 0000000..4c87866 --- /dev/null +++ b/client/incident_settings/delete_lifecycle_milestone_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteLifecycleMilestoneReader is a Reader for the DeleteLifecycleMilestone structure. +type DeleteLifecycleMilestoneReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteLifecycleMilestoneReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteLifecycleMilestoneOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteLifecycleMilestoneOK creates a DeleteLifecycleMilestoneOK with default headers values +func NewDeleteLifecycleMilestoneOK() *DeleteLifecycleMilestoneOK { + return &DeleteLifecycleMilestoneOK{} +} + +/* +DeleteLifecycleMilestoneOK describes a response with status code 200, with default header values. + +Delete a milestone +*/ +type DeleteLifecycleMilestoneOK struct { + Payload *models.LifecyclesPhaseEntity +} + +// IsSuccess returns true when this delete lifecycle milestone o k response has a 2xx status code +func (o *DeleteLifecycleMilestoneOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete lifecycle milestone o k response has a 3xx status code +func (o *DeleteLifecycleMilestoneOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete lifecycle milestone o k response has a 4xx status code +func (o *DeleteLifecycleMilestoneOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete lifecycle milestone o k response has a 5xx status code +func (o *DeleteLifecycleMilestoneOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete lifecycle milestone o k response a status code equal to that given +func (o *DeleteLifecycleMilestoneOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteLifecycleMilestoneOK) Error() string { + return fmt.Sprintf("[DELETE /v1/lifecycles/milestones/{milestone_id}][%d] deleteLifecycleMilestoneOK %+v", 200, o.Payload) +} + +func (o *DeleteLifecycleMilestoneOK) String() string { + return fmt.Sprintf("[DELETE /v1/lifecycles/milestones/{milestone_id}][%d] deleteLifecycleMilestoneOK %+v", 200, o.Payload) +} + +func (o *DeleteLifecycleMilestoneOK) GetPayload() *models.LifecyclesPhaseEntity { + return o.Payload +} + +func (o *DeleteLifecycleMilestoneOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.LifecyclesPhaseEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/delete_priority_parameters.go b/client/incident_settings/delete_priority_parameters.go new file mode 100644 index 0000000..f2a8544 --- /dev/null +++ b/client/incident_settings/delete_priority_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeletePriorityParams creates a new DeletePriorityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeletePriorityParams() *DeletePriorityParams { + return &DeletePriorityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeletePriorityParamsWithTimeout creates a new DeletePriorityParams object +// with the ability to set a timeout on a request. +func NewDeletePriorityParamsWithTimeout(timeout time.Duration) *DeletePriorityParams { + return &DeletePriorityParams{ + timeout: timeout, + } +} + +// NewDeletePriorityParamsWithContext creates a new DeletePriorityParams object +// with the ability to set a context for a request. +func NewDeletePriorityParamsWithContext(ctx context.Context) *DeletePriorityParams { + return &DeletePriorityParams{ + Context: ctx, + } +} + +// NewDeletePriorityParamsWithHTTPClient creates a new DeletePriorityParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeletePriorityParamsWithHTTPClient(client *http.Client) *DeletePriorityParams { + return &DeletePriorityParams{ + HTTPClient: client, + } +} + +/* +DeletePriorityParams contains all the parameters to send to the API endpoint + + for the delete priority operation. + + Typically these are written to a http.Request. +*/ +type DeletePriorityParams struct { + + // PrioritySlug. + PrioritySlug string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeletePriorityParams) WithDefaults() *DeletePriorityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeletePriorityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete priority params +func (o *DeletePriorityParams) WithTimeout(timeout time.Duration) *DeletePriorityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete priority params +func (o *DeletePriorityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete priority params +func (o *DeletePriorityParams) WithContext(ctx context.Context) *DeletePriorityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete priority params +func (o *DeletePriorityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete priority params +func (o *DeletePriorityParams) WithHTTPClient(client *http.Client) *DeletePriorityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete priority params +func (o *DeletePriorityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPrioritySlug adds the prioritySlug to the delete priority params +func (o *DeletePriorityParams) WithPrioritySlug(prioritySlug string) *DeletePriorityParams { + o.SetPrioritySlug(prioritySlug) + return o +} + +// SetPrioritySlug adds the prioritySlug to the delete priority params +func (o *DeletePriorityParams) SetPrioritySlug(prioritySlug string) { + o.PrioritySlug = prioritySlug +} + +// WriteToRequest writes these params to a swagger request +func (o *DeletePriorityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param priority_slug + if err := r.SetPathParam("priority_slug", o.PrioritySlug); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/delete_priority_responses.go b/client/incident_settings/delete_priority_responses.go new file mode 100644 index 0000000..578c9af --- /dev/null +++ b/client/incident_settings/delete_priority_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeletePriorityReader is a Reader for the DeletePriority structure. +type DeletePriorityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeletePriorityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeletePriorityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeletePriorityOK creates a DeletePriorityOK with default headers values +func NewDeletePriorityOK() *DeletePriorityOK { + return &DeletePriorityOK{} +} + +/* +DeletePriorityOK describes a response with status code 200, with default header values. + +Delete a specific priority +*/ +type DeletePriorityOK struct { + Payload *models.PriorityEntity +} + +// IsSuccess returns true when this delete priority o k response has a 2xx status code +func (o *DeletePriorityOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete priority o k response has a 3xx status code +func (o *DeletePriorityOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete priority o k response has a 4xx status code +func (o *DeletePriorityOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete priority o k response has a 5xx status code +func (o *DeletePriorityOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete priority o k response a status code equal to that given +func (o *DeletePriorityOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeletePriorityOK) Error() string { + return fmt.Sprintf("[DELETE /v1/priorities/{priority_slug}][%d] deletePriorityOK %+v", 200, o.Payload) +} + +func (o *DeletePriorityOK) String() string { + return fmt.Sprintf("[DELETE /v1/priorities/{priority_slug}][%d] deletePriorityOK %+v", 200, o.Payload) +} + +func (o *DeletePriorityOK) GetPayload() *models.PriorityEntity { + return o.Payload +} + +func (o *DeletePriorityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PriorityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/delete_severity_matrix_condition_parameters.go b/client/incident_settings/delete_severity_matrix_condition_parameters.go new file mode 100644 index 0000000..88d0de1 --- /dev/null +++ b/client/incident_settings/delete_severity_matrix_condition_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteSeverityMatrixConditionParams creates a new DeleteSeverityMatrixConditionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteSeverityMatrixConditionParams() *DeleteSeverityMatrixConditionParams { + return &DeleteSeverityMatrixConditionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSeverityMatrixConditionParamsWithTimeout creates a new DeleteSeverityMatrixConditionParams object +// with the ability to set a timeout on a request. +func NewDeleteSeverityMatrixConditionParamsWithTimeout(timeout time.Duration) *DeleteSeverityMatrixConditionParams { + return &DeleteSeverityMatrixConditionParams{ + timeout: timeout, + } +} + +// NewDeleteSeverityMatrixConditionParamsWithContext creates a new DeleteSeverityMatrixConditionParams object +// with the ability to set a context for a request. +func NewDeleteSeverityMatrixConditionParamsWithContext(ctx context.Context) *DeleteSeverityMatrixConditionParams { + return &DeleteSeverityMatrixConditionParams{ + Context: ctx, + } +} + +// NewDeleteSeverityMatrixConditionParamsWithHTTPClient creates a new DeleteSeverityMatrixConditionParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteSeverityMatrixConditionParamsWithHTTPClient(client *http.Client) *DeleteSeverityMatrixConditionParams { + return &DeleteSeverityMatrixConditionParams{ + HTTPClient: client, + } +} + +/* +DeleteSeverityMatrixConditionParams contains all the parameters to send to the API endpoint + + for the delete severity matrix condition operation. + + Typically these are written to a http.Request. +*/ +type DeleteSeverityMatrixConditionParams struct { + + // ConditionID. + ConditionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete severity matrix condition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSeverityMatrixConditionParams) WithDefaults() *DeleteSeverityMatrixConditionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete severity matrix condition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSeverityMatrixConditionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete severity matrix condition params +func (o *DeleteSeverityMatrixConditionParams) WithTimeout(timeout time.Duration) *DeleteSeverityMatrixConditionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete severity matrix condition params +func (o *DeleteSeverityMatrixConditionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete severity matrix condition params +func (o *DeleteSeverityMatrixConditionParams) WithContext(ctx context.Context) *DeleteSeverityMatrixConditionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete severity matrix condition params +func (o *DeleteSeverityMatrixConditionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete severity matrix condition params +func (o *DeleteSeverityMatrixConditionParams) WithHTTPClient(client *http.Client) *DeleteSeverityMatrixConditionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete severity matrix condition params +func (o *DeleteSeverityMatrixConditionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConditionID adds the conditionID to the delete severity matrix condition params +func (o *DeleteSeverityMatrixConditionParams) WithConditionID(conditionID string) *DeleteSeverityMatrixConditionParams { + o.SetConditionID(conditionID) + return o +} + +// SetConditionID adds the conditionId to the delete severity matrix condition params +func (o *DeleteSeverityMatrixConditionParams) SetConditionID(conditionID string) { + o.ConditionID = conditionID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSeverityMatrixConditionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param condition_id + if err := r.SetPathParam("condition_id", o.ConditionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/delete_severity_matrix_condition_responses.go b/client/incident_settings/delete_severity_matrix_condition_responses.go new file mode 100644 index 0000000..af92006 --- /dev/null +++ b/client/incident_settings/delete_severity_matrix_condition_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteSeverityMatrixConditionReader is a Reader for the DeleteSeverityMatrixCondition structure. +type DeleteSeverityMatrixConditionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSeverityMatrixConditionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteSeverityMatrixConditionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteSeverityMatrixConditionOK creates a DeleteSeverityMatrixConditionOK with default headers values +func NewDeleteSeverityMatrixConditionOK() *DeleteSeverityMatrixConditionOK { + return &DeleteSeverityMatrixConditionOK{} +} + +/* +DeleteSeverityMatrixConditionOK describes a response with status code 200, with default header values. + +Delete a specific condition +*/ +type DeleteSeverityMatrixConditionOK struct { + Payload *models.SeverityMatrixConditionEntity +} + +// IsSuccess returns true when this delete severity matrix condition o k response has a 2xx status code +func (o *DeleteSeverityMatrixConditionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete severity matrix condition o k response has a 3xx status code +func (o *DeleteSeverityMatrixConditionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete severity matrix condition o k response has a 4xx status code +func (o *DeleteSeverityMatrixConditionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete severity matrix condition o k response has a 5xx status code +func (o *DeleteSeverityMatrixConditionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete severity matrix condition o k response a status code equal to that given +func (o *DeleteSeverityMatrixConditionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteSeverityMatrixConditionOK) Error() string { + return fmt.Sprintf("[DELETE /v1/severity_matrix/conditions/{condition_id}][%d] deleteSeverityMatrixConditionOK %+v", 200, o.Payload) +} + +func (o *DeleteSeverityMatrixConditionOK) String() string { + return fmt.Sprintf("[DELETE /v1/severity_matrix/conditions/{condition_id}][%d] deleteSeverityMatrixConditionOK %+v", 200, o.Payload) +} + +func (o *DeleteSeverityMatrixConditionOK) GetPayload() *models.SeverityMatrixConditionEntity { + return o.Payload +} + +func (o *DeleteSeverityMatrixConditionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityMatrixConditionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/delete_severity_matrix_impact_parameters.go b/client/incident_settings/delete_severity_matrix_impact_parameters.go new file mode 100644 index 0000000..11505bd --- /dev/null +++ b/client/incident_settings/delete_severity_matrix_impact_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteSeverityMatrixImpactParams creates a new DeleteSeverityMatrixImpactParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteSeverityMatrixImpactParams() *DeleteSeverityMatrixImpactParams { + return &DeleteSeverityMatrixImpactParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSeverityMatrixImpactParamsWithTimeout creates a new DeleteSeverityMatrixImpactParams object +// with the ability to set a timeout on a request. +func NewDeleteSeverityMatrixImpactParamsWithTimeout(timeout time.Duration) *DeleteSeverityMatrixImpactParams { + return &DeleteSeverityMatrixImpactParams{ + timeout: timeout, + } +} + +// NewDeleteSeverityMatrixImpactParamsWithContext creates a new DeleteSeverityMatrixImpactParams object +// with the ability to set a context for a request. +func NewDeleteSeverityMatrixImpactParamsWithContext(ctx context.Context) *DeleteSeverityMatrixImpactParams { + return &DeleteSeverityMatrixImpactParams{ + Context: ctx, + } +} + +// NewDeleteSeverityMatrixImpactParamsWithHTTPClient creates a new DeleteSeverityMatrixImpactParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteSeverityMatrixImpactParamsWithHTTPClient(client *http.Client) *DeleteSeverityMatrixImpactParams { + return &DeleteSeverityMatrixImpactParams{ + HTTPClient: client, + } +} + +/* +DeleteSeverityMatrixImpactParams contains all the parameters to send to the API endpoint + + for the delete severity matrix impact operation. + + Typically these are written to a http.Request. +*/ +type DeleteSeverityMatrixImpactParams struct { + + // ImpactID. + ImpactID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete severity matrix impact params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSeverityMatrixImpactParams) WithDefaults() *DeleteSeverityMatrixImpactParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete severity matrix impact params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSeverityMatrixImpactParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete severity matrix impact params +func (o *DeleteSeverityMatrixImpactParams) WithTimeout(timeout time.Duration) *DeleteSeverityMatrixImpactParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete severity matrix impact params +func (o *DeleteSeverityMatrixImpactParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete severity matrix impact params +func (o *DeleteSeverityMatrixImpactParams) WithContext(ctx context.Context) *DeleteSeverityMatrixImpactParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete severity matrix impact params +func (o *DeleteSeverityMatrixImpactParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete severity matrix impact params +func (o *DeleteSeverityMatrixImpactParams) WithHTTPClient(client *http.Client) *DeleteSeverityMatrixImpactParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete severity matrix impact params +func (o *DeleteSeverityMatrixImpactParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpactID adds the impactID to the delete severity matrix impact params +func (o *DeleteSeverityMatrixImpactParams) WithImpactID(impactID string) *DeleteSeverityMatrixImpactParams { + o.SetImpactID(impactID) + return o +} + +// SetImpactID adds the impactId to the delete severity matrix impact params +func (o *DeleteSeverityMatrixImpactParams) SetImpactID(impactID string) { + o.ImpactID = impactID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSeverityMatrixImpactParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param impact_id + if err := r.SetPathParam("impact_id", o.ImpactID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/delete_severity_matrix_impact_responses.go b/client/incident_settings/delete_severity_matrix_impact_responses.go new file mode 100644 index 0000000..09e39b0 --- /dev/null +++ b/client/incident_settings/delete_severity_matrix_impact_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteSeverityMatrixImpactReader is a Reader for the DeleteSeverityMatrixImpact structure. +type DeleteSeverityMatrixImpactReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSeverityMatrixImpactReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteSeverityMatrixImpactOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteSeverityMatrixImpactOK creates a DeleteSeverityMatrixImpactOK with default headers values +func NewDeleteSeverityMatrixImpactOK() *DeleteSeverityMatrixImpactOK { + return &DeleteSeverityMatrixImpactOK{} +} + +/* +DeleteSeverityMatrixImpactOK describes a response with status code 200, with default header values. + +Delete a specific impact +*/ +type DeleteSeverityMatrixImpactOK struct { + Payload *models.SeverityMatrixImpactEntity +} + +// IsSuccess returns true when this delete severity matrix impact o k response has a 2xx status code +func (o *DeleteSeverityMatrixImpactOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete severity matrix impact o k response has a 3xx status code +func (o *DeleteSeverityMatrixImpactOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete severity matrix impact o k response has a 4xx status code +func (o *DeleteSeverityMatrixImpactOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete severity matrix impact o k response has a 5xx status code +func (o *DeleteSeverityMatrixImpactOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete severity matrix impact o k response a status code equal to that given +func (o *DeleteSeverityMatrixImpactOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteSeverityMatrixImpactOK) Error() string { + return fmt.Sprintf("[DELETE /v1/severity_matrix/impacts/{impact_id}][%d] deleteSeverityMatrixImpactOK %+v", 200, o.Payload) +} + +func (o *DeleteSeverityMatrixImpactOK) String() string { + return fmt.Sprintf("[DELETE /v1/severity_matrix/impacts/{impact_id}][%d] deleteSeverityMatrixImpactOK %+v", 200, o.Payload) +} + +func (o *DeleteSeverityMatrixImpactOK) GetPayload() *models.SeverityMatrixImpactEntity { + return o.Payload +} + +func (o *DeleteSeverityMatrixImpactOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityMatrixImpactEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/delete_severity_parameters.go b/client/incident_settings/delete_severity_parameters.go new file mode 100644 index 0000000..e21ba14 --- /dev/null +++ b/client/incident_settings/delete_severity_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteSeverityParams creates a new DeleteSeverityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteSeverityParams() *DeleteSeverityParams { + return &DeleteSeverityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSeverityParamsWithTimeout creates a new DeleteSeverityParams object +// with the ability to set a timeout on a request. +func NewDeleteSeverityParamsWithTimeout(timeout time.Duration) *DeleteSeverityParams { + return &DeleteSeverityParams{ + timeout: timeout, + } +} + +// NewDeleteSeverityParamsWithContext creates a new DeleteSeverityParams object +// with the ability to set a context for a request. +func NewDeleteSeverityParamsWithContext(ctx context.Context) *DeleteSeverityParams { + return &DeleteSeverityParams{ + Context: ctx, + } +} + +// NewDeleteSeverityParamsWithHTTPClient creates a new DeleteSeverityParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteSeverityParamsWithHTTPClient(client *http.Client) *DeleteSeverityParams { + return &DeleteSeverityParams{ + HTTPClient: client, + } +} + +/* +DeleteSeverityParams contains all the parameters to send to the API endpoint + + for the delete severity operation. + + Typically these are written to a http.Request. +*/ +type DeleteSeverityParams struct { + + // SeveritySlug. + SeveritySlug string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete severity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSeverityParams) WithDefaults() *DeleteSeverityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete severity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSeverityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete severity params +func (o *DeleteSeverityParams) WithTimeout(timeout time.Duration) *DeleteSeverityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete severity params +func (o *DeleteSeverityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete severity params +func (o *DeleteSeverityParams) WithContext(ctx context.Context) *DeleteSeverityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete severity params +func (o *DeleteSeverityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete severity params +func (o *DeleteSeverityParams) WithHTTPClient(client *http.Client) *DeleteSeverityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete severity params +func (o *DeleteSeverityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSeveritySlug adds the severitySlug to the delete severity params +func (o *DeleteSeverityParams) WithSeveritySlug(severitySlug string) *DeleteSeverityParams { + o.SetSeveritySlug(severitySlug) + return o +} + +// SetSeveritySlug adds the severitySlug to the delete severity params +func (o *DeleteSeverityParams) SetSeveritySlug(severitySlug string) { + o.SeveritySlug = severitySlug +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSeverityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param severity_slug + if err := r.SetPathParam("severity_slug", o.SeveritySlug); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/delete_severity_responses.go b/client/incident_settings/delete_severity_responses.go new file mode 100644 index 0000000..89256ab --- /dev/null +++ b/client/incident_settings/delete_severity_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteSeverityReader is a Reader for the DeleteSeverity structure. +type DeleteSeverityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSeverityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteSeverityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteSeverityOK creates a DeleteSeverityOK with default headers values +func NewDeleteSeverityOK() *DeleteSeverityOK { + return &DeleteSeverityOK{} +} + +/* +DeleteSeverityOK describes a response with status code 200, with default header values. + +Delete a specific severity +*/ +type DeleteSeverityOK struct { + Payload *models.SeverityEntity +} + +// IsSuccess returns true when this delete severity o k response has a 2xx status code +func (o *DeleteSeverityOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete severity o k response has a 3xx status code +func (o *DeleteSeverityOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete severity o k response has a 4xx status code +func (o *DeleteSeverityOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete severity o k response has a 5xx status code +func (o *DeleteSeverityOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete severity o k response a status code equal to that given +func (o *DeleteSeverityOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteSeverityOK) Error() string { + return fmt.Sprintf("[DELETE /v1/severities/{severity_slug}][%d] deleteSeverityOK %+v", 200, o.Payload) +} + +func (o *DeleteSeverityOK) String() string { + return fmt.Sprintf("[DELETE /v1/severities/{severity_slug}][%d] deleteSeverityOK %+v", 200, o.Payload) +} + +func (o *DeleteSeverityOK) GetPayload() *models.SeverityEntity { + return o.Payload +} + +func (o *DeleteSeverityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/get_form_configuration_parameters.go b/client/incident_settings/get_form_configuration_parameters.go new file mode 100644 index 0000000..b3df2c8 --- /dev/null +++ b/client/incident_settings/get_form_configuration_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetFormConfigurationParams creates a new GetFormConfigurationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetFormConfigurationParams() *GetFormConfigurationParams { + return &GetFormConfigurationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetFormConfigurationParamsWithTimeout creates a new GetFormConfigurationParams object +// with the ability to set a timeout on a request. +func NewGetFormConfigurationParamsWithTimeout(timeout time.Duration) *GetFormConfigurationParams { + return &GetFormConfigurationParams{ + timeout: timeout, + } +} + +// NewGetFormConfigurationParamsWithContext creates a new GetFormConfigurationParams object +// with the ability to set a context for a request. +func NewGetFormConfigurationParamsWithContext(ctx context.Context) *GetFormConfigurationParams { + return &GetFormConfigurationParams{ + Context: ctx, + } +} + +// NewGetFormConfigurationParamsWithHTTPClient creates a new GetFormConfigurationParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetFormConfigurationParamsWithHTTPClient(client *http.Client) *GetFormConfigurationParams { + return &GetFormConfigurationParams{ + HTTPClient: client, + } +} + +/* +GetFormConfigurationParams contains all the parameters to send to the API endpoint + + for the get form configuration operation. + + Typically these are written to a http.Request. +*/ +type GetFormConfigurationParams struct { + + // Slug. + Slug string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get form configuration params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFormConfigurationParams) WithDefaults() *GetFormConfigurationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get form configuration params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetFormConfigurationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get form configuration params +func (o *GetFormConfigurationParams) WithTimeout(timeout time.Duration) *GetFormConfigurationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get form configuration params +func (o *GetFormConfigurationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get form configuration params +func (o *GetFormConfigurationParams) WithContext(ctx context.Context) *GetFormConfigurationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get form configuration params +func (o *GetFormConfigurationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get form configuration params +func (o *GetFormConfigurationParams) WithHTTPClient(client *http.Client) *GetFormConfigurationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get form configuration params +func (o *GetFormConfigurationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSlug adds the slug to the get form configuration params +func (o *GetFormConfigurationParams) WithSlug(slug string) *GetFormConfigurationParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the get form configuration params +func (o *GetFormConfigurationParams) SetSlug(slug string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *GetFormConfigurationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param slug + if err := r.SetPathParam("slug", o.Slug); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/get_form_configuration_responses.go b/client/incident_settings/get_form_configuration_responses.go new file mode 100644 index 0000000..f58d7a1 --- /dev/null +++ b/client/incident_settings/get_form_configuration_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetFormConfigurationReader is a Reader for the GetFormConfiguration structure. +type GetFormConfigurationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetFormConfigurationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetFormConfigurationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetFormConfigurationOK creates a GetFormConfigurationOK with default headers values +func NewGetFormConfigurationOK() *GetFormConfigurationOK { + return &GetFormConfigurationOK{} +} + +/* +GetFormConfigurationOK describes a response with status code 200, with default header values. + +Get a form configuration +*/ +type GetFormConfigurationOK struct { + Payload *models.FormConfigurationEntity +} + +// IsSuccess returns true when this get form configuration o k response has a 2xx status code +func (o *GetFormConfigurationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get form configuration o k response has a 3xx status code +func (o *GetFormConfigurationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get form configuration o k response has a 4xx status code +func (o *GetFormConfigurationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get form configuration o k response has a 5xx status code +func (o *GetFormConfigurationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get form configuration o k response a status code equal to that given +func (o *GetFormConfigurationOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetFormConfigurationOK) Error() string { + return fmt.Sprintf("[GET /v1/form_configurations/{slug}][%d] getFormConfigurationOK %+v", 200, o.Payload) +} + +func (o *GetFormConfigurationOK) String() string { + return fmt.Sprintf("[GET /v1/form_configurations/{slug}][%d] getFormConfigurationOK %+v", 200, o.Payload) +} + +func (o *GetFormConfigurationOK) GetPayload() *models.FormConfigurationEntity { + return o.Payload +} + +func (o *GetFormConfigurationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FormConfigurationEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/get_incident_role_parameters.go b/client/incident_settings/get_incident_role_parameters.go new file mode 100644 index 0000000..9004ea2 --- /dev/null +++ b/client/incident_settings/get_incident_role_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetIncidentRoleParams creates a new GetIncidentRoleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetIncidentRoleParams() *GetIncidentRoleParams { + return &GetIncidentRoleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetIncidentRoleParamsWithTimeout creates a new GetIncidentRoleParams object +// with the ability to set a timeout on a request. +func NewGetIncidentRoleParamsWithTimeout(timeout time.Duration) *GetIncidentRoleParams { + return &GetIncidentRoleParams{ + timeout: timeout, + } +} + +// NewGetIncidentRoleParamsWithContext creates a new GetIncidentRoleParams object +// with the ability to set a context for a request. +func NewGetIncidentRoleParamsWithContext(ctx context.Context) *GetIncidentRoleParams { + return &GetIncidentRoleParams{ + Context: ctx, + } +} + +// NewGetIncidentRoleParamsWithHTTPClient creates a new GetIncidentRoleParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetIncidentRoleParamsWithHTTPClient(client *http.Client) *GetIncidentRoleParams { + return &GetIncidentRoleParams{ + HTTPClient: client, + } +} + +/* +GetIncidentRoleParams contains all the parameters to send to the API endpoint + + for the get incident role operation. + + Typically these are written to a http.Request. +*/ +type GetIncidentRoleParams struct { + + // IncidentRoleID. + IncidentRoleID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get incident role params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentRoleParams) WithDefaults() *GetIncidentRoleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get incident role params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentRoleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get incident role params +func (o *GetIncidentRoleParams) WithTimeout(timeout time.Duration) *GetIncidentRoleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get incident role params +func (o *GetIncidentRoleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get incident role params +func (o *GetIncidentRoleParams) WithContext(ctx context.Context) *GetIncidentRoleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get incident role params +func (o *GetIncidentRoleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get incident role params +func (o *GetIncidentRoleParams) WithHTTPClient(client *http.Client) *GetIncidentRoleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get incident role params +func (o *GetIncidentRoleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentRoleID adds the incidentRoleID to the get incident role params +func (o *GetIncidentRoleParams) WithIncidentRoleID(incidentRoleID string) *GetIncidentRoleParams { + o.SetIncidentRoleID(incidentRoleID) + return o +} + +// SetIncidentRoleID adds the incidentRoleId to the get incident role params +func (o *GetIncidentRoleParams) SetIncidentRoleID(incidentRoleID string) { + o.IncidentRoleID = incidentRoleID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetIncidentRoleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_role_id + if err := r.SetPathParam("incident_role_id", o.IncidentRoleID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/get_incident_role_responses.go b/client/incident_settings/get_incident_role_responses.go new file mode 100644 index 0000000..ee09a7a --- /dev/null +++ b/client/incident_settings/get_incident_role_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetIncidentRoleReader is a Reader for the GetIncidentRole structure. +type GetIncidentRoleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetIncidentRoleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetIncidentRoleOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetIncidentRoleOK creates a GetIncidentRoleOK with default headers values +func NewGetIncidentRoleOK() *GetIncidentRoleOK { + return &GetIncidentRoleOK{} +} + +/* +GetIncidentRoleOK describes a response with status code 200, with default header values. + +Retrieve a single incident role from its ID +*/ +type GetIncidentRoleOK struct { + Payload *models.IncidentRoleEntity +} + +// IsSuccess returns true when this get incident role o k response has a 2xx status code +func (o *GetIncidentRoleOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get incident role o k response has a 3xx status code +func (o *GetIncidentRoleOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get incident role o k response has a 4xx status code +func (o *GetIncidentRoleOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get incident role o k response has a 5xx status code +func (o *GetIncidentRoleOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get incident role o k response a status code equal to that given +func (o *GetIncidentRoleOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetIncidentRoleOK) Error() string { + return fmt.Sprintf("[GET /v1/incident_roles/{incident_role_id}][%d] getIncidentRoleOK %+v", 200, o.Payload) +} + +func (o *GetIncidentRoleOK) String() string { + return fmt.Sprintf("[GET /v1/incident_roles/{incident_role_id}][%d] getIncidentRoleOK %+v", 200, o.Payload) +} + +func (o *GetIncidentRoleOK) GetPayload() *models.IncidentRoleEntity { + return o.Payload +} + +func (o *GetIncidentRoleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentRoleEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/get_incident_type_parameters.go b/client/incident_settings/get_incident_type_parameters.go new file mode 100644 index 0000000..44a2c7d --- /dev/null +++ b/client/incident_settings/get_incident_type_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetIncidentTypeParams creates a new GetIncidentTypeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetIncidentTypeParams() *GetIncidentTypeParams { + return &GetIncidentTypeParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetIncidentTypeParamsWithTimeout creates a new GetIncidentTypeParams object +// with the ability to set a timeout on a request. +func NewGetIncidentTypeParamsWithTimeout(timeout time.Duration) *GetIncidentTypeParams { + return &GetIncidentTypeParams{ + timeout: timeout, + } +} + +// NewGetIncidentTypeParamsWithContext creates a new GetIncidentTypeParams object +// with the ability to set a context for a request. +func NewGetIncidentTypeParamsWithContext(ctx context.Context) *GetIncidentTypeParams { + return &GetIncidentTypeParams{ + Context: ctx, + } +} + +// NewGetIncidentTypeParamsWithHTTPClient creates a new GetIncidentTypeParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetIncidentTypeParamsWithHTTPClient(client *http.Client) *GetIncidentTypeParams { + return &GetIncidentTypeParams{ + HTTPClient: client, + } +} + +/* +GetIncidentTypeParams contains all the parameters to send to the API endpoint + + for the get incident type operation. + + Typically these are written to a http.Request. +*/ +type GetIncidentTypeParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get incident type params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentTypeParams) WithDefaults() *GetIncidentTypeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get incident type params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentTypeParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get incident type params +func (o *GetIncidentTypeParams) WithTimeout(timeout time.Duration) *GetIncidentTypeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get incident type params +func (o *GetIncidentTypeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get incident type params +func (o *GetIncidentTypeParams) WithContext(ctx context.Context) *GetIncidentTypeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get incident type params +func (o *GetIncidentTypeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get incident type params +func (o *GetIncidentTypeParams) WithHTTPClient(client *http.Client) *GetIncidentTypeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get incident type params +func (o *GetIncidentTypeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get incident type params +func (o *GetIncidentTypeParams) WithID(id string) *GetIncidentTypeParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get incident type params +func (o *GetIncidentTypeParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *GetIncidentTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/get_incident_type_responses.go b/client/incident_settings/get_incident_type_responses.go new file mode 100644 index 0000000..c7b4d91 --- /dev/null +++ b/client/incident_settings/get_incident_type_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetIncidentTypeReader is a Reader for the GetIncidentType structure. +type GetIncidentTypeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetIncidentTypeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetIncidentTypeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetIncidentTypeOK creates a GetIncidentTypeOK with default headers values +func NewGetIncidentTypeOK() *GetIncidentTypeOK { + return &GetIncidentTypeOK{} +} + +/* +GetIncidentTypeOK describes a response with status code 200, with default header values. + +Retrieve a single incident type from its ID +*/ +type GetIncidentTypeOK struct { + Payload *models.IncidentTypeEntity +} + +// IsSuccess returns true when this get incident type o k response has a 2xx status code +func (o *GetIncidentTypeOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get incident type o k response has a 3xx status code +func (o *GetIncidentTypeOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get incident type o k response has a 4xx status code +func (o *GetIncidentTypeOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get incident type o k response has a 5xx status code +func (o *GetIncidentTypeOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get incident type o k response a status code equal to that given +func (o *GetIncidentTypeOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetIncidentTypeOK) Error() string { + return fmt.Sprintf("[GET /v1/incident_types/{id}][%d] getIncidentTypeOK %+v", 200, o.Payload) +} + +func (o *GetIncidentTypeOK) String() string { + return fmt.Sprintf("[GET /v1/incident_types/{id}][%d] getIncidentTypeOK %+v", 200, o.Payload) +} + +func (o *GetIncidentTypeOK) GetPayload() *models.IncidentTypeEntity { + return o.Payload +} + +func (o *GetIncidentTypeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentTypeEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/get_lifecycle_measurement_definition_parameters.go b/client/incident_settings/get_lifecycle_measurement_definition_parameters.go new file mode 100644 index 0000000..df00281 --- /dev/null +++ b/client/incident_settings/get_lifecycle_measurement_definition_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetLifecycleMeasurementDefinitionParams creates a new GetLifecycleMeasurementDefinitionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetLifecycleMeasurementDefinitionParams() *GetLifecycleMeasurementDefinitionParams { + return &GetLifecycleMeasurementDefinitionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetLifecycleMeasurementDefinitionParamsWithTimeout creates a new GetLifecycleMeasurementDefinitionParams object +// with the ability to set a timeout on a request. +func NewGetLifecycleMeasurementDefinitionParamsWithTimeout(timeout time.Duration) *GetLifecycleMeasurementDefinitionParams { + return &GetLifecycleMeasurementDefinitionParams{ + timeout: timeout, + } +} + +// NewGetLifecycleMeasurementDefinitionParamsWithContext creates a new GetLifecycleMeasurementDefinitionParams object +// with the ability to set a context for a request. +func NewGetLifecycleMeasurementDefinitionParamsWithContext(ctx context.Context) *GetLifecycleMeasurementDefinitionParams { + return &GetLifecycleMeasurementDefinitionParams{ + Context: ctx, + } +} + +// NewGetLifecycleMeasurementDefinitionParamsWithHTTPClient creates a new GetLifecycleMeasurementDefinitionParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetLifecycleMeasurementDefinitionParamsWithHTTPClient(client *http.Client) *GetLifecycleMeasurementDefinitionParams { + return &GetLifecycleMeasurementDefinitionParams{ + HTTPClient: client, + } +} + +/* +GetLifecycleMeasurementDefinitionParams contains all the parameters to send to the API endpoint + + for the get lifecycle measurement definition operation. + + Typically these are written to a http.Request. +*/ +type GetLifecycleMeasurementDefinitionParams struct { + + // MeasurementDefinitionID. + MeasurementDefinitionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get lifecycle measurement definition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLifecycleMeasurementDefinitionParams) WithDefaults() *GetLifecycleMeasurementDefinitionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get lifecycle measurement definition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLifecycleMeasurementDefinitionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get lifecycle measurement definition params +func (o *GetLifecycleMeasurementDefinitionParams) WithTimeout(timeout time.Duration) *GetLifecycleMeasurementDefinitionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get lifecycle measurement definition params +func (o *GetLifecycleMeasurementDefinitionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get lifecycle measurement definition params +func (o *GetLifecycleMeasurementDefinitionParams) WithContext(ctx context.Context) *GetLifecycleMeasurementDefinitionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get lifecycle measurement definition params +func (o *GetLifecycleMeasurementDefinitionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get lifecycle measurement definition params +func (o *GetLifecycleMeasurementDefinitionParams) WithHTTPClient(client *http.Client) *GetLifecycleMeasurementDefinitionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get lifecycle measurement definition params +func (o *GetLifecycleMeasurementDefinitionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMeasurementDefinitionID adds the measurementDefinitionID to the get lifecycle measurement definition params +func (o *GetLifecycleMeasurementDefinitionParams) WithMeasurementDefinitionID(measurementDefinitionID string) *GetLifecycleMeasurementDefinitionParams { + o.SetMeasurementDefinitionID(measurementDefinitionID) + return o +} + +// SetMeasurementDefinitionID adds the measurementDefinitionId to the get lifecycle measurement definition params +func (o *GetLifecycleMeasurementDefinitionParams) SetMeasurementDefinitionID(measurementDefinitionID string) { + o.MeasurementDefinitionID = measurementDefinitionID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetLifecycleMeasurementDefinitionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param measurement_definition_id + if err := r.SetPathParam("measurement_definition_id", o.MeasurementDefinitionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/get_lifecycle_measurement_definition_responses.go b/client/incident_settings/get_lifecycle_measurement_definition_responses.go new file mode 100644 index 0000000..20c66c7 --- /dev/null +++ b/client/incident_settings/get_lifecycle_measurement_definition_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetLifecycleMeasurementDefinitionReader is a Reader for the GetLifecycleMeasurementDefinition structure. +type GetLifecycleMeasurementDefinitionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetLifecycleMeasurementDefinitionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetLifecycleMeasurementDefinitionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetLifecycleMeasurementDefinitionOK creates a GetLifecycleMeasurementDefinitionOK with default headers values +func NewGetLifecycleMeasurementDefinitionOK() *GetLifecycleMeasurementDefinitionOK { + return &GetLifecycleMeasurementDefinitionOK{} +} + +/* +GetLifecycleMeasurementDefinitionOK describes a response with status code 200, with default header values. + +Retrieve a single measurement definition from its ID +*/ +type GetLifecycleMeasurementDefinitionOK struct { +} + +// IsSuccess returns true when this get lifecycle measurement definition o k response has a 2xx status code +func (o *GetLifecycleMeasurementDefinitionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get lifecycle measurement definition o k response has a 3xx status code +func (o *GetLifecycleMeasurementDefinitionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get lifecycle measurement definition o k response has a 4xx status code +func (o *GetLifecycleMeasurementDefinitionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get lifecycle measurement definition o k response has a 5xx status code +func (o *GetLifecycleMeasurementDefinitionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get lifecycle measurement definition o k response a status code equal to that given +func (o *GetLifecycleMeasurementDefinitionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetLifecycleMeasurementDefinitionOK) Error() string { + return fmt.Sprintf("[GET /v1/lifecycles/measurement_definitions/{measurement_definition_id}][%d] getLifecycleMeasurementDefinitionOK ", 200) +} + +func (o *GetLifecycleMeasurementDefinitionOK) String() string { + return fmt.Sprintf("[GET /v1/lifecycles/measurement_definitions/{measurement_definition_id}][%d] getLifecycleMeasurementDefinitionOK ", 200) +} + +func (o *GetLifecycleMeasurementDefinitionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/incident_settings/get_priority_parameters.go b/client/incident_settings/get_priority_parameters.go new file mode 100644 index 0000000..3efb6ff --- /dev/null +++ b/client/incident_settings/get_priority_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetPriorityParams creates a new GetPriorityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetPriorityParams() *GetPriorityParams { + return &GetPriorityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetPriorityParamsWithTimeout creates a new GetPriorityParams object +// with the ability to set a timeout on a request. +func NewGetPriorityParamsWithTimeout(timeout time.Duration) *GetPriorityParams { + return &GetPriorityParams{ + timeout: timeout, + } +} + +// NewGetPriorityParamsWithContext creates a new GetPriorityParams object +// with the ability to set a context for a request. +func NewGetPriorityParamsWithContext(ctx context.Context) *GetPriorityParams { + return &GetPriorityParams{ + Context: ctx, + } +} + +// NewGetPriorityParamsWithHTTPClient creates a new GetPriorityParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetPriorityParamsWithHTTPClient(client *http.Client) *GetPriorityParams { + return &GetPriorityParams{ + HTTPClient: client, + } +} + +/* +GetPriorityParams contains all the parameters to send to the API endpoint + + for the get priority operation. + + Typically these are written to a http.Request. +*/ +type GetPriorityParams struct { + + // PrioritySlug. + PrioritySlug string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPriorityParams) WithDefaults() *GetPriorityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPriorityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get priority params +func (o *GetPriorityParams) WithTimeout(timeout time.Duration) *GetPriorityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get priority params +func (o *GetPriorityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get priority params +func (o *GetPriorityParams) WithContext(ctx context.Context) *GetPriorityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get priority params +func (o *GetPriorityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get priority params +func (o *GetPriorityParams) WithHTTPClient(client *http.Client) *GetPriorityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get priority params +func (o *GetPriorityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPrioritySlug adds the prioritySlug to the get priority params +func (o *GetPriorityParams) WithPrioritySlug(prioritySlug string) *GetPriorityParams { + o.SetPrioritySlug(prioritySlug) + return o +} + +// SetPrioritySlug adds the prioritySlug to the get priority params +func (o *GetPriorityParams) SetPrioritySlug(prioritySlug string) { + o.PrioritySlug = prioritySlug +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPriorityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param priority_slug + if err := r.SetPathParam("priority_slug", o.PrioritySlug); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/get_priority_responses.go b/client/incident_settings/get_priority_responses.go new file mode 100644 index 0000000..768ea6d --- /dev/null +++ b/client/incident_settings/get_priority_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetPriorityReader is a Reader for the GetPriority structure. +type GetPriorityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPriorityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPriorityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetPriorityOK creates a GetPriorityOK with default headers values +func NewGetPriorityOK() *GetPriorityOK { + return &GetPriorityOK{} +} + +/* +GetPriorityOK describes a response with status code 200, with default header values. + +Retrieve a specific priority +*/ +type GetPriorityOK struct { + Payload *models.PriorityEntity +} + +// IsSuccess returns true when this get priority o k response has a 2xx status code +func (o *GetPriorityOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get priority o k response has a 3xx status code +func (o *GetPriorityOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get priority o k response has a 4xx status code +func (o *GetPriorityOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get priority o k response has a 5xx status code +func (o *GetPriorityOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get priority o k response a status code equal to that given +func (o *GetPriorityOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetPriorityOK) Error() string { + return fmt.Sprintf("[GET /v1/priorities/{priority_slug}][%d] getPriorityOK %+v", 200, o.Payload) +} + +func (o *GetPriorityOK) String() string { + return fmt.Sprintf("[GET /v1/priorities/{priority_slug}][%d] getPriorityOK %+v", 200, o.Payload) +} + +func (o *GetPriorityOK) GetPayload() *models.PriorityEntity { + return o.Payload +} + +func (o *GetPriorityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PriorityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/get_severity_matrix_condition_parameters.go b/client/incident_settings/get_severity_matrix_condition_parameters.go new file mode 100644 index 0000000..4fe1b8a --- /dev/null +++ b/client/incident_settings/get_severity_matrix_condition_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSeverityMatrixConditionParams creates a new GetSeverityMatrixConditionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSeverityMatrixConditionParams() *GetSeverityMatrixConditionParams { + return &GetSeverityMatrixConditionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSeverityMatrixConditionParamsWithTimeout creates a new GetSeverityMatrixConditionParams object +// with the ability to set a timeout on a request. +func NewGetSeverityMatrixConditionParamsWithTimeout(timeout time.Duration) *GetSeverityMatrixConditionParams { + return &GetSeverityMatrixConditionParams{ + timeout: timeout, + } +} + +// NewGetSeverityMatrixConditionParamsWithContext creates a new GetSeverityMatrixConditionParams object +// with the ability to set a context for a request. +func NewGetSeverityMatrixConditionParamsWithContext(ctx context.Context) *GetSeverityMatrixConditionParams { + return &GetSeverityMatrixConditionParams{ + Context: ctx, + } +} + +// NewGetSeverityMatrixConditionParamsWithHTTPClient creates a new GetSeverityMatrixConditionParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSeverityMatrixConditionParamsWithHTTPClient(client *http.Client) *GetSeverityMatrixConditionParams { + return &GetSeverityMatrixConditionParams{ + HTTPClient: client, + } +} + +/* +GetSeverityMatrixConditionParams contains all the parameters to send to the API endpoint + + for the get severity matrix condition operation. + + Typically these are written to a http.Request. +*/ +type GetSeverityMatrixConditionParams struct { + + // ConditionID. + ConditionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get severity matrix condition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSeverityMatrixConditionParams) WithDefaults() *GetSeverityMatrixConditionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get severity matrix condition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSeverityMatrixConditionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get severity matrix condition params +func (o *GetSeverityMatrixConditionParams) WithTimeout(timeout time.Duration) *GetSeverityMatrixConditionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get severity matrix condition params +func (o *GetSeverityMatrixConditionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get severity matrix condition params +func (o *GetSeverityMatrixConditionParams) WithContext(ctx context.Context) *GetSeverityMatrixConditionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get severity matrix condition params +func (o *GetSeverityMatrixConditionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get severity matrix condition params +func (o *GetSeverityMatrixConditionParams) WithHTTPClient(client *http.Client) *GetSeverityMatrixConditionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get severity matrix condition params +func (o *GetSeverityMatrixConditionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConditionID adds the conditionID to the get severity matrix condition params +func (o *GetSeverityMatrixConditionParams) WithConditionID(conditionID string) *GetSeverityMatrixConditionParams { + o.SetConditionID(conditionID) + return o +} + +// SetConditionID adds the conditionId to the get severity matrix condition params +func (o *GetSeverityMatrixConditionParams) SetConditionID(conditionID string) { + o.ConditionID = conditionID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSeverityMatrixConditionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param condition_id + if err := r.SetPathParam("condition_id", o.ConditionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/get_severity_matrix_condition_responses.go b/client/incident_settings/get_severity_matrix_condition_responses.go new file mode 100644 index 0000000..f99cf67 --- /dev/null +++ b/client/incident_settings/get_severity_matrix_condition_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetSeverityMatrixConditionReader is a Reader for the GetSeverityMatrixCondition structure. +type GetSeverityMatrixConditionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSeverityMatrixConditionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSeverityMatrixConditionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSeverityMatrixConditionOK creates a GetSeverityMatrixConditionOK with default headers values +func NewGetSeverityMatrixConditionOK() *GetSeverityMatrixConditionOK { + return &GetSeverityMatrixConditionOK{} +} + +/* +GetSeverityMatrixConditionOK describes a response with status code 200, with default header values. + +Retrieve a specific condition +*/ +type GetSeverityMatrixConditionOK struct { + Payload *models.SeverityMatrixConditionEntity +} + +// IsSuccess returns true when this get severity matrix condition o k response has a 2xx status code +func (o *GetSeverityMatrixConditionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get severity matrix condition o k response has a 3xx status code +func (o *GetSeverityMatrixConditionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get severity matrix condition o k response has a 4xx status code +func (o *GetSeverityMatrixConditionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get severity matrix condition o k response has a 5xx status code +func (o *GetSeverityMatrixConditionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get severity matrix condition o k response a status code equal to that given +func (o *GetSeverityMatrixConditionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetSeverityMatrixConditionOK) Error() string { + return fmt.Sprintf("[GET /v1/severity_matrix/conditions/{condition_id}][%d] getSeverityMatrixConditionOK %+v", 200, o.Payload) +} + +func (o *GetSeverityMatrixConditionOK) String() string { + return fmt.Sprintf("[GET /v1/severity_matrix/conditions/{condition_id}][%d] getSeverityMatrixConditionOK %+v", 200, o.Payload) +} + +func (o *GetSeverityMatrixConditionOK) GetPayload() *models.SeverityMatrixConditionEntity { + return o.Payload +} + +func (o *GetSeverityMatrixConditionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityMatrixConditionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/get_severity_matrix_parameters.go b/client/incident_settings/get_severity_matrix_parameters.go new file mode 100644 index 0000000..c66857a --- /dev/null +++ b/client/incident_settings/get_severity_matrix_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSeverityMatrixParams creates a new GetSeverityMatrixParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSeverityMatrixParams() *GetSeverityMatrixParams { + return &GetSeverityMatrixParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSeverityMatrixParamsWithTimeout creates a new GetSeverityMatrixParams object +// with the ability to set a timeout on a request. +func NewGetSeverityMatrixParamsWithTimeout(timeout time.Duration) *GetSeverityMatrixParams { + return &GetSeverityMatrixParams{ + timeout: timeout, + } +} + +// NewGetSeverityMatrixParamsWithContext creates a new GetSeverityMatrixParams object +// with the ability to set a context for a request. +func NewGetSeverityMatrixParamsWithContext(ctx context.Context) *GetSeverityMatrixParams { + return &GetSeverityMatrixParams{ + Context: ctx, + } +} + +// NewGetSeverityMatrixParamsWithHTTPClient creates a new GetSeverityMatrixParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSeverityMatrixParamsWithHTTPClient(client *http.Client) *GetSeverityMatrixParams { + return &GetSeverityMatrixParams{ + HTTPClient: client, + } +} + +/* +GetSeverityMatrixParams contains all the parameters to send to the API endpoint + + for the get severity matrix operation. + + Typically these are written to a http.Request. +*/ +type GetSeverityMatrixParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get severity matrix params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSeverityMatrixParams) WithDefaults() *GetSeverityMatrixParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get severity matrix params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSeverityMatrixParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get severity matrix params +func (o *GetSeverityMatrixParams) WithTimeout(timeout time.Duration) *GetSeverityMatrixParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get severity matrix params +func (o *GetSeverityMatrixParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get severity matrix params +func (o *GetSeverityMatrixParams) WithContext(ctx context.Context) *GetSeverityMatrixParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get severity matrix params +func (o *GetSeverityMatrixParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get severity matrix params +func (o *GetSeverityMatrixParams) WithHTTPClient(client *http.Client) *GetSeverityMatrixParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get severity matrix params +func (o *GetSeverityMatrixParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSeverityMatrixParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/get_severity_matrix_responses.go b/client/incident_settings/get_severity_matrix_responses.go new file mode 100644 index 0000000..1176227 --- /dev/null +++ b/client/incident_settings/get_severity_matrix_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetSeverityMatrixReader is a Reader for the GetSeverityMatrix structure. +type GetSeverityMatrixReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSeverityMatrixReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSeverityMatrixOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSeverityMatrixOK creates a GetSeverityMatrixOK with default headers values +func NewGetSeverityMatrixOK() *GetSeverityMatrixOK { + return &GetSeverityMatrixOK{} +} + +/* +GetSeverityMatrixOK describes a response with status code 200, with default header values. + +Retrieve the Severity matrix for your organization and its components and configured severities. +*/ +type GetSeverityMatrixOK struct { + Payload *models.SeverityMatrixSeverityMatrixEntity +} + +// IsSuccess returns true when this get severity matrix o k response has a 2xx status code +func (o *GetSeverityMatrixOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get severity matrix o k response has a 3xx status code +func (o *GetSeverityMatrixOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get severity matrix o k response has a 4xx status code +func (o *GetSeverityMatrixOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get severity matrix o k response has a 5xx status code +func (o *GetSeverityMatrixOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get severity matrix o k response a status code equal to that given +func (o *GetSeverityMatrixOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetSeverityMatrixOK) Error() string { + return fmt.Sprintf("[GET /v1/severity_matrix][%d] getSeverityMatrixOK %+v", 200, o.Payload) +} + +func (o *GetSeverityMatrixOK) String() string { + return fmt.Sprintf("[GET /v1/severity_matrix][%d] getSeverityMatrixOK %+v", 200, o.Payload) +} + +func (o *GetSeverityMatrixOK) GetPayload() *models.SeverityMatrixSeverityMatrixEntity { + return o.Payload +} + +func (o *GetSeverityMatrixOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityMatrixSeverityMatrixEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/get_severity_parameters.go b/client/incident_settings/get_severity_parameters.go new file mode 100644 index 0000000..5737604 --- /dev/null +++ b/client/incident_settings/get_severity_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSeverityParams creates a new GetSeverityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSeverityParams() *GetSeverityParams { + return &GetSeverityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSeverityParamsWithTimeout creates a new GetSeverityParams object +// with the ability to set a timeout on a request. +func NewGetSeverityParamsWithTimeout(timeout time.Duration) *GetSeverityParams { + return &GetSeverityParams{ + timeout: timeout, + } +} + +// NewGetSeverityParamsWithContext creates a new GetSeverityParams object +// with the ability to set a context for a request. +func NewGetSeverityParamsWithContext(ctx context.Context) *GetSeverityParams { + return &GetSeverityParams{ + Context: ctx, + } +} + +// NewGetSeverityParamsWithHTTPClient creates a new GetSeverityParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSeverityParamsWithHTTPClient(client *http.Client) *GetSeverityParams { + return &GetSeverityParams{ + HTTPClient: client, + } +} + +/* +GetSeverityParams contains all the parameters to send to the API endpoint + + for the get severity operation. + + Typically these are written to a http.Request. +*/ +type GetSeverityParams struct { + + // SeveritySlug. + SeveritySlug string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get severity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSeverityParams) WithDefaults() *GetSeverityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get severity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSeverityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get severity params +func (o *GetSeverityParams) WithTimeout(timeout time.Duration) *GetSeverityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get severity params +func (o *GetSeverityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get severity params +func (o *GetSeverityParams) WithContext(ctx context.Context) *GetSeverityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get severity params +func (o *GetSeverityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get severity params +func (o *GetSeverityParams) WithHTTPClient(client *http.Client) *GetSeverityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get severity params +func (o *GetSeverityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSeveritySlug adds the severitySlug to the get severity params +func (o *GetSeverityParams) WithSeveritySlug(severitySlug string) *GetSeverityParams { + o.SetSeveritySlug(severitySlug) + return o +} + +// SetSeveritySlug adds the severitySlug to the get severity params +func (o *GetSeverityParams) SetSeveritySlug(severitySlug string) { + o.SeveritySlug = severitySlug +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSeverityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param severity_slug + if err := r.SetPathParam("severity_slug", o.SeveritySlug); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/get_severity_responses.go b/client/incident_settings/get_severity_responses.go new file mode 100644 index 0000000..293b57c --- /dev/null +++ b/client/incident_settings/get_severity_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetSeverityReader is a Reader for the GetSeverity structure. +type GetSeverityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSeverityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSeverityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSeverityOK creates a GetSeverityOK with default headers values +func NewGetSeverityOK() *GetSeverityOK { + return &GetSeverityOK{} +} + +/* +GetSeverityOK describes a response with status code 200, with default header values. + +Retrieve a specific severity +*/ +type GetSeverityOK struct { + Payload *models.SeverityEntity +} + +// IsSuccess returns true when this get severity o k response has a 2xx status code +func (o *GetSeverityOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get severity o k response has a 3xx status code +func (o *GetSeverityOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get severity o k response has a 4xx status code +func (o *GetSeverityOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get severity o k response has a 5xx status code +func (o *GetSeverityOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get severity o k response a status code equal to that given +func (o *GetSeverityOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetSeverityOK) Error() string { + return fmt.Sprintf("[GET /v1/severities/{severity_slug}][%d] getSeverityOK %+v", 200, o.Payload) +} + +func (o *GetSeverityOK) String() string { + return fmt.Sprintf("[GET /v1/severities/{severity_slug}][%d] getSeverityOK %+v", 200, o.Payload) +} + +func (o *GetSeverityOK) GetPayload() *models.SeverityEntity { + return o.Payload +} + +func (o *GetSeverityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/incident_settings_client.go b/client/incident_settings/incident_settings_client.go index 01cab16..7b2166d 100644 --- a/client/incident_settings/incident_settings_client.go +++ b/client/incident_settings/incident_settings_client.go @@ -30,124 +30,124 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1CustomFieldsDefinitionsFieldID(params *DeleteV1CustomFieldsDefinitionsFieldIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1CustomFieldsDefinitionsFieldIDOK, error) + CreateCustomFieldDefinition(params *CreateCustomFieldDefinitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCustomFieldDefinitionCreated, error) - DeleteV1IncidentRolesIncidentRoleID(params *DeleteV1IncidentRolesIncidentRoleIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentRolesIncidentRoleIDOK, error) + CreateIncidentRole(params *CreateIncidentRoleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentRoleCreated, error) - DeleteV1IncidentTypesID(params *DeleteV1IncidentTypesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentTypesIDOK, error) + CreateIncidentType(params *CreateIncidentTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentTypeCreated, error) - DeleteV1LifecyclesMeasurementDefinitionsMeasurementDefinitionID(params *DeleteV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDNoContent, error) + CreateLifecycleMeasurementDefinition(params *CreateLifecycleMeasurementDefinitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateLifecycleMeasurementDefinitionCreated, error) - DeleteV1LifecyclesMilestonesMilestoneID(params *DeleteV1LifecyclesMilestonesMilestoneIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1LifecyclesMilestonesMilestoneIDOK, error) + CreateLifecycleMilestone(params *CreateLifecycleMilestoneParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateLifecycleMilestoneCreated, error) - DeleteV1PrioritiesPrioritySlug(params *DeleteV1PrioritiesPrioritySlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1PrioritiesPrioritySlugOK, error) + CreatePriority(params *CreatePriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePriorityCreated, error) - DeleteV1SeveritiesSeveritySlug(params *DeleteV1SeveritiesSeveritySlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SeveritiesSeveritySlugOK, error) + CreateSeverity(params *CreateSeverityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSeverityCreated, error) - DeleteV1SeverityMatrixConditionsConditionID(params *DeleteV1SeverityMatrixConditionsConditionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SeverityMatrixConditionsConditionIDOK, error) + CreateSeverityMatrixCondition(params *CreateSeverityMatrixConditionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSeverityMatrixConditionCreated, error) - DeleteV1SeverityMatrixImpactsImpactID(params *DeleteV1SeverityMatrixImpactsImpactIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SeverityMatrixImpactsImpactIDOK, error) + CreateSeverityMatrixImpact(params *CreateSeverityMatrixImpactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSeverityMatrixImpactCreated, error) - GetV1CustomFieldsDefinitions(params *GetV1CustomFieldsDefinitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1CustomFieldsDefinitionsOK, error) + DeleteCustomFieldDefinition(params *DeleteCustomFieldDefinitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCustomFieldDefinitionOK, error) - GetV1CustomFieldsDefinitionsFieldIDSelectOptions(params *GetV1CustomFieldsDefinitionsFieldIDSelectOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1CustomFieldsDefinitionsFieldIDSelectOptionsOK, error) + DeleteIncidentRole(params *DeleteIncidentRoleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentRoleOK, error) - GetV1FormConfigurationsSlug(params *GetV1FormConfigurationsSlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1FormConfigurationsSlugOK, error) + DeleteIncidentType(params *DeleteIncidentTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentTypeOK, error) - GetV1IncidentRoles(params *GetV1IncidentRolesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentRolesOK, error) + DeleteLifecycleMeasurementDefinition(params *DeleteLifecycleMeasurementDefinitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteLifecycleMeasurementDefinitionNoContent, error) - GetV1IncidentRolesIncidentRoleID(params *GetV1IncidentRolesIncidentRoleIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentRolesIncidentRoleIDOK, error) + DeleteLifecycleMilestone(params *DeleteLifecycleMilestoneParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteLifecycleMilestoneOK, error) - GetV1IncidentTags(params *GetV1IncidentTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentTagsOK, error) + DeletePriority(params *DeletePriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeletePriorityOK, error) - GetV1IncidentTypes(params *GetV1IncidentTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentTypesOK, error) + DeleteSeverity(params *DeleteSeverityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSeverityOK, error) - GetV1IncidentTypesID(params *GetV1IncidentTypesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentTypesIDOK, error) + DeleteSeverityMatrixCondition(params *DeleteSeverityMatrixConditionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSeverityMatrixConditionOK, error) - GetV1LifecyclesMeasurementDefinitions(params *GetV1LifecyclesMeasurementDefinitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1LifecyclesMeasurementDefinitionsOK, error) + DeleteSeverityMatrixImpact(params *DeleteSeverityMatrixImpactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSeverityMatrixImpactOK, error) - GetV1LifecyclesMeasurementDefinitionsMeasurementDefinitionID(params *GetV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDOK, error) + GetFormConfiguration(params *GetFormConfigurationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetFormConfigurationOK, error) - GetV1LifecyclesPhases(params *GetV1LifecyclesPhasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1LifecyclesPhasesOK, error) + GetIncidentRole(params *GetIncidentRoleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentRoleOK, error) - GetV1Priorities(params *GetV1PrioritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PrioritiesOK, error) + GetIncidentType(params *GetIncidentTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentTypeOK, error) - GetV1PrioritiesPrioritySlug(params *GetV1PrioritiesPrioritySlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PrioritiesPrioritySlugOK, error) + GetLifecycleMeasurementDefinition(params *GetLifecycleMeasurementDefinitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLifecycleMeasurementDefinitionOK, error) - GetV1Severities(params *GetV1SeveritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SeveritiesOK, error) + GetPriority(params *GetPriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPriorityOK, error) - GetV1SeveritiesSeveritySlug(params *GetV1SeveritiesSeveritySlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SeveritiesSeveritySlugOK, error) + GetSeverity(params *GetSeverityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSeverityOK, error) - GetV1SeverityMatrix(params *GetV1SeverityMatrixParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SeverityMatrixOK, error) + GetSeverityMatrix(params *GetSeverityMatrixParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSeverityMatrixOK, error) - GetV1SeverityMatrixConditions(params *GetV1SeverityMatrixConditionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SeverityMatrixConditionsOK, error) + GetSeverityMatrixCondition(params *GetSeverityMatrixConditionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSeverityMatrixConditionOK, error) - GetV1SeverityMatrixConditionsConditionID(params *GetV1SeverityMatrixConditionsConditionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SeverityMatrixConditionsConditionIDOK, error) + ListCustomFieldDefinitions(params *ListCustomFieldDefinitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCustomFieldDefinitionsOK, error) - GetV1SeverityMatrixImpacts(params *GetV1SeverityMatrixImpactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SeverityMatrixImpactsOK, error) + ListCustomFieldSelectOptions(params *ListCustomFieldSelectOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCustomFieldSelectOptionsOK, error) - PatchV1CustomFieldsDefinitionsFieldID(params *PatchV1CustomFieldsDefinitionsFieldIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1CustomFieldsDefinitionsFieldIDOK, error) + ListIncidentRoles(params *ListIncidentRolesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentRolesOK, error) - PatchV1IncidentRolesIncidentRoleID(params *PatchV1IncidentRolesIncidentRoleIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentRolesIncidentRoleIDOK, error) + ListIncidentTags(params *ListIncidentTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentTagsOK, error) - PatchV1IncidentTypesID(params *PatchV1IncidentTypesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentTypesIDOK, error) + ListIncidentTypes(params *ListIncidentTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentTypesOK, error) - PatchV1LifecyclesMeasurementDefinitionsMeasurementDefinitionID(params *PatchV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDOK, error) + ListLifecycleMeasurementDefinitions(params *ListLifecycleMeasurementDefinitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListLifecycleMeasurementDefinitionsOK, error) - PatchV1LifecyclesMilestonesMilestoneID(params *PatchV1LifecyclesMilestonesMilestoneIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1LifecyclesMilestonesMilestoneIDOK, error) + ListLifecyclePhases(params *ListLifecyclePhasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListLifecyclePhasesOK, error) - PatchV1PrioritiesPrioritySlug(params *PatchV1PrioritiesPrioritySlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1PrioritiesPrioritySlugOK, error) + ListPriorities(params *ListPrioritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPrioritiesOK, error) - PatchV1SeveritiesSeveritySlug(params *PatchV1SeveritiesSeveritySlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SeveritiesSeveritySlugOK, error) + ListSeverities(params *ListSeveritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSeveritiesOK, error) - PatchV1SeverityMatrix(params *PatchV1SeverityMatrixParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SeverityMatrixOK, error) + ListSeverityMatrixConditions(params *ListSeverityMatrixConditionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSeverityMatrixConditionsOK, error) - PatchV1SeverityMatrixConditionsConditionID(params *PatchV1SeverityMatrixConditionsConditionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SeverityMatrixConditionsConditionIDOK, error) + ListSeverityMatrixImpacts(params *ListSeverityMatrixImpactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSeverityMatrixImpactsOK, error) - PatchV1SeverityMatrixImpactsImpactID(params *PatchV1SeverityMatrixImpactsImpactIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SeverityMatrixImpactsImpactIDOK, error) + UpdateCustomFieldDefinition(params *UpdateCustomFieldDefinitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCustomFieldDefinitionOK, error) - PostV1CustomFieldsDefinitions(params *PostV1CustomFieldsDefinitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1CustomFieldsDefinitionsCreated, error) + UpdateIncidentRole(params *UpdateIncidentRoleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentRoleOK, error) - PostV1IncidentRoles(params *PostV1IncidentRolesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentRolesCreated, error) + UpdateIncidentType(params *UpdateIncidentTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentTypeOK, error) - PostV1IncidentTagsValidate(params *PostV1IncidentTagsValidateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentTagsValidateCreated, error) + UpdateLifecycleMeasurementDefinition(params *UpdateLifecycleMeasurementDefinitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateLifecycleMeasurementDefinitionOK, error) - PostV1IncidentTypes(params *PostV1IncidentTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentTypesCreated, error) + UpdateLifecycleMilestone(params *UpdateLifecycleMilestoneParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateLifecycleMilestoneOK, error) - PostV1LifecyclesMeasurementDefinitions(params *PostV1LifecyclesMeasurementDefinitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1LifecyclesMeasurementDefinitionsCreated, error) + UpdatePriority(params *UpdatePriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePriorityOK, error) - PostV1LifecyclesMilestones(params *PostV1LifecyclesMilestonesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1LifecyclesMilestonesCreated, error) + UpdateSeverity(params *UpdateSeverityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSeverityOK, error) - PostV1Priorities(params *PostV1PrioritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1PrioritiesCreated, error) + UpdateSeverityMatrix(params *UpdateSeverityMatrixParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSeverityMatrixOK, error) - PostV1Severities(params *PostV1SeveritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SeveritiesCreated, error) + UpdateSeverityMatrixCondition(params *UpdateSeverityMatrixConditionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSeverityMatrixConditionOK, error) - PostV1SeverityMatrixConditions(params *PostV1SeverityMatrixConditionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SeverityMatrixConditionsCreated, error) + UpdateSeverityMatrixImpact(params *UpdateSeverityMatrixImpactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSeverityMatrixImpactOK, error) - PostV1SeverityMatrixImpacts(params *PostV1SeverityMatrixImpactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SeverityMatrixImpactsCreated, error) + ValidateIncidentTags(params *ValidateIncidentTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ValidateIncidentTagsCreated, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1CustomFieldsDefinitionsFieldID deletes a custom field definition +CreateCustomFieldDefinition creates a custom field definition -Delete a custom field definition +Create a new custom field definition */ -func (a *Client) DeleteV1CustomFieldsDefinitionsFieldID(params *DeleteV1CustomFieldsDefinitionsFieldIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1CustomFieldsDefinitionsFieldIDOK, error) { +func (a *Client) CreateCustomFieldDefinition(params *CreateCustomFieldDefinitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCustomFieldDefinitionCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1CustomFieldsDefinitionsFieldIDParams() + params = NewCreateCustomFieldDefinitionParams() } op := &runtime.ClientOperation{ - ID: "deleteV1CustomFieldsDefinitionsFieldId", - Method: "DELETE", - PathPattern: "/v1/custom_fields/definitions/{field_id}", + ID: "create_custom_field_definition", + Method: "POST", + PathPattern: "/v1/custom_fields/definitions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1CustomFieldsDefinitionsFieldIDReader{formats: a.formats}, + Reader: &CreateCustomFieldDefinitionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -160,35 +160,35 @@ func (a *Client) DeleteV1CustomFieldsDefinitionsFieldID(params *DeleteV1CustomFi if err != nil { return nil, err } - success, ok := result.(*DeleteV1CustomFieldsDefinitionsFieldIDOK) + success, ok := result.(*CreateCustomFieldDefinitionCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1CustomFieldsDefinitionsFieldId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_custom_field_definition: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1IncidentRolesIncidentRoleID archives an incident role +CreateIncidentRole creates an incident role -Archives an incident role which will hide it from lists and metrics +Create a new incident role */ -func (a *Client) DeleteV1IncidentRolesIncidentRoleID(params *DeleteV1IncidentRolesIncidentRoleIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentRolesIncidentRoleIDOK, error) { +func (a *Client) CreateIncidentRole(params *CreateIncidentRoleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentRoleCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IncidentRolesIncidentRoleIDParams() + params = NewCreateIncidentRoleParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IncidentRolesIncidentRoleId", - Method: "DELETE", - PathPattern: "/v1/incident_roles/{incident_role_id}", + ID: "create_incident_role", + Method: "POST", + PathPattern: "/v1/incident_roles", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IncidentRolesIncidentRoleIDReader{formats: a.formats}, + Reader: &CreateIncidentRoleReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -201,35 +201,35 @@ func (a *Client) DeleteV1IncidentRolesIncidentRoleID(params *DeleteV1IncidentRol if err != nil { return nil, err } - success, ok := result.(*DeleteV1IncidentRolesIncidentRoleIDOK) + success, ok := result.(*CreateIncidentRoleCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IncidentRolesIncidentRoleId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_role: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1IncidentTypesID archives an incident type +CreateIncidentType creates an incident type -Archives an incident type which will hide it from lists and metrics +Create a new incident type */ -func (a *Client) DeleteV1IncidentTypesID(params *DeleteV1IncidentTypesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentTypesIDOK, error) { +func (a *Client) CreateIncidentType(params *CreateIncidentTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentTypeCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IncidentTypesIDParams() + params = NewCreateIncidentTypeParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IncidentTypesId", - Method: "DELETE", - PathPattern: "/v1/incident_types/{id}", + ID: "create_incident_type", + Method: "POST", + PathPattern: "/v1/incident_types", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IncidentTypesIDReader{formats: a.formats}, + Reader: &CreateIncidentTypeReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -242,35 +242,35 @@ func (a *Client) DeleteV1IncidentTypesID(params *DeleteV1IncidentTypesIDParams, if err != nil { return nil, err } - success, ok := result.(*DeleteV1IncidentTypesIDOK) + success, ok := result.(*CreateIncidentTypeCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IncidentTypesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_type: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1LifecyclesMeasurementDefinitionsMeasurementDefinitionID archives a measurement definition +CreateLifecycleMeasurementDefinition creates a measurement definition -Archives a measurement definition which will hide it from lists and metrics +Create a new measurement definition */ -func (a *Client) DeleteV1LifecyclesMeasurementDefinitionsMeasurementDefinitionID(params *DeleteV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDNoContent, error) { +func (a *Client) CreateLifecycleMeasurementDefinition(params *CreateLifecycleMeasurementDefinitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateLifecycleMeasurementDefinitionCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDParams() + params = NewCreateLifecycleMeasurementDefinitionParams() } op := &runtime.ClientOperation{ - ID: "deleteV1LifecyclesMeasurementDefinitionsMeasurementDefinitionId", - Method: "DELETE", - PathPattern: "/v1/lifecycles/measurement_definitions/{measurement_definition_id}", + ID: "create_lifecycle_measurement_definition", + Method: "POST", + PathPattern: "/v1/lifecycles/measurement_definitions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDReader{formats: a.formats}, + Reader: &CreateLifecycleMeasurementDefinitionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -283,35 +283,35 @@ func (a *Client) DeleteV1LifecyclesMeasurementDefinitionsMeasurementDefinitionID if err != nil { return nil, err } - success, ok := result.(*DeleteV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDNoContent) + success, ok := result.(*CreateLifecycleMeasurementDefinitionCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1LifecyclesMeasurementDefinitionsMeasurementDefinitionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_lifecycle_measurement_definition: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1LifecyclesMilestonesMilestoneID deletes a milestone +CreateLifecycleMilestone creates a milestone -Delete a milestone +Create a new milestone */ -func (a *Client) DeleteV1LifecyclesMilestonesMilestoneID(params *DeleteV1LifecyclesMilestonesMilestoneIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1LifecyclesMilestonesMilestoneIDOK, error) { +func (a *Client) CreateLifecycleMilestone(params *CreateLifecycleMilestoneParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateLifecycleMilestoneCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1LifecyclesMilestonesMilestoneIDParams() + params = NewCreateLifecycleMilestoneParams() } op := &runtime.ClientOperation{ - ID: "deleteV1LifecyclesMilestonesMilestoneId", - Method: "DELETE", - PathPattern: "/v1/lifecycles/milestones/{milestone_id}", + ID: "create_lifecycle_milestone", + Method: "POST", + PathPattern: "/v1/lifecycles/milestones", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1LifecyclesMilestonesMilestoneIDReader{formats: a.formats}, + Reader: &CreateLifecycleMilestoneReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -324,35 +324,35 @@ func (a *Client) DeleteV1LifecyclesMilestonesMilestoneID(params *DeleteV1Lifecyc if err != nil { return nil, err } - success, ok := result.(*DeleteV1LifecyclesMilestonesMilestoneIDOK) + success, ok := result.(*CreateLifecycleMilestoneCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1LifecyclesMilestonesMilestoneId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_lifecycle_milestone: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1PrioritiesPrioritySlug deletes a priority +CreatePriority creates a priority -Delete a specific priority +Create a new priority */ -func (a *Client) DeleteV1PrioritiesPrioritySlug(params *DeleteV1PrioritiesPrioritySlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1PrioritiesPrioritySlugOK, error) { +func (a *Client) CreatePriority(params *CreatePriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePriorityCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1PrioritiesPrioritySlugParams() + params = NewCreatePriorityParams() } op := &runtime.ClientOperation{ - ID: "deleteV1PrioritiesPrioritySlug", - Method: "DELETE", - PathPattern: "/v1/priorities/{priority_slug}", + ID: "create_priority", + Method: "POST", + PathPattern: "/v1/priorities", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1PrioritiesPrioritySlugReader{formats: a.formats}, + Reader: &CreatePriorityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -365,35 +365,35 @@ func (a *Client) DeleteV1PrioritiesPrioritySlug(params *DeleteV1PrioritiesPriori if err != nil { return nil, err } - success, ok := result.(*DeleteV1PrioritiesPrioritySlugOK) + success, ok := result.(*CreatePriorityCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1PrioritiesPrioritySlug: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_priority: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1SeveritiesSeveritySlug deletes a severity +CreateSeverity creates a severity -Delete a specific severity +Create a new severity */ -func (a *Client) DeleteV1SeveritiesSeveritySlug(params *DeleteV1SeveritiesSeveritySlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SeveritiesSeveritySlugOK, error) { +func (a *Client) CreateSeverity(params *CreateSeverityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSeverityCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1SeveritiesSeveritySlugParams() + params = NewCreateSeverityParams() } op := &runtime.ClientOperation{ - ID: "deleteV1SeveritiesSeveritySlug", - Method: "DELETE", - PathPattern: "/v1/severities/{severity_slug}", + ID: "create_severity", + Method: "POST", + PathPattern: "/v1/severities", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1SeveritiesSeveritySlugReader{formats: a.formats}, + Reader: &CreateSeverityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -406,35 +406,35 @@ func (a *Client) DeleteV1SeveritiesSeveritySlug(params *DeleteV1SeveritiesSeveri if err != nil { return nil, err } - success, ok := result.(*DeleteV1SeveritiesSeveritySlugOK) + success, ok := result.(*CreateSeverityCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1SeveritiesSeveritySlug: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_severity: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1SeverityMatrixConditionsConditionID deletes a severity matrix condition +CreateSeverityMatrixCondition creates a severity matrix condition -Delete a specific condition +Create a new condition */ -func (a *Client) DeleteV1SeverityMatrixConditionsConditionID(params *DeleteV1SeverityMatrixConditionsConditionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SeverityMatrixConditionsConditionIDOK, error) { +func (a *Client) CreateSeverityMatrixCondition(params *CreateSeverityMatrixConditionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSeverityMatrixConditionCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1SeverityMatrixConditionsConditionIDParams() + params = NewCreateSeverityMatrixConditionParams() } op := &runtime.ClientOperation{ - ID: "deleteV1SeverityMatrixConditionsConditionId", - Method: "DELETE", - PathPattern: "/v1/severity_matrix/conditions/{condition_id}", + ID: "create_severity_matrix_condition", + Method: "POST", + PathPattern: "/v1/severity_matrix/conditions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1SeverityMatrixConditionsConditionIDReader{formats: a.formats}, + Reader: &CreateSeverityMatrixConditionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -447,35 +447,35 @@ func (a *Client) DeleteV1SeverityMatrixConditionsConditionID(params *DeleteV1Sev if err != nil { return nil, err } - success, ok := result.(*DeleteV1SeverityMatrixConditionsConditionIDOK) + success, ok := result.(*CreateSeverityMatrixConditionCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1SeverityMatrixConditionsConditionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_severity_matrix_condition: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1SeverityMatrixImpactsImpactID deletes a severity matrix impact +CreateSeverityMatrixImpact creates a severity matrix impact -Delete a specific impact +Create a new impact */ -func (a *Client) DeleteV1SeverityMatrixImpactsImpactID(params *DeleteV1SeverityMatrixImpactsImpactIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SeverityMatrixImpactsImpactIDOK, error) { +func (a *Client) CreateSeverityMatrixImpact(params *CreateSeverityMatrixImpactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSeverityMatrixImpactCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1SeverityMatrixImpactsImpactIDParams() + params = NewCreateSeverityMatrixImpactParams() } op := &runtime.ClientOperation{ - ID: "deleteV1SeverityMatrixImpactsImpactId", - Method: "DELETE", - PathPattern: "/v1/severity_matrix/impacts/{impact_id}", + ID: "create_severity_matrix_impact", + Method: "POST", + PathPattern: "/v1/severity_matrix/impacts", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1SeverityMatrixImpactsImpactIDReader{formats: a.formats}, + Reader: &CreateSeverityMatrixImpactReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -488,35 +488,35 @@ func (a *Client) DeleteV1SeverityMatrixImpactsImpactID(params *DeleteV1SeverityM if err != nil { return nil, err } - success, ok := result.(*DeleteV1SeverityMatrixImpactsImpactIDOK) + success, ok := result.(*CreateSeverityMatrixImpactCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1SeverityMatrixImpactsImpactId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_severity_matrix_impact: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1CustomFieldsDefinitions lists custom field definitions +DeleteCustomFieldDefinition deletes a custom field definition -List all custom field definitions +Delete a custom field definition */ -func (a *Client) GetV1CustomFieldsDefinitions(params *GetV1CustomFieldsDefinitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1CustomFieldsDefinitionsOK, error) { +func (a *Client) DeleteCustomFieldDefinition(params *DeleteCustomFieldDefinitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCustomFieldDefinitionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1CustomFieldsDefinitionsParams() + params = NewDeleteCustomFieldDefinitionParams() } op := &runtime.ClientOperation{ - ID: "getV1CustomFieldsDefinitions", - Method: "GET", - PathPattern: "/v1/custom_fields/definitions", + ID: "delete_custom_field_definition", + Method: "DELETE", + PathPattern: "/v1/custom_fields/definitions/{field_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1CustomFieldsDefinitionsReader{formats: a.formats}, + Reader: &DeleteCustomFieldDefinitionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -529,35 +529,35 @@ func (a *Client) GetV1CustomFieldsDefinitions(params *GetV1CustomFieldsDefinitio if err != nil { return nil, err } - success, ok := result.(*GetV1CustomFieldsDefinitionsOK) + success, ok := result.(*DeleteCustomFieldDefinitionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1CustomFieldsDefinitions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_custom_field_definition: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1CustomFieldsDefinitionsFieldIDSelectOptions gets available values for a custom field +DeleteIncidentRole archives an incident role -Get the permissible values for the a currently active custom select or multi-select field. +Archives an incident role which will hide it from lists and metrics */ -func (a *Client) GetV1CustomFieldsDefinitionsFieldIDSelectOptions(params *GetV1CustomFieldsDefinitionsFieldIDSelectOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1CustomFieldsDefinitionsFieldIDSelectOptionsOK, error) { +func (a *Client) DeleteIncidentRole(params *DeleteIncidentRoleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentRoleOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1CustomFieldsDefinitionsFieldIDSelectOptionsParams() + params = NewDeleteIncidentRoleParams() } op := &runtime.ClientOperation{ - ID: "getV1CustomFieldsDefinitionsFieldIdSelectOptions", - Method: "GET", - PathPattern: "/v1/custom_fields/definitions/{field_id}/select_options", + ID: "delete_incident_role", + Method: "DELETE", + PathPattern: "/v1/incident_roles/{incident_role_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1CustomFieldsDefinitionsFieldIDSelectOptionsReader{formats: a.formats}, + Reader: &DeleteIncidentRoleReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -570,35 +570,35 @@ func (a *Client) GetV1CustomFieldsDefinitionsFieldIDSelectOptions(params *GetV1C if err != nil { return nil, err } - success, ok := result.(*GetV1CustomFieldsDefinitionsFieldIDSelectOptionsOK) + success, ok := result.(*DeleteIncidentRoleOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1CustomFieldsDefinitionsFieldIdSelectOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_incident_role: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1FormConfigurationsSlug gets a form configuration +DeleteIncidentType archives an incident type -Get a form configuration +Archives an incident type which will hide it from lists and metrics */ -func (a *Client) GetV1FormConfigurationsSlug(params *GetV1FormConfigurationsSlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1FormConfigurationsSlugOK, error) { +func (a *Client) DeleteIncidentType(params *DeleteIncidentTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentTypeOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1FormConfigurationsSlugParams() + params = NewDeleteIncidentTypeParams() } op := &runtime.ClientOperation{ - ID: "getV1FormConfigurationsSlug", - Method: "GET", - PathPattern: "/v1/form_configurations/{slug}", + ID: "delete_incident_type", + Method: "DELETE", + PathPattern: "/v1/incident_types/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1FormConfigurationsSlugReader{formats: a.formats}, + Reader: &DeleteIncidentTypeReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -611,35 +611,35 @@ func (a *Client) GetV1FormConfigurationsSlug(params *GetV1FormConfigurationsSlug if err != nil { return nil, err } - success, ok := result.(*GetV1FormConfigurationsSlugOK) + success, ok := result.(*DeleteIncidentTypeOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1FormConfigurationsSlug: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_incident_type: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentRoles lists incident roles +DeleteLifecycleMeasurementDefinition archives a measurement definition -List all of the incident roles in the organization +Archives a measurement definition which will hide it from lists and metrics */ -func (a *Client) GetV1IncidentRoles(params *GetV1IncidentRolesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentRolesOK, error) { +func (a *Client) DeleteLifecycleMeasurementDefinition(params *DeleteLifecycleMeasurementDefinitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteLifecycleMeasurementDefinitionNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentRolesParams() + params = NewDeleteLifecycleMeasurementDefinitionParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentRoles", - Method: "GET", - PathPattern: "/v1/incident_roles", + ID: "delete_lifecycle_measurement_definition", + Method: "DELETE", + PathPattern: "/v1/lifecycles/measurement_definitions/{measurement_definition_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentRolesReader{formats: a.formats}, + Reader: &DeleteLifecycleMeasurementDefinitionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -652,35 +652,35 @@ func (a *Client) GetV1IncidentRoles(params *GetV1IncidentRolesParams, authInfo r if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentRolesOK) + success, ok := result.(*DeleteLifecycleMeasurementDefinitionNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentRoles: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_lifecycle_measurement_definition: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentRolesIncidentRoleID gets an incident role +DeleteLifecycleMilestone deletes a milestone -Retrieve a single incident role from its ID +Delete a milestone */ -func (a *Client) GetV1IncidentRolesIncidentRoleID(params *GetV1IncidentRolesIncidentRoleIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentRolesIncidentRoleIDOK, error) { +func (a *Client) DeleteLifecycleMilestone(params *DeleteLifecycleMilestoneParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteLifecycleMilestoneOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentRolesIncidentRoleIDParams() + params = NewDeleteLifecycleMilestoneParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentRolesIncidentRoleId", - Method: "GET", - PathPattern: "/v1/incident_roles/{incident_role_id}", + ID: "delete_lifecycle_milestone", + Method: "DELETE", + PathPattern: "/v1/lifecycles/milestones/{milestone_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentRolesIncidentRoleIDReader{formats: a.formats}, + Reader: &DeleteLifecycleMilestoneReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -693,35 +693,35 @@ func (a *Client) GetV1IncidentRolesIncidentRoleID(params *GetV1IncidentRolesInci if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentRolesIncidentRoleIDOK) + success, ok := result.(*DeleteLifecycleMilestoneOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentRolesIncidentRoleId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_lifecycle_milestone: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentTags lists incident tags +DeletePriority deletes a priority -List all of the incident tags in the organization +Delete a specific priority */ -func (a *Client) GetV1IncidentTags(params *GetV1IncidentTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentTagsOK, error) { +func (a *Client) DeletePriority(params *DeletePriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeletePriorityOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentTagsParams() + params = NewDeletePriorityParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentTags", - Method: "GET", - PathPattern: "/v1/incident_tags", + ID: "delete_priority", + Method: "DELETE", + PathPattern: "/v1/priorities/{priority_slug}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentTagsReader{formats: a.formats}, + Reader: &DeletePriorityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -734,35 +734,35 @@ func (a *Client) GetV1IncidentTags(params *GetV1IncidentTagsParams, authInfo run if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentTagsOK) + success, ok := result.(*DeletePriorityOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentTags: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_priority: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentTypes lists incident types +DeleteSeverity deletes a severity -List all of the incident types in the organization +Delete a specific severity */ -func (a *Client) GetV1IncidentTypes(params *GetV1IncidentTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentTypesOK, error) { +func (a *Client) DeleteSeverity(params *DeleteSeverityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSeverityOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentTypesParams() + params = NewDeleteSeverityParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentTypes", - Method: "GET", - PathPattern: "/v1/incident_types", + ID: "delete_severity", + Method: "DELETE", + PathPattern: "/v1/severities/{severity_slug}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentTypesReader{formats: a.formats}, + Reader: &DeleteSeverityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -775,35 +775,35 @@ func (a *Client) GetV1IncidentTypes(params *GetV1IncidentTypesParams, authInfo r if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentTypesOK) + success, ok := result.(*DeleteSeverityOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_severity: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentTypesID gets an incident type +DeleteSeverityMatrixCondition deletes a severity matrix condition -Retrieve a single incident type from its ID +Delete a specific condition */ -func (a *Client) GetV1IncidentTypesID(params *GetV1IncidentTypesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentTypesIDOK, error) { +func (a *Client) DeleteSeverityMatrixCondition(params *DeleteSeverityMatrixConditionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSeverityMatrixConditionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentTypesIDParams() + params = NewDeleteSeverityMatrixConditionParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentTypesId", - Method: "GET", - PathPattern: "/v1/incident_types/{id}", + ID: "delete_severity_matrix_condition", + Method: "DELETE", + PathPattern: "/v1/severity_matrix/conditions/{condition_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentTypesIDReader{formats: a.formats}, + Reader: &DeleteSeverityMatrixConditionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -816,35 +816,35 @@ func (a *Client) GetV1IncidentTypesID(params *GetV1IncidentTypesIDParams, authIn if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentTypesIDOK) + success, ok := result.(*DeleteSeverityMatrixConditionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentTypesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_severity_matrix_condition: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1LifecyclesMeasurementDefinitions lists measurement definitions +DeleteSeverityMatrixImpact deletes a severity matrix impact -List all of the measurement definitions in the organization +Delete a specific impact */ -func (a *Client) GetV1LifecyclesMeasurementDefinitions(params *GetV1LifecyclesMeasurementDefinitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1LifecyclesMeasurementDefinitionsOK, error) { +func (a *Client) DeleteSeverityMatrixImpact(params *DeleteSeverityMatrixImpactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSeverityMatrixImpactOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1LifecyclesMeasurementDefinitionsParams() + params = NewDeleteSeverityMatrixImpactParams() } op := &runtime.ClientOperation{ - ID: "getV1LifecyclesMeasurementDefinitions", - Method: "GET", - PathPattern: "/v1/lifecycles/measurement_definitions", + ID: "delete_severity_matrix_impact", + Method: "DELETE", + PathPattern: "/v1/severity_matrix/impacts/{impact_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1LifecyclesMeasurementDefinitionsReader{formats: a.formats}, + Reader: &DeleteSeverityMatrixImpactReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -857,35 +857,35 @@ func (a *Client) GetV1LifecyclesMeasurementDefinitions(params *GetV1LifecyclesMe if err != nil { return nil, err } - success, ok := result.(*GetV1LifecyclesMeasurementDefinitionsOK) + success, ok := result.(*DeleteSeverityMatrixImpactOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1LifecyclesMeasurementDefinitions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_severity_matrix_impact: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1LifecyclesMeasurementDefinitionsMeasurementDefinitionID gets a measurement definition +GetFormConfiguration gets a form configuration -Retrieve a single measurement definition from its ID +Get a form configuration */ -func (a *Client) GetV1LifecyclesMeasurementDefinitionsMeasurementDefinitionID(params *GetV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDOK, error) { +func (a *Client) GetFormConfiguration(params *GetFormConfigurationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetFormConfigurationOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDParams() + params = NewGetFormConfigurationParams() } op := &runtime.ClientOperation{ - ID: "getV1LifecyclesMeasurementDefinitionsMeasurementDefinitionId", + ID: "get_form_configuration", Method: "GET", - PathPattern: "/v1/lifecycles/measurement_definitions/{measurement_definition_id}", + PathPattern: "/v1/form_configurations/{slug}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDReader{formats: a.formats}, + Reader: &GetFormConfigurationReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -898,35 +898,35 @@ func (a *Client) GetV1LifecyclesMeasurementDefinitionsMeasurementDefinitionID(pa if err != nil { return nil, err } - success, ok := result.(*GetV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDOK) + success, ok := result.(*GetFormConfigurationOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1LifecyclesMeasurementDefinitionsMeasurementDefinitionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_form_configuration: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1LifecyclesPhases lists phases and milestones +GetIncidentRole gets an incident role -List all of the lifecycle phases and milestones in the organization +Retrieve a single incident role from its ID */ -func (a *Client) GetV1LifecyclesPhases(params *GetV1LifecyclesPhasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1LifecyclesPhasesOK, error) { +func (a *Client) GetIncidentRole(params *GetIncidentRoleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentRoleOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1LifecyclesPhasesParams() + params = NewGetIncidentRoleParams() } op := &runtime.ClientOperation{ - ID: "getV1LifecyclesPhases", + ID: "get_incident_role", Method: "GET", - PathPattern: "/v1/lifecycles/phases", + PathPattern: "/v1/incident_roles/{incident_role_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1LifecyclesPhasesReader{formats: a.formats}, + Reader: &GetIncidentRoleReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -939,35 +939,35 @@ func (a *Client) GetV1LifecyclesPhases(params *GetV1LifecyclesPhasesParams, auth if err != nil { return nil, err } - success, ok := result.(*GetV1LifecyclesPhasesOK) + success, ok := result.(*GetIncidentRoleOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1LifecyclesPhases: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_incident_role: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Priorities lists priorities +GetIncidentType gets an incident type -Lists priorities +Retrieve a single incident type from its ID */ -func (a *Client) GetV1Priorities(params *GetV1PrioritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PrioritiesOK, error) { +func (a *Client) GetIncidentType(params *GetIncidentTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentTypeOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1PrioritiesParams() + params = NewGetIncidentTypeParams() } op := &runtime.ClientOperation{ - ID: "getV1Priorities", + ID: "get_incident_type", Method: "GET", - PathPattern: "/v1/priorities", + PathPattern: "/v1/incident_types/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1PrioritiesReader{formats: a.formats}, + Reader: &GetIncidentTypeReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -980,35 +980,35 @@ func (a *Client) GetV1Priorities(params *GetV1PrioritiesParams, authInfo runtime if err != nil { return nil, err } - success, ok := result.(*GetV1PrioritiesOK) + success, ok := result.(*GetIncidentTypeOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Priorities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_incident_type: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1PrioritiesPrioritySlug gets a priority +GetLifecycleMeasurementDefinition gets a measurement definition -Retrieve a specific priority +Retrieve a single measurement definition from its ID */ -func (a *Client) GetV1PrioritiesPrioritySlug(params *GetV1PrioritiesPrioritySlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PrioritiesPrioritySlugOK, error) { +func (a *Client) GetLifecycleMeasurementDefinition(params *GetLifecycleMeasurementDefinitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLifecycleMeasurementDefinitionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1PrioritiesPrioritySlugParams() + params = NewGetLifecycleMeasurementDefinitionParams() } op := &runtime.ClientOperation{ - ID: "getV1PrioritiesPrioritySlug", + ID: "get_lifecycle_measurement_definition", Method: "GET", - PathPattern: "/v1/priorities/{priority_slug}", + PathPattern: "/v1/lifecycles/measurement_definitions/{measurement_definition_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1PrioritiesPrioritySlugReader{formats: a.formats}, + Reader: &GetLifecycleMeasurementDefinitionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1021,35 +1021,35 @@ func (a *Client) GetV1PrioritiesPrioritySlug(params *GetV1PrioritiesPrioritySlug if err != nil { return nil, err } - success, ok := result.(*GetV1PrioritiesPrioritySlugOK) + success, ok := result.(*GetLifecycleMeasurementDefinitionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1PrioritiesPrioritySlug: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_lifecycle_measurement_definition: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Severities lists severities +GetPriority gets a priority -Lists severities +Retrieve a specific priority */ -func (a *Client) GetV1Severities(params *GetV1SeveritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SeveritiesOK, error) { +func (a *Client) GetPriority(params *GetPriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPriorityOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SeveritiesParams() + params = NewGetPriorityParams() } op := &runtime.ClientOperation{ - ID: "getV1Severities", + ID: "get_priority", Method: "GET", - PathPattern: "/v1/severities", + PathPattern: "/v1/priorities/{priority_slug}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SeveritiesReader{formats: a.formats}, + Reader: &GetPriorityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1062,35 +1062,35 @@ func (a *Client) GetV1Severities(params *GetV1SeveritiesParams, authInfo runtime if err != nil { return nil, err } - success, ok := result.(*GetV1SeveritiesOK) + success, ok := result.(*GetPriorityOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Severities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_priority: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SeveritiesSeveritySlug gets a severity +GetSeverity gets a severity Retrieve a specific severity */ -func (a *Client) GetV1SeveritiesSeveritySlug(params *GetV1SeveritiesSeveritySlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SeveritiesSeveritySlugOK, error) { +func (a *Client) GetSeverity(params *GetSeverityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSeverityOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SeveritiesSeveritySlugParams() + params = NewGetSeverityParams() } op := &runtime.ClientOperation{ - ID: "getV1SeveritiesSeveritySlug", + ID: "get_severity", Method: "GET", PathPattern: "/v1/severities/{severity_slug}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SeveritiesSeveritySlugReader{formats: a.formats}, + Reader: &GetSeverityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1103,35 +1103,35 @@ func (a *Client) GetV1SeveritiesSeveritySlug(params *GetV1SeveritiesSeveritySlug if err != nil { return nil, err } - success, ok := result.(*GetV1SeveritiesSeveritySlugOK) + success, ok := result.(*GetSeverityOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SeveritiesSeveritySlug: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_severity: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SeverityMatrix gets severity matrix +GetSeverityMatrix gets severity matrix Retrieve the Severity matrix for your organization and its components and configured severities. */ -func (a *Client) GetV1SeverityMatrix(params *GetV1SeverityMatrixParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SeverityMatrixOK, error) { +func (a *Client) GetSeverityMatrix(params *GetSeverityMatrixParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSeverityMatrixOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SeverityMatrixParams() + params = NewGetSeverityMatrixParams() } op := &runtime.ClientOperation{ - ID: "getV1SeverityMatrix", + ID: "get_severity_matrix", Method: "GET", PathPattern: "/v1/severity_matrix", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SeverityMatrixReader{formats: a.formats}, + Reader: &GetSeverityMatrixReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1144,35 +1144,35 @@ func (a *Client) GetV1SeverityMatrix(params *GetV1SeverityMatrixParams, authInfo if err != nil { return nil, err } - success, ok := result.(*GetV1SeverityMatrixOK) + success, ok := result.(*GetSeverityMatrixOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SeverityMatrix: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_severity_matrix: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SeverityMatrixConditions lists severity matrix conditions +GetSeverityMatrixCondition gets a severity matrix condition -Lists conditions +Retrieve a specific condition */ -func (a *Client) GetV1SeverityMatrixConditions(params *GetV1SeverityMatrixConditionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SeverityMatrixConditionsOK, error) { +func (a *Client) GetSeverityMatrixCondition(params *GetSeverityMatrixConditionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSeverityMatrixConditionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SeverityMatrixConditionsParams() + params = NewGetSeverityMatrixConditionParams() } op := &runtime.ClientOperation{ - ID: "getV1SeverityMatrixConditions", + ID: "get_severity_matrix_condition", Method: "GET", - PathPattern: "/v1/severity_matrix/conditions", + PathPattern: "/v1/severity_matrix/conditions/{condition_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SeverityMatrixConditionsReader{formats: a.formats}, + Reader: &GetSeverityMatrixConditionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1185,35 +1185,35 @@ func (a *Client) GetV1SeverityMatrixConditions(params *GetV1SeverityMatrixCondit if err != nil { return nil, err } - success, ok := result.(*GetV1SeverityMatrixConditionsOK) + success, ok := result.(*GetSeverityMatrixConditionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SeverityMatrixConditions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_severity_matrix_condition: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SeverityMatrixConditionsConditionID gets a severity matrix condition +ListCustomFieldDefinitions lists custom field definitions -Retrieve a specific condition +List all custom field definitions */ -func (a *Client) GetV1SeverityMatrixConditionsConditionID(params *GetV1SeverityMatrixConditionsConditionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SeverityMatrixConditionsConditionIDOK, error) { +func (a *Client) ListCustomFieldDefinitions(params *ListCustomFieldDefinitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCustomFieldDefinitionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SeverityMatrixConditionsConditionIDParams() + params = NewListCustomFieldDefinitionsParams() } op := &runtime.ClientOperation{ - ID: "getV1SeverityMatrixConditionsConditionId", + ID: "list_custom_field_definitions", Method: "GET", - PathPattern: "/v1/severity_matrix/conditions/{condition_id}", + PathPattern: "/v1/custom_fields/definitions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SeverityMatrixConditionsConditionIDReader{formats: a.formats}, + Reader: &ListCustomFieldDefinitionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1226,35 +1226,35 @@ func (a *Client) GetV1SeverityMatrixConditionsConditionID(params *GetV1SeverityM if err != nil { return nil, err } - success, ok := result.(*GetV1SeverityMatrixConditionsConditionIDOK) + success, ok := result.(*ListCustomFieldDefinitionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SeverityMatrixConditionsConditionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_custom_field_definitions: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SeverityMatrixImpacts lists severity matrix impacts +ListCustomFieldSelectOptions gets available values for a custom field -Lists impacts +Get the permissible values for the a currently active custom select or multi-select field. */ -func (a *Client) GetV1SeverityMatrixImpacts(params *GetV1SeverityMatrixImpactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SeverityMatrixImpactsOK, error) { +func (a *Client) ListCustomFieldSelectOptions(params *ListCustomFieldSelectOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCustomFieldSelectOptionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SeverityMatrixImpactsParams() + params = NewListCustomFieldSelectOptionsParams() } op := &runtime.ClientOperation{ - ID: "getV1SeverityMatrixImpacts", + ID: "list_custom_field_select_options", Method: "GET", - PathPattern: "/v1/severity_matrix/impacts", + PathPattern: "/v1/custom_fields/definitions/{field_id}/select_options", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SeverityMatrixImpactsReader{formats: a.formats}, + Reader: &ListCustomFieldSelectOptionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1267,35 +1267,35 @@ func (a *Client) GetV1SeverityMatrixImpacts(params *GetV1SeverityMatrixImpactsPa if err != nil { return nil, err } - success, ok := result.(*GetV1SeverityMatrixImpactsOK) + success, ok := result.(*ListCustomFieldSelectOptionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SeverityMatrixImpacts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_custom_field_select_options: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1CustomFieldsDefinitionsFieldID updates a custom field definition +ListIncidentRoles lists incident roles -Update a single custom field definition +List all of the incident roles in the organization */ -func (a *Client) PatchV1CustomFieldsDefinitionsFieldID(params *PatchV1CustomFieldsDefinitionsFieldIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1CustomFieldsDefinitionsFieldIDOK, error) { +func (a *Client) ListIncidentRoles(params *ListIncidentRolesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentRolesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1CustomFieldsDefinitionsFieldIDParams() + params = NewListIncidentRolesParams() } op := &runtime.ClientOperation{ - ID: "patchV1CustomFieldsDefinitionsFieldId", - Method: "PATCH", - PathPattern: "/v1/custom_fields/definitions/{field_id}", + ID: "list_incident_roles", + Method: "GET", + PathPattern: "/v1/incident_roles", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1CustomFieldsDefinitionsFieldIDReader{formats: a.formats}, + Reader: &ListIncidentRolesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1308,35 +1308,35 @@ func (a *Client) PatchV1CustomFieldsDefinitionsFieldID(params *PatchV1CustomFiel if err != nil { return nil, err } - success, ok := result.(*PatchV1CustomFieldsDefinitionsFieldIDOK) + success, ok := result.(*ListIncidentRolesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1CustomFieldsDefinitionsFieldId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_roles: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IncidentRolesIncidentRoleID updates an incident role +ListIncidentTags lists incident tags -Update a single incident role from its ID +List all of the incident tags in the organization */ -func (a *Client) PatchV1IncidentRolesIncidentRoleID(params *PatchV1IncidentRolesIncidentRoleIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentRolesIncidentRoleIDOK, error) { +func (a *Client) ListIncidentTags(params *ListIncidentTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentTagsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IncidentRolesIncidentRoleIDParams() + params = NewListIncidentTagsParams() } op := &runtime.ClientOperation{ - ID: "patchV1IncidentRolesIncidentRoleId", - Method: "PATCH", - PathPattern: "/v1/incident_roles/{incident_role_id}", + ID: "list_incident_tags", + Method: "GET", + PathPattern: "/v1/incident_tags", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IncidentRolesIncidentRoleIDReader{formats: a.formats}, + Reader: &ListIncidentTagsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1349,35 +1349,35 @@ func (a *Client) PatchV1IncidentRolesIncidentRoleID(params *PatchV1IncidentRoles if err != nil { return nil, err } - success, ok := result.(*PatchV1IncidentRolesIncidentRoleIDOK) + success, ok := result.(*ListIncidentTagsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IncidentRolesIncidentRoleId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_tags: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IncidentTypesID updates an incident type +ListIncidentTypes lists incident types -Update a single incident type from its ID +List all of the incident types in the organization */ -func (a *Client) PatchV1IncidentTypesID(params *PatchV1IncidentTypesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentTypesIDOK, error) { +func (a *Client) ListIncidentTypes(params *ListIncidentTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentTypesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IncidentTypesIDParams() + params = NewListIncidentTypesParams() } op := &runtime.ClientOperation{ - ID: "patchV1IncidentTypesId", - Method: "PATCH", - PathPattern: "/v1/incident_types/{id}", + ID: "list_incident_types", + Method: "GET", + PathPattern: "/v1/incident_types", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IncidentTypesIDReader{formats: a.formats}, + Reader: &ListIncidentTypesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1390,35 +1390,35 @@ func (a *Client) PatchV1IncidentTypesID(params *PatchV1IncidentTypesIDParams, au if err != nil { return nil, err } - success, ok := result.(*PatchV1IncidentTypesIDOK) + success, ok := result.(*ListIncidentTypesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IncidentTypesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_types: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1LifecyclesMeasurementDefinitionsMeasurementDefinitionID updates a measurement definition +ListLifecycleMeasurementDefinitions lists measurement definitions -Update a single measurement definition from its ID +List all of the measurement definitions in the organization */ -func (a *Client) PatchV1LifecyclesMeasurementDefinitionsMeasurementDefinitionID(params *PatchV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDOK, error) { +func (a *Client) ListLifecycleMeasurementDefinitions(params *ListLifecycleMeasurementDefinitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListLifecycleMeasurementDefinitionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDParams() + params = NewListLifecycleMeasurementDefinitionsParams() } op := &runtime.ClientOperation{ - ID: "patchV1LifecyclesMeasurementDefinitionsMeasurementDefinitionId", - Method: "PATCH", - PathPattern: "/v1/lifecycles/measurement_definitions/{measurement_definition_id}", + ID: "list_lifecycle_measurement_definitions", + Method: "GET", + PathPattern: "/v1/lifecycles/measurement_definitions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDReader{formats: a.formats}, + Reader: &ListLifecycleMeasurementDefinitionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1431,35 +1431,35 @@ func (a *Client) PatchV1LifecyclesMeasurementDefinitionsMeasurementDefinitionID( if err != nil { return nil, err } - success, ok := result.(*PatchV1LifecyclesMeasurementDefinitionsMeasurementDefinitionIDOK) + success, ok := result.(*ListLifecycleMeasurementDefinitionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1LifecyclesMeasurementDefinitionsMeasurementDefinitionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_lifecycle_measurement_definitions: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1LifecyclesMilestonesMilestoneID updates a milestone +ListLifecyclePhases lists phases and milestones -Update a milestone +List all of the lifecycle phases and milestones in the organization */ -func (a *Client) PatchV1LifecyclesMilestonesMilestoneID(params *PatchV1LifecyclesMilestonesMilestoneIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1LifecyclesMilestonesMilestoneIDOK, error) { +func (a *Client) ListLifecyclePhases(params *ListLifecyclePhasesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListLifecyclePhasesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1LifecyclesMilestonesMilestoneIDParams() + params = NewListLifecyclePhasesParams() } op := &runtime.ClientOperation{ - ID: "patchV1LifecyclesMilestonesMilestoneId", - Method: "PATCH", - PathPattern: "/v1/lifecycles/milestones/{milestone_id}", + ID: "list_lifecycle_phases", + Method: "GET", + PathPattern: "/v1/lifecycles/phases", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1LifecyclesMilestonesMilestoneIDReader{formats: a.formats}, + Reader: &ListLifecyclePhasesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1472,35 +1472,35 @@ func (a *Client) PatchV1LifecyclesMilestonesMilestoneID(params *PatchV1Lifecycle if err != nil { return nil, err } - success, ok := result.(*PatchV1LifecyclesMilestonesMilestoneIDOK) + success, ok := result.(*ListLifecyclePhasesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1LifecyclesMilestonesMilestoneId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_lifecycle_phases: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1PrioritiesPrioritySlug updates a priority +ListPriorities lists priorities -Update a specific priority +Lists priorities */ -func (a *Client) PatchV1PrioritiesPrioritySlug(params *PatchV1PrioritiesPrioritySlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1PrioritiesPrioritySlugOK, error) { +func (a *Client) ListPriorities(params *ListPrioritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPrioritiesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1PrioritiesPrioritySlugParams() + params = NewListPrioritiesParams() } op := &runtime.ClientOperation{ - ID: "patchV1PrioritiesPrioritySlug", - Method: "PATCH", - PathPattern: "/v1/priorities/{priority_slug}", + ID: "list_priorities", + Method: "GET", + PathPattern: "/v1/priorities", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1PrioritiesPrioritySlugReader{formats: a.formats}, + Reader: &ListPrioritiesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1513,35 +1513,35 @@ func (a *Client) PatchV1PrioritiesPrioritySlug(params *PatchV1PrioritiesPriority if err != nil { return nil, err } - success, ok := result.(*PatchV1PrioritiesPrioritySlugOK) + success, ok := result.(*ListPrioritiesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1PrioritiesPrioritySlug: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_priorities: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1SeveritiesSeveritySlug updates a severity +ListSeverities lists severities -Update a specific severity +Lists severities */ -func (a *Client) PatchV1SeveritiesSeveritySlug(params *PatchV1SeveritiesSeveritySlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SeveritiesSeveritySlugOK, error) { +func (a *Client) ListSeverities(params *ListSeveritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSeveritiesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1SeveritiesSeveritySlugParams() + params = NewListSeveritiesParams() } op := &runtime.ClientOperation{ - ID: "patchV1SeveritiesSeveritySlug", - Method: "PATCH", - PathPattern: "/v1/severities/{severity_slug}", + ID: "list_severities", + Method: "GET", + PathPattern: "/v1/severities", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1SeveritiesSeveritySlugReader{formats: a.formats}, + Reader: &ListSeveritiesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1554,35 +1554,35 @@ func (a *Client) PatchV1SeveritiesSeveritySlug(params *PatchV1SeveritiesSeverity if err != nil { return nil, err } - success, ok := result.(*PatchV1SeveritiesSeveritySlugOK) + success, ok := result.(*ListSeveritiesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1SeveritiesSeveritySlug: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_severities: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1SeverityMatrix updates severity matrix +ListSeverityMatrixConditions lists severity matrix conditions -Update available severities and impacts in your organization's severity matrix. +Lists conditions */ -func (a *Client) PatchV1SeverityMatrix(params *PatchV1SeverityMatrixParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SeverityMatrixOK, error) { +func (a *Client) ListSeverityMatrixConditions(params *ListSeverityMatrixConditionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSeverityMatrixConditionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1SeverityMatrixParams() + params = NewListSeverityMatrixConditionsParams() } op := &runtime.ClientOperation{ - ID: "patchV1SeverityMatrix", - Method: "PATCH", - PathPattern: "/v1/severity_matrix", + ID: "list_severity_matrix_conditions", + Method: "GET", + PathPattern: "/v1/severity_matrix/conditions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1SeverityMatrixReader{formats: a.formats}, + Reader: &ListSeverityMatrixConditionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1595,35 +1595,35 @@ func (a *Client) PatchV1SeverityMatrix(params *PatchV1SeverityMatrixParams, auth if err != nil { return nil, err } - success, ok := result.(*PatchV1SeverityMatrixOK) + success, ok := result.(*ListSeverityMatrixConditionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1SeverityMatrix: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_severity_matrix_conditions: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1SeverityMatrixConditionsConditionID updates a severity matrix condition +ListSeverityMatrixImpacts lists severity matrix impacts -Update a severity matrix condition +Lists impacts */ -func (a *Client) PatchV1SeverityMatrixConditionsConditionID(params *PatchV1SeverityMatrixConditionsConditionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SeverityMatrixConditionsConditionIDOK, error) { +func (a *Client) ListSeverityMatrixImpacts(params *ListSeverityMatrixImpactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSeverityMatrixImpactsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1SeverityMatrixConditionsConditionIDParams() + params = NewListSeverityMatrixImpactsParams() } op := &runtime.ClientOperation{ - ID: "patchV1SeverityMatrixConditionsConditionId", - Method: "PATCH", - PathPattern: "/v1/severity_matrix/conditions/{condition_id}", + ID: "list_severity_matrix_impacts", + Method: "GET", + PathPattern: "/v1/severity_matrix/impacts", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1SeverityMatrixConditionsConditionIDReader{formats: a.formats}, + Reader: &ListSeverityMatrixImpactsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1636,35 +1636,35 @@ func (a *Client) PatchV1SeverityMatrixConditionsConditionID(params *PatchV1Sever if err != nil { return nil, err } - success, ok := result.(*PatchV1SeverityMatrixConditionsConditionIDOK) + success, ok := result.(*ListSeverityMatrixImpactsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1SeverityMatrixConditionsConditionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_severity_matrix_impacts: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1SeverityMatrixImpactsImpactID updates a severity matrix impact +UpdateCustomFieldDefinition updates a custom field definition -Update a severity matrix impact +Update a single custom field definition */ -func (a *Client) PatchV1SeverityMatrixImpactsImpactID(params *PatchV1SeverityMatrixImpactsImpactIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SeverityMatrixImpactsImpactIDOK, error) { +func (a *Client) UpdateCustomFieldDefinition(params *UpdateCustomFieldDefinitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCustomFieldDefinitionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1SeverityMatrixImpactsImpactIDParams() + params = NewUpdateCustomFieldDefinitionParams() } op := &runtime.ClientOperation{ - ID: "patchV1SeverityMatrixImpactsImpactId", + ID: "update_custom_field_definition", Method: "PATCH", - PathPattern: "/v1/severity_matrix/impacts/{impact_id}", + PathPattern: "/v1/custom_fields/definitions/{field_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1SeverityMatrixImpactsImpactIDReader{formats: a.formats}, + Reader: &UpdateCustomFieldDefinitionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1677,35 +1677,35 @@ func (a *Client) PatchV1SeverityMatrixImpactsImpactID(params *PatchV1SeverityMat if err != nil { return nil, err } - success, ok := result.(*PatchV1SeverityMatrixImpactsImpactIDOK) + success, ok := result.(*UpdateCustomFieldDefinitionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1SeverityMatrixImpactsImpactId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_custom_field_definition: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1CustomFieldsDefinitions creates a custom field definition +UpdateIncidentRole updates an incident role -Create a new custom field definition +Update a single incident role from its ID */ -func (a *Client) PostV1CustomFieldsDefinitions(params *PostV1CustomFieldsDefinitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1CustomFieldsDefinitionsCreated, error) { +func (a *Client) UpdateIncidentRole(params *UpdateIncidentRoleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentRoleOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1CustomFieldsDefinitionsParams() + params = NewUpdateIncidentRoleParams() } op := &runtime.ClientOperation{ - ID: "postV1CustomFieldsDefinitions", - Method: "POST", - PathPattern: "/v1/custom_fields/definitions", + ID: "update_incident_role", + Method: "PATCH", + PathPattern: "/v1/incident_roles/{incident_role_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1CustomFieldsDefinitionsReader{formats: a.formats}, + Reader: &UpdateIncidentRoleReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1718,35 +1718,35 @@ func (a *Client) PostV1CustomFieldsDefinitions(params *PostV1CustomFieldsDefinit if err != nil { return nil, err } - success, ok := result.(*PostV1CustomFieldsDefinitionsCreated) + success, ok := result.(*UpdateIncidentRoleOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1CustomFieldsDefinitions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_incident_role: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentRoles creates an incident role +UpdateIncidentType updates an incident type -Create a new incident role +Update a single incident type from its ID */ -func (a *Client) PostV1IncidentRoles(params *PostV1IncidentRolesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentRolesCreated, error) { +func (a *Client) UpdateIncidentType(params *UpdateIncidentTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentTypeOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentRolesParams() + params = NewUpdateIncidentTypeParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentRoles", - Method: "POST", - PathPattern: "/v1/incident_roles", + ID: "update_incident_type", + Method: "PATCH", + PathPattern: "/v1/incident_types/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentRolesReader{formats: a.formats}, + Reader: &UpdateIncidentTypeReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1759,35 +1759,35 @@ func (a *Client) PostV1IncidentRoles(params *PostV1IncidentRolesParams, authInfo if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentRolesCreated) + success, ok := result.(*UpdateIncidentTypeOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentRoles: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_incident_type: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentTagsValidate validates incident tags +UpdateLifecycleMeasurementDefinition updates a measurement definition -Validate the format of a list of tags +Update a single measurement definition from its ID */ -func (a *Client) PostV1IncidentTagsValidate(params *PostV1IncidentTagsValidateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentTagsValidateCreated, error) { +func (a *Client) UpdateLifecycleMeasurementDefinition(params *UpdateLifecycleMeasurementDefinitionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateLifecycleMeasurementDefinitionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentTagsValidateParams() + params = NewUpdateLifecycleMeasurementDefinitionParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentTagsValidate", - Method: "POST", - PathPattern: "/v1/incident_tags/validate", + ID: "update_lifecycle_measurement_definition", + Method: "PATCH", + PathPattern: "/v1/lifecycles/measurement_definitions/{measurement_definition_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentTagsValidateReader{formats: a.formats}, + Reader: &UpdateLifecycleMeasurementDefinitionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1800,35 +1800,35 @@ func (a *Client) PostV1IncidentTagsValidate(params *PostV1IncidentTagsValidatePa if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentTagsValidateCreated) + success, ok := result.(*UpdateLifecycleMeasurementDefinitionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentTagsValidate: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_lifecycle_measurement_definition: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentTypes creates an incident type +UpdateLifecycleMilestone updates a milestone -Create a new incident type +Update a milestone */ -func (a *Client) PostV1IncidentTypes(params *PostV1IncidentTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentTypesCreated, error) { +func (a *Client) UpdateLifecycleMilestone(params *UpdateLifecycleMilestoneParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateLifecycleMilestoneOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentTypesParams() + params = NewUpdateLifecycleMilestoneParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentTypes", - Method: "POST", - PathPattern: "/v1/incident_types", + ID: "update_lifecycle_milestone", + Method: "PATCH", + PathPattern: "/v1/lifecycles/milestones/{milestone_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentTypesReader{formats: a.formats}, + Reader: &UpdateLifecycleMilestoneReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1841,35 +1841,35 @@ func (a *Client) PostV1IncidentTypes(params *PostV1IncidentTypesParams, authInfo if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentTypesCreated) + success, ok := result.(*UpdateLifecycleMilestoneOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_lifecycle_milestone: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1LifecyclesMeasurementDefinitions creates a measurement definition +UpdatePriority updates a priority -Create a new measurement definition +Update a specific priority */ -func (a *Client) PostV1LifecyclesMeasurementDefinitions(params *PostV1LifecyclesMeasurementDefinitionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1LifecyclesMeasurementDefinitionsCreated, error) { +func (a *Client) UpdatePriority(params *UpdatePriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePriorityOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1LifecyclesMeasurementDefinitionsParams() + params = NewUpdatePriorityParams() } op := &runtime.ClientOperation{ - ID: "postV1LifecyclesMeasurementDefinitions", - Method: "POST", - PathPattern: "/v1/lifecycles/measurement_definitions", + ID: "update_priority", + Method: "PATCH", + PathPattern: "/v1/priorities/{priority_slug}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1LifecyclesMeasurementDefinitionsReader{formats: a.formats}, + Reader: &UpdatePriorityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1882,35 +1882,35 @@ func (a *Client) PostV1LifecyclesMeasurementDefinitions(params *PostV1Lifecycles if err != nil { return nil, err } - success, ok := result.(*PostV1LifecyclesMeasurementDefinitionsCreated) + success, ok := result.(*UpdatePriorityOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1LifecyclesMeasurementDefinitions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_priority: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1LifecyclesMilestones creates a milestone +UpdateSeverity updates a severity -Create a new milestone +Update a specific severity */ -func (a *Client) PostV1LifecyclesMilestones(params *PostV1LifecyclesMilestonesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1LifecyclesMilestonesCreated, error) { +func (a *Client) UpdateSeverity(params *UpdateSeverityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSeverityOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1LifecyclesMilestonesParams() + params = NewUpdateSeverityParams() } op := &runtime.ClientOperation{ - ID: "postV1LifecyclesMilestones", - Method: "POST", - PathPattern: "/v1/lifecycles/milestones", + ID: "update_severity", + Method: "PATCH", + PathPattern: "/v1/severities/{severity_slug}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1LifecyclesMilestonesReader{formats: a.formats}, + Reader: &UpdateSeverityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1923,35 +1923,35 @@ func (a *Client) PostV1LifecyclesMilestones(params *PostV1LifecyclesMilestonesPa if err != nil { return nil, err } - success, ok := result.(*PostV1LifecyclesMilestonesCreated) + success, ok := result.(*UpdateSeverityOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1LifecyclesMilestones: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_severity: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1Priorities creates a priority +UpdateSeverityMatrix updates severity matrix -Create a new priority +Update available severities and impacts in your organization's severity matrix. */ -func (a *Client) PostV1Priorities(params *PostV1PrioritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1PrioritiesCreated, error) { +func (a *Client) UpdateSeverityMatrix(params *UpdateSeverityMatrixParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSeverityMatrixOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1PrioritiesParams() + params = NewUpdateSeverityMatrixParams() } op := &runtime.ClientOperation{ - ID: "postV1Priorities", - Method: "POST", - PathPattern: "/v1/priorities", + ID: "update_severity_matrix", + Method: "PATCH", + PathPattern: "/v1/severity_matrix", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1PrioritiesReader{formats: a.formats}, + Reader: &UpdateSeverityMatrixReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1964,35 +1964,35 @@ func (a *Client) PostV1Priorities(params *PostV1PrioritiesParams, authInfo runti if err != nil { return nil, err } - success, ok := result.(*PostV1PrioritiesCreated) + success, ok := result.(*UpdateSeverityMatrixOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1Priorities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_severity_matrix: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1Severities creates a severity +UpdateSeverityMatrixCondition updates a severity matrix condition -Create a new severity +Update a severity matrix condition */ -func (a *Client) PostV1Severities(params *PostV1SeveritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SeveritiesCreated, error) { +func (a *Client) UpdateSeverityMatrixCondition(params *UpdateSeverityMatrixConditionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSeverityMatrixConditionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1SeveritiesParams() + params = NewUpdateSeverityMatrixConditionParams() } op := &runtime.ClientOperation{ - ID: "postV1Severities", - Method: "POST", - PathPattern: "/v1/severities", + ID: "update_severity_matrix_condition", + Method: "PATCH", + PathPattern: "/v1/severity_matrix/conditions/{condition_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1SeveritiesReader{formats: a.formats}, + Reader: &UpdateSeverityMatrixConditionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2005,35 +2005,35 @@ func (a *Client) PostV1Severities(params *PostV1SeveritiesParams, authInfo runti if err != nil { return nil, err } - success, ok := result.(*PostV1SeveritiesCreated) + success, ok := result.(*UpdateSeverityMatrixConditionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1Severities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_severity_matrix_condition: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1SeverityMatrixConditions creates a severity matrix condition +UpdateSeverityMatrixImpact updates a severity matrix impact -Create a new condition +Update a severity matrix impact */ -func (a *Client) PostV1SeverityMatrixConditions(params *PostV1SeverityMatrixConditionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SeverityMatrixConditionsCreated, error) { +func (a *Client) UpdateSeverityMatrixImpact(params *UpdateSeverityMatrixImpactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSeverityMatrixImpactOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1SeverityMatrixConditionsParams() + params = NewUpdateSeverityMatrixImpactParams() } op := &runtime.ClientOperation{ - ID: "postV1SeverityMatrixConditions", - Method: "POST", - PathPattern: "/v1/severity_matrix/conditions", + ID: "update_severity_matrix_impact", + Method: "PATCH", + PathPattern: "/v1/severity_matrix/impacts/{impact_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1SeverityMatrixConditionsReader{formats: a.formats}, + Reader: &UpdateSeverityMatrixImpactReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2046,35 +2046,35 @@ func (a *Client) PostV1SeverityMatrixConditions(params *PostV1SeverityMatrixCond if err != nil { return nil, err } - success, ok := result.(*PostV1SeverityMatrixConditionsCreated) + success, ok := result.(*UpdateSeverityMatrixImpactOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1SeverityMatrixConditions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_severity_matrix_impact: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1SeverityMatrixImpacts creates a severity matrix impact +ValidateIncidentTags validates incident tags -Create a new impact +Validate the format of a list of tags */ -func (a *Client) PostV1SeverityMatrixImpacts(params *PostV1SeverityMatrixImpactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SeverityMatrixImpactsCreated, error) { +func (a *Client) ValidateIncidentTags(params *ValidateIncidentTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ValidateIncidentTagsCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1SeverityMatrixImpactsParams() + params = NewValidateIncidentTagsParams() } op := &runtime.ClientOperation{ - ID: "postV1SeverityMatrixImpacts", + ID: "validate_incident_tags", Method: "POST", - PathPattern: "/v1/severity_matrix/impacts", + PathPattern: "/v1/incident_tags/validate", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1SeverityMatrixImpactsReader{formats: a.formats}, + Reader: &ValidateIncidentTagsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2087,13 +2087,13 @@ func (a *Client) PostV1SeverityMatrixImpacts(params *PostV1SeverityMatrixImpacts if err != nil { return nil, err } - success, ok := result.(*PostV1SeverityMatrixImpactsCreated) + success, ok := result.(*ValidateIncidentTagsCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1SeverityMatrixImpacts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for validate_incident_tags: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/incident_settings/list_custom_field_definitions_parameters.go b/client/incident_settings/list_custom_field_definitions_parameters.go new file mode 100644 index 0000000..68eec3c --- /dev/null +++ b/client/incident_settings/list_custom_field_definitions_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListCustomFieldDefinitionsParams creates a new ListCustomFieldDefinitionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListCustomFieldDefinitionsParams() *ListCustomFieldDefinitionsParams { + return &ListCustomFieldDefinitionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListCustomFieldDefinitionsParamsWithTimeout creates a new ListCustomFieldDefinitionsParams object +// with the ability to set a timeout on a request. +func NewListCustomFieldDefinitionsParamsWithTimeout(timeout time.Duration) *ListCustomFieldDefinitionsParams { + return &ListCustomFieldDefinitionsParams{ + timeout: timeout, + } +} + +// NewListCustomFieldDefinitionsParamsWithContext creates a new ListCustomFieldDefinitionsParams object +// with the ability to set a context for a request. +func NewListCustomFieldDefinitionsParamsWithContext(ctx context.Context) *ListCustomFieldDefinitionsParams { + return &ListCustomFieldDefinitionsParams{ + Context: ctx, + } +} + +// NewListCustomFieldDefinitionsParamsWithHTTPClient creates a new ListCustomFieldDefinitionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListCustomFieldDefinitionsParamsWithHTTPClient(client *http.Client) *ListCustomFieldDefinitionsParams { + return &ListCustomFieldDefinitionsParams{ + HTTPClient: client, + } +} + +/* +ListCustomFieldDefinitionsParams contains all the parameters to send to the API endpoint + + for the list custom field definitions operation. + + Typically these are written to a http.Request. +*/ +type ListCustomFieldDefinitionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list custom field definitions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListCustomFieldDefinitionsParams) WithDefaults() *ListCustomFieldDefinitionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list custom field definitions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListCustomFieldDefinitionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list custom field definitions params +func (o *ListCustomFieldDefinitionsParams) WithTimeout(timeout time.Duration) *ListCustomFieldDefinitionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list custom field definitions params +func (o *ListCustomFieldDefinitionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list custom field definitions params +func (o *ListCustomFieldDefinitionsParams) WithContext(ctx context.Context) *ListCustomFieldDefinitionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list custom field definitions params +func (o *ListCustomFieldDefinitionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list custom field definitions params +func (o *ListCustomFieldDefinitionsParams) WithHTTPClient(client *http.Client) *ListCustomFieldDefinitionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list custom field definitions params +func (o *ListCustomFieldDefinitionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListCustomFieldDefinitionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/list_custom_field_definitions_responses.go b/client/incident_settings/list_custom_field_definitions_responses.go new file mode 100644 index 0000000..c85fe4f --- /dev/null +++ b/client/incident_settings/list_custom_field_definitions_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListCustomFieldDefinitionsReader is a Reader for the ListCustomFieldDefinitions structure. +type ListCustomFieldDefinitionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListCustomFieldDefinitionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListCustomFieldDefinitionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListCustomFieldDefinitionsOK creates a ListCustomFieldDefinitionsOK with default headers values +func NewListCustomFieldDefinitionsOK() *ListCustomFieldDefinitionsOK { + return &ListCustomFieldDefinitionsOK{} +} + +/* +ListCustomFieldDefinitionsOK describes a response with status code 200, with default header values. + +List all custom field definitions +*/ +type ListCustomFieldDefinitionsOK struct { + Payload *models.OrganizationsCustomFieldDefinitionEntity +} + +// IsSuccess returns true when this list custom field definitions o k response has a 2xx status code +func (o *ListCustomFieldDefinitionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list custom field definitions o k response has a 3xx status code +func (o *ListCustomFieldDefinitionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list custom field definitions o k response has a 4xx status code +func (o *ListCustomFieldDefinitionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list custom field definitions o k response has a 5xx status code +func (o *ListCustomFieldDefinitionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list custom field definitions o k response a status code equal to that given +func (o *ListCustomFieldDefinitionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListCustomFieldDefinitionsOK) Error() string { + return fmt.Sprintf("[GET /v1/custom_fields/definitions][%d] listCustomFieldDefinitionsOK %+v", 200, o.Payload) +} + +func (o *ListCustomFieldDefinitionsOK) String() string { + return fmt.Sprintf("[GET /v1/custom_fields/definitions][%d] listCustomFieldDefinitionsOK %+v", 200, o.Payload) +} + +func (o *ListCustomFieldDefinitionsOK) GetPayload() *models.OrganizationsCustomFieldDefinitionEntity { + return o.Payload +} + +func (o *ListCustomFieldDefinitionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OrganizationsCustomFieldDefinitionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/list_custom_field_select_options_parameters.go b/client/incident_settings/list_custom_field_select_options_parameters.go new file mode 100644 index 0000000..6610e4e --- /dev/null +++ b/client/incident_settings/list_custom_field_select_options_parameters.go @@ -0,0 +1,217 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListCustomFieldSelectOptionsParams creates a new ListCustomFieldSelectOptionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListCustomFieldSelectOptionsParams() *ListCustomFieldSelectOptionsParams { + return &ListCustomFieldSelectOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListCustomFieldSelectOptionsParamsWithTimeout creates a new ListCustomFieldSelectOptionsParams object +// with the ability to set a timeout on a request. +func NewListCustomFieldSelectOptionsParamsWithTimeout(timeout time.Duration) *ListCustomFieldSelectOptionsParams { + return &ListCustomFieldSelectOptionsParams{ + timeout: timeout, + } +} + +// NewListCustomFieldSelectOptionsParamsWithContext creates a new ListCustomFieldSelectOptionsParams object +// with the ability to set a context for a request. +func NewListCustomFieldSelectOptionsParamsWithContext(ctx context.Context) *ListCustomFieldSelectOptionsParams { + return &ListCustomFieldSelectOptionsParams{ + Context: ctx, + } +} + +// NewListCustomFieldSelectOptionsParamsWithHTTPClient creates a new ListCustomFieldSelectOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListCustomFieldSelectOptionsParamsWithHTTPClient(client *http.Client) *ListCustomFieldSelectOptionsParams { + return &ListCustomFieldSelectOptionsParams{ + HTTPClient: client, + } +} + +/* +ListCustomFieldSelectOptionsParams contains all the parameters to send to the API endpoint + + for the list custom field select options operation. + + Typically these are written to a http.Request. +*/ +type ListCustomFieldSelectOptionsParams struct { + + /* AllVersions. + + If true, return all versions of the custom field definition. + */ + AllVersions *bool + + // FieldID. + FieldID string + + /* Query. + + Text string of a query for filtering values. + */ + Query *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list custom field select options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListCustomFieldSelectOptionsParams) WithDefaults() *ListCustomFieldSelectOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list custom field select options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListCustomFieldSelectOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list custom field select options params +func (o *ListCustomFieldSelectOptionsParams) WithTimeout(timeout time.Duration) *ListCustomFieldSelectOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list custom field select options params +func (o *ListCustomFieldSelectOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list custom field select options params +func (o *ListCustomFieldSelectOptionsParams) WithContext(ctx context.Context) *ListCustomFieldSelectOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list custom field select options params +func (o *ListCustomFieldSelectOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list custom field select options params +func (o *ListCustomFieldSelectOptionsParams) WithHTTPClient(client *http.Client) *ListCustomFieldSelectOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list custom field select options params +func (o *ListCustomFieldSelectOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAllVersions adds the allVersions to the list custom field select options params +func (o *ListCustomFieldSelectOptionsParams) WithAllVersions(allVersions *bool) *ListCustomFieldSelectOptionsParams { + o.SetAllVersions(allVersions) + return o +} + +// SetAllVersions adds the allVersions to the list custom field select options params +func (o *ListCustomFieldSelectOptionsParams) SetAllVersions(allVersions *bool) { + o.AllVersions = allVersions +} + +// WithFieldID adds the fieldID to the list custom field select options params +func (o *ListCustomFieldSelectOptionsParams) WithFieldID(fieldID string) *ListCustomFieldSelectOptionsParams { + o.SetFieldID(fieldID) + return o +} + +// SetFieldID adds the fieldId to the list custom field select options params +func (o *ListCustomFieldSelectOptionsParams) SetFieldID(fieldID string) { + o.FieldID = fieldID +} + +// WithQuery adds the query to the list custom field select options params +func (o *ListCustomFieldSelectOptionsParams) WithQuery(query *string) *ListCustomFieldSelectOptionsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list custom field select options params +func (o *ListCustomFieldSelectOptionsParams) SetQuery(query *string) { + o.Query = query +} + +// WriteToRequest writes these params to a swagger request +func (o *ListCustomFieldSelectOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AllVersions != nil { + + // query param all_versions + var qrAllVersions bool + + if o.AllVersions != nil { + qrAllVersions = *o.AllVersions + } + qAllVersions := swag.FormatBool(qrAllVersions) + if qAllVersions != "" { + + if err := r.SetQueryParam("all_versions", qAllVersions); err != nil { + return err + } + } + } + + // path param field_id + if err := r.SetPathParam("field_id", o.FieldID); err != nil { + return err + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/list_custom_field_select_options_responses.go b/client/incident_settings/list_custom_field_select_options_responses.go new file mode 100644 index 0000000..682b9ea --- /dev/null +++ b/client/incident_settings/list_custom_field_select_options_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListCustomFieldSelectOptionsReader is a Reader for the ListCustomFieldSelectOptions structure. +type ListCustomFieldSelectOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListCustomFieldSelectOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListCustomFieldSelectOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListCustomFieldSelectOptionsOK creates a ListCustomFieldSelectOptionsOK with default headers values +func NewListCustomFieldSelectOptionsOK() *ListCustomFieldSelectOptionsOK { + return &ListCustomFieldSelectOptionsOK{} +} + +/* +ListCustomFieldSelectOptionsOK describes a response with status code 200, with default header values. + +Get the permissible values for the a currently active custom select or multi-select field. +*/ +type ListCustomFieldSelectOptionsOK struct { + Payload *models.OrganizationsCustomFieldDefinitionEntity +} + +// IsSuccess returns true when this list custom field select options o k response has a 2xx status code +func (o *ListCustomFieldSelectOptionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list custom field select options o k response has a 3xx status code +func (o *ListCustomFieldSelectOptionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list custom field select options o k response has a 4xx status code +func (o *ListCustomFieldSelectOptionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list custom field select options o k response has a 5xx status code +func (o *ListCustomFieldSelectOptionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list custom field select options o k response a status code equal to that given +func (o *ListCustomFieldSelectOptionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListCustomFieldSelectOptionsOK) Error() string { + return fmt.Sprintf("[GET /v1/custom_fields/definitions/{field_id}/select_options][%d] listCustomFieldSelectOptionsOK %+v", 200, o.Payload) +} + +func (o *ListCustomFieldSelectOptionsOK) String() string { + return fmt.Sprintf("[GET /v1/custom_fields/definitions/{field_id}/select_options][%d] listCustomFieldSelectOptionsOK %+v", 200, o.Payload) +} + +func (o *ListCustomFieldSelectOptionsOK) GetPayload() *models.OrganizationsCustomFieldDefinitionEntity { + return o.Payload +} + +func (o *ListCustomFieldSelectOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OrganizationsCustomFieldDefinitionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/list_incident_roles_parameters.go b/client/incident_settings/list_incident_roles_parameters.go new file mode 100644 index 0000000..efc3e5a --- /dev/null +++ b/client/incident_settings/list_incident_roles_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListIncidentRolesParams creates a new ListIncidentRolesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentRolesParams() *ListIncidentRolesParams { + return &ListIncidentRolesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentRolesParamsWithTimeout creates a new ListIncidentRolesParams object +// with the ability to set a timeout on a request. +func NewListIncidentRolesParamsWithTimeout(timeout time.Duration) *ListIncidentRolesParams { + return &ListIncidentRolesParams{ + timeout: timeout, + } +} + +// NewListIncidentRolesParamsWithContext creates a new ListIncidentRolesParams object +// with the ability to set a context for a request. +func NewListIncidentRolesParamsWithContext(ctx context.Context) *ListIncidentRolesParams { + return &ListIncidentRolesParams{ + Context: ctx, + } +} + +// NewListIncidentRolesParamsWithHTTPClient creates a new ListIncidentRolesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentRolesParamsWithHTTPClient(client *http.Client) *ListIncidentRolesParams { + return &ListIncidentRolesParams{ + HTTPClient: client, + } +} + +/* +ListIncidentRolesParams contains all the parameters to send to the API endpoint + + for the list incident roles operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentRolesParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident roles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentRolesParams) WithDefaults() *ListIncidentRolesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident roles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentRolesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident roles params +func (o *ListIncidentRolesParams) WithTimeout(timeout time.Duration) *ListIncidentRolesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident roles params +func (o *ListIncidentRolesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident roles params +func (o *ListIncidentRolesParams) WithContext(ctx context.Context) *ListIncidentRolesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident roles params +func (o *ListIncidentRolesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident roles params +func (o *ListIncidentRolesParams) WithHTTPClient(client *http.Client) *ListIncidentRolesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident roles params +func (o *ListIncidentRolesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list incident roles params +func (o *ListIncidentRolesParams) WithPage(page *int32) *ListIncidentRolesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list incident roles params +func (o *ListIncidentRolesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list incident roles params +func (o *ListIncidentRolesParams) WithPerPage(perPage *int32) *ListIncidentRolesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list incident roles params +func (o *ListIncidentRolesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentRolesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/list_incident_roles_responses.go b/client/incident_settings/list_incident_roles_responses.go new file mode 100644 index 0000000..8a71282 --- /dev/null +++ b/client/incident_settings/list_incident_roles_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentRolesReader is a Reader for the ListIncidentRoles structure. +type ListIncidentRolesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentRolesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentRolesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentRolesOK creates a ListIncidentRolesOK with default headers values +func NewListIncidentRolesOK() *ListIncidentRolesOK { + return &ListIncidentRolesOK{} +} + +/* +ListIncidentRolesOK describes a response with status code 200, with default header values. + +List all of the incident roles in the organization +*/ +type ListIncidentRolesOK struct { + Payload *models.IncidentRoleEntityPaginated +} + +// IsSuccess returns true when this list incident roles o k response has a 2xx status code +func (o *ListIncidentRolesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident roles o k response has a 3xx status code +func (o *ListIncidentRolesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident roles o k response has a 4xx status code +func (o *ListIncidentRolesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident roles o k response has a 5xx status code +func (o *ListIncidentRolesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident roles o k response a status code equal to that given +func (o *ListIncidentRolesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentRolesOK) Error() string { + return fmt.Sprintf("[GET /v1/incident_roles][%d] listIncidentRolesOK %+v", 200, o.Payload) +} + +func (o *ListIncidentRolesOK) String() string { + return fmt.Sprintf("[GET /v1/incident_roles][%d] listIncidentRolesOK %+v", 200, o.Payload) +} + +func (o *ListIncidentRolesOK) GetPayload() *models.IncidentRoleEntityPaginated { + return o.Payload +} + +func (o *ListIncidentRolesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentRoleEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/list_incident_tags_parameters.go b/client/incident_settings/list_incident_tags_parameters.go new file mode 100644 index 0000000..0e90b37 --- /dev/null +++ b/client/incident_settings/list_incident_tags_parameters.go @@ -0,0 +1,160 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListIncidentTagsParams creates a new ListIncidentTagsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentTagsParams() *ListIncidentTagsParams { + return &ListIncidentTagsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentTagsParamsWithTimeout creates a new ListIncidentTagsParams object +// with the ability to set a timeout on a request. +func NewListIncidentTagsParamsWithTimeout(timeout time.Duration) *ListIncidentTagsParams { + return &ListIncidentTagsParams{ + timeout: timeout, + } +} + +// NewListIncidentTagsParamsWithContext creates a new ListIncidentTagsParams object +// with the ability to set a context for a request. +func NewListIncidentTagsParamsWithContext(ctx context.Context) *ListIncidentTagsParams { + return &ListIncidentTagsParams{ + Context: ctx, + } +} + +// NewListIncidentTagsParamsWithHTTPClient creates a new ListIncidentTagsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentTagsParamsWithHTTPClient(client *http.Client) *ListIncidentTagsParams { + return &ListIncidentTagsParams{ + HTTPClient: client, + } +} + +/* +ListIncidentTagsParams contains all the parameters to send to the API endpoint + + for the list incident tags operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentTagsParams struct { + + // Prefix. + Prefix *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident tags params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentTagsParams) WithDefaults() *ListIncidentTagsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident tags params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentTagsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident tags params +func (o *ListIncidentTagsParams) WithTimeout(timeout time.Duration) *ListIncidentTagsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident tags params +func (o *ListIncidentTagsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident tags params +func (o *ListIncidentTagsParams) WithContext(ctx context.Context) *ListIncidentTagsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident tags params +func (o *ListIncidentTagsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident tags params +func (o *ListIncidentTagsParams) WithHTTPClient(client *http.Client) *ListIncidentTagsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident tags params +func (o *ListIncidentTagsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPrefix adds the prefix to the list incident tags params +func (o *ListIncidentTagsParams) WithPrefix(prefix *string) *ListIncidentTagsParams { + o.SetPrefix(prefix) + return o +} + +// SetPrefix adds the prefix to the list incident tags params +func (o *ListIncidentTagsParams) SetPrefix(prefix *string) { + o.Prefix = prefix +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentTagsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Prefix != nil { + + // query param prefix + var qrPrefix string + + if o.Prefix != nil { + qrPrefix = *o.Prefix + } + qPrefix := qrPrefix + if qPrefix != "" { + + if err := r.SetQueryParam("prefix", qPrefix); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/list_incident_tags_responses.go b/client/incident_settings/list_incident_tags_responses.go new file mode 100644 index 0000000..317147c --- /dev/null +++ b/client/incident_settings/list_incident_tags_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentTagsReader is a Reader for the ListIncidentTags structure. +type ListIncidentTagsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentTagsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentTagsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentTagsOK creates a ListIncidentTagsOK with default headers values +func NewListIncidentTagsOK() *ListIncidentTagsOK { + return &ListIncidentTagsOK{} +} + +/* +ListIncidentTagsOK describes a response with status code 200, with default header values. + +List all of the incident tags in the organization +*/ +type ListIncidentTagsOK struct { + Payload *models.TagEntityPaginated +} + +// IsSuccess returns true when this list incident tags o k response has a 2xx status code +func (o *ListIncidentTagsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident tags o k response has a 3xx status code +func (o *ListIncidentTagsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident tags o k response has a 4xx status code +func (o *ListIncidentTagsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident tags o k response has a 5xx status code +func (o *ListIncidentTagsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident tags o k response a status code equal to that given +func (o *ListIncidentTagsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentTagsOK) Error() string { + return fmt.Sprintf("[GET /v1/incident_tags][%d] listIncidentTagsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentTagsOK) String() string { + return fmt.Sprintf("[GET /v1/incident_tags][%d] listIncidentTagsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentTagsOK) GetPayload() *models.TagEntityPaginated { + return o.Payload +} + +func (o *ListIncidentTagsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TagEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/list_incident_types_parameters.go b/client/incident_settings/list_incident_types_parameters.go new file mode 100644 index 0000000..713f75b --- /dev/null +++ b/client/incident_settings/list_incident_types_parameters.go @@ -0,0 +1,230 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListIncidentTypesParams creates a new ListIncidentTypesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentTypesParams() *ListIncidentTypesParams { + return &ListIncidentTypesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentTypesParamsWithTimeout creates a new ListIncidentTypesParams object +// with the ability to set a timeout on a request. +func NewListIncidentTypesParamsWithTimeout(timeout time.Duration) *ListIncidentTypesParams { + return &ListIncidentTypesParams{ + timeout: timeout, + } +} + +// NewListIncidentTypesParamsWithContext creates a new ListIncidentTypesParams object +// with the ability to set a context for a request. +func NewListIncidentTypesParamsWithContext(ctx context.Context) *ListIncidentTypesParams { + return &ListIncidentTypesParams{ + Context: ctx, + } +} + +// NewListIncidentTypesParamsWithHTTPClient creates a new ListIncidentTypesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentTypesParamsWithHTTPClient(client *http.Client) *ListIncidentTypesParams { + return &ListIncidentTypesParams{ + HTTPClient: client, + } +} + +/* +ListIncidentTypesParams contains all the parameters to send to the API endpoint + + for the list incident types operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentTypesParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + A query to search incident types by their name + */ + Query *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident types params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentTypesParams) WithDefaults() *ListIncidentTypesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident types params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentTypesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident types params +func (o *ListIncidentTypesParams) WithTimeout(timeout time.Duration) *ListIncidentTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident types params +func (o *ListIncidentTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident types params +func (o *ListIncidentTypesParams) WithContext(ctx context.Context) *ListIncidentTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident types params +func (o *ListIncidentTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident types params +func (o *ListIncidentTypesParams) WithHTTPClient(client *http.Client) *ListIncidentTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident types params +func (o *ListIncidentTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list incident types params +func (o *ListIncidentTypesParams) WithPage(page *int32) *ListIncidentTypesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list incident types params +func (o *ListIncidentTypesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list incident types params +func (o *ListIncidentTypesParams) WithPerPage(perPage *int32) *ListIncidentTypesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list incident types params +func (o *ListIncidentTypesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list incident types params +func (o *ListIncidentTypesParams) WithQuery(query *string) *ListIncidentTypesParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list incident types params +func (o *ListIncidentTypesParams) SetQuery(query *string) { + o.Query = query +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/list_incident_types_responses.go b/client/incident_settings/list_incident_types_responses.go new file mode 100644 index 0000000..c30a183 --- /dev/null +++ b/client/incident_settings/list_incident_types_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentTypesReader is a Reader for the ListIncidentTypes structure. +type ListIncidentTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentTypesOK creates a ListIncidentTypesOK with default headers values +func NewListIncidentTypesOK() *ListIncidentTypesOK { + return &ListIncidentTypesOK{} +} + +/* +ListIncidentTypesOK describes a response with status code 200, with default header values. + +List all of the incident types in the organization +*/ +type ListIncidentTypesOK struct { + Payload *models.IncidentTypeEntityPaginated +} + +// IsSuccess returns true when this list incident types o k response has a 2xx status code +func (o *ListIncidentTypesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident types o k response has a 3xx status code +func (o *ListIncidentTypesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident types o k response has a 4xx status code +func (o *ListIncidentTypesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident types o k response has a 5xx status code +func (o *ListIncidentTypesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident types o k response a status code equal to that given +func (o *ListIncidentTypesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentTypesOK) Error() string { + return fmt.Sprintf("[GET /v1/incident_types][%d] listIncidentTypesOK %+v", 200, o.Payload) +} + +func (o *ListIncidentTypesOK) String() string { + return fmt.Sprintf("[GET /v1/incident_types][%d] listIncidentTypesOK %+v", 200, o.Payload) +} + +func (o *ListIncidentTypesOK) GetPayload() *models.IncidentTypeEntityPaginated { + return o.Payload +} + +func (o *ListIncidentTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentTypeEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/list_lifecycle_measurement_definitions_parameters.go b/client/incident_settings/list_lifecycle_measurement_definitions_parameters.go new file mode 100644 index 0000000..cd2daae --- /dev/null +++ b/client/incident_settings/list_lifecycle_measurement_definitions_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListLifecycleMeasurementDefinitionsParams creates a new ListLifecycleMeasurementDefinitionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListLifecycleMeasurementDefinitionsParams() *ListLifecycleMeasurementDefinitionsParams { + return &ListLifecycleMeasurementDefinitionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListLifecycleMeasurementDefinitionsParamsWithTimeout creates a new ListLifecycleMeasurementDefinitionsParams object +// with the ability to set a timeout on a request. +func NewListLifecycleMeasurementDefinitionsParamsWithTimeout(timeout time.Duration) *ListLifecycleMeasurementDefinitionsParams { + return &ListLifecycleMeasurementDefinitionsParams{ + timeout: timeout, + } +} + +// NewListLifecycleMeasurementDefinitionsParamsWithContext creates a new ListLifecycleMeasurementDefinitionsParams object +// with the ability to set a context for a request. +func NewListLifecycleMeasurementDefinitionsParamsWithContext(ctx context.Context) *ListLifecycleMeasurementDefinitionsParams { + return &ListLifecycleMeasurementDefinitionsParams{ + Context: ctx, + } +} + +// NewListLifecycleMeasurementDefinitionsParamsWithHTTPClient creates a new ListLifecycleMeasurementDefinitionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListLifecycleMeasurementDefinitionsParamsWithHTTPClient(client *http.Client) *ListLifecycleMeasurementDefinitionsParams { + return &ListLifecycleMeasurementDefinitionsParams{ + HTTPClient: client, + } +} + +/* +ListLifecycleMeasurementDefinitionsParams contains all the parameters to send to the API endpoint + + for the list lifecycle measurement definitions operation. + + Typically these are written to a http.Request. +*/ +type ListLifecycleMeasurementDefinitionsParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list lifecycle measurement definitions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListLifecycleMeasurementDefinitionsParams) WithDefaults() *ListLifecycleMeasurementDefinitionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list lifecycle measurement definitions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListLifecycleMeasurementDefinitionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list lifecycle measurement definitions params +func (o *ListLifecycleMeasurementDefinitionsParams) WithTimeout(timeout time.Duration) *ListLifecycleMeasurementDefinitionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list lifecycle measurement definitions params +func (o *ListLifecycleMeasurementDefinitionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list lifecycle measurement definitions params +func (o *ListLifecycleMeasurementDefinitionsParams) WithContext(ctx context.Context) *ListLifecycleMeasurementDefinitionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list lifecycle measurement definitions params +func (o *ListLifecycleMeasurementDefinitionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list lifecycle measurement definitions params +func (o *ListLifecycleMeasurementDefinitionsParams) WithHTTPClient(client *http.Client) *ListLifecycleMeasurementDefinitionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list lifecycle measurement definitions params +func (o *ListLifecycleMeasurementDefinitionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list lifecycle measurement definitions params +func (o *ListLifecycleMeasurementDefinitionsParams) WithPage(page *int32) *ListLifecycleMeasurementDefinitionsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list lifecycle measurement definitions params +func (o *ListLifecycleMeasurementDefinitionsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list lifecycle measurement definitions params +func (o *ListLifecycleMeasurementDefinitionsParams) WithPerPage(perPage *int32) *ListLifecycleMeasurementDefinitionsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list lifecycle measurement definitions params +func (o *ListLifecycleMeasurementDefinitionsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListLifecycleMeasurementDefinitionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/list_lifecycle_measurement_definitions_responses.go b/client/incident_settings/list_lifecycle_measurement_definitions_responses.go new file mode 100644 index 0000000..91502e4 --- /dev/null +++ b/client/incident_settings/list_lifecycle_measurement_definitions_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListLifecycleMeasurementDefinitionsReader is a Reader for the ListLifecycleMeasurementDefinitions structure. +type ListLifecycleMeasurementDefinitionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListLifecycleMeasurementDefinitionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListLifecycleMeasurementDefinitionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListLifecycleMeasurementDefinitionsOK creates a ListLifecycleMeasurementDefinitionsOK with default headers values +func NewListLifecycleMeasurementDefinitionsOK() *ListLifecycleMeasurementDefinitionsOK { + return &ListLifecycleMeasurementDefinitionsOK{} +} + +/* +ListLifecycleMeasurementDefinitionsOK describes a response with status code 200, with default header values. + +List all of the measurement definitions in the organization +*/ +type ListLifecycleMeasurementDefinitionsOK struct { +} + +// IsSuccess returns true when this list lifecycle measurement definitions o k response has a 2xx status code +func (o *ListLifecycleMeasurementDefinitionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list lifecycle measurement definitions o k response has a 3xx status code +func (o *ListLifecycleMeasurementDefinitionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list lifecycle measurement definitions o k response has a 4xx status code +func (o *ListLifecycleMeasurementDefinitionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list lifecycle measurement definitions o k response has a 5xx status code +func (o *ListLifecycleMeasurementDefinitionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list lifecycle measurement definitions o k response a status code equal to that given +func (o *ListLifecycleMeasurementDefinitionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListLifecycleMeasurementDefinitionsOK) Error() string { + return fmt.Sprintf("[GET /v1/lifecycles/measurement_definitions][%d] listLifecycleMeasurementDefinitionsOK ", 200) +} + +func (o *ListLifecycleMeasurementDefinitionsOK) String() string { + return fmt.Sprintf("[GET /v1/lifecycles/measurement_definitions][%d] listLifecycleMeasurementDefinitionsOK ", 200) +} + +func (o *ListLifecycleMeasurementDefinitionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/incident_settings/list_lifecycle_phases_parameters.go b/client/incident_settings/list_lifecycle_phases_parameters.go new file mode 100644 index 0000000..cd8a542 --- /dev/null +++ b/client/incident_settings/list_lifecycle_phases_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListLifecyclePhasesParams creates a new ListLifecyclePhasesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListLifecyclePhasesParams() *ListLifecyclePhasesParams { + return &ListLifecyclePhasesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListLifecyclePhasesParamsWithTimeout creates a new ListLifecyclePhasesParams object +// with the ability to set a timeout on a request. +func NewListLifecyclePhasesParamsWithTimeout(timeout time.Duration) *ListLifecyclePhasesParams { + return &ListLifecyclePhasesParams{ + timeout: timeout, + } +} + +// NewListLifecyclePhasesParamsWithContext creates a new ListLifecyclePhasesParams object +// with the ability to set a context for a request. +func NewListLifecyclePhasesParamsWithContext(ctx context.Context) *ListLifecyclePhasesParams { + return &ListLifecyclePhasesParams{ + Context: ctx, + } +} + +// NewListLifecyclePhasesParamsWithHTTPClient creates a new ListLifecyclePhasesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListLifecyclePhasesParamsWithHTTPClient(client *http.Client) *ListLifecyclePhasesParams { + return &ListLifecyclePhasesParams{ + HTTPClient: client, + } +} + +/* +ListLifecyclePhasesParams contains all the parameters to send to the API endpoint + + for the list lifecycle phases operation. + + Typically these are written to a http.Request. +*/ +type ListLifecyclePhasesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list lifecycle phases params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListLifecyclePhasesParams) WithDefaults() *ListLifecyclePhasesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list lifecycle phases params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListLifecyclePhasesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list lifecycle phases params +func (o *ListLifecyclePhasesParams) WithTimeout(timeout time.Duration) *ListLifecyclePhasesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list lifecycle phases params +func (o *ListLifecyclePhasesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list lifecycle phases params +func (o *ListLifecyclePhasesParams) WithContext(ctx context.Context) *ListLifecyclePhasesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list lifecycle phases params +func (o *ListLifecyclePhasesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list lifecycle phases params +func (o *ListLifecyclePhasesParams) WithHTTPClient(client *http.Client) *ListLifecyclePhasesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list lifecycle phases params +func (o *ListLifecyclePhasesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListLifecyclePhasesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/list_lifecycle_phases_responses.go b/client/incident_settings/list_lifecycle_phases_responses.go new file mode 100644 index 0000000..7050db5 --- /dev/null +++ b/client/incident_settings/list_lifecycle_phases_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListLifecyclePhasesReader is a Reader for the ListLifecyclePhases structure. +type ListLifecyclePhasesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListLifecyclePhasesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListLifecyclePhasesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListLifecyclePhasesOK creates a ListLifecyclePhasesOK with default headers values +func NewListLifecyclePhasesOK() *ListLifecyclePhasesOK { + return &ListLifecyclePhasesOK{} +} + +/* +ListLifecyclePhasesOK describes a response with status code 200, with default header values. + +List all of the lifecycle phases and milestones in the organization +*/ +type ListLifecyclePhasesOK struct { + Payload *models.LifecyclesPhaseEntityList +} + +// IsSuccess returns true when this list lifecycle phases o k response has a 2xx status code +func (o *ListLifecyclePhasesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list lifecycle phases o k response has a 3xx status code +func (o *ListLifecyclePhasesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list lifecycle phases o k response has a 4xx status code +func (o *ListLifecyclePhasesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list lifecycle phases o k response has a 5xx status code +func (o *ListLifecyclePhasesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list lifecycle phases o k response a status code equal to that given +func (o *ListLifecyclePhasesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListLifecyclePhasesOK) Error() string { + return fmt.Sprintf("[GET /v1/lifecycles/phases][%d] listLifecyclePhasesOK %+v", 200, o.Payload) +} + +func (o *ListLifecyclePhasesOK) String() string { + return fmt.Sprintf("[GET /v1/lifecycles/phases][%d] listLifecyclePhasesOK %+v", 200, o.Payload) +} + +func (o *ListLifecyclePhasesOK) GetPayload() *models.LifecyclesPhaseEntityList { + return o.Payload +} + +func (o *ListLifecyclePhasesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.LifecyclesPhaseEntityList) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/list_priorities_parameters.go b/client/incident_settings/list_priorities_parameters.go new file mode 100644 index 0000000..eca608f --- /dev/null +++ b/client/incident_settings/list_priorities_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListPrioritiesParams creates a new ListPrioritiesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListPrioritiesParams() *ListPrioritiesParams { + return &ListPrioritiesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListPrioritiesParamsWithTimeout creates a new ListPrioritiesParams object +// with the ability to set a timeout on a request. +func NewListPrioritiesParamsWithTimeout(timeout time.Duration) *ListPrioritiesParams { + return &ListPrioritiesParams{ + timeout: timeout, + } +} + +// NewListPrioritiesParamsWithContext creates a new ListPrioritiesParams object +// with the ability to set a context for a request. +func NewListPrioritiesParamsWithContext(ctx context.Context) *ListPrioritiesParams { + return &ListPrioritiesParams{ + Context: ctx, + } +} + +// NewListPrioritiesParamsWithHTTPClient creates a new ListPrioritiesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListPrioritiesParamsWithHTTPClient(client *http.Client) *ListPrioritiesParams { + return &ListPrioritiesParams{ + HTTPClient: client, + } +} + +/* +ListPrioritiesParams contains all the parameters to send to the API endpoint + + for the list priorities operation. + + Typically these are written to a http.Request. +*/ +type ListPrioritiesParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list priorities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListPrioritiesParams) WithDefaults() *ListPrioritiesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list priorities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListPrioritiesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list priorities params +func (o *ListPrioritiesParams) WithTimeout(timeout time.Duration) *ListPrioritiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list priorities params +func (o *ListPrioritiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list priorities params +func (o *ListPrioritiesParams) WithContext(ctx context.Context) *ListPrioritiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list priorities params +func (o *ListPrioritiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list priorities params +func (o *ListPrioritiesParams) WithHTTPClient(client *http.Client) *ListPrioritiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list priorities params +func (o *ListPrioritiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list priorities params +func (o *ListPrioritiesParams) WithPage(page *int32) *ListPrioritiesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list priorities params +func (o *ListPrioritiesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list priorities params +func (o *ListPrioritiesParams) WithPerPage(perPage *int32) *ListPrioritiesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list priorities params +func (o *ListPrioritiesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListPrioritiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/list_priorities_responses.go b/client/incident_settings/list_priorities_responses.go new file mode 100644 index 0000000..941f170 --- /dev/null +++ b/client/incident_settings/list_priorities_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListPrioritiesReader is a Reader for the ListPriorities structure. +type ListPrioritiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListPrioritiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListPrioritiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListPrioritiesOK creates a ListPrioritiesOK with default headers values +func NewListPrioritiesOK() *ListPrioritiesOK { + return &ListPrioritiesOK{} +} + +/* +ListPrioritiesOK describes a response with status code 200, with default header values. + +Lists priorities +*/ +type ListPrioritiesOK struct { + Payload *models.PriorityEntity +} + +// IsSuccess returns true when this list priorities o k response has a 2xx status code +func (o *ListPrioritiesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list priorities o k response has a 3xx status code +func (o *ListPrioritiesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list priorities o k response has a 4xx status code +func (o *ListPrioritiesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list priorities o k response has a 5xx status code +func (o *ListPrioritiesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list priorities o k response a status code equal to that given +func (o *ListPrioritiesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListPrioritiesOK) Error() string { + return fmt.Sprintf("[GET /v1/priorities][%d] listPrioritiesOK %+v", 200, o.Payload) +} + +func (o *ListPrioritiesOK) String() string { + return fmt.Sprintf("[GET /v1/priorities][%d] listPrioritiesOK %+v", 200, o.Payload) +} + +func (o *ListPrioritiesOK) GetPayload() *models.PriorityEntity { + return o.Payload +} + +func (o *ListPrioritiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PriorityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/list_severities_parameters.go b/client/incident_settings/list_severities_parameters.go new file mode 100644 index 0000000..0d8c1c4 --- /dev/null +++ b/client/incident_settings/list_severities_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListSeveritiesParams creates a new ListSeveritiesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSeveritiesParams() *ListSeveritiesParams { + return &ListSeveritiesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSeveritiesParamsWithTimeout creates a new ListSeveritiesParams object +// with the ability to set a timeout on a request. +func NewListSeveritiesParamsWithTimeout(timeout time.Duration) *ListSeveritiesParams { + return &ListSeveritiesParams{ + timeout: timeout, + } +} + +// NewListSeveritiesParamsWithContext creates a new ListSeveritiesParams object +// with the ability to set a context for a request. +func NewListSeveritiesParamsWithContext(ctx context.Context) *ListSeveritiesParams { + return &ListSeveritiesParams{ + Context: ctx, + } +} + +// NewListSeveritiesParamsWithHTTPClient creates a new ListSeveritiesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSeveritiesParamsWithHTTPClient(client *http.Client) *ListSeveritiesParams { + return &ListSeveritiesParams{ + HTTPClient: client, + } +} + +/* +ListSeveritiesParams contains all the parameters to send to the API endpoint + + for the list severities operation. + + Typically these are written to a http.Request. +*/ +type ListSeveritiesParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list severities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSeveritiesParams) WithDefaults() *ListSeveritiesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list severities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSeveritiesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list severities params +func (o *ListSeveritiesParams) WithTimeout(timeout time.Duration) *ListSeveritiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list severities params +func (o *ListSeveritiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list severities params +func (o *ListSeveritiesParams) WithContext(ctx context.Context) *ListSeveritiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list severities params +func (o *ListSeveritiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list severities params +func (o *ListSeveritiesParams) WithHTTPClient(client *http.Client) *ListSeveritiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list severities params +func (o *ListSeveritiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list severities params +func (o *ListSeveritiesParams) WithPage(page *int32) *ListSeveritiesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list severities params +func (o *ListSeveritiesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list severities params +func (o *ListSeveritiesParams) WithPerPage(perPage *int32) *ListSeveritiesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list severities params +func (o *ListSeveritiesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSeveritiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/list_severities_responses.go b/client/incident_settings/list_severities_responses.go new file mode 100644 index 0000000..5b7c7c0 --- /dev/null +++ b/client/incident_settings/list_severities_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListSeveritiesReader is a Reader for the ListSeverities structure. +type ListSeveritiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSeveritiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSeveritiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListSeveritiesOK creates a ListSeveritiesOK with default headers values +func NewListSeveritiesOK() *ListSeveritiesOK { + return &ListSeveritiesOK{} +} + +/* +ListSeveritiesOK describes a response with status code 200, with default header values. + +Lists severities +*/ +type ListSeveritiesOK struct { + Payload *models.SeverityEntityPaginated +} + +// IsSuccess returns true when this list severities o k response has a 2xx status code +func (o *ListSeveritiesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list severities o k response has a 3xx status code +func (o *ListSeveritiesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list severities o k response has a 4xx status code +func (o *ListSeveritiesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list severities o k response has a 5xx status code +func (o *ListSeveritiesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list severities o k response a status code equal to that given +func (o *ListSeveritiesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListSeveritiesOK) Error() string { + return fmt.Sprintf("[GET /v1/severities][%d] listSeveritiesOK %+v", 200, o.Payload) +} + +func (o *ListSeveritiesOK) String() string { + return fmt.Sprintf("[GET /v1/severities][%d] listSeveritiesOK %+v", 200, o.Payload) +} + +func (o *ListSeveritiesOK) GetPayload() *models.SeverityEntityPaginated { + return o.Payload +} + +func (o *ListSeveritiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/list_severity_matrix_conditions_parameters.go b/client/incident_settings/list_severity_matrix_conditions_parameters.go new file mode 100644 index 0000000..02bd95a --- /dev/null +++ b/client/incident_settings/list_severity_matrix_conditions_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListSeverityMatrixConditionsParams creates a new ListSeverityMatrixConditionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSeverityMatrixConditionsParams() *ListSeverityMatrixConditionsParams { + return &ListSeverityMatrixConditionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSeverityMatrixConditionsParamsWithTimeout creates a new ListSeverityMatrixConditionsParams object +// with the ability to set a timeout on a request. +func NewListSeverityMatrixConditionsParamsWithTimeout(timeout time.Duration) *ListSeverityMatrixConditionsParams { + return &ListSeverityMatrixConditionsParams{ + timeout: timeout, + } +} + +// NewListSeverityMatrixConditionsParamsWithContext creates a new ListSeverityMatrixConditionsParams object +// with the ability to set a context for a request. +func NewListSeverityMatrixConditionsParamsWithContext(ctx context.Context) *ListSeverityMatrixConditionsParams { + return &ListSeverityMatrixConditionsParams{ + Context: ctx, + } +} + +// NewListSeverityMatrixConditionsParamsWithHTTPClient creates a new ListSeverityMatrixConditionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSeverityMatrixConditionsParamsWithHTTPClient(client *http.Client) *ListSeverityMatrixConditionsParams { + return &ListSeverityMatrixConditionsParams{ + HTTPClient: client, + } +} + +/* +ListSeverityMatrixConditionsParams contains all the parameters to send to the API endpoint + + for the list severity matrix conditions operation. + + Typically these are written to a http.Request. +*/ +type ListSeverityMatrixConditionsParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list severity matrix conditions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSeverityMatrixConditionsParams) WithDefaults() *ListSeverityMatrixConditionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list severity matrix conditions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSeverityMatrixConditionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list severity matrix conditions params +func (o *ListSeverityMatrixConditionsParams) WithTimeout(timeout time.Duration) *ListSeverityMatrixConditionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list severity matrix conditions params +func (o *ListSeverityMatrixConditionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list severity matrix conditions params +func (o *ListSeverityMatrixConditionsParams) WithContext(ctx context.Context) *ListSeverityMatrixConditionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list severity matrix conditions params +func (o *ListSeverityMatrixConditionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list severity matrix conditions params +func (o *ListSeverityMatrixConditionsParams) WithHTTPClient(client *http.Client) *ListSeverityMatrixConditionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list severity matrix conditions params +func (o *ListSeverityMatrixConditionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list severity matrix conditions params +func (o *ListSeverityMatrixConditionsParams) WithPage(page *int32) *ListSeverityMatrixConditionsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list severity matrix conditions params +func (o *ListSeverityMatrixConditionsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list severity matrix conditions params +func (o *ListSeverityMatrixConditionsParams) WithPerPage(perPage *int32) *ListSeverityMatrixConditionsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list severity matrix conditions params +func (o *ListSeverityMatrixConditionsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSeverityMatrixConditionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/list_severity_matrix_conditions_responses.go b/client/incident_settings/list_severity_matrix_conditions_responses.go new file mode 100644 index 0000000..e29ce28 --- /dev/null +++ b/client/incident_settings/list_severity_matrix_conditions_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListSeverityMatrixConditionsReader is a Reader for the ListSeverityMatrixConditions structure. +type ListSeverityMatrixConditionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSeverityMatrixConditionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSeverityMatrixConditionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListSeverityMatrixConditionsOK creates a ListSeverityMatrixConditionsOK with default headers values +func NewListSeverityMatrixConditionsOK() *ListSeverityMatrixConditionsOK { + return &ListSeverityMatrixConditionsOK{} +} + +/* +ListSeverityMatrixConditionsOK describes a response with status code 200, with default header values. + +Lists conditions +*/ +type ListSeverityMatrixConditionsOK struct { + Payload *models.SeverityMatrixConditionEntity +} + +// IsSuccess returns true when this list severity matrix conditions o k response has a 2xx status code +func (o *ListSeverityMatrixConditionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list severity matrix conditions o k response has a 3xx status code +func (o *ListSeverityMatrixConditionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list severity matrix conditions o k response has a 4xx status code +func (o *ListSeverityMatrixConditionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list severity matrix conditions o k response has a 5xx status code +func (o *ListSeverityMatrixConditionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list severity matrix conditions o k response a status code equal to that given +func (o *ListSeverityMatrixConditionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListSeverityMatrixConditionsOK) Error() string { + return fmt.Sprintf("[GET /v1/severity_matrix/conditions][%d] listSeverityMatrixConditionsOK %+v", 200, o.Payload) +} + +func (o *ListSeverityMatrixConditionsOK) String() string { + return fmt.Sprintf("[GET /v1/severity_matrix/conditions][%d] listSeverityMatrixConditionsOK %+v", 200, o.Payload) +} + +func (o *ListSeverityMatrixConditionsOK) GetPayload() *models.SeverityMatrixConditionEntity { + return o.Payload +} + +func (o *ListSeverityMatrixConditionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityMatrixConditionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/list_severity_matrix_impacts_parameters.go b/client/incident_settings/list_severity_matrix_impacts_parameters.go new file mode 100644 index 0000000..477feaa --- /dev/null +++ b/client/incident_settings/list_severity_matrix_impacts_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListSeverityMatrixImpactsParams creates a new ListSeverityMatrixImpactsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSeverityMatrixImpactsParams() *ListSeverityMatrixImpactsParams { + return &ListSeverityMatrixImpactsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSeverityMatrixImpactsParamsWithTimeout creates a new ListSeverityMatrixImpactsParams object +// with the ability to set a timeout on a request. +func NewListSeverityMatrixImpactsParamsWithTimeout(timeout time.Duration) *ListSeverityMatrixImpactsParams { + return &ListSeverityMatrixImpactsParams{ + timeout: timeout, + } +} + +// NewListSeverityMatrixImpactsParamsWithContext creates a new ListSeverityMatrixImpactsParams object +// with the ability to set a context for a request. +func NewListSeverityMatrixImpactsParamsWithContext(ctx context.Context) *ListSeverityMatrixImpactsParams { + return &ListSeverityMatrixImpactsParams{ + Context: ctx, + } +} + +// NewListSeverityMatrixImpactsParamsWithHTTPClient creates a new ListSeverityMatrixImpactsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSeverityMatrixImpactsParamsWithHTTPClient(client *http.Client) *ListSeverityMatrixImpactsParams { + return &ListSeverityMatrixImpactsParams{ + HTTPClient: client, + } +} + +/* +ListSeverityMatrixImpactsParams contains all the parameters to send to the API endpoint + + for the list severity matrix impacts operation. + + Typically these are written to a http.Request. +*/ +type ListSeverityMatrixImpactsParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list severity matrix impacts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSeverityMatrixImpactsParams) WithDefaults() *ListSeverityMatrixImpactsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list severity matrix impacts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSeverityMatrixImpactsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list severity matrix impacts params +func (o *ListSeverityMatrixImpactsParams) WithTimeout(timeout time.Duration) *ListSeverityMatrixImpactsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list severity matrix impacts params +func (o *ListSeverityMatrixImpactsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list severity matrix impacts params +func (o *ListSeverityMatrixImpactsParams) WithContext(ctx context.Context) *ListSeverityMatrixImpactsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list severity matrix impacts params +func (o *ListSeverityMatrixImpactsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list severity matrix impacts params +func (o *ListSeverityMatrixImpactsParams) WithHTTPClient(client *http.Client) *ListSeverityMatrixImpactsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list severity matrix impacts params +func (o *ListSeverityMatrixImpactsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list severity matrix impacts params +func (o *ListSeverityMatrixImpactsParams) WithPage(page *int32) *ListSeverityMatrixImpactsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list severity matrix impacts params +func (o *ListSeverityMatrixImpactsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list severity matrix impacts params +func (o *ListSeverityMatrixImpactsParams) WithPerPage(perPage *int32) *ListSeverityMatrixImpactsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list severity matrix impacts params +func (o *ListSeverityMatrixImpactsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSeverityMatrixImpactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/list_severity_matrix_impacts_responses.go b/client/incident_settings/list_severity_matrix_impacts_responses.go new file mode 100644 index 0000000..770ad71 --- /dev/null +++ b/client/incident_settings/list_severity_matrix_impacts_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListSeverityMatrixImpactsReader is a Reader for the ListSeverityMatrixImpacts structure. +type ListSeverityMatrixImpactsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSeverityMatrixImpactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSeverityMatrixImpactsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListSeverityMatrixImpactsOK creates a ListSeverityMatrixImpactsOK with default headers values +func NewListSeverityMatrixImpactsOK() *ListSeverityMatrixImpactsOK { + return &ListSeverityMatrixImpactsOK{} +} + +/* +ListSeverityMatrixImpactsOK describes a response with status code 200, with default header values. + +Lists impacts +*/ +type ListSeverityMatrixImpactsOK struct { + Payload *models.SeverityMatrixImpactEntity +} + +// IsSuccess returns true when this list severity matrix impacts o k response has a 2xx status code +func (o *ListSeverityMatrixImpactsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list severity matrix impacts o k response has a 3xx status code +func (o *ListSeverityMatrixImpactsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list severity matrix impacts o k response has a 4xx status code +func (o *ListSeverityMatrixImpactsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list severity matrix impacts o k response has a 5xx status code +func (o *ListSeverityMatrixImpactsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list severity matrix impacts o k response a status code equal to that given +func (o *ListSeverityMatrixImpactsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListSeverityMatrixImpactsOK) Error() string { + return fmt.Sprintf("[GET /v1/severity_matrix/impacts][%d] listSeverityMatrixImpactsOK %+v", 200, o.Payload) +} + +func (o *ListSeverityMatrixImpactsOK) String() string { + return fmt.Sprintf("[GET /v1/severity_matrix/impacts][%d] listSeverityMatrixImpactsOK %+v", 200, o.Payload) +} + +func (o *ListSeverityMatrixImpactsOK) GetPayload() *models.SeverityMatrixImpactEntity { + return o.Payload +} + +func (o *ListSeverityMatrixImpactsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityMatrixImpactEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/update_custom_field_definition_parameters.go b/client/incident_settings/update_custom_field_definition_parameters.go new file mode 100644 index 0000000..1111cd0 --- /dev/null +++ b/client/incident_settings/update_custom_field_definition_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateCustomFieldDefinitionParams creates a new UpdateCustomFieldDefinitionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateCustomFieldDefinitionParams() *UpdateCustomFieldDefinitionParams { + return &UpdateCustomFieldDefinitionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateCustomFieldDefinitionParamsWithTimeout creates a new UpdateCustomFieldDefinitionParams object +// with the ability to set a timeout on a request. +func NewUpdateCustomFieldDefinitionParamsWithTimeout(timeout time.Duration) *UpdateCustomFieldDefinitionParams { + return &UpdateCustomFieldDefinitionParams{ + timeout: timeout, + } +} + +// NewUpdateCustomFieldDefinitionParamsWithContext creates a new UpdateCustomFieldDefinitionParams object +// with the ability to set a context for a request. +func NewUpdateCustomFieldDefinitionParamsWithContext(ctx context.Context) *UpdateCustomFieldDefinitionParams { + return &UpdateCustomFieldDefinitionParams{ + Context: ctx, + } +} + +// NewUpdateCustomFieldDefinitionParamsWithHTTPClient creates a new UpdateCustomFieldDefinitionParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateCustomFieldDefinitionParamsWithHTTPClient(client *http.Client) *UpdateCustomFieldDefinitionParams { + return &UpdateCustomFieldDefinitionParams{ + HTTPClient: client, + } +} + +/* +UpdateCustomFieldDefinitionParams contains all the parameters to send to the API endpoint + + for the update custom field definition operation. + + Typically these are written to a http.Request. +*/ +type UpdateCustomFieldDefinitionParams struct { + + // FieldID. + FieldID string + + // UpdateCustomFieldDefinition. + UpdateCustomFieldDefinition *models.UpdateCustomFieldDefinition + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update custom field definition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateCustomFieldDefinitionParams) WithDefaults() *UpdateCustomFieldDefinitionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update custom field definition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateCustomFieldDefinitionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update custom field definition params +func (o *UpdateCustomFieldDefinitionParams) WithTimeout(timeout time.Duration) *UpdateCustomFieldDefinitionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update custom field definition params +func (o *UpdateCustomFieldDefinitionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update custom field definition params +func (o *UpdateCustomFieldDefinitionParams) WithContext(ctx context.Context) *UpdateCustomFieldDefinitionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update custom field definition params +func (o *UpdateCustomFieldDefinitionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update custom field definition params +func (o *UpdateCustomFieldDefinitionParams) WithHTTPClient(client *http.Client) *UpdateCustomFieldDefinitionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update custom field definition params +func (o *UpdateCustomFieldDefinitionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFieldID adds the fieldID to the update custom field definition params +func (o *UpdateCustomFieldDefinitionParams) WithFieldID(fieldID string) *UpdateCustomFieldDefinitionParams { + o.SetFieldID(fieldID) + return o +} + +// SetFieldID adds the fieldId to the update custom field definition params +func (o *UpdateCustomFieldDefinitionParams) SetFieldID(fieldID string) { + o.FieldID = fieldID +} + +// WithUpdateCustomFieldDefinition adds the updateCustomFieldDefinition to the update custom field definition params +func (o *UpdateCustomFieldDefinitionParams) WithUpdateCustomFieldDefinition(updateCustomFieldDefinition *models.UpdateCustomFieldDefinition) *UpdateCustomFieldDefinitionParams { + o.SetUpdateCustomFieldDefinition(updateCustomFieldDefinition) + return o +} + +// SetUpdateCustomFieldDefinition adds the updateCustomFieldDefinition to the update custom field definition params +func (o *UpdateCustomFieldDefinitionParams) SetUpdateCustomFieldDefinition(updateCustomFieldDefinition *models.UpdateCustomFieldDefinition) { + o.UpdateCustomFieldDefinition = updateCustomFieldDefinition +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateCustomFieldDefinitionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param field_id + if err := r.SetPathParam("field_id", o.FieldID); err != nil { + return err + } + if o.UpdateCustomFieldDefinition != nil { + if err := r.SetBodyParam(o.UpdateCustomFieldDefinition); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/update_custom_field_definition_responses.go b/client/incident_settings/update_custom_field_definition_responses.go new file mode 100644 index 0000000..e6d39ea --- /dev/null +++ b/client/incident_settings/update_custom_field_definition_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateCustomFieldDefinitionReader is a Reader for the UpdateCustomFieldDefinition structure. +type UpdateCustomFieldDefinitionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateCustomFieldDefinitionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateCustomFieldDefinitionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateCustomFieldDefinitionOK creates a UpdateCustomFieldDefinitionOK with default headers values +func NewUpdateCustomFieldDefinitionOK() *UpdateCustomFieldDefinitionOK { + return &UpdateCustomFieldDefinitionOK{} +} + +/* +UpdateCustomFieldDefinitionOK describes a response with status code 200, with default header values. + +Update a single custom field definition +*/ +type UpdateCustomFieldDefinitionOK struct { + Payload *models.OrganizationsCustomFieldDefinitionEntity +} + +// IsSuccess returns true when this update custom field definition o k response has a 2xx status code +func (o *UpdateCustomFieldDefinitionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update custom field definition o k response has a 3xx status code +func (o *UpdateCustomFieldDefinitionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update custom field definition o k response has a 4xx status code +func (o *UpdateCustomFieldDefinitionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update custom field definition o k response has a 5xx status code +func (o *UpdateCustomFieldDefinitionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update custom field definition o k response a status code equal to that given +func (o *UpdateCustomFieldDefinitionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateCustomFieldDefinitionOK) Error() string { + return fmt.Sprintf("[PATCH /v1/custom_fields/definitions/{field_id}][%d] updateCustomFieldDefinitionOK %+v", 200, o.Payload) +} + +func (o *UpdateCustomFieldDefinitionOK) String() string { + return fmt.Sprintf("[PATCH /v1/custom_fields/definitions/{field_id}][%d] updateCustomFieldDefinitionOK %+v", 200, o.Payload) +} + +func (o *UpdateCustomFieldDefinitionOK) GetPayload() *models.OrganizationsCustomFieldDefinitionEntity { + return o.Payload +} + +func (o *UpdateCustomFieldDefinitionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OrganizationsCustomFieldDefinitionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/update_incident_role_parameters.go b/client/incident_settings/update_incident_role_parameters.go new file mode 100644 index 0000000..1aa9986 --- /dev/null +++ b/client/incident_settings/update_incident_role_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateIncidentRoleParams creates a new UpdateIncidentRoleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIncidentRoleParams() *UpdateIncidentRoleParams { + return &UpdateIncidentRoleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIncidentRoleParamsWithTimeout creates a new UpdateIncidentRoleParams object +// with the ability to set a timeout on a request. +func NewUpdateIncidentRoleParamsWithTimeout(timeout time.Duration) *UpdateIncidentRoleParams { + return &UpdateIncidentRoleParams{ + timeout: timeout, + } +} + +// NewUpdateIncidentRoleParamsWithContext creates a new UpdateIncidentRoleParams object +// with the ability to set a context for a request. +func NewUpdateIncidentRoleParamsWithContext(ctx context.Context) *UpdateIncidentRoleParams { + return &UpdateIncidentRoleParams{ + Context: ctx, + } +} + +// NewUpdateIncidentRoleParamsWithHTTPClient creates a new UpdateIncidentRoleParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIncidentRoleParamsWithHTTPClient(client *http.Client) *UpdateIncidentRoleParams { + return &UpdateIncidentRoleParams{ + HTTPClient: client, + } +} + +/* +UpdateIncidentRoleParams contains all the parameters to send to the API endpoint + + for the update incident role operation. + + Typically these are written to a http.Request. +*/ +type UpdateIncidentRoleParams struct { + + // IncidentRoleID. + IncidentRoleID string + + // UpdateIncidentRole. + UpdateIncidentRole *models.UpdateIncidentRole + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update incident role params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentRoleParams) WithDefaults() *UpdateIncidentRoleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update incident role params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentRoleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update incident role params +func (o *UpdateIncidentRoleParams) WithTimeout(timeout time.Duration) *UpdateIncidentRoleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update incident role params +func (o *UpdateIncidentRoleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update incident role params +func (o *UpdateIncidentRoleParams) WithContext(ctx context.Context) *UpdateIncidentRoleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update incident role params +func (o *UpdateIncidentRoleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update incident role params +func (o *UpdateIncidentRoleParams) WithHTTPClient(client *http.Client) *UpdateIncidentRoleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update incident role params +func (o *UpdateIncidentRoleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentRoleID adds the incidentRoleID to the update incident role params +func (o *UpdateIncidentRoleParams) WithIncidentRoleID(incidentRoleID string) *UpdateIncidentRoleParams { + o.SetIncidentRoleID(incidentRoleID) + return o +} + +// SetIncidentRoleID adds the incidentRoleId to the update incident role params +func (o *UpdateIncidentRoleParams) SetIncidentRoleID(incidentRoleID string) { + o.IncidentRoleID = incidentRoleID +} + +// WithUpdateIncidentRole adds the updateIncidentRole to the update incident role params +func (o *UpdateIncidentRoleParams) WithUpdateIncidentRole(updateIncidentRole *models.UpdateIncidentRole) *UpdateIncidentRoleParams { + o.SetUpdateIncidentRole(updateIncidentRole) + return o +} + +// SetUpdateIncidentRole adds the updateIncidentRole to the update incident role params +func (o *UpdateIncidentRoleParams) SetUpdateIncidentRole(updateIncidentRole *models.UpdateIncidentRole) { + o.UpdateIncidentRole = updateIncidentRole +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIncidentRoleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_role_id + if err := r.SetPathParam("incident_role_id", o.IncidentRoleID); err != nil { + return err + } + if o.UpdateIncidentRole != nil { + if err := r.SetBodyParam(o.UpdateIncidentRole); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/update_incident_role_responses.go b/client/incident_settings/update_incident_role_responses.go new file mode 100644 index 0000000..5214238 --- /dev/null +++ b/client/incident_settings/update_incident_role_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateIncidentRoleReader is a Reader for the UpdateIncidentRole structure. +type UpdateIncidentRoleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIncidentRoleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIncidentRoleOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIncidentRoleOK creates a UpdateIncidentRoleOK with default headers values +func NewUpdateIncidentRoleOK() *UpdateIncidentRoleOK { + return &UpdateIncidentRoleOK{} +} + +/* +UpdateIncidentRoleOK describes a response with status code 200, with default header values. + +Update a single incident role from its ID +*/ +type UpdateIncidentRoleOK struct { + Payload *models.IncidentRoleEntity +} + +// IsSuccess returns true when this update incident role o k response has a 2xx status code +func (o *UpdateIncidentRoleOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update incident role o k response has a 3xx status code +func (o *UpdateIncidentRoleOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident role o k response has a 4xx status code +func (o *UpdateIncidentRoleOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update incident role o k response has a 5xx status code +func (o *UpdateIncidentRoleOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident role o k response a status code equal to that given +func (o *UpdateIncidentRoleOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateIncidentRoleOK) Error() string { + return fmt.Sprintf("[PATCH /v1/incident_roles/{incident_role_id}][%d] updateIncidentRoleOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentRoleOK) String() string { + return fmt.Sprintf("[PATCH /v1/incident_roles/{incident_role_id}][%d] updateIncidentRoleOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentRoleOK) GetPayload() *models.IncidentRoleEntity { + return o.Payload +} + +func (o *UpdateIncidentRoleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentRoleEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/update_incident_type_parameters.go b/client/incident_settings/update_incident_type_parameters.go new file mode 100644 index 0000000..9f9bb7d --- /dev/null +++ b/client/incident_settings/update_incident_type_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateIncidentTypeParams creates a new UpdateIncidentTypeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIncidentTypeParams() *UpdateIncidentTypeParams { + return &UpdateIncidentTypeParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIncidentTypeParamsWithTimeout creates a new UpdateIncidentTypeParams object +// with the ability to set a timeout on a request. +func NewUpdateIncidentTypeParamsWithTimeout(timeout time.Duration) *UpdateIncidentTypeParams { + return &UpdateIncidentTypeParams{ + timeout: timeout, + } +} + +// NewUpdateIncidentTypeParamsWithContext creates a new UpdateIncidentTypeParams object +// with the ability to set a context for a request. +func NewUpdateIncidentTypeParamsWithContext(ctx context.Context) *UpdateIncidentTypeParams { + return &UpdateIncidentTypeParams{ + Context: ctx, + } +} + +// NewUpdateIncidentTypeParamsWithHTTPClient creates a new UpdateIncidentTypeParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIncidentTypeParamsWithHTTPClient(client *http.Client) *UpdateIncidentTypeParams { + return &UpdateIncidentTypeParams{ + HTTPClient: client, + } +} + +/* +UpdateIncidentTypeParams contains all the parameters to send to the API endpoint + + for the update incident type operation. + + Typically these are written to a http.Request. +*/ +type UpdateIncidentTypeParams struct { + + // ID. + ID string + + // UpdateIncidentType. + UpdateIncidentType *models.UpdateIncidentType + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update incident type params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentTypeParams) WithDefaults() *UpdateIncidentTypeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update incident type params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentTypeParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update incident type params +func (o *UpdateIncidentTypeParams) WithTimeout(timeout time.Duration) *UpdateIncidentTypeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update incident type params +func (o *UpdateIncidentTypeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update incident type params +func (o *UpdateIncidentTypeParams) WithContext(ctx context.Context) *UpdateIncidentTypeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update incident type params +func (o *UpdateIncidentTypeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update incident type params +func (o *UpdateIncidentTypeParams) WithHTTPClient(client *http.Client) *UpdateIncidentTypeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update incident type params +func (o *UpdateIncidentTypeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the update incident type params +func (o *UpdateIncidentTypeParams) WithID(id string) *UpdateIncidentTypeParams { + o.SetID(id) + return o +} + +// SetID adds the id to the update incident type params +func (o *UpdateIncidentTypeParams) SetID(id string) { + o.ID = id +} + +// WithUpdateIncidentType adds the updateIncidentType to the update incident type params +func (o *UpdateIncidentTypeParams) WithUpdateIncidentType(updateIncidentType *models.UpdateIncidentType) *UpdateIncidentTypeParams { + o.SetUpdateIncidentType(updateIncidentType) + return o +} + +// SetUpdateIncidentType adds the updateIncidentType to the update incident type params +func (o *UpdateIncidentTypeParams) SetUpdateIncidentType(updateIncidentType *models.UpdateIncidentType) { + o.UpdateIncidentType = updateIncidentType +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIncidentTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + if o.UpdateIncidentType != nil { + if err := r.SetBodyParam(o.UpdateIncidentType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/update_incident_type_responses.go b/client/incident_settings/update_incident_type_responses.go new file mode 100644 index 0000000..e517ee9 --- /dev/null +++ b/client/incident_settings/update_incident_type_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateIncidentTypeReader is a Reader for the UpdateIncidentType structure. +type UpdateIncidentTypeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIncidentTypeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIncidentTypeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIncidentTypeOK creates a UpdateIncidentTypeOK with default headers values +func NewUpdateIncidentTypeOK() *UpdateIncidentTypeOK { + return &UpdateIncidentTypeOK{} +} + +/* +UpdateIncidentTypeOK describes a response with status code 200, with default header values. + +Update a single incident type from its ID +*/ +type UpdateIncidentTypeOK struct { + Payload *models.IncidentTypeEntity +} + +// IsSuccess returns true when this update incident type o k response has a 2xx status code +func (o *UpdateIncidentTypeOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update incident type o k response has a 3xx status code +func (o *UpdateIncidentTypeOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident type o k response has a 4xx status code +func (o *UpdateIncidentTypeOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update incident type o k response has a 5xx status code +func (o *UpdateIncidentTypeOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident type o k response a status code equal to that given +func (o *UpdateIncidentTypeOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateIncidentTypeOK) Error() string { + return fmt.Sprintf("[PATCH /v1/incident_types/{id}][%d] updateIncidentTypeOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentTypeOK) String() string { + return fmt.Sprintf("[PATCH /v1/incident_types/{id}][%d] updateIncidentTypeOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentTypeOK) GetPayload() *models.IncidentTypeEntity { + return o.Payload +} + +func (o *UpdateIncidentTypeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentTypeEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/update_lifecycle_measurement_definition_parameters.go b/client/incident_settings/update_lifecycle_measurement_definition_parameters.go new file mode 100644 index 0000000..79f3bb7 --- /dev/null +++ b/client/incident_settings/update_lifecycle_measurement_definition_parameters.go @@ -0,0 +1,293 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateLifecycleMeasurementDefinitionParams creates a new UpdateLifecycleMeasurementDefinitionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateLifecycleMeasurementDefinitionParams() *UpdateLifecycleMeasurementDefinitionParams { + return &UpdateLifecycleMeasurementDefinitionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateLifecycleMeasurementDefinitionParamsWithTimeout creates a new UpdateLifecycleMeasurementDefinitionParams object +// with the ability to set a timeout on a request. +func NewUpdateLifecycleMeasurementDefinitionParamsWithTimeout(timeout time.Duration) *UpdateLifecycleMeasurementDefinitionParams { + return &UpdateLifecycleMeasurementDefinitionParams{ + timeout: timeout, + } +} + +// NewUpdateLifecycleMeasurementDefinitionParamsWithContext creates a new UpdateLifecycleMeasurementDefinitionParams object +// with the ability to set a context for a request. +func NewUpdateLifecycleMeasurementDefinitionParamsWithContext(ctx context.Context) *UpdateLifecycleMeasurementDefinitionParams { + return &UpdateLifecycleMeasurementDefinitionParams{ + Context: ctx, + } +} + +// NewUpdateLifecycleMeasurementDefinitionParamsWithHTTPClient creates a new UpdateLifecycleMeasurementDefinitionParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateLifecycleMeasurementDefinitionParamsWithHTTPClient(client *http.Client) *UpdateLifecycleMeasurementDefinitionParams { + return &UpdateLifecycleMeasurementDefinitionParams{ + HTTPClient: client, + } +} + +/* +UpdateLifecycleMeasurementDefinitionParams contains all the parameters to send to the API endpoint + + for the update lifecycle measurement definition operation. + + Typically these are written to a http.Request. +*/ +type UpdateLifecycleMeasurementDefinitionParams struct { + + // Description. + Description *string + + // EndsAtMilestoneID. + EndsAtMilestoneID *string + + // MeasurementDefinitionID. + MeasurementDefinitionID string + + // Name. + Name *string + + // Slug. + Slug *string + + // StartsAtMilestoneID. + StartsAtMilestoneID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update lifecycle measurement definition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateLifecycleMeasurementDefinitionParams) WithDefaults() *UpdateLifecycleMeasurementDefinitionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update lifecycle measurement definition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateLifecycleMeasurementDefinitionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) WithTimeout(timeout time.Duration) *UpdateLifecycleMeasurementDefinitionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) WithContext(ctx context.Context) *UpdateLifecycleMeasurementDefinitionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) WithHTTPClient(client *http.Client) *UpdateLifecycleMeasurementDefinitionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDescription adds the description to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) WithDescription(description *string) *UpdateLifecycleMeasurementDefinitionParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) SetDescription(description *string) { + o.Description = description +} + +// WithEndsAtMilestoneID adds the endsAtMilestoneID to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) WithEndsAtMilestoneID(endsAtMilestoneID *string) *UpdateLifecycleMeasurementDefinitionParams { + o.SetEndsAtMilestoneID(endsAtMilestoneID) + return o +} + +// SetEndsAtMilestoneID adds the endsAtMilestoneId to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) SetEndsAtMilestoneID(endsAtMilestoneID *string) { + o.EndsAtMilestoneID = endsAtMilestoneID +} + +// WithMeasurementDefinitionID adds the measurementDefinitionID to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) WithMeasurementDefinitionID(measurementDefinitionID string) *UpdateLifecycleMeasurementDefinitionParams { + o.SetMeasurementDefinitionID(measurementDefinitionID) + return o +} + +// SetMeasurementDefinitionID adds the measurementDefinitionId to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) SetMeasurementDefinitionID(measurementDefinitionID string) { + o.MeasurementDefinitionID = measurementDefinitionID +} + +// WithName adds the name to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) WithName(name *string) *UpdateLifecycleMeasurementDefinitionParams { + o.SetName(name) + return o +} + +// SetName adds the name to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) SetName(name *string) { + o.Name = name +} + +// WithSlug adds the slug to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) WithSlug(slug *string) *UpdateLifecycleMeasurementDefinitionParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WithStartsAtMilestoneID adds the startsAtMilestoneID to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) WithStartsAtMilestoneID(startsAtMilestoneID *string) *UpdateLifecycleMeasurementDefinitionParams { + o.SetStartsAtMilestoneID(startsAtMilestoneID) + return o +} + +// SetStartsAtMilestoneID adds the startsAtMilestoneId to the update lifecycle measurement definition params +func (o *UpdateLifecycleMeasurementDefinitionParams) SetStartsAtMilestoneID(startsAtMilestoneID *string) { + o.StartsAtMilestoneID = startsAtMilestoneID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateLifecycleMeasurementDefinitionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Description != nil { + + // form param description + var frDescription string + if o.Description != nil { + frDescription = *o.Description + } + fDescription := frDescription + if fDescription != "" { + if err := r.SetFormParam("description", fDescription); err != nil { + return err + } + } + } + + if o.EndsAtMilestoneID != nil { + + // form param ends_at_milestone_id + var frEndsAtMilestoneID string + if o.EndsAtMilestoneID != nil { + frEndsAtMilestoneID = *o.EndsAtMilestoneID + } + fEndsAtMilestoneID := frEndsAtMilestoneID + if fEndsAtMilestoneID != "" { + if err := r.SetFormParam("ends_at_milestone_id", fEndsAtMilestoneID); err != nil { + return err + } + } + } + + // path param measurement_definition_id + if err := r.SetPathParam("measurement_definition_id", o.MeasurementDefinitionID); err != nil { + return err + } + + if o.Name != nil { + + // form param name + var frName string + if o.Name != nil { + frName = *o.Name + } + fName := frName + if fName != "" { + if err := r.SetFormParam("name", fName); err != nil { + return err + } + } + } + + if o.Slug != nil { + + // form param slug + var frSlug string + if o.Slug != nil { + frSlug = *o.Slug + } + fSlug := frSlug + if fSlug != "" { + if err := r.SetFormParam("slug", fSlug); err != nil { + return err + } + } + } + + if o.StartsAtMilestoneID != nil { + + // form param starts_at_milestone_id + var frStartsAtMilestoneID string + if o.StartsAtMilestoneID != nil { + frStartsAtMilestoneID = *o.StartsAtMilestoneID + } + fStartsAtMilestoneID := frStartsAtMilestoneID + if fStartsAtMilestoneID != "" { + if err := r.SetFormParam("starts_at_milestone_id", fStartsAtMilestoneID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/update_lifecycle_measurement_definition_responses.go b/client/incident_settings/update_lifecycle_measurement_definition_responses.go new file mode 100644 index 0000000..3a02f50 --- /dev/null +++ b/client/incident_settings/update_lifecycle_measurement_definition_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateLifecycleMeasurementDefinitionReader is a Reader for the UpdateLifecycleMeasurementDefinition structure. +type UpdateLifecycleMeasurementDefinitionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateLifecycleMeasurementDefinitionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateLifecycleMeasurementDefinitionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateLifecycleMeasurementDefinitionOK creates a UpdateLifecycleMeasurementDefinitionOK with default headers values +func NewUpdateLifecycleMeasurementDefinitionOK() *UpdateLifecycleMeasurementDefinitionOK { + return &UpdateLifecycleMeasurementDefinitionOK{} +} + +/* +UpdateLifecycleMeasurementDefinitionOK describes a response with status code 200, with default header values. + +Update a single measurement definition from its ID +*/ +type UpdateLifecycleMeasurementDefinitionOK struct { +} + +// IsSuccess returns true when this update lifecycle measurement definition o k response has a 2xx status code +func (o *UpdateLifecycleMeasurementDefinitionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update lifecycle measurement definition o k response has a 3xx status code +func (o *UpdateLifecycleMeasurementDefinitionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update lifecycle measurement definition o k response has a 4xx status code +func (o *UpdateLifecycleMeasurementDefinitionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update lifecycle measurement definition o k response has a 5xx status code +func (o *UpdateLifecycleMeasurementDefinitionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update lifecycle measurement definition o k response a status code equal to that given +func (o *UpdateLifecycleMeasurementDefinitionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateLifecycleMeasurementDefinitionOK) Error() string { + return fmt.Sprintf("[PATCH /v1/lifecycles/measurement_definitions/{measurement_definition_id}][%d] updateLifecycleMeasurementDefinitionOK ", 200) +} + +func (o *UpdateLifecycleMeasurementDefinitionOK) String() string { + return fmt.Sprintf("[PATCH /v1/lifecycles/measurement_definitions/{measurement_definition_id}][%d] updateLifecycleMeasurementDefinitionOK ", 200) +} + +func (o *UpdateLifecycleMeasurementDefinitionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/incident_settings/update_lifecycle_milestone_parameters.go b/client/incident_settings/update_lifecycle_milestone_parameters.go new file mode 100644 index 0000000..bfa1918 --- /dev/null +++ b/client/incident_settings/update_lifecycle_milestone_parameters.go @@ -0,0 +1,343 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewUpdateLifecycleMilestoneParams creates a new UpdateLifecycleMilestoneParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateLifecycleMilestoneParams() *UpdateLifecycleMilestoneParams { + return &UpdateLifecycleMilestoneParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateLifecycleMilestoneParamsWithTimeout creates a new UpdateLifecycleMilestoneParams object +// with the ability to set a timeout on a request. +func NewUpdateLifecycleMilestoneParamsWithTimeout(timeout time.Duration) *UpdateLifecycleMilestoneParams { + return &UpdateLifecycleMilestoneParams{ + timeout: timeout, + } +} + +// NewUpdateLifecycleMilestoneParamsWithContext creates a new UpdateLifecycleMilestoneParams object +// with the ability to set a context for a request. +func NewUpdateLifecycleMilestoneParamsWithContext(ctx context.Context) *UpdateLifecycleMilestoneParams { + return &UpdateLifecycleMilestoneParams{ + Context: ctx, + } +} + +// NewUpdateLifecycleMilestoneParamsWithHTTPClient creates a new UpdateLifecycleMilestoneParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateLifecycleMilestoneParamsWithHTTPClient(client *http.Client) *UpdateLifecycleMilestoneParams { + return &UpdateLifecycleMilestoneParams{ + HTTPClient: client, + } +} + +/* +UpdateLifecycleMilestoneParams contains all the parameters to send to the API endpoint + + for the update lifecycle milestone operation. + + Typically these are written to a http.Request. +*/ +type UpdateLifecycleMilestoneParams struct { + + /* AutoAssignTimestampOnCreate. + + The setting for auto-assigning the milestone's timestamp during incident declaration + */ + AutoAssignTimestampOnCreate *string + + /* Description. + + A long-form description of the milestone's purpose + */ + Description *string + + // MilestoneID. + MilestoneID string + + /* Name. + + The name of the milestone + */ + Name *string + + /* Position. + + The position of the milestone within the phase. If not provided, the milestone will be added as the last milestone in the phase. + + Format: int32 + */ + Position *int32 + + /* RequiredAtMilestoneID. + + The ID of a later milestone that cannot be started until this milestone has a timestamp populated + */ + RequiredAtMilestoneID *string + + /* Slug. + + A unique identifier for the milestone. If not provided, one will be generated from the name. + */ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update lifecycle milestone params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateLifecycleMilestoneParams) WithDefaults() *UpdateLifecycleMilestoneParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update lifecycle milestone params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateLifecycleMilestoneParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) WithTimeout(timeout time.Duration) *UpdateLifecycleMilestoneParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) WithContext(ctx context.Context) *UpdateLifecycleMilestoneParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) WithHTTPClient(client *http.Client) *UpdateLifecycleMilestoneParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAutoAssignTimestampOnCreate adds the autoAssignTimestampOnCreate to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) WithAutoAssignTimestampOnCreate(autoAssignTimestampOnCreate *string) *UpdateLifecycleMilestoneParams { + o.SetAutoAssignTimestampOnCreate(autoAssignTimestampOnCreate) + return o +} + +// SetAutoAssignTimestampOnCreate adds the autoAssignTimestampOnCreate to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) SetAutoAssignTimestampOnCreate(autoAssignTimestampOnCreate *string) { + o.AutoAssignTimestampOnCreate = autoAssignTimestampOnCreate +} + +// WithDescription adds the description to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) WithDescription(description *string) *UpdateLifecycleMilestoneParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) SetDescription(description *string) { + o.Description = description +} + +// WithMilestoneID adds the milestoneID to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) WithMilestoneID(milestoneID string) *UpdateLifecycleMilestoneParams { + o.SetMilestoneID(milestoneID) + return o +} + +// SetMilestoneID adds the milestoneId to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) SetMilestoneID(milestoneID string) { + o.MilestoneID = milestoneID +} + +// WithName adds the name to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) WithName(name *string) *UpdateLifecycleMilestoneParams { + o.SetName(name) + return o +} + +// SetName adds the name to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) SetName(name *string) { + o.Name = name +} + +// WithPosition adds the position to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) WithPosition(position *int32) *UpdateLifecycleMilestoneParams { + o.SetPosition(position) + return o +} + +// SetPosition adds the position to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) SetPosition(position *int32) { + o.Position = position +} + +// WithRequiredAtMilestoneID adds the requiredAtMilestoneID to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) WithRequiredAtMilestoneID(requiredAtMilestoneID *string) *UpdateLifecycleMilestoneParams { + o.SetRequiredAtMilestoneID(requiredAtMilestoneID) + return o +} + +// SetRequiredAtMilestoneID adds the requiredAtMilestoneId to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) SetRequiredAtMilestoneID(requiredAtMilestoneID *string) { + o.RequiredAtMilestoneID = requiredAtMilestoneID +} + +// WithSlug adds the slug to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) WithSlug(slug *string) *UpdateLifecycleMilestoneParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the update lifecycle milestone params +func (o *UpdateLifecycleMilestoneParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateLifecycleMilestoneParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AutoAssignTimestampOnCreate != nil { + + // form param auto_assign_timestamp_on_create + var frAutoAssignTimestampOnCreate string + if o.AutoAssignTimestampOnCreate != nil { + frAutoAssignTimestampOnCreate = *o.AutoAssignTimestampOnCreate + } + fAutoAssignTimestampOnCreate := frAutoAssignTimestampOnCreate + if fAutoAssignTimestampOnCreate != "" { + if err := r.SetFormParam("auto_assign_timestamp_on_create", fAutoAssignTimestampOnCreate); err != nil { + return err + } + } + } + + if o.Description != nil { + + // form param description + var frDescription string + if o.Description != nil { + frDescription = *o.Description + } + fDescription := frDescription + if fDescription != "" { + if err := r.SetFormParam("description", fDescription); err != nil { + return err + } + } + } + + // path param milestone_id + if err := r.SetPathParam("milestone_id", o.MilestoneID); err != nil { + return err + } + + if o.Name != nil { + + // form param name + var frName string + if o.Name != nil { + frName = *o.Name + } + fName := frName + if fName != "" { + if err := r.SetFormParam("name", fName); err != nil { + return err + } + } + } + + if o.Position != nil { + + // form param position + var frPosition int32 + if o.Position != nil { + frPosition = *o.Position + } + fPosition := swag.FormatInt32(frPosition) + if fPosition != "" { + if err := r.SetFormParam("position", fPosition); err != nil { + return err + } + } + } + + if o.RequiredAtMilestoneID != nil { + + // form param required_at_milestone_id + var frRequiredAtMilestoneID string + if o.RequiredAtMilestoneID != nil { + frRequiredAtMilestoneID = *o.RequiredAtMilestoneID + } + fRequiredAtMilestoneID := frRequiredAtMilestoneID + if fRequiredAtMilestoneID != "" { + if err := r.SetFormParam("required_at_milestone_id", fRequiredAtMilestoneID); err != nil { + return err + } + } + } + + if o.Slug != nil { + + // form param slug + var frSlug string + if o.Slug != nil { + frSlug = *o.Slug + } + fSlug := frSlug + if fSlug != "" { + if err := r.SetFormParam("slug", fSlug); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/update_lifecycle_milestone_responses.go b/client/incident_settings/update_lifecycle_milestone_responses.go new file mode 100644 index 0000000..2e96272 --- /dev/null +++ b/client/incident_settings/update_lifecycle_milestone_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateLifecycleMilestoneReader is a Reader for the UpdateLifecycleMilestone structure. +type UpdateLifecycleMilestoneReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateLifecycleMilestoneReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateLifecycleMilestoneOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateLifecycleMilestoneOK creates a UpdateLifecycleMilestoneOK with default headers values +func NewUpdateLifecycleMilestoneOK() *UpdateLifecycleMilestoneOK { + return &UpdateLifecycleMilestoneOK{} +} + +/* +UpdateLifecycleMilestoneOK describes a response with status code 200, with default header values. + +Update a milestone +*/ +type UpdateLifecycleMilestoneOK struct { + Payload *models.LifecyclesPhaseEntity +} + +// IsSuccess returns true when this update lifecycle milestone o k response has a 2xx status code +func (o *UpdateLifecycleMilestoneOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update lifecycle milestone o k response has a 3xx status code +func (o *UpdateLifecycleMilestoneOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update lifecycle milestone o k response has a 4xx status code +func (o *UpdateLifecycleMilestoneOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update lifecycle milestone o k response has a 5xx status code +func (o *UpdateLifecycleMilestoneOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update lifecycle milestone o k response a status code equal to that given +func (o *UpdateLifecycleMilestoneOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateLifecycleMilestoneOK) Error() string { + return fmt.Sprintf("[PATCH /v1/lifecycles/milestones/{milestone_id}][%d] updateLifecycleMilestoneOK %+v", 200, o.Payload) +} + +func (o *UpdateLifecycleMilestoneOK) String() string { + return fmt.Sprintf("[PATCH /v1/lifecycles/milestones/{milestone_id}][%d] updateLifecycleMilestoneOK %+v", 200, o.Payload) +} + +func (o *UpdateLifecycleMilestoneOK) GetPayload() *models.LifecyclesPhaseEntity { + return o.Payload +} + +func (o *UpdateLifecycleMilestoneOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.LifecyclesPhaseEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/update_priority_parameters.go b/client/incident_settings/update_priority_parameters.go new file mode 100644 index 0000000..59928fc --- /dev/null +++ b/client/incident_settings/update_priority_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdatePriorityParams creates a new UpdatePriorityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdatePriorityParams() *UpdatePriorityParams { + return &UpdatePriorityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdatePriorityParamsWithTimeout creates a new UpdatePriorityParams object +// with the ability to set a timeout on a request. +func NewUpdatePriorityParamsWithTimeout(timeout time.Duration) *UpdatePriorityParams { + return &UpdatePriorityParams{ + timeout: timeout, + } +} + +// NewUpdatePriorityParamsWithContext creates a new UpdatePriorityParams object +// with the ability to set a context for a request. +func NewUpdatePriorityParamsWithContext(ctx context.Context) *UpdatePriorityParams { + return &UpdatePriorityParams{ + Context: ctx, + } +} + +// NewUpdatePriorityParamsWithHTTPClient creates a new UpdatePriorityParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdatePriorityParamsWithHTTPClient(client *http.Client) *UpdatePriorityParams { + return &UpdatePriorityParams{ + HTTPClient: client, + } +} + +/* +UpdatePriorityParams contains all the parameters to send to the API endpoint + + for the update priority operation. + + Typically these are written to a http.Request. +*/ +type UpdatePriorityParams struct { + + // PrioritySlug. + PrioritySlug string + + // UpdatePriority. + UpdatePriority *models.UpdatePriority + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePriorityParams) WithDefaults() *UpdatePriorityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePriorityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update priority params +func (o *UpdatePriorityParams) WithTimeout(timeout time.Duration) *UpdatePriorityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update priority params +func (o *UpdatePriorityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update priority params +func (o *UpdatePriorityParams) WithContext(ctx context.Context) *UpdatePriorityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update priority params +func (o *UpdatePriorityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update priority params +func (o *UpdatePriorityParams) WithHTTPClient(client *http.Client) *UpdatePriorityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update priority params +func (o *UpdatePriorityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPrioritySlug adds the prioritySlug to the update priority params +func (o *UpdatePriorityParams) WithPrioritySlug(prioritySlug string) *UpdatePriorityParams { + o.SetPrioritySlug(prioritySlug) + return o +} + +// SetPrioritySlug adds the prioritySlug to the update priority params +func (o *UpdatePriorityParams) SetPrioritySlug(prioritySlug string) { + o.PrioritySlug = prioritySlug +} + +// WithUpdatePriority adds the updatePriority to the update priority params +func (o *UpdatePriorityParams) WithUpdatePriority(updatePriority *models.UpdatePriority) *UpdatePriorityParams { + o.SetUpdatePriority(updatePriority) + return o +} + +// SetUpdatePriority adds the updatePriority to the update priority params +func (o *UpdatePriorityParams) SetUpdatePriority(updatePriority *models.UpdatePriority) { + o.UpdatePriority = updatePriority +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdatePriorityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param priority_slug + if err := r.SetPathParam("priority_slug", o.PrioritySlug); err != nil { + return err + } + if o.UpdatePriority != nil { + if err := r.SetBodyParam(o.UpdatePriority); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/update_priority_responses.go b/client/incident_settings/update_priority_responses.go new file mode 100644 index 0000000..ca60b55 --- /dev/null +++ b/client/incident_settings/update_priority_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdatePriorityReader is a Reader for the UpdatePriority structure. +type UpdatePriorityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdatePriorityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdatePriorityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdatePriorityOK creates a UpdatePriorityOK with default headers values +func NewUpdatePriorityOK() *UpdatePriorityOK { + return &UpdatePriorityOK{} +} + +/* +UpdatePriorityOK describes a response with status code 200, with default header values. + +Update a specific priority +*/ +type UpdatePriorityOK struct { + Payload *models.PriorityEntity +} + +// IsSuccess returns true when this update priority o k response has a 2xx status code +func (o *UpdatePriorityOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update priority o k response has a 3xx status code +func (o *UpdatePriorityOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update priority o k response has a 4xx status code +func (o *UpdatePriorityOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update priority o k response has a 5xx status code +func (o *UpdatePriorityOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update priority o k response a status code equal to that given +func (o *UpdatePriorityOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdatePriorityOK) Error() string { + return fmt.Sprintf("[PATCH /v1/priorities/{priority_slug}][%d] updatePriorityOK %+v", 200, o.Payload) +} + +func (o *UpdatePriorityOK) String() string { + return fmt.Sprintf("[PATCH /v1/priorities/{priority_slug}][%d] updatePriorityOK %+v", 200, o.Payload) +} + +func (o *UpdatePriorityOK) GetPayload() *models.PriorityEntity { + return o.Payload +} + +func (o *UpdatePriorityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PriorityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/update_severity_matrix_condition_parameters.go b/client/incident_settings/update_severity_matrix_condition_parameters.go new file mode 100644 index 0000000..b8be37c --- /dev/null +++ b/client/incident_settings/update_severity_matrix_condition_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateSeverityMatrixConditionParams creates a new UpdateSeverityMatrixConditionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateSeverityMatrixConditionParams() *UpdateSeverityMatrixConditionParams { + return &UpdateSeverityMatrixConditionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateSeverityMatrixConditionParamsWithTimeout creates a new UpdateSeverityMatrixConditionParams object +// with the ability to set a timeout on a request. +func NewUpdateSeverityMatrixConditionParamsWithTimeout(timeout time.Duration) *UpdateSeverityMatrixConditionParams { + return &UpdateSeverityMatrixConditionParams{ + timeout: timeout, + } +} + +// NewUpdateSeverityMatrixConditionParamsWithContext creates a new UpdateSeverityMatrixConditionParams object +// with the ability to set a context for a request. +func NewUpdateSeverityMatrixConditionParamsWithContext(ctx context.Context) *UpdateSeverityMatrixConditionParams { + return &UpdateSeverityMatrixConditionParams{ + Context: ctx, + } +} + +// NewUpdateSeverityMatrixConditionParamsWithHTTPClient creates a new UpdateSeverityMatrixConditionParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateSeverityMatrixConditionParamsWithHTTPClient(client *http.Client) *UpdateSeverityMatrixConditionParams { + return &UpdateSeverityMatrixConditionParams{ + HTTPClient: client, + } +} + +/* +UpdateSeverityMatrixConditionParams contains all the parameters to send to the API endpoint + + for the update severity matrix condition operation. + + Typically these are written to a http.Request. +*/ +type UpdateSeverityMatrixConditionParams struct { + + // ConditionID. + ConditionID string + + // UpdateSeverityMatrixCondition. + UpdateSeverityMatrixCondition *models.UpdateSeverityMatrixCondition + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update severity matrix condition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSeverityMatrixConditionParams) WithDefaults() *UpdateSeverityMatrixConditionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update severity matrix condition params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSeverityMatrixConditionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update severity matrix condition params +func (o *UpdateSeverityMatrixConditionParams) WithTimeout(timeout time.Duration) *UpdateSeverityMatrixConditionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update severity matrix condition params +func (o *UpdateSeverityMatrixConditionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update severity matrix condition params +func (o *UpdateSeverityMatrixConditionParams) WithContext(ctx context.Context) *UpdateSeverityMatrixConditionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update severity matrix condition params +func (o *UpdateSeverityMatrixConditionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update severity matrix condition params +func (o *UpdateSeverityMatrixConditionParams) WithHTTPClient(client *http.Client) *UpdateSeverityMatrixConditionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update severity matrix condition params +func (o *UpdateSeverityMatrixConditionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConditionID adds the conditionID to the update severity matrix condition params +func (o *UpdateSeverityMatrixConditionParams) WithConditionID(conditionID string) *UpdateSeverityMatrixConditionParams { + o.SetConditionID(conditionID) + return o +} + +// SetConditionID adds the conditionId to the update severity matrix condition params +func (o *UpdateSeverityMatrixConditionParams) SetConditionID(conditionID string) { + o.ConditionID = conditionID +} + +// WithUpdateSeverityMatrixCondition adds the updateSeverityMatrixCondition to the update severity matrix condition params +func (o *UpdateSeverityMatrixConditionParams) WithUpdateSeverityMatrixCondition(updateSeverityMatrixCondition *models.UpdateSeverityMatrixCondition) *UpdateSeverityMatrixConditionParams { + o.SetUpdateSeverityMatrixCondition(updateSeverityMatrixCondition) + return o +} + +// SetUpdateSeverityMatrixCondition adds the updateSeverityMatrixCondition to the update severity matrix condition params +func (o *UpdateSeverityMatrixConditionParams) SetUpdateSeverityMatrixCondition(updateSeverityMatrixCondition *models.UpdateSeverityMatrixCondition) { + o.UpdateSeverityMatrixCondition = updateSeverityMatrixCondition +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateSeverityMatrixConditionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param condition_id + if err := r.SetPathParam("condition_id", o.ConditionID); err != nil { + return err + } + if o.UpdateSeverityMatrixCondition != nil { + if err := r.SetBodyParam(o.UpdateSeverityMatrixCondition); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/update_severity_matrix_condition_responses.go b/client/incident_settings/update_severity_matrix_condition_responses.go new file mode 100644 index 0000000..9c111ae --- /dev/null +++ b/client/incident_settings/update_severity_matrix_condition_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateSeverityMatrixConditionReader is a Reader for the UpdateSeverityMatrixCondition structure. +type UpdateSeverityMatrixConditionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateSeverityMatrixConditionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateSeverityMatrixConditionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateSeverityMatrixConditionOK creates a UpdateSeverityMatrixConditionOK with default headers values +func NewUpdateSeverityMatrixConditionOK() *UpdateSeverityMatrixConditionOK { + return &UpdateSeverityMatrixConditionOK{} +} + +/* +UpdateSeverityMatrixConditionOK describes a response with status code 200, with default header values. + +Update a severity matrix condition +*/ +type UpdateSeverityMatrixConditionOK struct { + Payload *models.SeverityMatrixConditionEntity +} + +// IsSuccess returns true when this update severity matrix condition o k response has a 2xx status code +func (o *UpdateSeverityMatrixConditionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update severity matrix condition o k response has a 3xx status code +func (o *UpdateSeverityMatrixConditionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update severity matrix condition o k response has a 4xx status code +func (o *UpdateSeverityMatrixConditionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update severity matrix condition o k response has a 5xx status code +func (o *UpdateSeverityMatrixConditionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update severity matrix condition o k response a status code equal to that given +func (o *UpdateSeverityMatrixConditionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateSeverityMatrixConditionOK) Error() string { + return fmt.Sprintf("[PATCH /v1/severity_matrix/conditions/{condition_id}][%d] updateSeverityMatrixConditionOK %+v", 200, o.Payload) +} + +func (o *UpdateSeverityMatrixConditionOK) String() string { + return fmt.Sprintf("[PATCH /v1/severity_matrix/conditions/{condition_id}][%d] updateSeverityMatrixConditionOK %+v", 200, o.Payload) +} + +func (o *UpdateSeverityMatrixConditionOK) GetPayload() *models.SeverityMatrixConditionEntity { + return o.Payload +} + +func (o *UpdateSeverityMatrixConditionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityMatrixConditionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/update_severity_matrix_impact_parameters.go b/client/incident_settings/update_severity_matrix_impact_parameters.go new file mode 100644 index 0000000..5ed90e0 --- /dev/null +++ b/client/incident_settings/update_severity_matrix_impact_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateSeverityMatrixImpactParams creates a new UpdateSeverityMatrixImpactParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateSeverityMatrixImpactParams() *UpdateSeverityMatrixImpactParams { + return &UpdateSeverityMatrixImpactParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateSeverityMatrixImpactParamsWithTimeout creates a new UpdateSeverityMatrixImpactParams object +// with the ability to set a timeout on a request. +func NewUpdateSeverityMatrixImpactParamsWithTimeout(timeout time.Duration) *UpdateSeverityMatrixImpactParams { + return &UpdateSeverityMatrixImpactParams{ + timeout: timeout, + } +} + +// NewUpdateSeverityMatrixImpactParamsWithContext creates a new UpdateSeverityMatrixImpactParams object +// with the ability to set a context for a request. +func NewUpdateSeverityMatrixImpactParamsWithContext(ctx context.Context) *UpdateSeverityMatrixImpactParams { + return &UpdateSeverityMatrixImpactParams{ + Context: ctx, + } +} + +// NewUpdateSeverityMatrixImpactParamsWithHTTPClient creates a new UpdateSeverityMatrixImpactParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateSeverityMatrixImpactParamsWithHTTPClient(client *http.Client) *UpdateSeverityMatrixImpactParams { + return &UpdateSeverityMatrixImpactParams{ + HTTPClient: client, + } +} + +/* +UpdateSeverityMatrixImpactParams contains all the parameters to send to the API endpoint + + for the update severity matrix impact operation. + + Typically these are written to a http.Request. +*/ +type UpdateSeverityMatrixImpactParams struct { + + // ImpactID. + ImpactID string + + // UpdateSeverityMatrixImpact. + UpdateSeverityMatrixImpact *models.UpdateSeverityMatrixImpact + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update severity matrix impact params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSeverityMatrixImpactParams) WithDefaults() *UpdateSeverityMatrixImpactParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update severity matrix impact params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSeverityMatrixImpactParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update severity matrix impact params +func (o *UpdateSeverityMatrixImpactParams) WithTimeout(timeout time.Duration) *UpdateSeverityMatrixImpactParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update severity matrix impact params +func (o *UpdateSeverityMatrixImpactParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update severity matrix impact params +func (o *UpdateSeverityMatrixImpactParams) WithContext(ctx context.Context) *UpdateSeverityMatrixImpactParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update severity matrix impact params +func (o *UpdateSeverityMatrixImpactParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update severity matrix impact params +func (o *UpdateSeverityMatrixImpactParams) WithHTTPClient(client *http.Client) *UpdateSeverityMatrixImpactParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update severity matrix impact params +func (o *UpdateSeverityMatrixImpactParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithImpactID adds the impactID to the update severity matrix impact params +func (o *UpdateSeverityMatrixImpactParams) WithImpactID(impactID string) *UpdateSeverityMatrixImpactParams { + o.SetImpactID(impactID) + return o +} + +// SetImpactID adds the impactId to the update severity matrix impact params +func (o *UpdateSeverityMatrixImpactParams) SetImpactID(impactID string) { + o.ImpactID = impactID +} + +// WithUpdateSeverityMatrixImpact adds the updateSeverityMatrixImpact to the update severity matrix impact params +func (o *UpdateSeverityMatrixImpactParams) WithUpdateSeverityMatrixImpact(updateSeverityMatrixImpact *models.UpdateSeverityMatrixImpact) *UpdateSeverityMatrixImpactParams { + o.SetUpdateSeverityMatrixImpact(updateSeverityMatrixImpact) + return o +} + +// SetUpdateSeverityMatrixImpact adds the updateSeverityMatrixImpact to the update severity matrix impact params +func (o *UpdateSeverityMatrixImpactParams) SetUpdateSeverityMatrixImpact(updateSeverityMatrixImpact *models.UpdateSeverityMatrixImpact) { + o.UpdateSeverityMatrixImpact = updateSeverityMatrixImpact +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateSeverityMatrixImpactParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param impact_id + if err := r.SetPathParam("impact_id", o.ImpactID); err != nil { + return err + } + if o.UpdateSeverityMatrixImpact != nil { + if err := r.SetBodyParam(o.UpdateSeverityMatrixImpact); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/update_severity_matrix_impact_responses.go b/client/incident_settings/update_severity_matrix_impact_responses.go new file mode 100644 index 0000000..4d07c48 --- /dev/null +++ b/client/incident_settings/update_severity_matrix_impact_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateSeverityMatrixImpactReader is a Reader for the UpdateSeverityMatrixImpact structure. +type UpdateSeverityMatrixImpactReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateSeverityMatrixImpactReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateSeverityMatrixImpactOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateSeverityMatrixImpactOK creates a UpdateSeverityMatrixImpactOK with default headers values +func NewUpdateSeverityMatrixImpactOK() *UpdateSeverityMatrixImpactOK { + return &UpdateSeverityMatrixImpactOK{} +} + +/* +UpdateSeverityMatrixImpactOK describes a response with status code 200, with default header values. + +Update a severity matrix impact +*/ +type UpdateSeverityMatrixImpactOK struct { + Payload *models.SeverityMatrixImpactEntity +} + +// IsSuccess returns true when this update severity matrix impact o k response has a 2xx status code +func (o *UpdateSeverityMatrixImpactOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update severity matrix impact o k response has a 3xx status code +func (o *UpdateSeverityMatrixImpactOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update severity matrix impact o k response has a 4xx status code +func (o *UpdateSeverityMatrixImpactOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update severity matrix impact o k response has a 5xx status code +func (o *UpdateSeverityMatrixImpactOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update severity matrix impact o k response a status code equal to that given +func (o *UpdateSeverityMatrixImpactOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateSeverityMatrixImpactOK) Error() string { + return fmt.Sprintf("[PATCH /v1/severity_matrix/impacts/{impact_id}][%d] updateSeverityMatrixImpactOK %+v", 200, o.Payload) +} + +func (o *UpdateSeverityMatrixImpactOK) String() string { + return fmt.Sprintf("[PATCH /v1/severity_matrix/impacts/{impact_id}][%d] updateSeverityMatrixImpactOK %+v", 200, o.Payload) +} + +func (o *UpdateSeverityMatrixImpactOK) GetPayload() *models.SeverityMatrixImpactEntity { + return o.Payload +} + +func (o *UpdateSeverityMatrixImpactOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityMatrixImpactEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/update_severity_matrix_parameters.go b/client/incident_settings/update_severity_matrix_parameters.go new file mode 100644 index 0000000..b3cd40a --- /dev/null +++ b/client/incident_settings/update_severity_matrix_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateSeverityMatrixParams creates a new UpdateSeverityMatrixParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateSeverityMatrixParams() *UpdateSeverityMatrixParams { + return &UpdateSeverityMatrixParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateSeverityMatrixParamsWithTimeout creates a new UpdateSeverityMatrixParams object +// with the ability to set a timeout on a request. +func NewUpdateSeverityMatrixParamsWithTimeout(timeout time.Duration) *UpdateSeverityMatrixParams { + return &UpdateSeverityMatrixParams{ + timeout: timeout, + } +} + +// NewUpdateSeverityMatrixParamsWithContext creates a new UpdateSeverityMatrixParams object +// with the ability to set a context for a request. +func NewUpdateSeverityMatrixParamsWithContext(ctx context.Context) *UpdateSeverityMatrixParams { + return &UpdateSeverityMatrixParams{ + Context: ctx, + } +} + +// NewUpdateSeverityMatrixParamsWithHTTPClient creates a new UpdateSeverityMatrixParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateSeverityMatrixParamsWithHTTPClient(client *http.Client) *UpdateSeverityMatrixParams { + return &UpdateSeverityMatrixParams{ + HTTPClient: client, + } +} + +/* +UpdateSeverityMatrixParams contains all the parameters to send to the API endpoint + + for the update severity matrix operation. + + Typically these are written to a http.Request. +*/ +type UpdateSeverityMatrixParams struct { + + // UpdateSeverityMatrix. + UpdateSeverityMatrix *models.UpdateSeverityMatrix + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update severity matrix params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSeverityMatrixParams) WithDefaults() *UpdateSeverityMatrixParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update severity matrix params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSeverityMatrixParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update severity matrix params +func (o *UpdateSeverityMatrixParams) WithTimeout(timeout time.Duration) *UpdateSeverityMatrixParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update severity matrix params +func (o *UpdateSeverityMatrixParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update severity matrix params +func (o *UpdateSeverityMatrixParams) WithContext(ctx context.Context) *UpdateSeverityMatrixParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update severity matrix params +func (o *UpdateSeverityMatrixParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update severity matrix params +func (o *UpdateSeverityMatrixParams) WithHTTPClient(client *http.Client) *UpdateSeverityMatrixParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update severity matrix params +func (o *UpdateSeverityMatrixParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithUpdateSeverityMatrix adds the updateSeverityMatrix to the update severity matrix params +func (o *UpdateSeverityMatrixParams) WithUpdateSeverityMatrix(updateSeverityMatrix *models.UpdateSeverityMatrix) *UpdateSeverityMatrixParams { + o.SetUpdateSeverityMatrix(updateSeverityMatrix) + return o +} + +// SetUpdateSeverityMatrix adds the updateSeverityMatrix to the update severity matrix params +func (o *UpdateSeverityMatrixParams) SetUpdateSeverityMatrix(updateSeverityMatrix *models.UpdateSeverityMatrix) { + o.UpdateSeverityMatrix = updateSeverityMatrix +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateSeverityMatrixParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.UpdateSeverityMatrix != nil { + if err := r.SetBodyParam(o.UpdateSeverityMatrix); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/update_severity_matrix_responses.go b/client/incident_settings/update_severity_matrix_responses.go new file mode 100644 index 0000000..71d5adf --- /dev/null +++ b/client/incident_settings/update_severity_matrix_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateSeverityMatrixReader is a Reader for the UpdateSeverityMatrix structure. +type UpdateSeverityMatrixReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateSeverityMatrixReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateSeverityMatrixOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateSeverityMatrixOK creates a UpdateSeverityMatrixOK with default headers values +func NewUpdateSeverityMatrixOK() *UpdateSeverityMatrixOK { + return &UpdateSeverityMatrixOK{} +} + +/* +UpdateSeverityMatrixOK describes a response with status code 200, with default header values. + +Update available severities and impacts in your organization's severity matrix. +*/ +type UpdateSeverityMatrixOK struct { + Payload *models.SeverityMatrixSeverityMatrixEntity +} + +// IsSuccess returns true when this update severity matrix o k response has a 2xx status code +func (o *UpdateSeverityMatrixOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update severity matrix o k response has a 3xx status code +func (o *UpdateSeverityMatrixOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update severity matrix o k response has a 4xx status code +func (o *UpdateSeverityMatrixOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update severity matrix o k response has a 5xx status code +func (o *UpdateSeverityMatrixOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update severity matrix o k response a status code equal to that given +func (o *UpdateSeverityMatrixOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateSeverityMatrixOK) Error() string { + return fmt.Sprintf("[PATCH /v1/severity_matrix][%d] updateSeverityMatrixOK %+v", 200, o.Payload) +} + +func (o *UpdateSeverityMatrixOK) String() string { + return fmt.Sprintf("[PATCH /v1/severity_matrix][%d] updateSeverityMatrixOK %+v", 200, o.Payload) +} + +func (o *UpdateSeverityMatrixOK) GetPayload() *models.SeverityMatrixSeverityMatrixEntity { + return o.Payload +} + +func (o *UpdateSeverityMatrixOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityMatrixSeverityMatrixEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/update_severity_parameters.go b/client/incident_settings/update_severity_parameters.go new file mode 100644 index 0000000..3cd8cdd --- /dev/null +++ b/client/incident_settings/update_severity_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateSeverityParams creates a new UpdateSeverityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateSeverityParams() *UpdateSeverityParams { + return &UpdateSeverityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateSeverityParamsWithTimeout creates a new UpdateSeverityParams object +// with the ability to set a timeout on a request. +func NewUpdateSeverityParamsWithTimeout(timeout time.Duration) *UpdateSeverityParams { + return &UpdateSeverityParams{ + timeout: timeout, + } +} + +// NewUpdateSeverityParamsWithContext creates a new UpdateSeverityParams object +// with the ability to set a context for a request. +func NewUpdateSeverityParamsWithContext(ctx context.Context) *UpdateSeverityParams { + return &UpdateSeverityParams{ + Context: ctx, + } +} + +// NewUpdateSeverityParamsWithHTTPClient creates a new UpdateSeverityParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateSeverityParamsWithHTTPClient(client *http.Client) *UpdateSeverityParams { + return &UpdateSeverityParams{ + HTTPClient: client, + } +} + +/* +UpdateSeverityParams contains all the parameters to send to the API endpoint + + for the update severity operation. + + Typically these are written to a http.Request. +*/ +type UpdateSeverityParams struct { + + // SeveritySlug. + SeveritySlug string + + // UpdateSeverity. + UpdateSeverity *models.UpdateSeverity + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update severity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSeverityParams) WithDefaults() *UpdateSeverityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update severity params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSeverityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update severity params +func (o *UpdateSeverityParams) WithTimeout(timeout time.Duration) *UpdateSeverityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update severity params +func (o *UpdateSeverityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update severity params +func (o *UpdateSeverityParams) WithContext(ctx context.Context) *UpdateSeverityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update severity params +func (o *UpdateSeverityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update severity params +func (o *UpdateSeverityParams) WithHTTPClient(client *http.Client) *UpdateSeverityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update severity params +func (o *UpdateSeverityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSeveritySlug adds the severitySlug to the update severity params +func (o *UpdateSeverityParams) WithSeveritySlug(severitySlug string) *UpdateSeverityParams { + o.SetSeveritySlug(severitySlug) + return o +} + +// SetSeveritySlug adds the severitySlug to the update severity params +func (o *UpdateSeverityParams) SetSeveritySlug(severitySlug string) { + o.SeveritySlug = severitySlug +} + +// WithUpdateSeverity adds the updateSeverity to the update severity params +func (o *UpdateSeverityParams) WithUpdateSeverity(updateSeverity *models.UpdateSeverity) *UpdateSeverityParams { + o.SetUpdateSeverity(updateSeverity) + return o +} + +// SetUpdateSeverity adds the updateSeverity to the update severity params +func (o *UpdateSeverityParams) SetUpdateSeverity(updateSeverity *models.UpdateSeverity) { + o.UpdateSeverity = updateSeverity +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateSeverityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param severity_slug + if err := r.SetPathParam("severity_slug", o.SeveritySlug); err != nil { + return err + } + if o.UpdateSeverity != nil { + if err := r.SetBodyParam(o.UpdateSeverity); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/update_severity_responses.go b/client/incident_settings/update_severity_responses.go new file mode 100644 index 0000000..cbb9264 --- /dev/null +++ b/client/incident_settings/update_severity_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateSeverityReader is a Reader for the UpdateSeverity structure. +type UpdateSeverityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateSeverityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateSeverityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateSeverityOK creates a UpdateSeverityOK with default headers values +func NewUpdateSeverityOK() *UpdateSeverityOK { + return &UpdateSeverityOK{} +} + +/* +UpdateSeverityOK describes a response with status code 200, with default header values. + +Update a specific severity +*/ +type UpdateSeverityOK struct { + Payload *models.SeverityEntity +} + +// IsSuccess returns true when this update severity o k response has a 2xx status code +func (o *UpdateSeverityOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update severity o k response has a 3xx status code +func (o *UpdateSeverityOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update severity o k response has a 4xx status code +func (o *UpdateSeverityOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update severity o k response has a 5xx status code +func (o *UpdateSeverityOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update severity o k response a status code equal to that given +func (o *UpdateSeverityOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateSeverityOK) Error() string { + return fmt.Sprintf("[PATCH /v1/severities/{severity_slug}][%d] updateSeverityOK %+v", 200, o.Payload) +} + +func (o *UpdateSeverityOK) String() string { + return fmt.Sprintf("[PATCH /v1/severities/{severity_slug}][%d] updateSeverityOK %+v", 200, o.Payload) +} + +func (o *UpdateSeverityOK) GetPayload() *models.SeverityEntity { + return o.Payload +} + +func (o *UpdateSeverityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SeverityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incident_settings/validate_incident_tags_parameters.go b/client/incident_settings/validate_incident_tags_parameters.go new file mode 100644 index 0000000..ffd530a --- /dev/null +++ b/client/incident_settings/validate_incident_tags_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewValidateIncidentTagsParams creates a new ValidateIncidentTagsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewValidateIncidentTagsParams() *ValidateIncidentTagsParams { + return &ValidateIncidentTagsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewValidateIncidentTagsParamsWithTimeout creates a new ValidateIncidentTagsParams object +// with the ability to set a timeout on a request. +func NewValidateIncidentTagsParamsWithTimeout(timeout time.Duration) *ValidateIncidentTagsParams { + return &ValidateIncidentTagsParams{ + timeout: timeout, + } +} + +// NewValidateIncidentTagsParamsWithContext creates a new ValidateIncidentTagsParams object +// with the ability to set a context for a request. +func NewValidateIncidentTagsParamsWithContext(ctx context.Context) *ValidateIncidentTagsParams { + return &ValidateIncidentTagsParams{ + Context: ctx, + } +} + +// NewValidateIncidentTagsParamsWithHTTPClient creates a new ValidateIncidentTagsParams object +// with the ability to set a custom HTTPClient for a request. +func NewValidateIncidentTagsParamsWithHTTPClient(client *http.Client) *ValidateIncidentTagsParams { + return &ValidateIncidentTagsParams{ + HTTPClient: client, + } +} + +/* +ValidateIncidentTagsParams contains all the parameters to send to the API endpoint + + for the validate incident tags operation. + + Typically these are written to a http.Request. +*/ +type ValidateIncidentTagsParams struct { + + /* Tags. + + A list of tags to validate + */ + Tags []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the validate incident tags params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateIncidentTagsParams) WithDefaults() *ValidateIncidentTagsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the validate incident tags params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateIncidentTagsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the validate incident tags params +func (o *ValidateIncidentTagsParams) WithTimeout(timeout time.Duration) *ValidateIncidentTagsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the validate incident tags params +func (o *ValidateIncidentTagsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the validate incident tags params +func (o *ValidateIncidentTagsParams) WithContext(ctx context.Context) *ValidateIncidentTagsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the validate incident tags params +func (o *ValidateIncidentTagsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the validate incident tags params +func (o *ValidateIncidentTagsParams) WithHTTPClient(client *http.Client) *ValidateIncidentTagsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the validate incident tags params +func (o *ValidateIncidentTagsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTags adds the tags to the validate incident tags params +func (o *ValidateIncidentTagsParams) WithTags(tags []string) *ValidateIncidentTagsParams { + o.SetTags(tags) + return o +} + +// SetTags adds the tags to the validate incident tags params +func (o *ValidateIncidentTagsParams) SetTags(tags []string) { + o.Tags = tags +} + +// WriteToRequest writes these params to a swagger request +func (o *ValidateIncidentTagsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Tags != nil { + if err := r.SetBodyParam(o.Tags); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incident_settings/validate_incident_tags_responses.go b/client/incident_settings/validate_incident_tags_responses.go new file mode 100644 index 0000000..3a7a481 --- /dev/null +++ b/client/incident_settings/validate_incident_tags_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incident_settings + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ValidateIncidentTagsReader is a Reader for the ValidateIncidentTags structure. +type ValidateIncidentTagsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ValidateIncidentTagsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewValidateIncidentTagsCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewValidateIncidentTagsCreated creates a ValidateIncidentTagsCreated with default headers values +func NewValidateIncidentTagsCreated() *ValidateIncidentTagsCreated { + return &ValidateIncidentTagsCreated{} +} + +/* +ValidateIncidentTagsCreated describes a response with status code 201, with default header values. + +Validate the format of a list of tags +*/ +type ValidateIncidentTagsCreated struct { + Payload *models.TagEntity +} + +// IsSuccess returns true when this validate incident tags created response has a 2xx status code +func (o *ValidateIncidentTagsCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this validate incident tags created response has a 3xx status code +func (o *ValidateIncidentTagsCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate incident tags created response has a 4xx status code +func (o *ValidateIncidentTagsCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate incident tags created response has a 5xx status code +func (o *ValidateIncidentTagsCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this validate incident tags created response a status code equal to that given +func (o *ValidateIncidentTagsCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *ValidateIncidentTagsCreated) Error() string { + return fmt.Sprintf("[POST /v1/incident_tags/validate][%d] validateIncidentTagsCreated %+v", 201, o.Payload) +} + +func (o *ValidateIncidentTagsCreated) String() string { + return fmt.Sprintf("[POST /v1/incident_tags/validate][%d] validateIncidentTagsCreated %+v", 201, o.Payload) +} + +func (o *ValidateIncidentTagsCreated) GetPayload() *models.TagEntity { + return o.Payload +} + +func (o *ValidateIncidentTagsCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TagEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/bulk_update_incident_milestones_parameters.go b/client/incidents/bulk_update_incident_milestones_parameters.go new file mode 100644 index 0000000..a25b4b4 --- /dev/null +++ b/client/incidents/bulk_update_incident_milestones_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewBulkUpdateIncidentMilestonesParams creates a new BulkUpdateIncidentMilestonesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewBulkUpdateIncidentMilestonesParams() *BulkUpdateIncidentMilestonesParams { + return &BulkUpdateIncidentMilestonesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewBulkUpdateIncidentMilestonesParamsWithTimeout creates a new BulkUpdateIncidentMilestonesParams object +// with the ability to set a timeout on a request. +func NewBulkUpdateIncidentMilestonesParamsWithTimeout(timeout time.Duration) *BulkUpdateIncidentMilestonesParams { + return &BulkUpdateIncidentMilestonesParams{ + timeout: timeout, + } +} + +// NewBulkUpdateIncidentMilestonesParamsWithContext creates a new BulkUpdateIncidentMilestonesParams object +// with the ability to set a context for a request. +func NewBulkUpdateIncidentMilestonesParamsWithContext(ctx context.Context) *BulkUpdateIncidentMilestonesParams { + return &BulkUpdateIncidentMilestonesParams{ + Context: ctx, + } +} + +// NewBulkUpdateIncidentMilestonesParamsWithHTTPClient creates a new BulkUpdateIncidentMilestonesParams object +// with the ability to set a custom HTTPClient for a request. +func NewBulkUpdateIncidentMilestonesParamsWithHTTPClient(client *http.Client) *BulkUpdateIncidentMilestonesParams { + return &BulkUpdateIncidentMilestonesParams{ + HTTPClient: client, + } +} + +/* +BulkUpdateIncidentMilestonesParams contains all the parameters to send to the API endpoint + + for the bulk update incident milestones operation. + + Typically these are written to a http.Request. +*/ +type BulkUpdateIncidentMilestonesParams struct { + + // BulkUpdateIncidentMilestones. + BulkUpdateIncidentMilestones *models.BulkUpdateIncidentMilestones + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the bulk update incident milestones params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *BulkUpdateIncidentMilestonesParams) WithDefaults() *BulkUpdateIncidentMilestonesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the bulk update incident milestones params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *BulkUpdateIncidentMilestonesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the bulk update incident milestones params +func (o *BulkUpdateIncidentMilestonesParams) WithTimeout(timeout time.Duration) *BulkUpdateIncidentMilestonesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the bulk update incident milestones params +func (o *BulkUpdateIncidentMilestonesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the bulk update incident milestones params +func (o *BulkUpdateIncidentMilestonesParams) WithContext(ctx context.Context) *BulkUpdateIncidentMilestonesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the bulk update incident milestones params +func (o *BulkUpdateIncidentMilestonesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the bulk update incident milestones params +func (o *BulkUpdateIncidentMilestonesParams) WithHTTPClient(client *http.Client) *BulkUpdateIncidentMilestonesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the bulk update incident milestones params +func (o *BulkUpdateIncidentMilestonesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBulkUpdateIncidentMilestones adds the bulkUpdateIncidentMilestones to the bulk update incident milestones params +func (o *BulkUpdateIncidentMilestonesParams) WithBulkUpdateIncidentMilestones(bulkUpdateIncidentMilestones *models.BulkUpdateIncidentMilestones) *BulkUpdateIncidentMilestonesParams { + o.SetBulkUpdateIncidentMilestones(bulkUpdateIncidentMilestones) + return o +} + +// SetBulkUpdateIncidentMilestones adds the bulkUpdateIncidentMilestones to the bulk update incident milestones params +func (o *BulkUpdateIncidentMilestonesParams) SetBulkUpdateIncidentMilestones(bulkUpdateIncidentMilestones *models.BulkUpdateIncidentMilestones) { + o.BulkUpdateIncidentMilestones = bulkUpdateIncidentMilestones +} + +// WithIncidentID adds the incidentID to the bulk update incident milestones params +func (o *BulkUpdateIncidentMilestonesParams) WithIncidentID(incidentID string) *BulkUpdateIncidentMilestonesParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the bulk update incident milestones params +func (o *BulkUpdateIncidentMilestonesParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *BulkUpdateIncidentMilestonesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.BulkUpdateIncidentMilestones != nil { + if err := r.SetBodyParam(o.BulkUpdateIncidentMilestones); err != nil { + return err + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/bulk_update_incident_milestones_responses.go b/client/incidents/bulk_update_incident_milestones_responses.go new file mode 100644 index 0000000..42150b6 --- /dev/null +++ b/client/incidents/bulk_update_incident_milestones_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// BulkUpdateIncidentMilestonesReader is a Reader for the BulkUpdateIncidentMilestones structure. +type BulkUpdateIncidentMilestonesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *BulkUpdateIncidentMilestonesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewBulkUpdateIncidentMilestonesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewBulkUpdateIncidentMilestonesOK creates a BulkUpdateIncidentMilestonesOK with default headers values +func NewBulkUpdateIncidentMilestonesOK() *BulkUpdateIncidentMilestonesOK { + return &BulkUpdateIncidentMilestonesOK{} +} + +/* + BulkUpdateIncidentMilestonesOK describes a response with status code 200, with default header values. + + Update milestone times in bulk for a given incident. All milestone + +times for an incident must occur in chronological order +corresponding to the configured order of milestones. If the result +of this request would cause any milestone(s) to appear out of place, +a 422 response will instead be returned. This includes milestones +not explicitly submitted or updated in this request. +*/ +type BulkUpdateIncidentMilestonesOK struct { + Payload *models.IncidentsMilestoneEntityPaginated +} + +// IsSuccess returns true when this bulk update incident milestones o k response has a 2xx status code +func (o *BulkUpdateIncidentMilestonesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this bulk update incident milestones o k response has a 3xx status code +func (o *BulkUpdateIncidentMilestonesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this bulk update incident milestones o k response has a 4xx status code +func (o *BulkUpdateIncidentMilestonesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this bulk update incident milestones o k response has a 5xx status code +func (o *BulkUpdateIncidentMilestonesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this bulk update incident milestones o k response a status code equal to that given +func (o *BulkUpdateIncidentMilestonesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *BulkUpdateIncidentMilestonesOK) Error() string { + return fmt.Sprintf("[PUT /v1/incidents/{incident_id}/milestones/bulk_update][%d] bulkUpdateIncidentMilestonesOK %+v", 200, o.Payload) +} + +func (o *BulkUpdateIncidentMilestonesOK) String() string { + return fmt.Sprintf("[PUT /v1/incidents/{incident_id}/milestones/bulk_update][%d] bulkUpdateIncidentMilestonesOK %+v", 200, o.Payload) +} + +func (o *BulkUpdateIncidentMilestonesOK) GetPayload() *models.IncidentsMilestoneEntityPaginated { + return o.Payload +} + +func (o *BulkUpdateIncidentMilestonesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsMilestoneEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/close_incident_parameters.go b/client/incidents/close_incident_parameters.go new file mode 100644 index 0000000..d84cefc --- /dev/null +++ b/client/incidents/close_incident_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCloseIncidentParams creates a new CloseIncidentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCloseIncidentParams() *CloseIncidentParams { + return &CloseIncidentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCloseIncidentParamsWithTimeout creates a new CloseIncidentParams object +// with the ability to set a timeout on a request. +func NewCloseIncidentParamsWithTimeout(timeout time.Duration) *CloseIncidentParams { + return &CloseIncidentParams{ + timeout: timeout, + } +} + +// NewCloseIncidentParamsWithContext creates a new CloseIncidentParams object +// with the ability to set a context for a request. +func NewCloseIncidentParamsWithContext(ctx context.Context) *CloseIncidentParams { + return &CloseIncidentParams{ + Context: ctx, + } +} + +// NewCloseIncidentParamsWithHTTPClient creates a new CloseIncidentParams object +// with the ability to set a custom HTTPClient for a request. +func NewCloseIncidentParamsWithHTTPClient(client *http.Client) *CloseIncidentParams { + return &CloseIncidentParams{ + HTTPClient: client, + } +} + +/* +CloseIncidentParams contains all the parameters to send to the API endpoint + + for the close incident operation. + + Typically these are written to a http.Request. +*/ +type CloseIncidentParams struct { + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the close incident params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CloseIncidentParams) WithDefaults() *CloseIncidentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the close incident params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CloseIncidentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the close incident params +func (o *CloseIncidentParams) WithTimeout(timeout time.Duration) *CloseIncidentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the close incident params +func (o *CloseIncidentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the close incident params +func (o *CloseIncidentParams) WithContext(ctx context.Context) *CloseIncidentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the close incident params +func (o *CloseIncidentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the close incident params +func (o *CloseIncidentParams) WithHTTPClient(client *http.Client) *CloseIncidentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the close incident params +func (o *CloseIncidentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the close incident params +func (o *CloseIncidentParams) WithIncidentID(incidentID string) *CloseIncidentParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the close incident params +func (o *CloseIncidentParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *CloseIncidentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/close_incident_responses.go b/client/incidents/close_incident_responses.go new file mode 100644 index 0000000..5ce9ee7 --- /dev/null +++ b/client/incidents/close_incident_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CloseIncidentReader is a Reader for the CloseIncident structure. +type CloseIncidentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CloseIncidentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCloseIncidentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCloseIncidentOK creates a CloseIncidentOK with default headers values +func NewCloseIncidentOK() *CloseIncidentOK { + return &CloseIncidentOK{} +} + +/* +CloseIncidentOK describes a response with status code 200, with default header values. + +Closes an incident and optionally close all children +*/ +type CloseIncidentOK struct { + Payload *models.IncidentEntity +} + +// IsSuccess returns true when this close incident o k response has a 2xx status code +func (o *CloseIncidentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this close incident o k response has a 3xx status code +func (o *CloseIncidentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this close incident o k response has a 4xx status code +func (o *CloseIncidentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this close incident o k response has a 5xx status code +func (o *CloseIncidentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this close incident o k response a status code equal to that given +func (o *CloseIncidentOK) IsCode(code int) bool { + return code == 200 +} + +func (o *CloseIncidentOK) Error() string { + return fmt.Sprintf("[PUT /v1/incidents/{incident_id}/close][%d] closeIncidentOK %+v", 200, o.Payload) +} + +func (o *CloseIncidentOK) String() string { + return fmt.Sprintf("[PUT /v1/incidents/{incident_id}/close][%d] closeIncidentOK %+v", 200, o.Payload) +} + +func (o *CloseIncidentOK) GetPayload() *models.IncidentEntity { + return o.Payload +} + +func (o *CloseIncidentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/create_incident_attachment_parameters.go b/client/incidents/create_incident_attachment_parameters.go new file mode 100644 index 0000000..cc711a6 --- /dev/null +++ b/client/incidents/create_incident_attachment_parameters.go @@ -0,0 +1,255 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateIncidentAttachmentParams creates a new CreateIncidentAttachmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentAttachmentParams() *CreateIncidentAttachmentParams { + return &CreateIncidentAttachmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentAttachmentParamsWithTimeout creates a new CreateIncidentAttachmentParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentAttachmentParamsWithTimeout(timeout time.Duration) *CreateIncidentAttachmentParams { + return &CreateIncidentAttachmentParams{ + timeout: timeout, + } +} + +// NewCreateIncidentAttachmentParamsWithContext creates a new CreateIncidentAttachmentParams object +// with the ability to set a context for a request. +func NewCreateIncidentAttachmentParamsWithContext(ctx context.Context) *CreateIncidentAttachmentParams { + return &CreateIncidentAttachmentParams{ + Context: ctx, + } +} + +// NewCreateIncidentAttachmentParamsWithHTTPClient creates a new CreateIncidentAttachmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentAttachmentParamsWithHTTPClient(client *http.Client) *CreateIncidentAttachmentParams { + return &CreateIncidentAttachmentParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentAttachmentParams contains all the parameters to send to the API endpoint + + for the create incident attachment operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentAttachmentParams struct { + + // Description. + Description *string + + // File. + File runtime.NamedReadCloser + + // IncidentID. + IncidentID string + + // OccurredAt. + // + // Format: date-time + OccurredAt *strfmt.DateTime + + // VoteDirection. + VoteDirection *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident attachment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentAttachmentParams) WithDefaults() *CreateIncidentAttachmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident attachment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentAttachmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident attachment params +func (o *CreateIncidentAttachmentParams) WithTimeout(timeout time.Duration) *CreateIncidentAttachmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident attachment params +func (o *CreateIncidentAttachmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident attachment params +func (o *CreateIncidentAttachmentParams) WithContext(ctx context.Context) *CreateIncidentAttachmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident attachment params +func (o *CreateIncidentAttachmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident attachment params +func (o *CreateIncidentAttachmentParams) WithHTTPClient(client *http.Client) *CreateIncidentAttachmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident attachment params +func (o *CreateIncidentAttachmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDescription adds the description to the create incident attachment params +func (o *CreateIncidentAttachmentParams) WithDescription(description *string) *CreateIncidentAttachmentParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the create incident attachment params +func (o *CreateIncidentAttachmentParams) SetDescription(description *string) { + o.Description = description +} + +// WithFile adds the file to the create incident attachment params +func (o *CreateIncidentAttachmentParams) WithFile(file runtime.NamedReadCloser) *CreateIncidentAttachmentParams { + o.SetFile(file) + return o +} + +// SetFile adds the file to the create incident attachment params +func (o *CreateIncidentAttachmentParams) SetFile(file runtime.NamedReadCloser) { + o.File = file +} + +// WithIncidentID adds the incidentID to the create incident attachment params +func (o *CreateIncidentAttachmentParams) WithIncidentID(incidentID string) *CreateIncidentAttachmentParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident attachment params +func (o *CreateIncidentAttachmentParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithOccurredAt adds the occurredAt to the create incident attachment params +func (o *CreateIncidentAttachmentParams) WithOccurredAt(occurredAt *strfmt.DateTime) *CreateIncidentAttachmentParams { + o.SetOccurredAt(occurredAt) + return o +} + +// SetOccurredAt adds the occurredAt to the create incident attachment params +func (o *CreateIncidentAttachmentParams) SetOccurredAt(occurredAt *strfmt.DateTime) { + o.OccurredAt = occurredAt +} + +// WithVoteDirection adds the voteDirection to the create incident attachment params +func (o *CreateIncidentAttachmentParams) WithVoteDirection(voteDirection *string) *CreateIncidentAttachmentParams { + o.SetVoteDirection(voteDirection) + return o +} + +// SetVoteDirection adds the voteDirection to the create incident attachment params +func (o *CreateIncidentAttachmentParams) SetVoteDirection(voteDirection *string) { + o.VoteDirection = voteDirection +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentAttachmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Description != nil { + + // form param description + var frDescription string + if o.Description != nil { + frDescription = *o.Description + } + fDescription := frDescription + if fDescription != "" { + if err := r.SetFormParam("description", fDescription); err != nil { + return err + } + } + } + // form file param file + if err := r.SetFileParam("file", o.File); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if o.OccurredAt != nil { + + // form param occurred_at + var frOccurredAt strfmt.DateTime + if o.OccurredAt != nil { + frOccurredAt = *o.OccurredAt + } + fOccurredAt := frOccurredAt.String() + if fOccurredAt != "" { + if err := r.SetFormParam("occurred_at", fOccurredAt); err != nil { + return err + } + } + } + + if o.VoteDirection != nil { + + // form param vote_direction + var frVoteDirection string + if o.VoteDirection != nil { + frVoteDirection = *o.VoteDirection + } + fVoteDirection := frVoteDirection + if fVoteDirection != "" { + if err := r.SetFormParam("vote_direction", fVoteDirection); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/create_incident_attachment_responses.go b/client/incidents/create_incident_attachment_responses.go new file mode 100644 index 0000000..9fce205 --- /dev/null +++ b/client/incidents/create_incident_attachment_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentAttachmentReader is a Reader for the CreateIncidentAttachment structure. +type CreateIncidentAttachmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentAttachmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentAttachmentCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentAttachmentCreated creates a CreateIncidentAttachmentCreated with default headers values +func NewCreateIncidentAttachmentCreated() *CreateIncidentAttachmentCreated { + return &CreateIncidentAttachmentCreated{} +} + +/* +CreateIncidentAttachmentCreated describes a response with status code 201, with default header values. + +Allows adding image attachments to an incident +*/ +type CreateIncidentAttachmentCreated struct { + Payload *models.IncidentAttachmentEntity +} + +// IsSuccess returns true when this create incident attachment created response has a 2xx status code +func (o *CreateIncidentAttachmentCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident attachment created response has a 3xx status code +func (o *CreateIncidentAttachmentCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident attachment created response has a 4xx status code +func (o *CreateIncidentAttachmentCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident attachment created response has a 5xx status code +func (o *CreateIncidentAttachmentCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident attachment created response a status code equal to that given +func (o *CreateIncidentAttachmentCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentAttachmentCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/attachments][%d] createIncidentAttachmentCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentAttachmentCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/attachments][%d] createIncidentAttachmentCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentAttachmentCreated) GetPayload() *models.IncidentAttachmentEntity { + return o.Payload +} + +func (o *CreateIncidentAttachmentCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentAttachmentEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/create_incident_change_event_parameters.go b/client/incidents/create_incident_change_event_parameters.go new file mode 100644 index 0000000..bd52ce4 --- /dev/null +++ b/client/incidents/create_incident_change_event_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateIncidentChangeEventParams creates a new CreateIncidentChangeEventParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentChangeEventParams() *CreateIncidentChangeEventParams { + return &CreateIncidentChangeEventParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentChangeEventParamsWithTimeout creates a new CreateIncidentChangeEventParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentChangeEventParamsWithTimeout(timeout time.Duration) *CreateIncidentChangeEventParams { + return &CreateIncidentChangeEventParams{ + timeout: timeout, + } +} + +// NewCreateIncidentChangeEventParamsWithContext creates a new CreateIncidentChangeEventParams object +// with the ability to set a context for a request. +func NewCreateIncidentChangeEventParamsWithContext(ctx context.Context) *CreateIncidentChangeEventParams { + return &CreateIncidentChangeEventParams{ + Context: ctx, + } +} + +// NewCreateIncidentChangeEventParamsWithHTTPClient creates a new CreateIncidentChangeEventParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentChangeEventParamsWithHTTPClient(client *http.Client) *CreateIncidentChangeEventParams { + return &CreateIncidentChangeEventParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentChangeEventParams contains all the parameters to send to the API endpoint + + for the create incident change event operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentChangeEventParams struct { + + // CreateIncidentChangeEvent. + CreateIncidentChangeEvent *models.CreateIncidentChangeEvent + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident change event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentChangeEventParams) WithDefaults() *CreateIncidentChangeEventParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident change event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentChangeEventParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident change event params +func (o *CreateIncidentChangeEventParams) WithTimeout(timeout time.Duration) *CreateIncidentChangeEventParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident change event params +func (o *CreateIncidentChangeEventParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident change event params +func (o *CreateIncidentChangeEventParams) WithContext(ctx context.Context) *CreateIncidentChangeEventParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident change event params +func (o *CreateIncidentChangeEventParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident change event params +func (o *CreateIncidentChangeEventParams) WithHTTPClient(client *http.Client) *CreateIncidentChangeEventParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident change event params +func (o *CreateIncidentChangeEventParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateIncidentChangeEvent adds the createIncidentChangeEvent to the create incident change event params +func (o *CreateIncidentChangeEventParams) WithCreateIncidentChangeEvent(createIncidentChangeEvent *models.CreateIncidentChangeEvent) *CreateIncidentChangeEventParams { + o.SetCreateIncidentChangeEvent(createIncidentChangeEvent) + return o +} + +// SetCreateIncidentChangeEvent adds the createIncidentChangeEvent to the create incident change event params +func (o *CreateIncidentChangeEventParams) SetCreateIncidentChangeEvent(createIncidentChangeEvent *models.CreateIncidentChangeEvent) { + o.CreateIncidentChangeEvent = createIncidentChangeEvent +} + +// WithIncidentID adds the incidentID to the create incident change event params +func (o *CreateIncidentChangeEventParams) WithIncidentID(incidentID string) *CreateIncidentChangeEventParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident change event params +func (o *CreateIncidentChangeEventParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentChangeEventParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateIncidentChangeEvent != nil { + if err := r.SetBodyParam(o.CreateIncidentChangeEvent); err != nil { + return err + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/create_incident_change_event_responses.go b/client/incidents/create_incident_change_event_responses.go new file mode 100644 index 0000000..533b9db --- /dev/null +++ b/client/incidents/create_incident_change_event_responses.go @@ -0,0 +1,236 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentChangeEventReader is a Reader for the CreateIncidentChangeEvent structure. +type CreateIncidentChangeEventReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentChangeEventReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentChangeEventCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateIncidentChangeEventBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewCreateIncidentChangeEventConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentChangeEventCreated creates a CreateIncidentChangeEventCreated with default headers values +func NewCreateIncidentChangeEventCreated() *CreateIncidentChangeEventCreated { + return &CreateIncidentChangeEventCreated{} +} + +/* +CreateIncidentChangeEventCreated describes a response with status code 201, with default header values. + +Add a related change to an incident. Changes added to an incident can be causes, fixes, or suspects. To remove a change from an incident, the type field should be set to dismissed. +*/ +type CreateIncidentChangeEventCreated struct { + Payload *models.IncidentsRelatedChangeEventEntity +} + +// IsSuccess returns true when this create incident change event created response has a 2xx status code +func (o *CreateIncidentChangeEventCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident change event created response has a 3xx status code +func (o *CreateIncidentChangeEventCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident change event created response has a 4xx status code +func (o *CreateIncidentChangeEventCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident change event created response has a 5xx status code +func (o *CreateIncidentChangeEventCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident change event created response a status code equal to that given +func (o *CreateIncidentChangeEventCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentChangeEventCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/related_change_events][%d] createIncidentChangeEventCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentChangeEventCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/related_change_events][%d] createIncidentChangeEventCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentChangeEventCreated) GetPayload() *models.IncidentsRelatedChangeEventEntity { + return o.Payload +} + +func (o *CreateIncidentChangeEventCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRelatedChangeEventEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateIncidentChangeEventBadRequest creates a CreateIncidentChangeEventBadRequest with default headers values +func NewCreateIncidentChangeEventBadRequest() *CreateIncidentChangeEventBadRequest { + return &CreateIncidentChangeEventBadRequest{} +} + +/* +CreateIncidentChangeEventBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type CreateIncidentChangeEventBadRequest struct { + Payload *models.ErrorEntity +} + +// IsSuccess returns true when this create incident change event bad request response has a 2xx status code +func (o *CreateIncidentChangeEventBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create incident change event bad request response has a 3xx status code +func (o *CreateIncidentChangeEventBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident change event bad request response has a 4xx status code +func (o *CreateIncidentChangeEventBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create incident change event bad request response has a 5xx status code +func (o *CreateIncidentChangeEventBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident change event bad request response a status code equal to that given +func (o *CreateIncidentChangeEventBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *CreateIncidentChangeEventBadRequest) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/related_change_events][%d] createIncidentChangeEventBadRequest %+v", 400, o.Payload) +} + +func (o *CreateIncidentChangeEventBadRequest) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/related_change_events][%d] createIncidentChangeEventBadRequest %+v", 400, o.Payload) +} + +func (o *CreateIncidentChangeEventBadRequest) GetPayload() *models.ErrorEntity { + return o.Payload +} + +func (o *CreateIncidentChangeEventBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateIncidentChangeEventConflict creates a CreateIncidentChangeEventConflict with default headers values +func NewCreateIncidentChangeEventConflict() *CreateIncidentChangeEventConflict { + return &CreateIncidentChangeEventConflict{} +} + +/* +CreateIncidentChangeEventConflict describes a response with status code 409, with default header values. + +Already Added +*/ +type CreateIncidentChangeEventConflict struct { + Payload *models.ErrorEntity +} + +// IsSuccess returns true when this create incident change event conflict response has a 2xx status code +func (o *CreateIncidentChangeEventConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create incident change event conflict response has a 3xx status code +func (o *CreateIncidentChangeEventConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident change event conflict response has a 4xx status code +func (o *CreateIncidentChangeEventConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this create incident change event conflict response has a 5xx status code +func (o *CreateIncidentChangeEventConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident change event conflict response a status code equal to that given +func (o *CreateIncidentChangeEventConflict) IsCode(code int) bool { + return code == 409 +} + +func (o *CreateIncidentChangeEventConflict) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/related_change_events][%d] createIncidentChangeEventConflict %+v", 409, o.Payload) +} + +func (o *CreateIncidentChangeEventConflict) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/related_change_events][%d] createIncidentChangeEventConflict %+v", 409, o.Payload) +} + +func (o *CreateIncidentChangeEventConflict) GetPayload() *models.ErrorEntity { + return o.Payload +} + +func (o *CreateIncidentChangeEventConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/create_incident_chat_message_parameters.go b/client/incidents/create_incident_chat_message_parameters.go new file mode 100644 index 0000000..ceb9191 --- /dev/null +++ b/client/incidents/create_incident_chat_message_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateIncidentChatMessageParams creates a new CreateIncidentChatMessageParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentChatMessageParams() *CreateIncidentChatMessageParams { + return &CreateIncidentChatMessageParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentChatMessageParamsWithTimeout creates a new CreateIncidentChatMessageParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentChatMessageParamsWithTimeout(timeout time.Duration) *CreateIncidentChatMessageParams { + return &CreateIncidentChatMessageParams{ + timeout: timeout, + } +} + +// NewCreateIncidentChatMessageParamsWithContext creates a new CreateIncidentChatMessageParams object +// with the ability to set a context for a request. +func NewCreateIncidentChatMessageParamsWithContext(ctx context.Context) *CreateIncidentChatMessageParams { + return &CreateIncidentChatMessageParams{ + Context: ctx, + } +} + +// NewCreateIncidentChatMessageParamsWithHTTPClient creates a new CreateIncidentChatMessageParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentChatMessageParamsWithHTTPClient(client *http.Client) *CreateIncidentChatMessageParams { + return &CreateIncidentChatMessageParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentChatMessageParams contains all the parameters to send to the API endpoint + + for the create incident chat message operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentChatMessageParams struct { + + // CreateIncidentChatMessage. + CreateIncidentChatMessage *models.CreateIncidentChatMessage + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident chat message params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentChatMessageParams) WithDefaults() *CreateIncidentChatMessageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident chat message params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentChatMessageParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident chat message params +func (o *CreateIncidentChatMessageParams) WithTimeout(timeout time.Duration) *CreateIncidentChatMessageParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident chat message params +func (o *CreateIncidentChatMessageParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident chat message params +func (o *CreateIncidentChatMessageParams) WithContext(ctx context.Context) *CreateIncidentChatMessageParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident chat message params +func (o *CreateIncidentChatMessageParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident chat message params +func (o *CreateIncidentChatMessageParams) WithHTTPClient(client *http.Client) *CreateIncidentChatMessageParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident chat message params +func (o *CreateIncidentChatMessageParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateIncidentChatMessage adds the createIncidentChatMessage to the create incident chat message params +func (o *CreateIncidentChatMessageParams) WithCreateIncidentChatMessage(createIncidentChatMessage *models.CreateIncidentChatMessage) *CreateIncidentChatMessageParams { + o.SetCreateIncidentChatMessage(createIncidentChatMessage) + return o +} + +// SetCreateIncidentChatMessage adds the createIncidentChatMessage to the create incident chat message params +func (o *CreateIncidentChatMessageParams) SetCreateIncidentChatMessage(createIncidentChatMessage *models.CreateIncidentChatMessage) { + o.CreateIncidentChatMessage = createIncidentChatMessage +} + +// WithIncidentID adds the incidentID to the create incident chat message params +func (o *CreateIncidentChatMessageParams) WithIncidentID(incidentID string) *CreateIncidentChatMessageParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident chat message params +func (o *CreateIncidentChatMessageParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentChatMessageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateIncidentChatMessage != nil { + if err := r.SetBodyParam(o.CreateIncidentChatMessage); err != nil { + return err + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/create_incident_chat_message_responses.go b/client/incidents/create_incident_chat_message_responses.go new file mode 100644 index 0000000..60d976f --- /dev/null +++ b/client/incidents/create_incident_chat_message_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentChatMessageReader is a Reader for the CreateIncidentChatMessage structure. +type CreateIncidentChatMessageReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentChatMessageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentChatMessageCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentChatMessageCreated creates a CreateIncidentChatMessageCreated with default headers values +func NewCreateIncidentChatMessageCreated() *CreateIncidentChatMessageCreated { + return &CreateIncidentChatMessageCreated{} +} + +/* +CreateIncidentChatMessageCreated describes a response with status code 201, with default header values. + +Create a new generic chat message on an incident timeline. These are independent of any specific chat provider. +*/ +type CreateIncidentChatMessageCreated struct { + Payload *models.EventGenericChatMessageEntity +} + +// IsSuccess returns true when this create incident chat message created response has a 2xx status code +func (o *CreateIncidentChatMessageCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident chat message created response has a 3xx status code +func (o *CreateIncidentChatMessageCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident chat message created response has a 4xx status code +func (o *CreateIncidentChatMessageCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident chat message created response has a 5xx status code +func (o *CreateIncidentChatMessageCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident chat message created response a status code equal to that given +func (o *CreateIncidentChatMessageCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentChatMessageCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/generic_chat_messages][%d] createIncidentChatMessageCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentChatMessageCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/generic_chat_messages][%d] createIncidentChatMessageCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentChatMessageCreated) GetPayload() *models.EventGenericChatMessageEntity { + return o.Payload +} + +func (o *CreateIncidentChatMessageCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.EventGenericChatMessageEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/create_incident_impact_parameters.go b/client/incidents/create_incident_impact_parameters.go new file mode 100644 index 0000000..92db544 --- /dev/null +++ b/client/incidents/create_incident_impact_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateIncidentImpactParams creates a new CreateIncidentImpactParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentImpactParams() *CreateIncidentImpactParams { + return &CreateIncidentImpactParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentImpactParamsWithTimeout creates a new CreateIncidentImpactParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentImpactParamsWithTimeout(timeout time.Duration) *CreateIncidentImpactParams { + return &CreateIncidentImpactParams{ + timeout: timeout, + } +} + +// NewCreateIncidentImpactParamsWithContext creates a new CreateIncidentImpactParams object +// with the ability to set a context for a request. +func NewCreateIncidentImpactParamsWithContext(ctx context.Context) *CreateIncidentImpactParams { + return &CreateIncidentImpactParams{ + Context: ctx, + } +} + +// NewCreateIncidentImpactParamsWithHTTPClient creates a new CreateIncidentImpactParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentImpactParamsWithHTTPClient(client *http.Client) *CreateIncidentImpactParams { + return &CreateIncidentImpactParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentImpactParams contains all the parameters to send to the API endpoint + + for the create incident impact operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentImpactParams struct { + + // CreateIncidentImpact. + CreateIncidentImpact *models.CreateIncidentImpact + + // IncidentID. + IncidentID string + + // Type. + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident impact params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentImpactParams) WithDefaults() *CreateIncidentImpactParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident impact params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentImpactParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident impact params +func (o *CreateIncidentImpactParams) WithTimeout(timeout time.Duration) *CreateIncidentImpactParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident impact params +func (o *CreateIncidentImpactParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident impact params +func (o *CreateIncidentImpactParams) WithContext(ctx context.Context) *CreateIncidentImpactParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident impact params +func (o *CreateIncidentImpactParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident impact params +func (o *CreateIncidentImpactParams) WithHTTPClient(client *http.Client) *CreateIncidentImpactParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident impact params +func (o *CreateIncidentImpactParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateIncidentImpact adds the createIncidentImpact to the create incident impact params +func (o *CreateIncidentImpactParams) WithCreateIncidentImpact(createIncidentImpact *models.CreateIncidentImpact) *CreateIncidentImpactParams { + o.SetCreateIncidentImpact(createIncidentImpact) + return o +} + +// SetCreateIncidentImpact adds the createIncidentImpact to the create incident impact params +func (o *CreateIncidentImpactParams) SetCreateIncidentImpact(createIncidentImpact *models.CreateIncidentImpact) { + o.CreateIncidentImpact = createIncidentImpact +} + +// WithIncidentID adds the incidentID to the create incident impact params +func (o *CreateIncidentImpactParams) WithIncidentID(incidentID string) *CreateIncidentImpactParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident impact params +func (o *CreateIncidentImpactParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithType adds the typeVar to the create incident impact params +func (o *CreateIncidentImpactParams) WithType(typeVar string) *CreateIncidentImpactParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the create incident impact params +func (o *CreateIncidentImpactParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentImpactParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateIncidentImpact != nil { + if err := r.SetBodyParam(o.CreateIncidentImpact); err != nil { + return err + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param type + if err := r.SetPathParam("type", o.Type); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/create_incident_impact_responses.go b/client/incidents/create_incident_impact_responses.go new file mode 100644 index 0000000..4555b97 --- /dev/null +++ b/client/incidents/create_incident_impact_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentImpactReader is a Reader for the CreateIncidentImpact structure. +type CreateIncidentImpactReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentImpactReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentImpactCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateIncidentImpactBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentImpactCreated creates a CreateIncidentImpactCreated with default headers values +func NewCreateIncidentImpactCreated() *CreateIncidentImpactCreated { + return &CreateIncidentImpactCreated{} +} + +/* +CreateIncidentImpactCreated describes a response with status code 201, with default header values. + +Add impacted infrastructure to an incident +*/ +type CreateIncidentImpactCreated struct { + Payload *models.IncidentImpactEntity +} + +// IsSuccess returns true when this create incident impact created response has a 2xx status code +func (o *CreateIncidentImpactCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident impact created response has a 3xx status code +func (o *CreateIncidentImpactCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident impact created response has a 4xx status code +func (o *CreateIncidentImpactCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident impact created response has a 5xx status code +func (o *CreateIncidentImpactCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident impact created response a status code equal to that given +func (o *CreateIncidentImpactCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentImpactCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/impact/{type}][%d] createIncidentImpactCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentImpactCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/impact/{type}][%d] createIncidentImpactCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentImpactCreated) GetPayload() *models.IncidentImpactEntity { + return o.Payload +} + +func (o *CreateIncidentImpactCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentImpactEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateIncidentImpactBadRequest creates a CreateIncidentImpactBadRequest with default headers values +func NewCreateIncidentImpactBadRequest() *CreateIncidentImpactBadRequest { + return &CreateIncidentImpactBadRequest{} +} + +/* +CreateIncidentImpactBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type CreateIncidentImpactBadRequest struct { + Payload *models.ErrorEntity +} + +// IsSuccess returns true when this create incident impact bad request response has a 2xx status code +func (o *CreateIncidentImpactBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create incident impact bad request response has a 3xx status code +func (o *CreateIncidentImpactBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident impact bad request response has a 4xx status code +func (o *CreateIncidentImpactBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create incident impact bad request response has a 5xx status code +func (o *CreateIncidentImpactBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident impact bad request response a status code equal to that given +func (o *CreateIncidentImpactBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *CreateIncidentImpactBadRequest) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/impact/{type}][%d] createIncidentImpactBadRequest %+v", 400, o.Payload) +} + +func (o *CreateIncidentImpactBadRequest) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/impact/{type}][%d] createIncidentImpactBadRequest %+v", 400, o.Payload) +} + +func (o *CreateIncidentImpactBadRequest) GetPayload() *models.ErrorEntity { + return o.Payload +} + +func (o *CreateIncidentImpactBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/create_incident_link_parameters.go b/client/incidents/create_incident_link_parameters.go new file mode 100644 index 0000000..b371b9e --- /dev/null +++ b/client/incidents/create_incident_link_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateIncidentLinkParams creates a new CreateIncidentLinkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentLinkParams() *CreateIncidentLinkParams { + return &CreateIncidentLinkParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentLinkParamsWithTimeout creates a new CreateIncidentLinkParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentLinkParamsWithTimeout(timeout time.Duration) *CreateIncidentLinkParams { + return &CreateIncidentLinkParams{ + timeout: timeout, + } +} + +// NewCreateIncidentLinkParamsWithContext creates a new CreateIncidentLinkParams object +// with the ability to set a context for a request. +func NewCreateIncidentLinkParamsWithContext(ctx context.Context) *CreateIncidentLinkParams { + return &CreateIncidentLinkParams{ + Context: ctx, + } +} + +// NewCreateIncidentLinkParamsWithHTTPClient creates a new CreateIncidentLinkParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentLinkParamsWithHTTPClient(client *http.Client) *CreateIncidentLinkParams { + return &CreateIncidentLinkParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentLinkParams contains all the parameters to send to the API endpoint + + for the create incident link operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentLinkParams struct { + + // CreateIncidentLink. + CreateIncidentLink *models.CreateIncidentLink + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentLinkParams) WithDefaults() *CreateIncidentLinkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentLinkParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident link params +func (o *CreateIncidentLinkParams) WithTimeout(timeout time.Duration) *CreateIncidentLinkParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident link params +func (o *CreateIncidentLinkParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident link params +func (o *CreateIncidentLinkParams) WithContext(ctx context.Context) *CreateIncidentLinkParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident link params +func (o *CreateIncidentLinkParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident link params +func (o *CreateIncidentLinkParams) WithHTTPClient(client *http.Client) *CreateIncidentLinkParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident link params +func (o *CreateIncidentLinkParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateIncidentLink adds the createIncidentLink to the create incident link params +func (o *CreateIncidentLinkParams) WithCreateIncidentLink(createIncidentLink *models.CreateIncidentLink) *CreateIncidentLinkParams { + o.SetCreateIncidentLink(createIncidentLink) + return o +} + +// SetCreateIncidentLink adds the createIncidentLink to the create incident link params +func (o *CreateIncidentLinkParams) SetCreateIncidentLink(createIncidentLink *models.CreateIncidentLink) { + o.CreateIncidentLink = createIncidentLink +} + +// WithIncidentID adds the incidentID to the create incident link params +func (o *CreateIncidentLinkParams) WithIncidentID(incidentID string) *CreateIncidentLinkParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident link params +func (o *CreateIncidentLinkParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentLinkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateIncidentLink != nil { + if err := r.SetBodyParam(o.CreateIncidentLink); err != nil { + return err + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/create_incident_link_responses.go b/client/incidents/create_incident_link_responses.go new file mode 100644 index 0000000..564af4f --- /dev/null +++ b/client/incidents/create_incident_link_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentLinkReader is a Reader for the CreateIncidentLink structure. +type CreateIncidentLinkReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentLinkReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentLinkCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentLinkCreated creates a CreateIncidentLinkCreated with default headers values +func NewCreateIncidentLinkCreated() *CreateIncidentLinkCreated { + return &CreateIncidentLinkCreated{} +} + +/* +CreateIncidentLinkCreated describes a response with status code 201, with default header values. + +Allows adding adhoc links to an incident as an attachment +*/ +type CreateIncidentLinkCreated struct { + Payload *models.AttachmentsLinkEntity +} + +// IsSuccess returns true when this create incident link created response has a 2xx status code +func (o *CreateIncidentLinkCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident link created response has a 3xx status code +func (o *CreateIncidentLinkCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident link created response has a 4xx status code +func (o *CreateIncidentLinkCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident link created response has a 5xx status code +func (o *CreateIncidentLinkCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident link created response a status code equal to that given +func (o *CreateIncidentLinkCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentLinkCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/links][%d] createIncidentLinkCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentLinkCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/links][%d] createIncidentLinkCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentLinkCreated) GetPayload() *models.AttachmentsLinkEntity { + return o.Payload +} + +func (o *CreateIncidentLinkCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AttachmentsLinkEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/create_incident_note_parameters.go b/client/incidents/create_incident_note_parameters.go new file mode 100644 index 0000000..77d3fad --- /dev/null +++ b/client/incidents/create_incident_note_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateIncidentNoteParams creates a new CreateIncidentNoteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentNoteParams() *CreateIncidentNoteParams { + return &CreateIncidentNoteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentNoteParamsWithTimeout creates a new CreateIncidentNoteParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentNoteParamsWithTimeout(timeout time.Duration) *CreateIncidentNoteParams { + return &CreateIncidentNoteParams{ + timeout: timeout, + } +} + +// NewCreateIncidentNoteParamsWithContext creates a new CreateIncidentNoteParams object +// with the ability to set a context for a request. +func NewCreateIncidentNoteParamsWithContext(ctx context.Context) *CreateIncidentNoteParams { + return &CreateIncidentNoteParams{ + Context: ctx, + } +} + +// NewCreateIncidentNoteParamsWithHTTPClient creates a new CreateIncidentNoteParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentNoteParamsWithHTTPClient(client *http.Client) *CreateIncidentNoteParams { + return &CreateIncidentNoteParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentNoteParams contains all the parameters to send to the API endpoint + + for the create incident note operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentNoteParams struct { + + // CreateIncidentNote. + CreateIncidentNote *models.CreateIncidentNote + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident note params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentNoteParams) WithDefaults() *CreateIncidentNoteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident note params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentNoteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident note params +func (o *CreateIncidentNoteParams) WithTimeout(timeout time.Duration) *CreateIncidentNoteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident note params +func (o *CreateIncidentNoteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident note params +func (o *CreateIncidentNoteParams) WithContext(ctx context.Context) *CreateIncidentNoteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident note params +func (o *CreateIncidentNoteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident note params +func (o *CreateIncidentNoteParams) WithHTTPClient(client *http.Client) *CreateIncidentNoteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident note params +func (o *CreateIncidentNoteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateIncidentNote adds the createIncidentNote to the create incident note params +func (o *CreateIncidentNoteParams) WithCreateIncidentNote(createIncidentNote *models.CreateIncidentNote) *CreateIncidentNoteParams { + o.SetCreateIncidentNote(createIncidentNote) + return o +} + +// SetCreateIncidentNote adds the createIncidentNote to the create incident note params +func (o *CreateIncidentNoteParams) SetCreateIncidentNote(createIncidentNote *models.CreateIncidentNote) { + o.CreateIncidentNote = createIncidentNote +} + +// WithIncidentID adds the incidentID to the create incident note params +func (o *CreateIncidentNoteParams) WithIncidentID(incidentID string) *CreateIncidentNoteParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident note params +func (o *CreateIncidentNoteParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentNoteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateIncidentNote != nil { + if err := r.SetBodyParam(o.CreateIncidentNote); err != nil { + return err + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/create_incident_note_responses.go b/client/incidents/create_incident_note_responses.go new file mode 100644 index 0000000..4f6bed1 --- /dev/null +++ b/client/incidents/create_incident_note_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentNoteReader is a Reader for the CreateIncidentNote structure. +type CreateIncidentNoteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentNoteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentNoteCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentNoteCreated creates a CreateIncidentNoteCreated with default headers values +func NewCreateIncidentNoteCreated() *CreateIncidentNoteCreated { + return &CreateIncidentNoteCreated{} +} + +/* +CreateIncidentNoteCreated describes a response with status code 201, with default header values. + +Create a new note on for an incident. The visibility field on a note determines where it gets posted. +*/ +type CreateIncidentNoteCreated struct { + Payload *models.EventNoteEntity +} + +// IsSuccess returns true when this create incident note created response has a 2xx status code +func (o *CreateIncidentNoteCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident note created response has a 3xx status code +func (o *CreateIncidentNoteCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident note created response has a 4xx status code +func (o *CreateIncidentNoteCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident note created response has a 5xx status code +func (o *CreateIncidentNoteCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident note created response a status code equal to that given +func (o *CreateIncidentNoteCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentNoteCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/notes][%d] createIncidentNoteCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentNoteCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/notes][%d] createIncidentNoteCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentNoteCreated) GetPayload() *models.EventNoteEntity { + return o.Payload +} + +func (o *CreateIncidentNoteCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.EventNoteEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/create_incident_parameters.go b/client/incidents/create_incident_parameters.go new file mode 100644 index 0000000..4a714d9 --- /dev/null +++ b/client/incidents/create_incident_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateIncidentParams creates a new CreateIncidentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentParams() *CreateIncidentParams { + return &CreateIncidentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentParamsWithTimeout creates a new CreateIncidentParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentParamsWithTimeout(timeout time.Duration) *CreateIncidentParams { + return &CreateIncidentParams{ + timeout: timeout, + } +} + +// NewCreateIncidentParamsWithContext creates a new CreateIncidentParams object +// with the ability to set a context for a request. +func NewCreateIncidentParamsWithContext(ctx context.Context) *CreateIncidentParams { + return &CreateIncidentParams{ + Context: ctx, + } +} + +// NewCreateIncidentParamsWithHTTPClient creates a new CreateIncidentParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentParamsWithHTTPClient(client *http.Client) *CreateIncidentParams { + return &CreateIncidentParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentParams contains all the parameters to send to the API endpoint + + for the create incident operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentParams struct { + + // CreateIncident. + CreateIncident *models.CreateIncident + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentParams) WithDefaults() *CreateIncidentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident params +func (o *CreateIncidentParams) WithTimeout(timeout time.Duration) *CreateIncidentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident params +func (o *CreateIncidentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident params +func (o *CreateIncidentParams) WithContext(ctx context.Context) *CreateIncidentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident params +func (o *CreateIncidentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident params +func (o *CreateIncidentParams) WithHTTPClient(client *http.Client) *CreateIncidentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident params +func (o *CreateIncidentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateIncident adds the createIncident to the create incident params +func (o *CreateIncidentParams) WithCreateIncident(createIncident *models.CreateIncident) *CreateIncidentParams { + o.SetCreateIncident(createIncident) + return o +} + +// SetCreateIncident adds the createIncident to the create incident params +func (o *CreateIncidentParams) SetCreateIncident(createIncident *models.CreateIncident) { + o.CreateIncident = createIncident +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateIncident != nil { + if err := r.SetBodyParam(o.CreateIncident); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/create_incident_responses.go b/client/incidents/create_incident_responses.go new file mode 100644 index 0000000..1837f15 --- /dev/null +++ b/client/incidents/create_incident_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentReader is a Reader for the CreateIncident structure. +type CreateIncidentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentCreated creates a CreateIncidentCreated with default headers values +func NewCreateIncidentCreated() *CreateIncidentCreated { + return &CreateIncidentCreated{} +} + +/* +CreateIncidentCreated describes a response with status code 201, with default header values. + +Create a new incident +*/ +type CreateIncidentCreated struct { + Payload *models.IncidentEntity +} + +// IsSuccess returns true when this create incident created response has a 2xx status code +func (o *CreateIncidentCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident created response has a 3xx status code +func (o *CreateIncidentCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident created response has a 4xx status code +func (o *CreateIncidentCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident created response has a 5xx status code +func (o *CreateIncidentCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident created response a status code equal to that given +func (o *CreateIncidentCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents][%d] createIncidentCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents][%d] createIncidentCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentCreated) GetPayload() *models.IncidentEntity { + return o.Payload +} + +func (o *CreateIncidentCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/create_incident_role_assignment_parameters.go b/client/incidents/create_incident_role_assignment_parameters.go new file mode 100644 index 0000000..7395592 --- /dev/null +++ b/client/incidents/create_incident_role_assignment_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateIncidentRoleAssignmentParams creates a new CreateIncidentRoleAssignmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentRoleAssignmentParams() *CreateIncidentRoleAssignmentParams { + return &CreateIncidentRoleAssignmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentRoleAssignmentParamsWithTimeout creates a new CreateIncidentRoleAssignmentParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentRoleAssignmentParamsWithTimeout(timeout time.Duration) *CreateIncidentRoleAssignmentParams { + return &CreateIncidentRoleAssignmentParams{ + timeout: timeout, + } +} + +// NewCreateIncidentRoleAssignmentParamsWithContext creates a new CreateIncidentRoleAssignmentParams object +// with the ability to set a context for a request. +func NewCreateIncidentRoleAssignmentParamsWithContext(ctx context.Context) *CreateIncidentRoleAssignmentParams { + return &CreateIncidentRoleAssignmentParams{ + Context: ctx, + } +} + +// NewCreateIncidentRoleAssignmentParamsWithHTTPClient creates a new CreateIncidentRoleAssignmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentRoleAssignmentParamsWithHTTPClient(client *http.Client) *CreateIncidentRoleAssignmentParams { + return &CreateIncidentRoleAssignmentParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentRoleAssignmentParams contains all the parameters to send to the API endpoint + + for the create incident role assignment operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentRoleAssignmentParams struct { + + // CreateIncidentRoleAssignment. + CreateIncidentRoleAssignment *models.CreateIncidentRoleAssignment + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident role assignment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentRoleAssignmentParams) WithDefaults() *CreateIncidentRoleAssignmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident role assignment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentRoleAssignmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident role assignment params +func (o *CreateIncidentRoleAssignmentParams) WithTimeout(timeout time.Duration) *CreateIncidentRoleAssignmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident role assignment params +func (o *CreateIncidentRoleAssignmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident role assignment params +func (o *CreateIncidentRoleAssignmentParams) WithContext(ctx context.Context) *CreateIncidentRoleAssignmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident role assignment params +func (o *CreateIncidentRoleAssignmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident role assignment params +func (o *CreateIncidentRoleAssignmentParams) WithHTTPClient(client *http.Client) *CreateIncidentRoleAssignmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident role assignment params +func (o *CreateIncidentRoleAssignmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateIncidentRoleAssignment adds the createIncidentRoleAssignment to the create incident role assignment params +func (o *CreateIncidentRoleAssignmentParams) WithCreateIncidentRoleAssignment(createIncidentRoleAssignment *models.CreateIncidentRoleAssignment) *CreateIncidentRoleAssignmentParams { + o.SetCreateIncidentRoleAssignment(createIncidentRoleAssignment) + return o +} + +// SetCreateIncidentRoleAssignment adds the createIncidentRoleAssignment to the create incident role assignment params +func (o *CreateIncidentRoleAssignmentParams) SetCreateIncidentRoleAssignment(createIncidentRoleAssignment *models.CreateIncidentRoleAssignment) { + o.CreateIncidentRoleAssignment = createIncidentRoleAssignment +} + +// WithIncidentID adds the incidentID to the create incident role assignment params +func (o *CreateIncidentRoleAssignmentParams) WithIncidentID(incidentID string) *CreateIncidentRoleAssignmentParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident role assignment params +func (o *CreateIncidentRoleAssignmentParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentRoleAssignmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateIncidentRoleAssignment != nil { + if err := r.SetBodyParam(o.CreateIncidentRoleAssignment); err != nil { + return err + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/create_incident_role_assignment_responses.go b/client/incidents/create_incident_role_assignment_responses.go new file mode 100644 index 0000000..a8f37e2 --- /dev/null +++ b/client/incidents/create_incident_role_assignment_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentRoleAssignmentReader is a Reader for the CreateIncidentRoleAssignment structure. +type CreateIncidentRoleAssignmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentRoleAssignmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentRoleAssignmentCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentRoleAssignmentCreated creates a CreateIncidentRoleAssignmentCreated with default headers values +func NewCreateIncidentRoleAssignmentCreated() *CreateIncidentRoleAssignmentCreated { + return &CreateIncidentRoleAssignmentCreated{} +} + +/* +CreateIncidentRoleAssignmentCreated describes a response with status code 201, with default header values. + +Assign a role to a user for this incident +*/ +type CreateIncidentRoleAssignmentCreated struct { + Payload *models.IncidentsRoleAssignmentEntity +} + +// IsSuccess returns true when this create incident role assignment created response has a 2xx status code +func (o *CreateIncidentRoleAssignmentCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident role assignment created response has a 3xx status code +func (o *CreateIncidentRoleAssignmentCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident role assignment created response has a 4xx status code +func (o *CreateIncidentRoleAssignmentCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident role assignment created response has a 5xx status code +func (o *CreateIncidentRoleAssignmentCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident role assignment created response a status code equal to that given +func (o *CreateIncidentRoleAssignmentCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentRoleAssignmentCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/role_assignments][%d] createIncidentRoleAssignmentCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentRoleAssignmentCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/role_assignments][%d] createIncidentRoleAssignmentCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentRoleAssignmentCreated) GetPayload() *models.IncidentsRoleAssignmentEntity { + return o.Payload +} + +func (o *CreateIncidentRoleAssignmentCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRoleAssignmentEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/create_incident_status_page_parameters.go b/client/incidents/create_incident_status_page_parameters.go new file mode 100644 index 0000000..db9beb4 --- /dev/null +++ b/client/incidents/create_incident_status_page_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateIncidentStatusPageParams creates a new CreateIncidentStatusPageParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentStatusPageParams() *CreateIncidentStatusPageParams { + return &CreateIncidentStatusPageParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentStatusPageParamsWithTimeout creates a new CreateIncidentStatusPageParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentStatusPageParamsWithTimeout(timeout time.Duration) *CreateIncidentStatusPageParams { + return &CreateIncidentStatusPageParams{ + timeout: timeout, + } +} + +// NewCreateIncidentStatusPageParamsWithContext creates a new CreateIncidentStatusPageParams object +// with the ability to set a context for a request. +func NewCreateIncidentStatusPageParamsWithContext(ctx context.Context) *CreateIncidentStatusPageParams { + return &CreateIncidentStatusPageParams{ + Context: ctx, + } +} + +// NewCreateIncidentStatusPageParamsWithHTTPClient creates a new CreateIncidentStatusPageParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentStatusPageParamsWithHTTPClient(client *http.Client) *CreateIncidentStatusPageParams { + return &CreateIncidentStatusPageParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentStatusPageParams contains all the parameters to send to the API endpoint + + for the create incident status page operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentStatusPageParams struct { + + // CreateIncidentStatusPage. + CreateIncidentStatusPage *models.CreateIncidentStatusPage + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident status page params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentStatusPageParams) WithDefaults() *CreateIncidentStatusPageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident status page params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentStatusPageParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident status page params +func (o *CreateIncidentStatusPageParams) WithTimeout(timeout time.Duration) *CreateIncidentStatusPageParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident status page params +func (o *CreateIncidentStatusPageParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident status page params +func (o *CreateIncidentStatusPageParams) WithContext(ctx context.Context) *CreateIncidentStatusPageParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident status page params +func (o *CreateIncidentStatusPageParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident status page params +func (o *CreateIncidentStatusPageParams) WithHTTPClient(client *http.Client) *CreateIncidentStatusPageParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident status page params +func (o *CreateIncidentStatusPageParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateIncidentStatusPage adds the createIncidentStatusPage to the create incident status page params +func (o *CreateIncidentStatusPageParams) WithCreateIncidentStatusPage(createIncidentStatusPage *models.CreateIncidentStatusPage) *CreateIncidentStatusPageParams { + o.SetCreateIncidentStatusPage(createIncidentStatusPage) + return o +} + +// SetCreateIncidentStatusPage adds the createIncidentStatusPage to the create incident status page params +func (o *CreateIncidentStatusPageParams) SetCreateIncidentStatusPage(createIncidentStatusPage *models.CreateIncidentStatusPage) { + o.CreateIncidentStatusPage = createIncidentStatusPage +} + +// WithIncidentID adds the incidentID to the create incident status page params +func (o *CreateIncidentStatusPageParams) WithIncidentID(incidentID string) *CreateIncidentStatusPageParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident status page params +func (o *CreateIncidentStatusPageParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentStatusPageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateIncidentStatusPage != nil { + if err := r.SetBodyParam(o.CreateIncidentStatusPage); err != nil { + return err + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/create_incident_status_page_responses.go b/client/incidents/create_incident_status_page_responses.go new file mode 100644 index 0000000..5342ab1 --- /dev/null +++ b/client/incidents/create_incident_status_page_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentStatusPageReader is a Reader for the CreateIncidentStatusPage structure. +type CreateIncidentStatusPageReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentStatusPageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentStatusPageCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentStatusPageCreated creates a CreateIncidentStatusPageCreated with default headers values +func NewCreateIncidentStatusPageCreated() *CreateIncidentStatusPageCreated { + return &CreateIncidentStatusPageCreated{} +} + +/* +CreateIncidentStatusPageCreated describes a response with status code 201, with default header values. + +Add a status page to an incident. +*/ +type CreateIncidentStatusPageCreated struct { + Payload *models.IncidentsStatusPageEntity +} + +// IsSuccess returns true when this create incident status page created response has a 2xx status code +func (o *CreateIncidentStatusPageCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident status page created response has a 3xx status code +func (o *CreateIncidentStatusPageCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident status page created response has a 4xx status code +func (o *CreateIncidentStatusPageCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident status page created response has a 5xx status code +func (o *CreateIncidentStatusPageCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident status page created response a status code equal to that given +func (o *CreateIncidentStatusPageCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentStatusPageCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/status_pages][%d] createIncidentStatusPageCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentStatusPageCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/status_pages][%d] createIncidentStatusPageCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentStatusPageCreated) GetPayload() *models.IncidentsStatusPageEntity { + return o.Payload +} + +func (o *CreateIncidentStatusPageCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsStatusPageEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/create_incident_team_assignment_parameters.go b/client/incidents/create_incident_team_assignment_parameters.go new file mode 100644 index 0000000..11e64a8 --- /dev/null +++ b/client/incidents/create_incident_team_assignment_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateIncidentTeamAssignmentParams creates a new CreateIncidentTeamAssignmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentTeamAssignmentParams() *CreateIncidentTeamAssignmentParams { + return &CreateIncidentTeamAssignmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentTeamAssignmentParamsWithTimeout creates a new CreateIncidentTeamAssignmentParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentTeamAssignmentParamsWithTimeout(timeout time.Duration) *CreateIncidentTeamAssignmentParams { + return &CreateIncidentTeamAssignmentParams{ + timeout: timeout, + } +} + +// NewCreateIncidentTeamAssignmentParamsWithContext creates a new CreateIncidentTeamAssignmentParams object +// with the ability to set a context for a request. +func NewCreateIncidentTeamAssignmentParamsWithContext(ctx context.Context) *CreateIncidentTeamAssignmentParams { + return &CreateIncidentTeamAssignmentParams{ + Context: ctx, + } +} + +// NewCreateIncidentTeamAssignmentParamsWithHTTPClient creates a new CreateIncidentTeamAssignmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentTeamAssignmentParamsWithHTTPClient(client *http.Client) *CreateIncidentTeamAssignmentParams { + return &CreateIncidentTeamAssignmentParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentTeamAssignmentParams contains all the parameters to send to the API endpoint + + for the create incident team assignment operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentTeamAssignmentParams struct { + + // CreateIncidentTeamAssignment. + CreateIncidentTeamAssignment *models.CreateIncidentTeamAssignment + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident team assignment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentTeamAssignmentParams) WithDefaults() *CreateIncidentTeamAssignmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident team assignment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentTeamAssignmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident team assignment params +func (o *CreateIncidentTeamAssignmentParams) WithTimeout(timeout time.Duration) *CreateIncidentTeamAssignmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident team assignment params +func (o *CreateIncidentTeamAssignmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident team assignment params +func (o *CreateIncidentTeamAssignmentParams) WithContext(ctx context.Context) *CreateIncidentTeamAssignmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident team assignment params +func (o *CreateIncidentTeamAssignmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident team assignment params +func (o *CreateIncidentTeamAssignmentParams) WithHTTPClient(client *http.Client) *CreateIncidentTeamAssignmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident team assignment params +func (o *CreateIncidentTeamAssignmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateIncidentTeamAssignment adds the createIncidentTeamAssignment to the create incident team assignment params +func (o *CreateIncidentTeamAssignmentParams) WithCreateIncidentTeamAssignment(createIncidentTeamAssignment *models.CreateIncidentTeamAssignment) *CreateIncidentTeamAssignmentParams { + o.SetCreateIncidentTeamAssignment(createIncidentTeamAssignment) + return o +} + +// SetCreateIncidentTeamAssignment adds the createIncidentTeamAssignment to the create incident team assignment params +func (o *CreateIncidentTeamAssignmentParams) SetCreateIncidentTeamAssignment(createIncidentTeamAssignment *models.CreateIncidentTeamAssignment) { + o.CreateIncidentTeamAssignment = createIncidentTeamAssignment +} + +// WithIncidentID adds the incidentID to the create incident team assignment params +func (o *CreateIncidentTeamAssignmentParams) WithIncidentID(incidentID string) *CreateIncidentTeamAssignmentParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident team assignment params +func (o *CreateIncidentTeamAssignmentParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentTeamAssignmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateIncidentTeamAssignment != nil { + if err := r.SetBodyParam(o.CreateIncidentTeamAssignment); err != nil { + return err + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/create_incident_team_assignment_responses.go b/client/incidents/create_incident_team_assignment_responses.go new file mode 100644 index 0000000..65425e3 --- /dev/null +++ b/client/incidents/create_incident_team_assignment_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateIncidentTeamAssignmentReader is a Reader for the CreateIncidentTeamAssignment structure. +type CreateIncidentTeamAssignmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentTeamAssignmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentTeamAssignmentCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentTeamAssignmentCreated creates a CreateIncidentTeamAssignmentCreated with default headers values +func NewCreateIncidentTeamAssignmentCreated() *CreateIncidentTeamAssignmentCreated { + return &CreateIncidentTeamAssignmentCreated{} +} + +/* +CreateIncidentTeamAssignmentCreated describes a response with status code 201, with default header values. + +Assign a team for this incident +*/ +type CreateIncidentTeamAssignmentCreated struct { +} + +// IsSuccess returns true when this create incident team assignment created response has a 2xx status code +func (o *CreateIncidentTeamAssignmentCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident team assignment created response has a 3xx status code +func (o *CreateIncidentTeamAssignmentCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident team assignment created response has a 4xx status code +func (o *CreateIncidentTeamAssignmentCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident team assignment created response has a 5xx status code +func (o *CreateIncidentTeamAssignmentCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident team assignment created response a status code equal to that given +func (o *CreateIncidentTeamAssignmentCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentTeamAssignmentCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/team_assignments][%d] createIncidentTeamAssignmentCreated ", 201) +} + +func (o *CreateIncidentTeamAssignmentCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/team_assignments][%d] createIncidentTeamAssignmentCreated ", 201) +} + +func (o *CreateIncidentTeamAssignmentCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/incidents/create_scheduled_maintenance_parameters.go b/client/incidents/create_scheduled_maintenance_parameters.go new file mode 100644 index 0000000..8c8e441 --- /dev/null +++ b/client/incidents/create_scheduled_maintenance_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateScheduledMaintenanceParams creates a new CreateScheduledMaintenanceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateScheduledMaintenanceParams() *CreateScheduledMaintenanceParams { + return &CreateScheduledMaintenanceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateScheduledMaintenanceParamsWithTimeout creates a new CreateScheduledMaintenanceParams object +// with the ability to set a timeout on a request. +func NewCreateScheduledMaintenanceParamsWithTimeout(timeout time.Duration) *CreateScheduledMaintenanceParams { + return &CreateScheduledMaintenanceParams{ + timeout: timeout, + } +} + +// NewCreateScheduledMaintenanceParamsWithContext creates a new CreateScheduledMaintenanceParams object +// with the ability to set a context for a request. +func NewCreateScheduledMaintenanceParamsWithContext(ctx context.Context) *CreateScheduledMaintenanceParams { + return &CreateScheduledMaintenanceParams{ + Context: ctx, + } +} + +// NewCreateScheduledMaintenanceParamsWithHTTPClient creates a new CreateScheduledMaintenanceParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateScheduledMaintenanceParamsWithHTTPClient(client *http.Client) *CreateScheduledMaintenanceParams { + return &CreateScheduledMaintenanceParams{ + HTTPClient: client, + } +} + +/* +CreateScheduledMaintenanceParams contains all the parameters to send to the API endpoint + + for the create scheduled maintenance operation. + + Typically these are written to a http.Request. +*/ +type CreateScheduledMaintenanceParams struct { + + // CreateScheduledMaintenance. + CreateScheduledMaintenance *models.CreateScheduledMaintenance + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create scheduled maintenance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateScheduledMaintenanceParams) WithDefaults() *CreateScheduledMaintenanceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create scheduled maintenance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateScheduledMaintenanceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create scheduled maintenance params +func (o *CreateScheduledMaintenanceParams) WithTimeout(timeout time.Duration) *CreateScheduledMaintenanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create scheduled maintenance params +func (o *CreateScheduledMaintenanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create scheduled maintenance params +func (o *CreateScheduledMaintenanceParams) WithContext(ctx context.Context) *CreateScheduledMaintenanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create scheduled maintenance params +func (o *CreateScheduledMaintenanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create scheduled maintenance params +func (o *CreateScheduledMaintenanceParams) WithHTTPClient(client *http.Client) *CreateScheduledMaintenanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create scheduled maintenance params +func (o *CreateScheduledMaintenanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateScheduledMaintenance adds the createScheduledMaintenance to the create scheduled maintenance params +func (o *CreateScheduledMaintenanceParams) WithCreateScheduledMaintenance(createScheduledMaintenance *models.CreateScheduledMaintenance) *CreateScheduledMaintenanceParams { + o.SetCreateScheduledMaintenance(createScheduledMaintenance) + return o +} + +// SetCreateScheduledMaintenance adds the createScheduledMaintenance to the create scheduled maintenance params +func (o *CreateScheduledMaintenanceParams) SetCreateScheduledMaintenance(createScheduledMaintenance *models.CreateScheduledMaintenance) { + o.CreateScheduledMaintenance = createScheduledMaintenance +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateScheduledMaintenanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateScheduledMaintenance != nil { + if err := r.SetBodyParam(o.CreateScheduledMaintenance); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/create_scheduled_maintenance_responses.go b/client/incidents/create_scheduled_maintenance_responses.go new file mode 100644 index 0000000..b747ebd --- /dev/null +++ b/client/incidents/create_scheduled_maintenance_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateScheduledMaintenanceReader is a Reader for the CreateScheduledMaintenance structure. +type CreateScheduledMaintenanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateScheduledMaintenanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateScheduledMaintenanceCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateScheduledMaintenanceBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateScheduledMaintenanceCreated creates a CreateScheduledMaintenanceCreated with default headers values +func NewCreateScheduledMaintenanceCreated() *CreateScheduledMaintenanceCreated { + return &CreateScheduledMaintenanceCreated{} +} + +/* +CreateScheduledMaintenanceCreated describes a response with status code 201, with default header values. + +Create a new scheduled maintenance event +*/ +type CreateScheduledMaintenanceCreated struct { + Payload *models.ScheduledMaintenanceEntity +} + +// IsSuccess returns true when this create scheduled maintenance created response has a 2xx status code +func (o *CreateScheduledMaintenanceCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create scheduled maintenance created response has a 3xx status code +func (o *CreateScheduledMaintenanceCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create scheduled maintenance created response has a 4xx status code +func (o *CreateScheduledMaintenanceCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create scheduled maintenance created response has a 5xx status code +func (o *CreateScheduledMaintenanceCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create scheduled maintenance created response a status code equal to that given +func (o *CreateScheduledMaintenanceCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateScheduledMaintenanceCreated) Error() string { + return fmt.Sprintf("[POST /v1/scheduled_maintenances][%d] createScheduledMaintenanceCreated %+v", 201, o.Payload) +} + +func (o *CreateScheduledMaintenanceCreated) String() string { + return fmt.Sprintf("[POST /v1/scheduled_maintenances][%d] createScheduledMaintenanceCreated %+v", 201, o.Payload) +} + +func (o *CreateScheduledMaintenanceCreated) GetPayload() *models.ScheduledMaintenanceEntity { + return o.Payload +} + +func (o *CreateScheduledMaintenanceCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ScheduledMaintenanceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateScheduledMaintenanceBadRequest creates a CreateScheduledMaintenanceBadRequest with default headers values +func NewCreateScheduledMaintenanceBadRequest() *CreateScheduledMaintenanceBadRequest { + return &CreateScheduledMaintenanceBadRequest{} +} + +/* +CreateScheduledMaintenanceBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type CreateScheduledMaintenanceBadRequest struct { + Payload *models.ErrorEntity +} + +// IsSuccess returns true when this create scheduled maintenance bad request response has a 2xx status code +func (o *CreateScheduledMaintenanceBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create scheduled maintenance bad request response has a 3xx status code +func (o *CreateScheduledMaintenanceBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create scheduled maintenance bad request response has a 4xx status code +func (o *CreateScheduledMaintenanceBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create scheduled maintenance bad request response has a 5xx status code +func (o *CreateScheduledMaintenanceBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create scheduled maintenance bad request response a status code equal to that given +func (o *CreateScheduledMaintenanceBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *CreateScheduledMaintenanceBadRequest) Error() string { + return fmt.Sprintf("[POST /v1/scheduled_maintenances][%d] createScheduledMaintenanceBadRequest %+v", 400, o.Payload) +} + +func (o *CreateScheduledMaintenanceBadRequest) String() string { + return fmt.Sprintf("[POST /v1/scheduled_maintenances][%d] createScheduledMaintenanceBadRequest %+v", 400, o.Payload) +} + +func (o *CreateScheduledMaintenanceBadRequest) GetPayload() *models.ErrorEntity { + return o.Payload +} + +func (o *CreateScheduledMaintenanceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/delete_incident_chat_message_parameters.go b/client/incidents/delete_incident_chat_message_parameters.go new file mode 100644 index 0000000..8d24f8c --- /dev/null +++ b/client/incidents/delete_incident_chat_message_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteIncidentChatMessageParams creates a new DeleteIncidentChatMessageParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteIncidentChatMessageParams() *DeleteIncidentChatMessageParams { + return &DeleteIncidentChatMessageParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteIncidentChatMessageParamsWithTimeout creates a new DeleteIncidentChatMessageParams object +// with the ability to set a timeout on a request. +func NewDeleteIncidentChatMessageParamsWithTimeout(timeout time.Duration) *DeleteIncidentChatMessageParams { + return &DeleteIncidentChatMessageParams{ + timeout: timeout, + } +} + +// NewDeleteIncidentChatMessageParamsWithContext creates a new DeleteIncidentChatMessageParams object +// with the ability to set a context for a request. +func NewDeleteIncidentChatMessageParamsWithContext(ctx context.Context) *DeleteIncidentChatMessageParams { + return &DeleteIncidentChatMessageParams{ + Context: ctx, + } +} + +// NewDeleteIncidentChatMessageParamsWithHTTPClient creates a new DeleteIncidentChatMessageParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteIncidentChatMessageParamsWithHTTPClient(client *http.Client) *DeleteIncidentChatMessageParams { + return &DeleteIncidentChatMessageParams{ + HTTPClient: client, + } +} + +/* +DeleteIncidentChatMessageParams contains all the parameters to send to the API endpoint + + for the delete incident chat message operation. + + Typically these are written to a http.Request. +*/ +type DeleteIncidentChatMessageParams struct { + + // IncidentID. + IncidentID string + + // MessageID. + MessageID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete incident chat message params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentChatMessageParams) WithDefaults() *DeleteIncidentChatMessageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete incident chat message params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentChatMessageParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete incident chat message params +func (o *DeleteIncidentChatMessageParams) WithTimeout(timeout time.Duration) *DeleteIncidentChatMessageParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete incident chat message params +func (o *DeleteIncidentChatMessageParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete incident chat message params +func (o *DeleteIncidentChatMessageParams) WithContext(ctx context.Context) *DeleteIncidentChatMessageParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete incident chat message params +func (o *DeleteIncidentChatMessageParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete incident chat message params +func (o *DeleteIncidentChatMessageParams) WithHTTPClient(client *http.Client) *DeleteIncidentChatMessageParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete incident chat message params +func (o *DeleteIncidentChatMessageParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the delete incident chat message params +func (o *DeleteIncidentChatMessageParams) WithIncidentID(incidentID string) *DeleteIncidentChatMessageParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the delete incident chat message params +func (o *DeleteIncidentChatMessageParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithMessageID adds the messageID to the delete incident chat message params +func (o *DeleteIncidentChatMessageParams) WithMessageID(messageID string) *DeleteIncidentChatMessageParams { + o.SetMessageID(messageID) + return o +} + +// SetMessageID adds the messageId to the delete incident chat message params +func (o *DeleteIncidentChatMessageParams) SetMessageID(messageID string) { + o.MessageID = messageID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteIncidentChatMessageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param message_id + if err := r.SetPathParam("message_id", o.MessageID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/delete_incident_chat_message_responses.go b/client/incidents/delete_incident_chat_message_responses.go new file mode 100644 index 0000000..e8dad3c --- /dev/null +++ b/client/incidents/delete_incident_chat_message_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteIncidentChatMessageReader is a Reader for the DeleteIncidentChatMessage structure. +type DeleteIncidentChatMessageReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteIncidentChatMessageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteIncidentChatMessageOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteIncidentChatMessageOK creates a DeleteIncidentChatMessageOK with default headers values +func NewDeleteIncidentChatMessageOK() *DeleteIncidentChatMessageOK { + return &DeleteIncidentChatMessageOK{} +} + +/* +DeleteIncidentChatMessageOK describes a response with status code 200, with default header values. + +Delete an existing generic chat message on an incident. +*/ +type DeleteIncidentChatMessageOK struct { + Payload *models.EventGenericChatMessageEntity +} + +// IsSuccess returns true when this delete incident chat message o k response has a 2xx status code +func (o *DeleteIncidentChatMessageOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete incident chat message o k response has a 3xx status code +func (o *DeleteIncidentChatMessageOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete incident chat message o k response has a 4xx status code +func (o *DeleteIncidentChatMessageOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete incident chat message o k response has a 5xx status code +func (o *DeleteIncidentChatMessageOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete incident chat message o k response a status code equal to that given +func (o *DeleteIncidentChatMessageOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteIncidentChatMessageOK) Error() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/generic_chat_messages/{message_id}][%d] deleteIncidentChatMessageOK %+v", 200, o.Payload) +} + +func (o *DeleteIncidentChatMessageOK) String() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/generic_chat_messages/{message_id}][%d] deleteIncidentChatMessageOK %+v", 200, o.Payload) +} + +func (o *DeleteIncidentChatMessageOK) GetPayload() *models.EventGenericChatMessageEntity { + return o.Payload +} + +func (o *DeleteIncidentChatMessageOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.EventGenericChatMessageEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/delete_incident_event_parameters.go b/client/incidents/delete_incident_event_parameters.go new file mode 100644 index 0000000..363ec89 --- /dev/null +++ b/client/incidents/delete_incident_event_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteIncidentEventParams creates a new DeleteIncidentEventParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteIncidentEventParams() *DeleteIncidentEventParams { + return &DeleteIncidentEventParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteIncidentEventParamsWithTimeout creates a new DeleteIncidentEventParams object +// with the ability to set a timeout on a request. +func NewDeleteIncidentEventParamsWithTimeout(timeout time.Duration) *DeleteIncidentEventParams { + return &DeleteIncidentEventParams{ + timeout: timeout, + } +} + +// NewDeleteIncidentEventParamsWithContext creates a new DeleteIncidentEventParams object +// with the ability to set a context for a request. +func NewDeleteIncidentEventParamsWithContext(ctx context.Context) *DeleteIncidentEventParams { + return &DeleteIncidentEventParams{ + Context: ctx, + } +} + +// NewDeleteIncidentEventParamsWithHTTPClient creates a new DeleteIncidentEventParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteIncidentEventParamsWithHTTPClient(client *http.Client) *DeleteIncidentEventParams { + return &DeleteIncidentEventParams{ + HTTPClient: client, + } +} + +/* +DeleteIncidentEventParams contains all the parameters to send to the API endpoint + + for the delete incident event operation. + + Typically these are written to a http.Request. +*/ +type DeleteIncidentEventParams struct { + + // EventID. + EventID string + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete incident event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentEventParams) WithDefaults() *DeleteIncidentEventParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete incident event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentEventParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete incident event params +func (o *DeleteIncidentEventParams) WithTimeout(timeout time.Duration) *DeleteIncidentEventParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete incident event params +func (o *DeleteIncidentEventParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete incident event params +func (o *DeleteIncidentEventParams) WithContext(ctx context.Context) *DeleteIncidentEventParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete incident event params +func (o *DeleteIncidentEventParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete incident event params +func (o *DeleteIncidentEventParams) WithHTTPClient(client *http.Client) *DeleteIncidentEventParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete incident event params +func (o *DeleteIncidentEventParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEventID adds the eventID to the delete incident event params +func (o *DeleteIncidentEventParams) WithEventID(eventID string) *DeleteIncidentEventParams { + o.SetEventID(eventID) + return o +} + +// SetEventID adds the eventId to the delete incident event params +func (o *DeleteIncidentEventParams) SetEventID(eventID string) { + o.EventID = eventID +} + +// WithIncidentID adds the incidentID to the delete incident event params +func (o *DeleteIncidentEventParams) WithIncidentID(incidentID string) *DeleteIncidentEventParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the delete incident event params +func (o *DeleteIncidentEventParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteIncidentEventParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param event_id + if err := r.SetPathParam("event_id", o.EventID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/delete_incident_event_responses.go b/client/incidents/delete_incident_event_responses.go new file mode 100644 index 0000000..f3402c2 --- /dev/null +++ b/client/incidents/delete_incident_event_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteIncidentEventReader is a Reader for the DeleteIncidentEvent structure. +type DeleteIncidentEventReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteIncidentEventReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteIncidentEventOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteIncidentEventOK creates a DeleteIncidentEventOK with default headers values +func NewDeleteIncidentEventOK() *DeleteIncidentEventOK { + return &DeleteIncidentEventOK{} +} + +/* +DeleteIncidentEventOK describes a response with status code 200, with default header values. + +Delete an event for an incident +*/ +type DeleteIncidentEventOK struct { + Payload *models.IncidentEventEntity +} + +// IsSuccess returns true when this delete incident event o k response has a 2xx status code +func (o *DeleteIncidentEventOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete incident event o k response has a 3xx status code +func (o *DeleteIncidentEventOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete incident event o k response has a 4xx status code +func (o *DeleteIncidentEventOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete incident event o k response has a 5xx status code +func (o *DeleteIncidentEventOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete incident event o k response a status code equal to that given +func (o *DeleteIncidentEventOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteIncidentEventOK) Error() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/events/{event_id}][%d] deleteIncidentEventOK %+v", 200, o.Payload) +} + +func (o *DeleteIncidentEventOK) String() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/events/{event_id}][%d] deleteIncidentEventOK %+v", 200, o.Payload) +} + +func (o *DeleteIncidentEventOK) GetPayload() *models.IncidentEventEntity { + return o.Payload +} + +func (o *DeleteIncidentEventOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentEventEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/delete_incident_impact_parameters.go b/client/incidents/delete_incident_impact_parameters.go new file mode 100644 index 0000000..555b219 --- /dev/null +++ b/client/incidents/delete_incident_impact_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteIncidentImpactParams creates a new DeleteIncidentImpactParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteIncidentImpactParams() *DeleteIncidentImpactParams { + return &DeleteIncidentImpactParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteIncidentImpactParamsWithTimeout creates a new DeleteIncidentImpactParams object +// with the ability to set a timeout on a request. +func NewDeleteIncidentImpactParamsWithTimeout(timeout time.Duration) *DeleteIncidentImpactParams { + return &DeleteIncidentImpactParams{ + timeout: timeout, + } +} + +// NewDeleteIncidentImpactParamsWithContext creates a new DeleteIncidentImpactParams object +// with the ability to set a context for a request. +func NewDeleteIncidentImpactParamsWithContext(ctx context.Context) *DeleteIncidentImpactParams { + return &DeleteIncidentImpactParams{ + Context: ctx, + } +} + +// NewDeleteIncidentImpactParamsWithHTTPClient creates a new DeleteIncidentImpactParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteIncidentImpactParamsWithHTTPClient(client *http.Client) *DeleteIncidentImpactParams { + return &DeleteIncidentImpactParams{ + HTTPClient: client, + } +} + +/* +DeleteIncidentImpactParams contains all the parameters to send to the API endpoint + + for the delete incident impact operation. + + Typically these are written to a http.Request. +*/ +type DeleteIncidentImpactParams struct { + + // ID. + ID string + + // IncidentID. + IncidentID string + + // Type. + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete incident impact params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentImpactParams) WithDefaults() *DeleteIncidentImpactParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete incident impact params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentImpactParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete incident impact params +func (o *DeleteIncidentImpactParams) WithTimeout(timeout time.Duration) *DeleteIncidentImpactParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete incident impact params +func (o *DeleteIncidentImpactParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete incident impact params +func (o *DeleteIncidentImpactParams) WithContext(ctx context.Context) *DeleteIncidentImpactParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete incident impact params +func (o *DeleteIncidentImpactParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete incident impact params +func (o *DeleteIncidentImpactParams) WithHTTPClient(client *http.Client) *DeleteIncidentImpactParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete incident impact params +func (o *DeleteIncidentImpactParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete incident impact params +func (o *DeleteIncidentImpactParams) WithID(id string) *DeleteIncidentImpactParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete incident impact params +func (o *DeleteIncidentImpactParams) SetID(id string) { + o.ID = id +} + +// WithIncidentID adds the incidentID to the delete incident impact params +func (o *DeleteIncidentImpactParams) WithIncidentID(incidentID string) *DeleteIncidentImpactParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the delete incident impact params +func (o *DeleteIncidentImpactParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithType adds the typeVar to the delete incident impact params +func (o *DeleteIncidentImpactParams) WithType(typeVar string) *DeleteIncidentImpactParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the delete incident impact params +func (o *DeleteIncidentImpactParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteIncidentImpactParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param type + if err := r.SetPathParam("type", o.Type); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/delete_incident_impact_responses.go b/client/incidents/delete_incident_impact_responses.go new file mode 100644 index 0000000..13c5493 --- /dev/null +++ b/client/incidents/delete_incident_impact_responses.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteIncidentImpactReader is a Reader for the DeleteIncidentImpact structure. +type DeleteIncidentImpactReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteIncidentImpactReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteIncidentImpactNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDeleteIncidentImpactBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteIncidentImpactNoContent creates a DeleteIncidentImpactNoContent with default headers values +func NewDeleteIncidentImpactNoContent() *DeleteIncidentImpactNoContent { + return &DeleteIncidentImpactNoContent{} +} + +/* +DeleteIncidentImpactNoContent describes a response with status code 204, with default header values. + +Remove impacted infrastructure from an incident +*/ +type DeleteIncidentImpactNoContent struct { +} + +// IsSuccess returns true when this delete incident impact no content response has a 2xx status code +func (o *DeleteIncidentImpactNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete incident impact no content response has a 3xx status code +func (o *DeleteIncidentImpactNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete incident impact no content response has a 4xx status code +func (o *DeleteIncidentImpactNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete incident impact no content response has a 5xx status code +func (o *DeleteIncidentImpactNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete incident impact no content response a status code equal to that given +func (o *DeleteIncidentImpactNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteIncidentImpactNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/impact/{type}/{id}][%d] deleteIncidentImpactNoContent ", 204) +} + +func (o *DeleteIncidentImpactNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/impact/{type}/{id}][%d] deleteIncidentImpactNoContent ", 204) +} + +func (o *DeleteIncidentImpactNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteIncidentImpactBadRequest creates a DeleteIncidentImpactBadRequest with default headers values +func NewDeleteIncidentImpactBadRequest() *DeleteIncidentImpactBadRequest { + return &DeleteIncidentImpactBadRequest{} +} + +/* +DeleteIncidentImpactBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type DeleteIncidentImpactBadRequest struct { + Payload *models.ErrorEntity +} + +// IsSuccess returns true when this delete incident impact bad request response has a 2xx status code +func (o *DeleteIncidentImpactBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete incident impact bad request response has a 3xx status code +func (o *DeleteIncidentImpactBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete incident impact bad request response has a 4xx status code +func (o *DeleteIncidentImpactBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete incident impact bad request response has a 5xx status code +func (o *DeleteIncidentImpactBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this delete incident impact bad request response a status code equal to that given +func (o *DeleteIncidentImpactBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *DeleteIncidentImpactBadRequest) Error() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/impact/{type}/{id}][%d] deleteIncidentImpactBadRequest %+v", 400, o.Payload) +} + +func (o *DeleteIncidentImpactBadRequest) String() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/impact/{type}/{id}][%d] deleteIncidentImpactBadRequest %+v", 400, o.Payload) +} + +func (o *DeleteIncidentImpactBadRequest) GetPayload() *models.ErrorEntity { + return o.Payload +} + +func (o *DeleteIncidentImpactBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/delete_incident_link_parameters.go b/client/incidents/delete_incident_link_parameters.go new file mode 100644 index 0000000..9b566ef --- /dev/null +++ b/client/incidents/delete_incident_link_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteIncidentLinkParams creates a new DeleteIncidentLinkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteIncidentLinkParams() *DeleteIncidentLinkParams { + return &DeleteIncidentLinkParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteIncidentLinkParamsWithTimeout creates a new DeleteIncidentLinkParams object +// with the ability to set a timeout on a request. +func NewDeleteIncidentLinkParamsWithTimeout(timeout time.Duration) *DeleteIncidentLinkParams { + return &DeleteIncidentLinkParams{ + timeout: timeout, + } +} + +// NewDeleteIncidentLinkParamsWithContext creates a new DeleteIncidentLinkParams object +// with the ability to set a context for a request. +func NewDeleteIncidentLinkParamsWithContext(ctx context.Context) *DeleteIncidentLinkParams { + return &DeleteIncidentLinkParams{ + Context: ctx, + } +} + +// NewDeleteIncidentLinkParamsWithHTTPClient creates a new DeleteIncidentLinkParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteIncidentLinkParamsWithHTTPClient(client *http.Client) *DeleteIncidentLinkParams { + return &DeleteIncidentLinkParams{ + HTTPClient: client, + } +} + +/* +DeleteIncidentLinkParams contains all the parameters to send to the API endpoint + + for the delete incident link operation. + + Typically these are written to a http.Request. +*/ +type DeleteIncidentLinkParams struct { + + // IncidentID. + IncidentID string + + // LinkID. + LinkID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete incident link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentLinkParams) WithDefaults() *DeleteIncidentLinkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete incident link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentLinkParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete incident link params +func (o *DeleteIncidentLinkParams) WithTimeout(timeout time.Duration) *DeleteIncidentLinkParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete incident link params +func (o *DeleteIncidentLinkParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete incident link params +func (o *DeleteIncidentLinkParams) WithContext(ctx context.Context) *DeleteIncidentLinkParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete incident link params +func (o *DeleteIncidentLinkParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete incident link params +func (o *DeleteIncidentLinkParams) WithHTTPClient(client *http.Client) *DeleteIncidentLinkParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete incident link params +func (o *DeleteIncidentLinkParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the delete incident link params +func (o *DeleteIncidentLinkParams) WithIncidentID(incidentID string) *DeleteIncidentLinkParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the delete incident link params +func (o *DeleteIncidentLinkParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithLinkID adds the linkID to the delete incident link params +func (o *DeleteIncidentLinkParams) WithLinkID(linkID string) *DeleteIncidentLinkParams { + o.SetLinkID(linkID) + return o +} + +// SetLinkID adds the linkId to the delete incident link params +func (o *DeleteIncidentLinkParams) SetLinkID(linkID string) { + o.LinkID = linkID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteIncidentLinkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param link_id + if err := r.SetPathParam("link_id", o.LinkID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/delete_incident_link_responses.go b/client/incidents/delete_incident_link_responses.go new file mode 100644 index 0000000..761d66e --- /dev/null +++ b/client/incidents/delete_incident_link_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteIncidentLinkReader is a Reader for the DeleteIncidentLink structure. +type DeleteIncidentLinkReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteIncidentLinkReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteIncidentLinkNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteIncidentLinkNoContent creates a DeleteIncidentLinkNoContent with default headers values +func NewDeleteIncidentLinkNoContent() *DeleteIncidentLinkNoContent { + return &DeleteIncidentLinkNoContent{} +} + +/* +DeleteIncidentLinkNoContent describes a response with status code 204, with default header values. + +Remove a link from an incident +*/ +type DeleteIncidentLinkNoContent struct { +} + +// IsSuccess returns true when this delete incident link no content response has a 2xx status code +func (o *DeleteIncidentLinkNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete incident link no content response has a 3xx status code +func (o *DeleteIncidentLinkNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete incident link no content response has a 4xx status code +func (o *DeleteIncidentLinkNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete incident link no content response has a 5xx status code +func (o *DeleteIncidentLinkNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete incident link no content response a status code equal to that given +func (o *DeleteIncidentLinkNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteIncidentLinkNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/links/{link_id}][%d] deleteIncidentLinkNoContent ", 204) +} + +func (o *DeleteIncidentLinkNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/links/{link_id}][%d] deleteIncidentLinkNoContent ", 204) +} + +func (o *DeleteIncidentLinkNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/incidents/delete_incident_parameters.go b/client/incidents/delete_incident_parameters.go new file mode 100644 index 0000000..aa47e32 --- /dev/null +++ b/client/incidents/delete_incident_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteIncidentParams creates a new DeleteIncidentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteIncidentParams() *DeleteIncidentParams { + return &DeleteIncidentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteIncidentParamsWithTimeout creates a new DeleteIncidentParams object +// with the ability to set a timeout on a request. +func NewDeleteIncidentParamsWithTimeout(timeout time.Duration) *DeleteIncidentParams { + return &DeleteIncidentParams{ + timeout: timeout, + } +} + +// NewDeleteIncidentParamsWithContext creates a new DeleteIncidentParams object +// with the ability to set a context for a request. +func NewDeleteIncidentParamsWithContext(ctx context.Context) *DeleteIncidentParams { + return &DeleteIncidentParams{ + Context: ctx, + } +} + +// NewDeleteIncidentParamsWithHTTPClient creates a new DeleteIncidentParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteIncidentParamsWithHTTPClient(client *http.Client) *DeleteIncidentParams { + return &DeleteIncidentParams{ + HTTPClient: client, + } +} + +/* +DeleteIncidentParams contains all the parameters to send to the API endpoint + + for the delete incident operation. + + Typically these are written to a http.Request. +*/ +type DeleteIncidentParams struct { + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete incident params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentParams) WithDefaults() *DeleteIncidentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete incident params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete incident params +func (o *DeleteIncidentParams) WithTimeout(timeout time.Duration) *DeleteIncidentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete incident params +func (o *DeleteIncidentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete incident params +func (o *DeleteIncidentParams) WithContext(ctx context.Context) *DeleteIncidentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete incident params +func (o *DeleteIncidentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete incident params +func (o *DeleteIncidentParams) WithHTTPClient(client *http.Client) *DeleteIncidentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete incident params +func (o *DeleteIncidentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the delete incident params +func (o *DeleteIncidentParams) WithIncidentID(incidentID string) *DeleteIncidentParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the delete incident params +func (o *DeleteIncidentParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteIncidentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/delete_incident_responses.go b/client/incidents/delete_incident_responses.go new file mode 100644 index 0000000..8197158 --- /dev/null +++ b/client/incidents/delete_incident_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteIncidentReader is a Reader for the DeleteIncident structure. +type DeleteIncidentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteIncidentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteIncidentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteIncidentOK creates a DeleteIncidentOK with default headers values +func NewDeleteIncidentOK() *DeleteIncidentOK { + return &DeleteIncidentOK{} +} + +/* +DeleteIncidentOK describes a response with status code 200, with default header values. + +Archives an incident which will hide it from lists and metrics +*/ +type DeleteIncidentOK struct { + Payload *models.IncidentEntity +} + +// IsSuccess returns true when this delete incident o k response has a 2xx status code +func (o *DeleteIncidentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete incident o k response has a 3xx status code +func (o *DeleteIncidentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete incident o k response has a 4xx status code +func (o *DeleteIncidentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete incident o k response has a 5xx status code +func (o *DeleteIncidentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete incident o k response a status code equal to that given +func (o *DeleteIncidentOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteIncidentOK) Error() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}][%d] deleteIncidentOK %+v", 200, o.Payload) +} + +func (o *DeleteIncidentOK) String() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}][%d] deleteIncidentOK %+v", 200, o.Payload) +} + +func (o *DeleteIncidentOK) GetPayload() *models.IncidentEntity { + return o.Payload +} + +func (o *DeleteIncidentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/delete_incident_role_assignment_parameters.go b/client/incidents/delete_incident_role_assignment_parameters.go new file mode 100644 index 0000000..3828c6a --- /dev/null +++ b/client/incidents/delete_incident_role_assignment_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteIncidentRoleAssignmentParams creates a new DeleteIncidentRoleAssignmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteIncidentRoleAssignmentParams() *DeleteIncidentRoleAssignmentParams { + return &DeleteIncidentRoleAssignmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteIncidentRoleAssignmentParamsWithTimeout creates a new DeleteIncidentRoleAssignmentParams object +// with the ability to set a timeout on a request. +func NewDeleteIncidentRoleAssignmentParamsWithTimeout(timeout time.Duration) *DeleteIncidentRoleAssignmentParams { + return &DeleteIncidentRoleAssignmentParams{ + timeout: timeout, + } +} + +// NewDeleteIncidentRoleAssignmentParamsWithContext creates a new DeleteIncidentRoleAssignmentParams object +// with the ability to set a context for a request. +func NewDeleteIncidentRoleAssignmentParamsWithContext(ctx context.Context) *DeleteIncidentRoleAssignmentParams { + return &DeleteIncidentRoleAssignmentParams{ + Context: ctx, + } +} + +// NewDeleteIncidentRoleAssignmentParamsWithHTTPClient creates a new DeleteIncidentRoleAssignmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteIncidentRoleAssignmentParamsWithHTTPClient(client *http.Client) *DeleteIncidentRoleAssignmentParams { + return &DeleteIncidentRoleAssignmentParams{ + HTTPClient: client, + } +} + +/* +DeleteIncidentRoleAssignmentParams contains all the parameters to send to the API endpoint + + for the delete incident role assignment operation. + + Typically these are written to a http.Request. +*/ +type DeleteIncidentRoleAssignmentParams struct { + + // IncidentID. + IncidentID string + + // RoleAssignmentID. + RoleAssignmentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete incident role assignment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentRoleAssignmentParams) WithDefaults() *DeleteIncidentRoleAssignmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete incident role assignment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentRoleAssignmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete incident role assignment params +func (o *DeleteIncidentRoleAssignmentParams) WithTimeout(timeout time.Duration) *DeleteIncidentRoleAssignmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete incident role assignment params +func (o *DeleteIncidentRoleAssignmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete incident role assignment params +func (o *DeleteIncidentRoleAssignmentParams) WithContext(ctx context.Context) *DeleteIncidentRoleAssignmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete incident role assignment params +func (o *DeleteIncidentRoleAssignmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete incident role assignment params +func (o *DeleteIncidentRoleAssignmentParams) WithHTTPClient(client *http.Client) *DeleteIncidentRoleAssignmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete incident role assignment params +func (o *DeleteIncidentRoleAssignmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the delete incident role assignment params +func (o *DeleteIncidentRoleAssignmentParams) WithIncidentID(incidentID string) *DeleteIncidentRoleAssignmentParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the delete incident role assignment params +func (o *DeleteIncidentRoleAssignmentParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithRoleAssignmentID adds the roleAssignmentID to the delete incident role assignment params +func (o *DeleteIncidentRoleAssignmentParams) WithRoleAssignmentID(roleAssignmentID string) *DeleteIncidentRoleAssignmentParams { + o.SetRoleAssignmentID(roleAssignmentID) + return o +} + +// SetRoleAssignmentID adds the roleAssignmentId to the delete incident role assignment params +func (o *DeleteIncidentRoleAssignmentParams) SetRoleAssignmentID(roleAssignmentID string) { + o.RoleAssignmentID = roleAssignmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteIncidentRoleAssignmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param role_assignment_id + if err := r.SetPathParam("role_assignment_id", o.RoleAssignmentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/delete_incident_role_assignment_responses.go b/client/incidents/delete_incident_role_assignment_responses.go new file mode 100644 index 0000000..607c265 --- /dev/null +++ b/client/incidents/delete_incident_role_assignment_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteIncidentRoleAssignmentReader is a Reader for the DeleteIncidentRoleAssignment structure. +type DeleteIncidentRoleAssignmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteIncidentRoleAssignmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteIncidentRoleAssignmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteIncidentRoleAssignmentOK creates a DeleteIncidentRoleAssignmentOK with default headers values +func NewDeleteIncidentRoleAssignmentOK() *DeleteIncidentRoleAssignmentOK { + return &DeleteIncidentRoleAssignmentOK{} +} + +/* +DeleteIncidentRoleAssignmentOK describes a response with status code 200, with default header values. + +Unassign a role from a user +*/ +type DeleteIncidentRoleAssignmentOK struct { + Payload *models.IncidentsRoleAssignmentEntity +} + +// IsSuccess returns true when this delete incident role assignment o k response has a 2xx status code +func (o *DeleteIncidentRoleAssignmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete incident role assignment o k response has a 3xx status code +func (o *DeleteIncidentRoleAssignmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete incident role assignment o k response has a 4xx status code +func (o *DeleteIncidentRoleAssignmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete incident role assignment o k response has a 5xx status code +func (o *DeleteIncidentRoleAssignmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete incident role assignment o k response a status code equal to that given +func (o *DeleteIncidentRoleAssignmentOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteIncidentRoleAssignmentOK) Error() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/role_assignments/{role_assignment_id}][%d] deleteIncidentRoleAssignmentOK %+v", 200, o.Payload) +} + +func (o *DeleteIncidentRoleAssignmentOK) String() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/role_assignments/{role_assignment_id}][%d] deleteIncidentRoleAssignmentOK %+v", 200, o.Payload) +} + +func (o *DeleteIncidentRoleAssignmentOK) GetPayload() *models.IncidentsRoleAssignmentEntity { + return o.Payload +} + +func (o *DeleteIncidentRoleAssignmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRoleAssignmentEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/delete_incident_team_assignment_parameters.go b/client/incidents/delete_incident_team_assignment_parameters.go new file mode 100644 index 0000000..6575635 --- /dev/null +++ b/client/incidents/delete_incident_team_assignment_parameters.go @@ -0,0 +1,213 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteIncidentTeamAssignmentParams creates a new DeleteIncidentTeamAssignmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteIncidentTeamAssignmentParams() *DeleteIncidentTeamAssignmentParams { + return &DeleteIncidentTeamAssignmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteIncidentTeamAssignmentParamsWithTimeout creates a new DeleteIncidentTeamAssignmentParams object +// with the ability to set a timeout on a request. +func NewDeleteIncidentTeamAssignmentParamsWithTimeout(timeout time.Duration) *DeleteIncidentTeamAssignmentParams { + return &DeleteIncidentTeamAssignmentParams{ + timeout: timeout, + } +} + +// NewDeleteIncidentTeamAssignmentParamsWithContext creates a new DeleteIncidentTeamAssignmentParams object +// with the ability to set a context for a request. +func NewDeleteIncidentTeamAssignmentParamsWithContext(ctx context.Context) *DeleteIncidentTeamAssignmentParams { + return &DeleteIncidentTeamAssignmentParams{ + Context: ctx, + } +} + +// NewDeleteIncidentTeamAssignmentParamsWithHTTPClient creates a new DeleteIncidentTeamAssignmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteIncidentTeamAssignmentParamsWithHTTPClient(client *http.Client) *DeleteIncidentTeamAssignmentParams { + return &DeleteIncidentTeamAssignmentParams{ + HTTPClient: client, + } +} + +/* +DeleteIncidentTeamAssignmentParams contains all the parameters to send to the API endpoint + + for the delete incident team assignment operation. + + Typically these are written to a http.Request. +*/ +type DeleteIncidentTeamAssignmentParams struct { + + // IncidentID. + IncidentID string + + /* RoleAssignmentIds. + + Team role assignments to unassign from the incident + */ + RoleAssignmentIds []string + + // TeamAssignmentID. + TeamAssignmentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete incident team assignment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentTeamAssignmentParams) WithDefaults() *DeleteIncidentTeamAssignmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete incident team assignment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentTeamAssignmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete incident team assignment params +func (o *DeleteIncidentTeamAssignmentParams) WithTimeout(timeout time.Duration) *DeleteIncidentTeamAssignmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete incident team assignment params +func (o *DeleteIncidentTeamAssignmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete incident team assignment params +func (o *DeleteIncidentTeamAssignmentParams) WithContext(ctx context.Context) *DeleteIncidentTeamAssignmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete incident team assignment params +func (o *DeleteIncidentTeamAssignmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete incident team assignment params +func (o *DeleteIncidentTeamAssignmentParams) WithHTTPClient(client *http.Client) *DeleteIncidentTeamAssignmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete incident team assignment params +func (o *DeleteIncidentTeamAssignmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the delete incident team assignment params +func (o *DeleteIncidentTeamAssignmentParams) WithIncidentID(incidentID string) *DeleteIncidentTeamAssignmentParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the delete incident team assignment params +func (o *DeleteIncidentTeamAssignmentParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithRoleAssignmentIds adds the roleAssignmentIds to the delete incident team assignment params +func (o *DeleteIncidentTeamAssignmentParams) WithRoleAssignmentIds(roleAssignmentIds []string) *DeleteIncidentTeamAssignmentParams { + o.SetRoleAssignmentIds(roleAssignmentIds) + return o +} + +// SetRoleAssignmentIds adds the roleAssignmentIds to the delete incident team assignment params +func (o *DeleteIncidentTeamAssignmentParams) SetRoleAssignmentIds(roleAssignmentIds []string) { + o.RoleAssignmentIds = roleAssignmentIds +} + +// WithTeamAssignmentID adds the teamAssignmentID to the delete incident team assignment params +func (o *DeleteIncidentTeamAssignmentParams) WithTeamAssignmentID(teamAssignmentID string) *DeleteIncidentTeamAssignmentParams { + o.SetTeamAssignmentID(teamAssignmentID) + return o +} + +// SetTeamAssignmentID adds the teamAssignmentId to the delete incident team assignment params +func (o *DeleteIncidentTeamAssignmentParams) SetTeamAssignmentID(teamAssignmentID string) { + o.TeamAssignmentID = teamAssignmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteIncidentTeamAssignmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if o.RoleAssignmentIds != nil { + + // binding items for role_assignment_ids + joinedRoleAssignmentIds := o.bindParamRoleAssignmentIds(reg) + + // form array param role_assignment_ids + if err := r.SetFormParam("role_assignment_ids", joinedRoleAssignmentIds...); err != nil { + return err + } + } + + // path param team_assignment_id + if err := r.SetPathParam("team_assignment_id", o.TeamAssignmentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamDeleteIncidentTeamAssignment binds the parameter role_assignment_ids +func (o *DeleteIncidentTeamAssignmentParams) bindParamRoleAssignmentIds(formats strfmt.Registry) []string { + roleAssignmentIdsIR := o.RoleAssignmentIds + + var roleAssignmentIdsIC []string + for _, roleAssignmentIdsIIR := range roleAssignmentIdsIR { // explode []string + + roleAssignmentIdsIIV := roleAssignmentIdsIIR // string as string + roleAssignmentIdsIC = append(roleAssignmentIdsIC, roleAssignmentIdsIIV) + } + + // items.CollectionFormat: "" + roleAssignmentIdsIS := swag.JoinByFormat(roleAssignmentIdsIC, "") + + return roleAssignmentIdsIS +} diff --git a/client/incidents/delete_incident_team_assignment_responses.go b/client/incidents/delete_incident_team_assignment_responses.go new file mode 100644 index 0000000..a535d35 --- /dev/null +++ b/client/incidents/delete_incident_team_assignment_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteIncidentTeamAssignmentReader is a Reader for the DeleteIncidentTeamAssignment structure. +type DeleteIncidentTeamAssignmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteIncidentTeamAssignmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteIncidentTeamAssignmentNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteIncidentTeamAssignmentNoContent creates a DeleteIncidentTeamAssignmentNoContent with default headers values +func NewDeleteIncidentTeamAssignmentNoContent() *DeleteIncidentTeamAssignmentNoContent { + return &DeleteIncidentTeamAssignmentNoContent{} +} + +/* +DeleteIncidentTeamAssignmentNoContent describes a response with status code 204, with default header values. + +Unassign a team from an incident +*/ +type DeleteIncidentTeamAssignmentNoContent struct { +} + +// IsSuccess returns true when this delete incident team assignment no content response has a 2xx status code +func (o *DeleteIncidentTeamAssignmentNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete incident team assignment no content response has a 3xx status code +func (o *DeleteIncidentTeamAssignmentNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete incident team assignment no content response has a 4xx status code +func (o *DeleteIncidentTeamAssignmentNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete incident team assignment no content response has a 5xx status code +func (o *DeleteIncidentTeamAssignmentNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete incident team assignment no content response a status code equal to that given +func (o *DeleteIncidentTeamAssignmentNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteIncidentTeamAssignmentNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/team_assignments/{team_assignment_id}][%d] deleteIncidentTeamAssignmentNoContent ", 204) +} + +func (o *DeleteIncidentTeamAssignmentNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/team_assignments/{team_assignment_id}][%d] deleteIncidentTeamAssignmentNoContent ", 204) +} + +func (o *DeleteIncidentTeamAssignmentNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/incidents/delete_scheduled_maintenance_parameters.go b/client/incidents/delete_scheduled_maintenance_parameters.go new file mode 100644 index 0000000..bb110dc --- /dev/null +++ b/client/incidents/delete_scheduled_maintenance_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteScheduledMaintenanceParams creates a new DeleteScheduledMaintenanceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteScheduledMaintenanceParams() *DeleteScheduledMaintenanceParams { + return &DeleteScheduledMaintenanceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteScheduledMaintenanceParamsWithTimeout creates a new DeleteScheduledMaintenanceParams object +// with the ability to set a timeout on a request. +func NewDeleteScheduledMaintenanceParamsWithTimeout(timeout time.Duration) *DeleteScheduledMaintenanceParams { + return &DeleteScheduledMaintenanceParams{ + timeout: timeout, + } +} + +// NewDeleteScheduledMaintenanceParamsWithContext creates a new DeleteScheduledMaintenanceParams object +// with the ability to set a context for a request. +func NewDeleteScheduledMaintenanceParamsWithContext(ctx context.Context) *DeleteScheduledMaintenanceParams { + return &DeleteScheduledMaintenanceParams{ + Context: ctx, + } +} + +// NewDeleteScheduledMaintenanceParamsWithHTTPClient creates a new DeleteScheduledMaintenanceParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteScheduledMaintenanceParamsWithHTTPClient(client *http.Client) *DeleteScheduledMaintenanceParams { + return &DeleteScheduledMaintenanceParams{ + HTTPClient: client, + } +} + +/* +DeleteScheduledMaintenanceParams contains all the parameters to send to the API endpoint + + for the delete scheduled maintenance operation. + + Typically these are written to a http.Request. +*/ +type DeleteScheduledMaintenanceParams struct { + + // ScheduledMaintenanceID. + ScheduledMaintenanceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete scheduled maintenance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteScheduledMaintenanceParams) WithDefaults() *DeleteScheduledMaintenanceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete scheduled maintenance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteScheduledMaintenanceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete scheduled maintenance params +func (o *DeleteScheduledMaintenanceParams) WithTimeout(timeout time.Duration) *DeleteScheduledMaintenanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete scheduled maintenance params +func (o *DeleteScheduledMaintenanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete scheduled maintenance params +func (o *DeleteScheduledMaintenanceParams) WithContext(ctx context.Context) *DeleteScheduledMaintenanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete scheduled maintenance params +func (o *DeleteScheduledMaintenanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete scheduled maintenance params +func (o *DeleteScheduledMaintenanceParams) WithHTTPClient(client *http.Client) *DeleteScheduledMaintenanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete scheduled maintenance params +func (o *DeleteScheduledMaintenanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithScheduledMaintenanceID adds the scheduledMaintenanceID to the delete scheduled maintenance params +func (o *DeleteScheduledMaintenanceParams) WithScheduledMaintenanceID(scheduledMaintenanceID string) *DeleteScheduledMaintenanceParams { + o.SetScheduledMaintenanceID(scheduledMaintenanceID) + return o +} + +// SetScheduledMaintenanceID adds the scheduledMaintenanceId to the delete scheduled maintenance params +func (o *DeleteScheduledMaintenanceParams) SetScheduledMaintenanceID(scheduledMaintenanceID string) { + o.ScheduledMaintenanceID = scheduledMaintenanceID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteScheduledMaintenanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param scheduled_maintenance_id + if err := r.SetPathParam("scheduled_maintenance_id", o.ScheduledMaintenanceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/delete_scheduled_maintenance_responses.go b/client/incidents/delete_scheduled_maintenance_responses.go new file mode 100644 index 0000000..5a9c54f --- /dev/null +++ b/client/incidents/delete_scheduled_maintenance_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteScheduledMaintenanceReader is a Reader for the DeleteScheduledMaintenance structure. +type DeleteScheduledMaintenanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteScheduledMaintenanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteScheduledMaintenanceNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteScheduledMaintenanceNoContent creates a DeleteScheduledMaintenanceNoContent with default headers values +func NewDeleteScheduledMaintenanceNoContent() *DeleteScheduledMaintenanceNoContent { + return &DeleteScheduledMaintenanceNoContent{} +} + +/* +DeleteScheduledMaintenanceNoContent describes a response with status code 204, with default header values. + +Delete a scheduled maintenance event, preventing it from taking place. +*/ +type DeleteScheduledMaintenanceNoContent struct { +} + +// IsSuccess returns true when this delete scheduled maintenance no content response has a 2xx status code +func (o *DeleteScheduledMaintenanceNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete scheduled maintenance no content response has a 3xx status code +func (o *DeleteScheduledMaintenanceNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete scheduled maintenance no content response has a 4xx status code +func (o *DeleteScheduledMaintenanceNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete scheduled maintenance no content response has a 5xx status code +func (o *DeleteScheduledMaintenanceNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete scheduled maintenance no content response a status code equal to that given +func (o *DeleteScheduledMaintenanceNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteScheduledMaintenanceNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/scheduled_maintenances/{scheduled_maintenance_id}][%d] deleteScheduledMaintenanceNoContent ", 204) +} + +func (o *DeleteScheduledMaintenanceNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/scheduled_maintenances/{scheduled_maintenance_id}][%d] deleteScheduledMaintenanceNoContent ", 204) +} + +func (o *DeleteScheduledMaintenanceNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/incidents/delete_transcript_entry_parameters.go b/client/incidents/delete_transcript_entry_parameters.go new file mode 100644 index 0000000..c620e68 --- /dev/null +++ b/client/incidents/delete_transcript_entry_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTranscriptEntryParams creates a new DeleteTranscriptEntryParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTranscriptEntryParams() *DeleteTranscriptEntryParams { + return &DeleteTranscriptEntryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTranscriptEntryParamsWithTimeout creates a new DeleteTranscriptEntryParams object +// with the ability to set a timeout on a request. +func NewDeleteTranscriptEntryParamsWithTimeout(timeout time.Duration) *DeleteTranscriptEntryParams { + return &DeleteTranscriptEntryParams{ + timeout: timeout, + } +} + +// NewDeleteTranscriptEntryParamsWithContext creates a new DeleteTranscriptEntryParams object +// with the ability to set a context for a request. +func NewDeleteTranscriptEntryParamsWithContext(ctx context.Context) *DeleteTranscriptEntryParams { + return &DeleteTranscriptEntryParams{ + Context: ctx, + } +} + +// NewDeleteTranscriptEntryParamsWithHTTPClient creates a new DeleteTranscriptEntryParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTranscriptEntryParamsWithHTTPClient(client *http.Client) *DeleteTranscriptEntryParams { + return &DeleteTranscriptEntryParams{ + HTTPClient: client, + } +} + +/* +DeleteTranscriptEntryParams contains all the parameters to send to the API endpoint + + for the delete transcript entry operation. + + Typically these are written to a http.Request. +*/ +type DeleteTranscriptEntryParams struct { + + // IncidentID. + IncidentID string + + // TranscriptID. + TranscriptID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete transcript entry params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTranscriptEntryParams) WithDefaults() *DeleteTranscriptEntryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete transcript entry params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTranscriptEntryParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete transcript entry params +func (o *DeleteTranscriptEntryParams) WithTimeout(timeout time.Duration) *DeleteTranscriptEntryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete transcript entry params +func (o *DeleteTranscriptEntryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete transcript entry params +func (o *DeleteTranscriptEntryParams) WithContext(ctx context.Context) *DeleteTranscriptEntryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete transcript entry params +func (o *DeleteTranscriptEntryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete transcript entry params +func (o *DeleteTranscriptEntryParams) WithHTTPClient(client *http.Client) *DeleteTranscriptEntryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete transcript entry params +func (o *DeleteTranscriptEntryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the delete transcript entry params +func (o *DeleteTranscriptEntryParams) WithIncidentID(incidentID string) *DeleteTranscriptEntryParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the delete transcript entry params +func (o *DeleteTranscriptEntryParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithTranscriptID adds the transcriptID to the delete transcript entry params +func (o *DeleteTranscriptEntryParams) WithTranscriptID(transcriptID string) *DeleteTranscriptEntryParams { + o.SetTranscriptID(transcriptID) + return o +} + +// SetTranscriptID adds the transcriptId to the delete transcript entry params +func (o *DeleteTranscriptEntryParams) SetTranscriptID(transcriptID string) { + o.TranscriptID = transcriptID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTranscriptEntryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param transcript_id + if err := r.SetPathParam("transcript_id", o.TranscriptID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/delete_transcript_entry_responses.go b/client/incidents/delete_transcript_entry_responses.go new file mode 100644 index 0000000..aa086dd --- /dev/null +++ b/client/incidents/delete_transcript_entry_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteTranscriptEntryReader is a Reader for the DeleteTranscriptEntry structure. +type DeleteTranscriptEntryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTranscriptEntryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteTranscriptEntryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTranscriptEntryOK creates a DeleteTranscriptEntryOK with default headers values +func NewDeleteTranscriptEntryOK() *DeleteTranscriptEntryOK { + return &DeleteTranscriptEntryOK{} +} + +/* +DeleteTranscriptEntryOK describes a response with status code 200, with default header values. + +Delete a transcript from an incident +*/ +type DeleteTranscriptEntryOK struct { + Payload *models.PublicAPIV1IncidentsTranscriptEntity +} + +// IsSuccess returns true when this delete transcript entry o k response has a 2xx status code +func (o *DeleteTranscriptEntryOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete transcript entry o k response has a 3xx status code +func (o *DeleteTranscriptEntryOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete transcript entry o k response has a 4xx status code +func (o *DeleteTranscriptEntryOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete transcript entry o k response has a 5xx status code +func (o *DeleteTranscriptEntryOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete transcript entry o k response a status code equal to that given +func (o *DeleteTranscriptEntryOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteTranscriptEntryOK) Error() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/transcript/{transcript_id}][%d] deleteTranscriptEntryOK %+v", 200, o.Payload) +} + +func (o *DeleteTranscriptEntryOK) String() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/transcript/{transcript_id}][%d] deleteTranscriptEntryOK %+v", 200, o.Payload) +} + +func (o *DeleteTranscriptEntryOK) GetPayload() *models.PublicAPIV1IncidentsTranscriptEntity { + return o.Payload +} + +func (o *DeleteTranscriptEntryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PublicAPIV1IncidentsTranscriptEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/get_ai_incident_summary_vote_status_parameters.go b/client/incidents/get_ai_incident_summary_vote_status_parameters.go new file mode 100644 index 0000000..e1105b0 --- /dev/null +++ b/client/incidents/get_ai_incident_summary_vote_status_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetAiIncidentSummaryVoteStatusParams creates a new GetAiIncidentSummaryVoteStatusParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetAiIncidentSummaryVoteStatusParams() *GetAiIncidentSummaryVoteStatusParams { + return &GetAiIncidentSummaryVoteStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAiIncidentSummaryVoteStatusParamsWithTimeout creates a new GetAiIncidentSummaryVoteStatusParams object +// with the ability to set a timeout on a request. +func NewGetAiIncidentSummaryVoteStatusParamsWithTimeout(timeout time.Duration) *GetAiIncidentSummaryVoteStatusParams { + return &GetAiIncidentSummaryVoteStatusParams{ + timeout: timeout, + } +} + +// NewGetAiIncidentSummaryVoteStatusParamsWithContext creates a new GetAiIncidentSummaryVoteStatusParams object +// with the ability to set a context for a request. +func NewGetAiIncidentSummaryVoteStatusParamsWithContext(ctx context.Context) *GetAiIncidentSummaryVoteStatusParams { + return &GetAiIncidentSummaryVoteStatusParams{ + Context: ctx, + } +} + +// NewGetAiIncidentSummaryVoteStatusParamsWithHTTPClient creates a new GetAiIncidentSummaryVoteStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAiIncidentSummaryVoteStatusParamsWithHTTPClient(client *http.Client) *GetAiIncidentSummaryVoteStatusParams { + return &GetAiIncidentSummaryVoteStatusParams{ + HTTPClient: client, + } +} + +/* +GetAiIncidentSummaryVoteStatusParams contains all the parameters to send to the API endpoint + + for the get ai incident summary vote status operation. + + Typically these are written to a http.Request. +*/ +type GetAiIncidentSummaryVoteStatusParams struct { + + // GeneratedSummaryID. + GeneratedSummaryID string + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get ai incident summary vote status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAiIncidentSummaryVoteStatusParams) WithDefaults() *GetAiIncidentSummaryVoteStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get ai incident summary vote status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAiIncidentSummaryVoteStatusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get ai incident summary vote status params +func (o *GetAiIncidentSummaryVoteStatusParams) WithTimeout(timeout time.Duration) *GetAiIncidentSummaryVoteStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get ai incident summary vote status params +func (o *GetAiIncidentSummaryVoteStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get ai incident summary vote status params +func (o *GetAiIncidentSummaryVoteStatusParams) WithContext(ctx context.Context) *GetAiIncidentSummaryVoteStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get ai incident summary vote status params +func (o *GetAiIncidentSummaryVoteStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get ai incident summary vote status params +func (o *GetAiIncidentSummaryVoteStatusParams) WithHTTPClient(client *http.Client) *GetAiIncidentSummaryVoteStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get ai incident summary vote status params +func (o *GetAiIncidentSummaryVoteStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGeneratedSummaryID adds the generatedSummaryID to the get ai incident summary vote status params +func (o *GetAiIncidentSummaryVoteStatusParams) WithGeneratedSummaryID(generatedSummaryID string) *GetAiIncidentSummaryVoteStatusParams { + o.SetGeneratedSummaryID(generatedSummaryID) + return o +} + +// SetGeneratedSummaryID adds the generatedSummaryId to the get ai incident summary vote status params +func (o *GetAiIncidentSummaryVoteStatusParams) SetGeneratedSummaryID(generatedSummaryID string) { + o.GeneratedSummaryID = generatedSummaryID +} + +// WithIncidentID adds the incidentID to the get ai incident summary vote status params +func (o *GetAiIncidentSummaryVoteStatusParams) WithIncidentID(incidentID string) *GetAiIncidentSummaryVoteStatusParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the get ai incident summary vote status params +func (o *GetAiIncidentSummaryVoteStatusParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAiIncidentSummaryVoteStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param generated_summary_id + if err := r.SetPathParam("generated_summary_id", o.GeneratedSummaryID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/get_ai_incident_summary_vote_status_responses.go b/client/incidents/get_ai_incident_summary_vote_status_responses.go new file mode 100644 index 0000000..e861899 --- /dev/null +++ b/client/incidents/get_ai_incident_summary_vote_status_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetAiIncidentSummaryVoteStatusReader is a Reader for the GetAiIncidentSummaryVoteStatus structure. +type GetAiIncidentSummaryVoteStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAiIncidentSummaryVoteStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAiIncidentSummaryVoteStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAiIncidentSummaryVoteStatusOK creates a GetAiIncidentSummaryVoteStatusOK with default headers values +func NewGetAiIncidentSummaryVoteStatusOK() *GetAiIncidentSummaryVoteStatusOK { + return &GetAiIncidentSummaryVoteStatusOK{} +} + +/* +GetAiIncidentSummaryVoteStatusOK describes a response with status code 200, with default header values. + +Get the current user's vote status for an AI-generated incident summary +*/ +type GetAiIncidentSummaryVoteStatusOK struct { +} + +// IsSuccess returns true when this get ai incident summary vote status o k response has a 2xx status code +func (o *GetAiIncidentSummaryVoteStatusOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get ai incident summary vote status o k response has a 3xx status code +func (o *GetAiIncidentSummaryVoteStatusOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get ai incident summary vote status o k response has a 4xx status code +func (o *GetAiIncidentSummaryVoteStatusOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get ai incident summary vote status o k response has a 5xx status code +func (o *GetAiIncidentSummaryVoteStatusOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get ai incident summary vote status o k response a status code equal to that given +func (o *GetAiIncidentSummaryVoteStatusOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetAiIncidentSummaryVoteStatusOK) Error() string { + return fmt.Sprintf("[GET /v1/ai/summarize_incident/{incident_id}/{generated_summary_id}/voted][%d] getAiIncidentSummaryVoteStatusOK ", 200) +} + +func (o *GetAiIncidentSummaryVoteStatusOK) String() string { + return fmt.Sprintf("[GET /v1/ai/summarize_incident/{incident_id}/{generated_summary_id}/voted][%d] getAiIncidentSummaryVoteStatusOK ", 200) +} + +func (o *GetAiIncidentSummaryVoteStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/incidents/get_conference_bridge_translation_parameters.go b/client/incidents/get_conference_bridge_translation_parameters.go new file mode 100644 index 0000000..bc1de64 --- /dev/null +++ b/client/incidents/get_conference_bridge_translation_parameters.go @@ -0,0 +1,192 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetConferenceBridgeTranslationParams creates a new GetConferenceBridgeTranslationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetConferenceBridgeTranslationParams() *GetConferenceBridgeTranslationParams { + return &GetConferenceBridgeTranslationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetConferenceBridgeTranslationParamsWithTimeout creates a new GetConferenceBridgeTranslationParams object +// with the ability to set a timeout on a request. +func NewGetConferenceBridgeTranslationParamsWithTimeout(timeout time.Duration) *GetConferenceBridgeTranslationParams { + return &GetConferenceBridgeTranslationParams{ + timeout: timeout, + } +} + +// NewGetConferenceBridgeTranslationParamsWithContext creates a new GetConferenceBridgeTranslationParams object +// with the ability to set a context for a request. +func NewGetConferenceBridgeTranslationParamsWithContext(ctx context.Context) *GetConferenceBridgeTranslationParams { + return &GetConferenceBridgeTranslationParams{ + Context: ctx, + } +} + +// NewGetConferenceBridgeTranslationParamsWithHTTPClient creates a new GetConferenceBridgeTranslationParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetConferenceBridgeTranslationParamsWithHTTPClient(client *http.Client) *GetConferenceBridgeTranslationParams { + return &GetConferenceBridgeTranslationParams{ + HTTPClient: client, + } +} + +/* +GetConferenceBridgeTranslationParams contains all the parameters to send to the API endpoint + + for the get conference bridge translation operation. + + Typically these are written to a http.Request. +*/ +type GetConferenceBridgeTranslationParams struct { + + /* ID. + + The ID of the conference bridge + */ + ID string + + // IncidentID. + IncidentID string + + /* LanguageCode. + + The language code of the translation + */ + LanguageCode string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get conference bridge translation params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetConferenceBridgeTranslationParams) WithDefaults() *GetConferenceBridgeTranslationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get conference bridge translation params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetConferenceBridgeTranslationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get conference bridge translation params +func (o *GetConferenceBridgeTranslationParams) WithTimeout(timeout time.Duration) *GetConferenceBridgeTranslationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get conference bridge translation params +func (o *GetConferenceBridgeTranslationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get conference bridge translation params +func (o *GetConferenceBridgeTranslationParams) WithContext(ctx context.Context) *GetConferenceBridgeTranslationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get conference bridge translation params +func (o *GetConferenceBridgeTranslationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get conference bridge translation params +func (o *GetConferenceBridgeTranslationParams) WithHTTPClient(client *http.Client) *GetConferenceBridgeTranslationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get conference bridge translation params +func (o *GetConferenceBridgeTranslationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get conference bridge translation params +func (o *GetConferenceBridgeTranslationParams) WithID(id string) *GetConferenceBridgeTranslationParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get conference bridge translation params +func (o *GetConferenceBridgeTranslationParams) SetID(id string) { + o.ID = id +} + +// WithIncidentID adds the incidentID to the get conference bridge translation params +func (o *GetConferenceBridgeTranslationParams) WithIncidentID(incidentID string) *GetConferenceBridgeTranslationParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the get conference bridge translation params +func (o *GetConferenceBridgeTranslationParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithLanguageCode adds the languageCode to the get conference bridge translation params +func (o *GetConferenceBridgeTranslationParams) WithLanguageCode(languageCode string) *GetConferenceBridgeTranslationParams { + o.SetLanguageCode(languageCode) + return o +} + +// SetLanguageCode adds the languageCode to the get conference bridge translation params +func (o *GetConferenceBridgeTranslationParams) SetLanguageCode(languageCode string) { + o.LanguageCode = languageCode +} + +// WriteToRequest writes these params to a swagger request +func (o *GetConferenceBridgeTranslationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param language_code + if err := r.SetPathParam("language_code", o.LanguageCode); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/get_conference_bridge_translation_responses.go b/client/incidents/get_conference_bridge_translation_responses.go new file mode 100644 index 0000000..bd225cf --- /dev/null +++ b/client/incidents/get_conference_bridge_translation_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetConferenceBridgeTranslationReader is a Reader for the GetConferenceBridgeTranslation structure. +type GetConferenceBridgeTranslationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetConferenceBridgeTranslationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetConferenceBridgeTranslationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetConferenceBridgeTranslationOK creates a GetConferenceBridgeTranslationOK with default headers values +func NewGetConferenceBridgeTranslationOK() *GetConferenceBridgeTranslationOK { + return &GetConferenceBridgeTranslationOK{} +} + +/* +GetConferenceBridgeTranslationOK describes a response with status code 200, with default header values. + +Retrieve the translations for a specific conference bridge +*/ +type GetConferenceBridgeTranslationOK struct { + Payload *models.IncidentsConferenceBridgeEntity +} + +// IsSuccess returns true when this get conference bridge translation o k response has a 2xx status code +func (o *GetConferenceBridgeTranslationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get conference bridge translation o k response has a 3xx status code +func (o *GetConferenceBridgeTranslationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get conference bridge translation o k response has a 4xx status code +func (o *GetConferenceBridgeTranslationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get conference bridge translation o k response has a 5xx status code +func (o *GetConferenceBridgeTranslationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get conference bridge translation o k response a status code equal to that given +func (o *GetConferenceBridgeTranslationOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetConferenceBridgeTranslationOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/conference_bridges/{id}/translations/{language_code}][%d] getConferenceBridgeTranslationOK %+v", 200, o.Payload) +} + +func (o *GetConferenceBridgeTranslationOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/conference_bridges/{id}/translations/{language_code}][%d] getConferenceBridgeTranslationOK %+v", 200, o.Payload) +} + +func (o *GetConferenceBridgeTranslationOK) GetPayload() *models.IncidentsConferenceBridgeEntity { + return o.Payload +} + +func (o *GetConferenceBridgeTranslationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsConferenceBridgeEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/get_incident_channel_parameters.go b/client/incidents/get_incident_channel_parameters.go new file mode 100644 index 0000000..7428995 --- /dev/null +++ b/client/incidents/get_incident_channel_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetIncidentChannelParams creates a new GetIncidentChannelParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetIncidentChannelParams() *GetIncidentChannelParams { + return &GetIncidentChannelParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetIncidentChannelParamsWithTimeout creates a new GetIncidentChannelParams object +// with the ability to set a timeout on a request. +func NewGetIncidentChannelParamsWithTimeout(timeout time.Duration) *GetIncidentChannelParams { + return &GetIncidentChannelParams{ + timeout: timeout, + } +} + +// NewGetIncidentChannelParamsWithContext creates a new GetIncidentChannelParams object +// with the ability to set a context for a request. +func NewGetIncidentChannelParamsWithContext(ctx context.Context) *GetIncidentChannelParams { + return &GetIncidentChannelParams{ + Context: ctx, + } +} + +// NewGetIncidentChannelParamsWithHTTPClient creates a new GetIncidentChannelParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetIncidentChannelParamsWithHTTPClient(client *http.Client) *GetIncidentChannelParams { + return &GetIncidentChannelParams{ + HTTPClient: client, + } +} + +/* +GetIncidentChannelParams contains all the parameters to send to the API endpoint + + for the get incident channel operation. + + Typically these are written to a http.Request. +*/ +type GetIncidentChannelParams struct { + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get incident channel params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentChannelParams) WithDefaults() *GetIncidentChannelParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get incident channel params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentChannelParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get incident channel params +func (o *GetIncidentChannelParams) WithTimeout(timeout time.Duration) *GetIncidentChannelParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get incident channel params +func (o *GetIncidentChannelParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get incident channel params +func (o *GetIncidentChannelParams) WithContext(ctx context.Context) *GetIncidentChannelParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get incident channel params +func (o *GetIncidentChannelParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get incident channel params +func (o *GetIncidentChannelParams) WithHTTPClient(client *http.Client) *GetIncidentChannelParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get incident channel params +func (o *GetIncidentChannelParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the get incident channel params +func (o *GetIncidentChannelParams) WithIncidentID(incidentID string) *GetIncidentChannelParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the get incident channel params +func (o *GetIncidentChannelParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetIncidentChannelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/get_incident_channel_responses.go b/client/incidents/get_incident_channel_responses.go new file mode 100644 index 0000000..ce0c386 --- /dev/null +++ b/client/incidents/get_incident_channel_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetIncidentChannelReader is a Reader for the GetIncidentChannel structure. +type GetIncidentChannelReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetIncidentChannelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetIncidentChannelOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetIncidentChannelOK creates a GetIncidentChannelOK with default headers values +func NewGetIncidentChannelOK() *GetIncidentChannelOK { + return &GetIncidentChannelOK{} +} + +/* +GetIncidentChannelOK describes a response with status code 200, with default header values. + +Gives chat channel information for the specified incident +*/ +type GetIncidentChannelOK struct { + Payload *models.IncidentsChannelEntity +} + +// IsSuccess returns true when this get incident channel o k response has a 2xx status code +func (o *GetIncidentChannelOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get incident channel o k response has a 3xx status code +func (o *GetIncidentChannelOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get incident channel o k response has a 4xx status code +func (o *GetIncidentChannelOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get incident channel o k response has a 5xx status code +func (o *GetIncidentChannelOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get incident channel o k response a status code equal to that given +func (o *GetIncidentChannelOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetIncidentChannelOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/channel][%d] getIncidentChannelOK %+v", 200, o.Payload) +} + +func (o *GetIncidentChannelOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/channel][%d] getIncidentChannelOK %+v", 200, o.Payload) +} + +func (o *GetIncidentChannelOK) GetPayload() *models.IncidentsChannelEntity { + return o.Payload +} + +func (o *GetIncidentChannelOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsChannelEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/get_incident_event_parameters.go b/client/incidents/get_incident_event_parameters.go new file mode 100644 index 0000000..82ec0b3 --- /dev/null +++ b/client/incidents/get_incident_event_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetIncidentEventParams creates a new GetIncidentEventParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetIncidentEventParams() *GetIncidentEventParams { + return &GetIncidentEventParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetIncidentEventParamsWithTimeout creates a new GetIncidentEventParams object +// with the ability to set a timeout on a request. +func NewGetIncidentEventParamsWithTimeout(timeout time.Duration) *GetIncidentEventParams { + return &GetIncidentEventParams{ + timeout: timeout, + } +} + +// NewGetIncidentEventParamsWithContext creates a new GetIncidentEventParams object +// with the ability to set a context for a request. +func NewGetIncidentEventParamsWithContext(ctx context.Context) *GetIncidentEventParams { + return &GetIncidentEventParams{ + Context: ctx, + } +} + +// NewGetIncidentEventParamsWithHTTPClient creates a new GetIncidentEventParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetIncidentEventParamsWithHTTPClient(client *http.Client) *GetIncidentEventParams { + return &GetIncidentEventParams{ + HTTPClient: client, + } +} + +/* +GetIncidentEventParams contains all the parameters to send to the API endpoint + + for the get incident event operation. + + Typically these are written to a http.Request. +*/ +type GetIncidentEventParams struct { + + // EventID. + EventID string + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get incident event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentEventParams) WithDefaults() *GetIncidentEventParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get incident event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentEventParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get incident event params +func (o *GetIncidentEventParams) WithTimeout(timeout time.Duration) *GetIncidentEventParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get incident event params +func (o *GetIncidentEventParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get incident event params +func (o *GetIncidentEventParams) WithContext(ctx context.Context) *GetIncidentEventParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get incident event params +func (o *GetIncidentEventParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get incident event params +func (o *GetIncidentEventParams) WithHTTPClient(client *http.Client) *GetIncidentEventParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get incident event params +func (o *GetIncidentEventParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEventID adds the eventID to the get incident event params +func (o *GetIncidentEventParams) WithEventID(eventID string) *GetIncidentEventParams { + o.SetEventID(eventID) + return o +} + +// SetEventID adds the eventId to the get incident event params +func (o *GetIncidentEventParams) SetEventID(eventID string) { + o.EventID = eventID +} + +// WithIncidentID adds the incidentID to the get incident event params +func (o *GetIncidentEventParams) WithIncidentID(incidentID string) *GetIncidentEventParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the get incident event params +func (o *GetIncidentEventParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetIncidentEventParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param event_id + if err := r.SetPathParam("event_id", o.EventID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/get_incident_event_responses.go b/client/incidents/get_incident_event_responses.go new file mode 100644 index 0000000..4d7f31e --- /dev/null +++ b/client/incidents/get_incident_event_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetIncidentEventReader is a Reader for the GetIncidentEvent structure. +type GetIncidentEventReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetIncidentEventReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetIncidentEventOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetIncidentEventOK creates a GetIncidentEventOK with default headers values +func NewGetIncidentEventOK() *GetIncidentEventOK { + return &GetIncidentEventOK{} +} + +/* +GetIncidentEventOK describes a response with status code 200, with default header values. + +Retrieve a single event for an incident +*/ +type GetIncidentEventOK struct { + Payload *models.IncidentEventEntity +} + +// IsSuccess returns true when this get incident event o k response has a 2xx status code +func (o *GetIncidentEventOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get incident event o k response has a 3xx status code +func (o *GetIncidentEventOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get incident event o k response has a 4xx status code +func (o *GetIncidentEventOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get incident event o k response has a 5xx status code +func (o *GetIncidentEventOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get incident event o k response a status code equal to that given +func (o *GetIncidentEventOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetIncidentEventOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/events/{event_id}][%d] getIncidentEventOK %+v", 200, o.Payload) +} + +func (o *GetIncidentEventOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/events/{event_id}][%d] getIncidentEventOK %+v", 200, o.Payload) +} + +func (o *GetIncidentEventOK) GetPayload() *models.IncidentEventEntity { + return o.Payload +} + +func (o *GetIncidentEventOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentEventEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/get_incident_parameters.go b/client/incidents/get_incident_parameters.go new file mode 100644 index 0000000..2944a2e --- /dev/null +++ b/client/incidents/get_incident_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetIncidentParams creates a new GetIncidentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetIncidentParams() *GetIncidentParams { + return &GetIncidentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetIncidentParamsWithTimeout creates a new GetIncidentParams object +// with the ability to set a timeout on a request. +func NewGetIncidentParamsWithTimeout(timeout time.Duration) *GetIncidentParams { + return &GetIncidentParams{ + timeout: timeout, + } +} + +// NewGetIncidentParamsWithContext creates a new GetIncidentParams object +// with the ability to set a context for a request. +func NewGetIncidentParamsWithContext(ctx context.Context) *GetIncidentParams { + return &GetIncidentParams{ + Context: ctx, + } +} + +// NewGetIncidentParamsWithHTTPClient creates a new GetIncidentParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetIncidentParamsWithHTTPClient(client *http.Client) *GetIncidentParams { + return &GetIncidentParams{ + HTTPClient: client, + } +} + +/* +GetIncidentParams contains all the parameters to send to the API endpoint + + for the get incident operation. + + Typically these are written to a http.Request. +*/ +type GetIncidentParams struct { + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get incident params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentParams) WithDefaults() *GetIncidentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get incident params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get incident params +func (o *GetIncidentParams) WithTimeout(timeout time.Duration) *GetIncidentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get incident params +func (o *GetIncidentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get incident params +func (o *GetIncidentParams) WithContext(ctx context.Context) *GetIncidentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get incident params +func (o *GetIncidentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get incident params +func (o *GetIncidentParams) WithHTTPClient(client *http.Client) *GetIncidentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get incident params +func (o *GetIncidentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the get incident params +func (o *GetIncidentParams) WithIncidentID(incidentID string) *GetIncidentParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the get incident params +func (o *GetIncidentParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetIncidentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/get_incident_relationships_parameters.go b/client/incidents/get_incident_relationships_parameters.go new file mode 100644 index 0000000..8f027c8 --- /dev/null +++ b/client/incidents/get_incident_relationships_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetIncidentRelationshipsParams creates a new GetIncidentRelationshipsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetIncidentRelationshipsParams() *GetIncidentRelationshipsParams { + return &GetIncidentRelationshipsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetIncidentRelationshipsParamsWithTimeout creates a new GetIncidentRelationshipsParams object +// with the ability to set a timeout on a request. +func NewGetIncidentRelationshipsParamsWithTimeout(timeout time.Duration) *GetIncidentRelationshipsParams { + return &GetIncidentRelationshipsParams{ + timeout: timeout, + } +} + +// NewGetIncidentRelationshipsParamsWithContext creates a new GetIncidentRelationshipsParams object +// with the ability to set a context for a request. +func NewGetIncidentRelationshipsParamsWithContext(ctx context.Context) *GetIncidentRelationshipsParams { + return &GetIncidentRelationshipsParams{ + Context: ctx, + } +} + +// NewGetIncidentRelationshipsParamsWithHTTPClient creates a new GetIncidentRelationshipsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetIncidentRelationshipsParamsWithHTTPClient(client *http.Client) *GetIncidentRelationshipsParams { + return &GetIncidentRelationshipsParams{ + HTTPClient: client, + } +} + +/* +GetIncidentRelationshipsParams contains all the parameters to send to the API endpoint + + for the get incident relationships operation. + + Typically these are written to a http.Request. +*/ +type GetIncidentRelationshipsParams struct { + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get incident relationships params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentRelationshipsParams) WithDefaults() *GetIncidentRelationshipsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get incident relationships params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentRelationshipsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get incident relationships params +func (o *GetIncidentRelationshipsParams) WithTimeout(timeout time.Duration) *GetIncidentRelationshipsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get incident relationships params +func (o *GetIncidentRelationshipsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get incident relationships params +func (o *GetIncidentRelationshipsParams) WithContext(ctx context.Context) *GetIncidentRelationshipsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get incident relationships params +func (o *GetIncidentRelationshipsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get incident relationships params +func (o *GetIncidentRelationshipsParams) WithHTTPClient(client *http.Client) *GetIncidentRelationshipsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get incident relationships params +func (o *GetIncidentRelationshipsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the get incident relationships params +func (o *GetIncidentRelationshipsParams) WithIncidentID(incidentID string) *GetIncidentRelationshipsParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the get incident relationships params +func (o *GetIncidentRelationshipsParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetIncidentRelationshipsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/get_incident_relationships_responses.go b/client/incidents/get_incident_relationships_responses.go new file mode 100644 index 0000000..dbf50d3 --- /dev/null +++ b/client/incidents/get_incident_relationships_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetIncidentRelationshipsReader is a Reader for the GetIncidentRelationships structure. +type GetIncidentRelationshipsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetIncidentRelationshipsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetIncidentRelationshipsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetIncidentRelationshipsOK creates a GetIncidentRelationshipsOK with default headers values +func NewGetIncidentRelationshipsOK() *GetIncidentRelationshipsOK { + return &GetIncidentRelationshipsOK{} +} + +/* +GetIncidentRelationshipsOK describes a response with status code 200, with default header values. + +List any parent/child relationships for an incident +*/ +type GetIncidentRelationshipsOK struct { + Payload *models.IncidentsRelationshipsEntity +} + +// IsSuccess returns true when this get incident relationships o k response has a 2xx status code +func (o *GetIncidentRelationshipsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get incident relationships o k response has a 3xx status code +func (o *GetIncidentRelationshipsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get incident relationships o k response has a 4xx status code +func (o *GetIncidentRelationshipsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get incident relationships o k response has a 5xx status code +func (o *GetIncidentRelationshipsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get incident relationships o k response a status code equal to that given +func (o *GetIncidentRelationshipsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetIncidentRelationshipsOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/relationships][%d] getIncidentRelationshipsOK %+v", 200, o.Payload) +} + +func (o *GetIncidentRelationshipsOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/relationships][%d] getIncidentRelationshipsOK %+v", 200, o.Payload) +} + +func (o *GetIncidentRelationshipsOK) GetPayload() *models.IncidentsRelationshipsEntity { + return o.Payload +} + +func (o *GetIncidentRelationshipsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRelationshipsEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/get_incident_responses.go b/client/incidents/get_incident_responses.go new file mode 100644 index 0000000..c2486ca --- /dev/null +++ b/client/incidents/get_incident_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetIncidentReader is a Reader for the GetIncident structure. +type GetIncidentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetIncidentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetIncidentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetIncidentOK creates a GetIncidentOK with default headers values +func NewGetIncidentOK() *GetIncidentOK { + return &GetIncidentOK{} +} + +/* +GetIncidentOK describes a response with status code 200, with default header values. + +Retrieve a single incident from its ID +*/ +type GetIncidentOK struct { + Payload *models.IncidentEntity +} + +// IsSuccess returns true when this get incident o k response has a 2xx status code +func (o *GetIncidentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get incident o k response has a 3xx status code +func (o *GetIncidentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get incident o k response has a 4xx status code +func (o *GetIncidentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get incident o k response has a 5xx status code +func (o *GetIncidentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get incident o k response a status code equal to that given +func (o *GetIncidentOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetIncidentOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}][%d] getIncidentOK %+v", 200, o.Payload) +} + +func (o *GetIncidentOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}][%d] getIncidentOK %+v", 200, o.Payload) +} + +func (o *GetIncidentOK) GetPayload() *models.IncidentEntity { + return o.Payload +} + +func (o *GetIncidentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/get_incident_user_parameters.go b/client/incidents/get_incident_user_parameters.go new file mode 100644 index 0000000..b2782ca --- /dev/null +++ b/client/incidents/get_incident_user_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetIncidentUserParams creates a new GetIncidentUserParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetIncidentUserParams() *GetIncidentUserParams { + return &GetIncidentUserParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetIncidentUserParamsWithTimeout creates a new GetIncidentUserParams object +// with the ability to set a timeout on a request. +func NewGetIncidentUserParamsWithTimeout(timeout time.Duration) *GetIncidentUserParams { + return &GetIncidentUserParams{ + timeout: timeout, + } +} + +// NewGetIncidentUserParamsWithContext creates a new GetIncidentUserParams object +// with the ability to set a context for a request. +func NewGetIncidentUserParamsWithContext(ctx context.Context) *GetIncidentUserParams { + return &GetIncidentUserParams{ + Context: ctx, + } +} + +// NewGetIncidentUserParamsWithHTTPClient creates a new GetIncidentUserParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetIncidentUserParamsWithHTTPClient(client *http.Client) *GetIncidentUserParams { + return &GetIncidentUserParams{ + HTTPClient: client, + } +} + +/* +GetIncidentUserParams contains all the parameters to send to the API endpoint + + for the get incident user operation. + + Typically these are written to a http.Request. +*/ +type GetIncidentUserParams struct { + + // IncidentID. + IncidentID string + + // UserID. + UserID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get incident user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentUserParams) WithDefaults() *GetIncidentUserParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get incident user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentUserParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get incident user params +func (o *GetIncidentUserParams) WithTimeout(timeout time.Duration) *GetIncidentUserParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get incident user params +func (o *GetIncidentUserParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get incident user params +func (o *GetIncidentUserParams) WithContext(ctx context.Context) *GetIncidentUserParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get incident user params +func (o *GetIncidentUserParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get incident user params +func (o *GetIncidentUserParams) WithHTTPClient(client *http.Client) *GetIncidentUserParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get incident user params +func (o *GetIncidentUserParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the get incident user params +func (o *GetIncidentUserParams) WithIncidentID(incidentID string) *GetIncidentUserParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the get incident user params +func (o *GetIncidentUserParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithUserID adds the userID to the get incident user params +func (o *GetIncidentUserParams) WithUserID(userID string) *GetIncidentUserParams { + o.SetUserID(userID) + return o +} + +// SetUserID adds the userId to the get incident user params +func (o *GetIncidentUserParams) SetUserID(userID string) { + o.UserID = userID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetIncidentUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param user_id + if err := r.SetPathParam("user_id", o.UserID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/get_incident_user_responses.go b/client/incidents/get_incident_user_responses.go new file mode 100644 index 0000000..eae9d9d --- /dev/null +++ b/client/incidents/get_incident_user_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetIncidentUserReader is a Reader for the GetIncidentUser structure. +type GetIncidentUserReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetIncidentUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetIncidentUserOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetIncidentUserOK creates a GetIncidentUserOK with default headers values +func NewGetIncidentUserOK() *GetIncidentUserOK { + return &GetIncidentUserOK{} +} + +/* +GetIncidentUserOK describes a response with status code 200, with default header values. + +Retrieve a user with current roles for an incident +*/ +type GetIncidentUserOK struct { + Payload *models.IncidentsRoleAssignmentEntity +} + +// IsSuccess returns true when this get incident user o k response has a 2xx status code +func (o *GetIncidentUserOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get incident user o k response has a 3xx status code +func (o *GetIncidentUserOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get incident user o k response has a 4xx status code +func (o *GetIncidentUserOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get incident user o k response has a 5xx status code +func (o *GetIncidentUserOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get incident user o k response a status code equal to that given +func (o *GetIncidentUserOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetIncidentUserOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/users/{user_id}][%d] getIncidentUserOK %+v", 200, o.Payload) +} + +func (o *GetIncidentUserOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/users/{user_id}][%d] getIncidentUserOK %+v", 200, o.Payload) +} + +func (o *GetIncidentUserOK) GetPayload() *models.IncidentsRoleAssignmentEntity { + return o.Payload +} + +func (o *GetIncidentUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRoleAssignmentEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/get_scheduled_maintenance_parameters.go b/client/incidents/get_scheduled_maintenance_parameters.go new file mode 100644 index 0000000..b9354d2 --- /dev/null +++ b/client/incidents/get_scheduled_maintenance_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetScheduledMaintenanceParams creates a new GetScheduledMaintenanceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetScheduledMaintenanceParams() *GetScheduledMaintenanceParams { + return &GetScheduledMaintenanceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetScheduledMaintenanceParamsWithTimeout creates a new GetScheduledMaintenanceParams object +// with the ability to set a timeout on a request. +func NewGetScheduledMaintenanceParamsWithTimeout(timeout time.Duration) *GetScheduledMaintenanceParams { + return &GetScheduledMaintenanceParams{ + timeout: timeout, + } +} + +// NewGetScheduledMaintenanceParamsWithContext creates a new GetScheduledMaintenanceParams object +// with the ability to set a context for a request. +func NewGetScheduledMaintenanceParamsWithContext(ctx context.Context) *GetScheduledMaintenanceParams { + return &GetScheduledMaintenanceParams{ + Context: ctx, + } +} + +// NewGetScheduledMaintenanceParamsWithHTTPClient creates a new GetScheduledMaintenanceParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetScheduledMaintenanceParamsWithHTTPClient(client *http.Client) *GetScheduledMaintenanceParams { + return &GetScheduledMaintenanceParams{ + HTTPClient: client, + } +} + +/* +GetScheduledMaintenanceParams contains all the parameters to send to the API endpoint + + for the get scheduled maintenance operation. + + Typically these are written to a http.Request. +*/ +type GetScheduledMaintenanceParams struct { + + // ScheduledMaintenanceID. + ScheduledMaintenanceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get scheduled maintenance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetScheduledMaintenanceParams) WithDefaults() *GetScheduledMaintenanceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get scheduled maintenance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetScheduledMaintenanceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get scheduled maintenance params +func (o *GetScheduledMaintenanceParams) WithTimeout(timeout time.Duration) *GetScheduledMaintenanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get scheduled maintenance params +func (o *GetScheduledMaintenanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get scheduled maintenance params +func (o *GetScheduledMaintenanceParams) WithContext(ctx context.Context) *GetScheduledMaintenanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get scheduled maintenance params +func (o *GetScheduledMaintenanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get scheduled maintenance params +func (o *GetScheduledMaintenanceParams) WithHTTPClient(client *http.Client) *GetScheduledMaintenanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get scheduled maintenance params +func (o *GetScheduledMaintenanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithScheduledMaintenanceID adds the scheduledMaintenanceID to the get scheduled maintenance params +func (o *GetScheduledMaintenanceParams) WithScheduledMaintenanceID(scheduledMaintenanceID string) *GetScheduledMaintenanceParams { + o.SetScheduledMaintenanceID(scheduledMaintenanceID) + return o +} + +// SetScheduledMaintenanceID adds the scheduledMaintenanceId to the get scheduled maintenance params +func (o *GetScheduledMaintenanceParams) SetScheduledMaintenanceID(scheduledMaintenanceID string) { + o.ScheduledMaintenanceID = scheduledMaintenanceID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetScheduledMaintenanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param scheduled_maintenance_id + if err := r.SetPathParam("scheduled_maintenance_id", o.ScheduledMaintenanceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/get_scheduled_maintenance_responses.go b/client/incidents/get_scheduled_maintenance_responses.go new file mode 100644 index 0000000..7b19269 --- /dev/null +++ b/client/incidents/get_scheduled_maintenance_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetScheduledMaintenanceReader is a Reader for the GetScheduledMaintenance structure. +type GetScheduledMaintenanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetScheduledMaintenanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetScheduledMaintenanceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetScheduledMaintenanceOK creates a GetScheduledMaintenanceOK with default headers values +func NewGetScheduledMaintenanceOK() *GetScheduledMaintenanceOK { + return &GetScheduledMaintenanceOK{} +} + +/* +GetScheduledMaintenanceOK describes a response with status code 200, with default header values. + +Fetch the details of a scheduled maintenance event. +*/ +type GetScheduledMaintenanceOK struct { + Payload *models.ScheduledMaintenanceEntity +} + +// IsSuccess returns true when this get scheduled maintenance o k response has a 2xx status code +func (o *GetScheduledMaintenanceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get scheduled maintenance o k response has a 3xx status code +func (o *GetScheduledMaintenanceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get scheduled maintenance o k response has a 4xx status code +func (o *GetScheduledMaintenanceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get scheduled maintenance o k response has a 5xx status code +func (o *GetScheduledMaintenanceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get scheduled maintenance o k response a status code equal to that given +func (o *GetScheduledMaintenanceOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetScheduledMaintenanceOK) Error() string { + return fmt.Sprintf("[GET /v1/scheduled_maintenances/{scheduled_maintenance_id}][%d] getScheduledMaintenanceOK %+v", 200, o.Payload) +} + +func (o *GetScheduledMaintenanceOK) String() string { + return fmt.Sprintf("[GET /v1/scheduled_maintenances/{scheduled_maintenance_id}][%d] getScheduledMaintenanceOK %+v", 200, o.Payload) +} + +func (o *GetScheduledMaintenanceOK) GetPayload() *models.ScheduledMaintenanceEntity { + return o.Payload +} + +func (o *GetScheduledMaintenanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ScheduledMaintenanceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/incidents_client.go b/client/incidents/incidents_client.go index f2a47a5..1dd1696 100644 --- a/client/incidents/incidents_client.go +++ b/client/incidents/incidents_client.go @@ -30,140 +30,146 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1IncidentsIncidentID(params *DeleteV1IncidentsIncidentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDOK, error) + BulkUpdateIncidentMilestones(params *BulkUpdateIncidentMilestonesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BulkUpdateIncidentMilestonesOK, error) - DeleteV1IncidentsIncidentIDEventsEventID(params *DeleteV1IncidentsIncidentIDEventsEventIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDEventsEventIDOK, error) + CloseIncident(params *CloseIncidentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CloseIncidentOK, error) - DeleteV1IncidentsIncidentIDGenericChatMessagesMessageID(params *DeleteV1IncidentsIncidentIDGenericChatMessagesMessageIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDGenericChatMessagesMessageIDOK, error) + CreateIncident(params *CreateIncidentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentCreated, error) - DeleteV1IncidentsIncidentIDImpactTypeID(params *DeleteV1IncidentsIncidentIDImpactTypeIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDImpactTypeIDNoContent, error) + CreateIncidentAttachment(params *CreateIncidentAttachmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentAttachmentCreated, error) - DeleteV1IncidentsIncidentIDLinksLinkID(params *DeleteV1IncidentsIncidentIDLinksLinkIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDLinksLinkIDNoContent, error) + CreateIncidentChangeEvent(params *CreateIncidentChangeEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentChangeEventCreated, error) - DeleteV1IncidentsIncidentIDRoleAssignmentsRoleAssignmentID(params *DeleteV1IncidentsIncidentIDRoleAssignmentsRoleAssignmentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDRoleAssignmentsRoleAssignmentIDOK, error) + CreateIncidentChatMessage(params *CreateIncidentChatMessageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentChatMessageCreated, error) - DeleteV1IncidentsIncidentIDTeamAssignmentsTeamAssignmentID(params *DeleteV1IncidentsIncidentIDTeamAssignmentsTeamAssignmentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDTeamAssignmentsTeamAssignmentIDNoContent, error) + CreateIncidentImpact(params *CreateIncidentImpactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentImpactCreated, error) - DeleteV1IncidentsIncidentIDTranscriptTranscriptID(params *DeleteV1IncidentsIncidentIDTranscriptTranscriptIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDTranscriptTranscriptIDOK, error) + CreateIncidentLink(params *CreateIncidentLinkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentLinkCreated, error) - DeleteV1ScheduledMaintenancesScheduledMaintenanceID(params *DeleteV1ScheduledMaintenancesScheduledMaintenanceIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ScheduledMaintenancesScheduledMaintenanceIDNoContent, error) + CreateIncidentNote(params *CreateIncidentNoteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentNoteCreated, error) - GetV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVoted(params *GetV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVotedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVotedOK, error) + CreateIncidentRoleAssignment(params *CreateIncidentRoleAssignmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentRoleAssignmentCreated, error) - GetV1Incidents(params *GetV1IncidentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsOK, error) + CreateIncidentStatusPage(params *CreateIncidentStatusPageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentStatusPageCreated, error) - GetV1IncidentsIncidentID(params *GetV1IncidentsIncidentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDOK, error) + CreateIncidentTeamAssignment(params *CreateIncidentTeamAssignmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentTeamAssignmentCreated, error) - GetV1IncidentsIncidentIDAttachments(params *GetV1IncidentsIncidentIDAttachmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDAttachmentsOK, error) + CreateScheduledMaintenance(params *CreateScheduledMaintenanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateScheduledMaintenanceCreated, error) - GetV1IncidentsIncidentIDChannel(params *GetV1IncidentsIncidentIDChannelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDChannelOK, error) + DeleteIncident(params *DeleteIncidentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentOK, error) - GetV1IncidentsIncidentIDConferenceBridges(params *GetV1IncidentsIncidentIDConferenceBridgesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDConferenceBridgesOK, error) + DeleteIncidentChatMessage(params *DeleteIncidentChatMessageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentChatMessageOK, error) - GetV1IncidentsIncidentIDConferenceBridgesIDTranslationsLanguageCode(params *GetV1IncidentsIncidentIDConferenceBridgesIDTranslationsLanguageCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDConferenceBridgesIDTranslationsLanguageCodeOK, error) + DeleteIncidentEvent(params *DeleteIncidentEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentEventOK, error) - GetV1IncidentsIncidentIDEvents(params *GetV1IncidentsIncidentIDEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDEventsOK, error) + DeleteIncidentImpact(params *DeleteIncidentImpactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentImpactNoContent, error) - GetV1IncidentsIncidentIDEventsEventID(params *GetV1IncidentsIncidentIDEventsEventIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDEventsEventIDOK, error) + DeleteIncidentLink(params *DeleteIncidentLinkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentLinkNoContent, error) - GetV1IncidentsIncidentIDImpactType(params *GetV1IncidentsIncidentIDImpactTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDImpactTypeOK, error) + DeleteIncidentRoleAssignment(params *DeleteIncidentRoleAssignmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentRoleAssignmentOK, error) - GetV1IncidentsIncidentIDLinks(params *GetV1IncidentsIncidentIDLinksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDLinksOK, error) + DeleteIncidentTeamAssignment(params *DeleteIncidentTeamAssignmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentTeamAssignmentNoContent, error) - GetV1IncidentsIncidentIDMilestones(params *GetV1IncidentsIncidentIDMilestonesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDMilestonesOK, error) + DeleteScheduledMaintenance(params *DeleteScheduledMaintenanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteScheduledMaintenanceNoContent, error) - GetV1IncidentsIncidentIDRelatedChangeEvents(params *GetV1IncidentsIncidentIDRelatedChangeEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDRelatedChangeEventsOK, error) + DeleteTranscriptEntry(params *DeleteTranscriptEntryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTranscriptEntryOK, error) - GetV1IncidentsIncidentIDRelationships(params *GetV1IncidentsIncidentIDRelationshipsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDRelationshipsOK, error) + GetAiIncidentSummaryVoteStatus(params *GetAiIncidentSummaryVoteStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAiIncidentSummaryVoteStatusOK, error) - GetV1IncidentsIncidentIDRoleAssignments(params *GetV1IncidentsIncidentIDRoleAssignmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDRoleAssignmentsOK, error) + GetConferenceBridgeTranslation(params *GetConferenceBridgeTranslationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetConferenceBridgeTranslationOK, error) - GetV1IncidentsIncidentIDSimilar(params *GetV1IncidentsIncidentIDSimilarParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDSimilarOK, error) + GetIncident(params *GetIncidentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentOK, error) - GetV1IncidentsIncidentIDStatusPages(params *GetV1IncidentsIncidentIDStatusPagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDStatusPagesOK, error) + GetIncidentChannel(params *GetIncidentChannelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentChannelOK, error) - GetV1IncidentsIncidentIDTranscript(params *GetV1IncidentsIncidentIDTranscriptParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDTranscriptOK, error) + GetIncidentEvent(params *GetIncidentEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentEventOK, error) - GetV1IncidentsIncidentIDUsersUserID(params *GetV1IncidentsIncidentIDUsersUserIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDUsersUserIDOK, error) + GetIncidentRelationships(params *GetIncidentRelationshipsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentRelationshipsOK, error) - GetV1ScheduledMaintenances(params *GetV1ScheduledMaintenancesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ScheduledMaintenancesOK, error) + GetIncidentUser(params *GetIncidentUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentUserOK, error) - GetV1ScheduledMaintenancesScheduledMaintenanceID(params *GetV1ScheduledMaintenancesScheduledMaintenanceIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ScheduledMaintenancesScheduledMaintenanceIDOK, error) + GetScheduledMaintenance(params *GetScheduledMaintenanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetScheduledMaintenanceOK, error) - PatchV1IncidentsIncidentID(params *PatchV1IncidentsIncidentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDOK, error) + ListIncidentAttachments(params *ListIncidentAttachmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentAttachmentsOK, error) - PatchV1IncidentsIncidentIDEventsEventID(params *PatchV1IncidentsIncidentIDEventsEventIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDEventsEventIDOK, error) + ListIncidentChangeEvents(params *ListIncidentChangeEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentChangeEventsOK, error) - PatchV1IncidentsIncidentIDGenericChatMessagesMessageID(params *PatchV1IncidentsIncidentIDGenericChatMessagesMessageIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDGenericChatMessagesMessageIDOK, error) + ListIncidentConferenceBridges(params *ListIncidentConferenceBridgesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentConferenceBridgesOK, error) - PatchV1IncidentsIncidentIDImpact(params *PatchV1IncidentsIncidentIDImpactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDImpactOK, error) + ListIncidentEvents(params *ListIncidentEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentEventsOK, error) - PatchV1IncidentsIncidentIDNotesNoteID(params *PatchV1IncidentsIncidentIDNotesNoteIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDNotesNoteIDOK, error) + ListIncidentImpacts(params *ListIncidentImpactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentImpactsOK, error) - PatchV1IncidentsIncidentIDRelatedChangeEventsRelatedChangeEventID(params *PatchV1IncidentsIncidentIDRelatedChangeEventsRelatedChangeEventIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDRelatedChangeEventsRelatedChangeEventIDOK, error) + ListIncidentLinks(params *ListIncidentLinksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentLinksOK, error) - PatchV1ScheduledMaintenancesScheduledMaintenanceID(params *PatchV1ScheduledMaintenancesScheduledMaintenanceIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1ScheduledMaintenancesScheduledMaintenanceIDOK, error) + ListIncidentMilestones(params *ListIncidentMilestonesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentMilestonesOK, error) - PostV1Incidents(params *PostV1IncidentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsCreated, error) + ListIncidentRoleAssignments(params *ListIncidentRoleAssignmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentRoleAssignmentsOK, error) - PostV1IncidentsIncidentIDAttachments(params *PostV1IncidentsIncidentIDAttachmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDAttachmentsCreated, error) + ListIncidentStatusPages(params *ListIncidentStatusPagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentStatusPagesOK, error) - PostV1IncidentsIncidentIDGenericChatMessages(params *PostV1IncidentsIncidentIDGenericChatMessagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDGenericChatMessagesCreated, error) + ListIncidents(params *ListIncidentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentsOK, error) - PostV1IncidentsIncidentIDImpactType(params *PostV1IncidentsIncidentIDImpactTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDImpactTypeCreated, error) + ListScheduledMaintenances(params *ListScheduledMaintenancesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListScheduledMaintenancesOK, error) - PostV1IncidentsIncidentIDLinks(params *PostV1IncidentsIncidentIDLinksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDLinksCreated, error) + ListSimilarIncidents(params *ListSimilarIncidentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSimilarIncidentsOK, error) - PostV1IncidentsIncidentIDNotes(params *PostV1IncidentsIncidentIDNotesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDNotesCreated, error) + ListTranscriptEntries(params *ListTranscriptEntriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTranscriptEntriesOK, error) - PostV1IncidentsIncidentIDRelatedChangeEvents(params *PostV1IncidentsIncidentIDRelatedChangeEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDRelatedChangeEventsCreated, error) + ResolveIncident(params *ResolveIncidentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResolveIncidentOK, error) - PostV1IncidentsIncidentIDRoleAssignments(params *PostV1IncidentsIncidentIDRoleAssignmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDRoleAssignmentsCreated, error) + UnarchiveIncident(params *UnarchiveIncidentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UnarchiveIncidentCreated, error) - PostV1IncidentsIncidentIDStatusPages(params *PostV1IncidentsIncidentIDStatusPagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDStatusPagesCreated, error) + UpdateIncident(params *UpdateIncidentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentOK, error) - PostV1IncidentsIncidentIDTeamAssignments(params *PostV1IncidentsIncidentIDTeamAssignmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDTeamAssignmentsCreated, error) + UpdateIncidentChangeEvent(params *UpdateIncidentChangeEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentChangeEventOK, error) - PostV1IncidentsIncidentIDUnarchive(params *PostV1IncidentsIncidentIDUnarchiveParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDUnarchiveCreated, error) + UpdateIncidentChatMessage(params *UpdateIncidentChatMessageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentChatMessageOK, error) - PostV1ScheduledMaintenances(params *PostV1ScheduledMaintenancesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ScheduledMaintenancesCreated, error) + UpdateIncidentEvent(params *UpdateIncidentEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentEventOK, error) - PutV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVote(params *PutV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVoteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVoteOK, error) + UpdateIncidentImpactPatch(params *UpdateIncidentImpactPatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentImpactPatchOK, error) - PutV1IncidentsIncidentIDClose(params *PutV1IncidentsIncidentIDCloseParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1IncidentsIncidentIDCloseOK, error) + UpdateIncidentImpactPut(params *UpdateIncidentImpactPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentImpactPutOK, error) - PutV1IncidentsIncidentIDImpact(params *PutV1IncidentsIncidentIDImpactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1IncidentsIncidentIDImpactOK, error) + UpdateIncidentLink(params *UpdateIncidentLinkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentLinkOK, error) - PutV1IncidentsIncidentIDLinksLinkID(params *PutV1IncidentsIncidentIDLinksLinkIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1IncidentsIncidentIDLinksLinkIDOK, error) + UpdateIncidentNote(params *UpdateIncidentNoteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentNoteOK, error) - PutV1IncidentsIncidentIDMilestonesBulkUpdate(params *PutV1IncidentsIncidentIDMilestonesBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1IncidentsIncidentIDMilestonesBulkUpdateOK, error) + UpdateScheduledMaintenance(params *UpdateScheduledMaintenanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateScheduledMaintenanceOK, error) - PutV1IncidentsIncidentIDResolve(params *PutV1IncidentsIncidentIDResolveParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1IncidentsIncidentIDResolveOK, error) + UpdateTranscriptAttribution(params *UpdateTranscriptAttributionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTranscriptAttributionOK, error) - PutV1IncidentsIncidentIDTranscriptAttribution(params *PutV1IncidentsIncidentIDTranscriptAttributionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1IncidentsIncidentIDTranscriptAttributionOK, error) + VoteAiIncidentSummary(params *VoteAiIncidentSummaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VoteAiIncidentSummaryOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1IncidentsIncidentID archives an incident + BulkUpdateIncidentMilestones updates milestone times -Archives an incident which will hide it from lists and metrics + Update milestone times in bulk for a given incident. All milestone + +times for an incident must occur in chronological order +corresponding to the configured order of milestones. If the result +of this request would cause any milestone(s) to appear out of place, +a 422 response will instead be returned. This includes milestones +not explicitly submitted or updated in this request. */ -func (a *Client) DeleteV1IncidentsIncidentID(params *DeleteV1IncidentsIncidentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDOK, error) { +func (a *Client) BulkUpdateIncidentMilestones(params *BulkUpdateIncidentMilestonesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BulkUpdateIncidentMilestonesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IncidentsIncidentIDParams() + params = NewBulkUpdateIncidentMilestonesParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IncidentsIncidentId", - Method: "DELETE", - PathPattern: "/v1/incidents/{incident_id}", + ID: "bulk_update_incident_milestones", + Method: "PUT", + PathPattern: "/v1/incidents/{incident_id}/milestones/bulk_update", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IncidentsIncidentIDReader{formats: a.formats}, + Reader: &BulkUpdateIncidentMilestonesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -176,35 +182,35 @@ func (a *Client) DeleteV1IncidentsIncidentID(params *DeleteV1IncidentsIncidentID if err != nil { return nil, err } - success, ok := result.(*DeleteV1IncidentsIncidentIDOK) + success, ok := result.(*BulkUpdateIncidentMilestonesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IncidentsIncidentId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for bulk_update_incident_milestones: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1IncidentsIncidentIDEventsEventID deletes an incident event +CloseIncident closes an incident -Delete an event for an incident +Closes an incident and optionally close all children */ -func (a *Client) DeleteV1IncidentsIncidentIDEventsEventID(params *DeleteV1IncidentsIncidentIDEventsEventIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDEventsEventIDOK, error) { +func (a *Client) CloseIncident(params *CloseIncidentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CloseIncidentOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IncidentsIncidentIDEventsEventIDParams() + params = NewCloseIncidentParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IncidentsIncidentIdEventsEventId", - Method: "DELETE", - PathPattern: "/v1/incidents/{incident_id}/events/{event_id}", + ID: "close_incident", + Method: "PUT", + PathPattern: "/v1/incidents/{incident_id}/close", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IncidentsIncidentIDEventsEventIDReader{formats: a.formats}, + Reader: &CloseIncidentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -217,35 +223,35 @@ func (a *Client) DeleteV1IncidentsIncidentIDEventsEventID(params *DeleteV1Incide if err != nil { return nil, err } - success, ok := result.(*DeleteV1IncidentsIncidentIDEventsEventIDOK) + success, ok := result.(*CloseIncidentOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IncidentsIncidentIdEventsEventId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for close_incident: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1IncidentsIncidentIDGenericChatMessagesMessageID deletes a chat message from an incident +CreateIncident creates an incident -Delete an existing generic chat message on an incident. +Create a new incident */ -func (a *Client) DeleteV1IncidentsIncidentIDGenericChatMessagesMessageID(params *DeleteV1IncidentsIncidentIDGenericChatMessagesMessageIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDGenericChatMessagesMessageIDOK, error) { +func (a *Client) CreateIncident(params *CreateIncidentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IncidentsIncidentIDGenericChatMessagesMessageIDParams() + params = NewCreateIncidentParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IncidentsIncidentIdGenericChatMessagesMessageId", - Method: "DELETE", - PathPattern: "/v1/incidents/{incident_id}/generic_chat_messages/{message_id}", + ID: "create_incident", + Method: "POST", + PathPattern: "/v1/incidents", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IncidentsIncidentIDGenericChatMessagesMessageIDReader{formats: a.formats}, + Reader: &CreateIncidentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -258,35 +264,35 @@ func (a *Client) DeleteV1IncidentsIncidentIDGenericChatMessagesMessageID(params if err != nil { return nil, err } - success, ok := result.(*DeleteV1IncidentsIncidentIDGenericChatMessagesMessageIDOK) + success, ok := result.(*CreateIncidentCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IncidentsIncidentIdGenericChatMessagesMessageId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1IncidentsIncidentIDImpactTypeID removes impacted infrastructure from an incident +CreateIncidentAttachment adds an attachment to the incident timeline -Remove impacted infrastructure from an incident +Allows adding image attachments to an incident */ -func (a *Client) DeleteV1IncidentsIncidentIDImpactTypeID(params *DeleteV1IncidentsIncidentIDImpactTypeIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDImpactTypeIDNoContent, error) { +func (a *Client) CreateIncidentAttachment(params *CreateIncidentAttachmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentAttachmentCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IncidentsIncidentIDImpactTypeIDParams() + params = NewCreateIncidentAttachmentParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IncidentsIncidentIdImpactTypeId", - Method: "DELETE", - PathPattern: "/v1/incidents/{incident_id}/impact/{type}/{id}", + ID: "create_incident_attachment", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/attachments", ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"multipart/form-data"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IncidentsIncidentIDImpactTypeIDReader{formats: a.formats}, + Reader: &CreateIncidentAttachmentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -299,35 +305,35 @@ func (a *Client) DeleteV1IncidentsIncidentIDImpactTypeID(params *DeleteV1Inciden if err != nil { return nil, err } - success, ok := result.(*DeleteV1IncidentsIncidentIDImpactTypeIDNoContent) + success, ok := result.(*CreateIncidentAttachmentCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IncidentsIncidentIdImpactTypeId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_attachment: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1IncidentsIncidentIDLinksLinkID removes a link from an incident +CreateIncidentChangeEvent adds a related change to an incident -Remove a link from an incident +Add a related change to an incident. Changes added to an incident can be causes, fixes, or suspects. To remove a change from an incident, the type field should be set to dismissed. */ -func (a *Client) DeleteV1IncidentsIncidentIDLinksLinkID(params *DeleteV1IncidentsIncidentIDLinksLinkIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDLinksLinkIDNoContent, error) { +func (a *Client) CreateIncidentChangeEvent(params *CreateIncidentChangeEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentChangeEventCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IncidentsIncidentIDLinksLinkIDParams() + params = NewCreateIncidentChangeEventParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IncidentsIncidentIdLinksLinkId", - Method: "DELETE", - PathPattern: "/v1/incidents/{incident_id}/links/{link_id}", + ID: "create_incident_change_event", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/related_change_events", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IncidentsIncidentIDLinksLinkIDReader{formats: a.formats}, + Reader: &CreateIncidentChangeEventReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -340,35 +346,35 @@ func (a *Client) DeleteV1IncidentsIncidentIDLinksLinkID(params *DeleteV1Incident if err != nil { return nil, err } - success, ok := result.(*DeleteV1IncidentsIncidentIDLinksLinkIDNoContent) + success, ok := result.(*CreateIncidentChangeEventCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IncidentsIncidentIdLinksLinkId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_change_event: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1IncidentsIncidentIDRoleAssignmentsRoleAssignmentID unassigns a user from an incident +CreateIncidentChatMessage adds a chat message to an incident -Unassign a role from a user +Create a new generic chat message on an incident timeline. These are independent of any specific chat provider. */ -func (a *Client) DeleteV1IncidentsIncidentIDRoleAssignmentsRoleAssignmentID(params *DeleteV1IncidentsIncidentIDRoleAssignmentsRoleAssignmentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDRoleAssignmentsRoleAssignmentIDOK, error) { +func (a *Client) CreateIncidentChatMessage(params *CreateIncidentChatMessageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentChatMessageCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IncidentsIncidentIDRoleAssignmentsRoleAssignmentIDParams() + params = NewCreateIncidentChatMessageParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IncidentsIncidentIdRoleAssignmentsRoleAssignmentId", - Method: "DELETE", - PathPattern: "/v1/incidents/{incident_id}/role_assignments/{role_assignment_id}", + ID: "create_incident_chat_message", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/generic_chat_messages", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IncidentsIncidentIDRoleAssignmentsRoleAssignmentIDReader{formats: a.formats}, + Reader: &CreateIncidentChatMessageReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -381,35 +387,35 @@ func (a *Client) DeleteV1IncidentsIncidentIDRoleAssignmentsRoleAssignmentID(para if err != nil { return nil, err } - success, ok := result.(*DeleteV1IncidentsIncidentIDRoleAssignmentsRoleAssignmentIDOK) + success, ok := result.(*CreateIncidentChatMessageCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IncidentsIncidentIdRoleAssignmentsRoleAssignmentId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_chat_message: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1IncidentsIncidentIDTeamAssignmentsTeamAssignmentID unassigns a team from an incident +CreateIncidentImpact adds impacted infrastructure to an incident -Unassign a team from an incident +Add impacted infrastructure to an incident */ -func (a *Client) DeleteV1IncidentsIncidentIDTeamAssignmentsTeamAssignmentID(params *DeleteV1IncidentsIncidentIDTeamAssignmentsTeamAssignmentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDTeamAssignmentsTeamAssignmentIDNoContent, error) { +func (a *Client) CreateIncidentImpact(params *CreateIncidentImpactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentImpactCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IncidentsIncidentIDTeamAssignmentsTeamAssignmentIDParams() + params = NewCreateIncidentImpactParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IncidentsIncidentIdTeamAssignmentsTeamAssignmentId", - Method: "DELETE", - PathPattern: "/v1/incidents/{incident_id}/team_assignments/{team_assignment_id}", + ID: "create_incident_impact", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/impact/{type}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IncidentsIncidentIDTeamAssignmentsTeamAssignmentIDReader{formats: a.formats}, + Reader: &CreateIncidentImpactReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -422,35 +428,35 @@ func (a *Client) DeleteV1IncidentsIncidentIDTeamAssignmentsTeamAssignmentID(para if err != nil { return nil, err } - success, ok := result.(*DeleteV1IncidentsIncidentIDTeamAssignmentsTeamAssignmentIDNoContent) + success, ok := result.(*CreateIncidentImpactCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IncidentsIncidentIdTeamAssignmentsTeamAssignmentId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_impact: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1IncidentsIncidentIDTranscriptTranscriptID deletes a transcript from an incident +CreateIncidentLink adds a link to an incident -Delete a transcript from an incident +Allows adding adhoc links to an incident as an attachment */ -func (a *Client) DeleteV1IncidentsIncidentIDTranscriptTranscriptID(params *DeleteV1IncidentsIncidentIDTranscriptTranscriptIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDTranscriptTranscriptIDOK, error) { +func (a *Client) CreateIncidentLink(params *CreateIncidentLinkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentLinkCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IncidentsIncidentIDTranscriptTranscriptIDParams() + params = NewCreateIncidentLinkParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IncidentsIncidentIdTranscriptTranscriptId", - Method: "DELETE", - PathPattern: "/v1/incidents/{incident_id}/transcript/{transcript_id}", + ID: "create_incident_link", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/links", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IncidentsIncidentIDTranscriptTranscriptIDReader{formats: a.formats}, + Reader: &CreateIncidentLinkReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -463,35 +469,35 @@ func (a *Client) DeleteV1IncidentsIncidentIDTranscriptTranscriptID(params *Delet if err != nil { return nil, err } - success, ok := result.(*DeleteV1IncidentsIncidentIDTranscriptTranscriptIDOK) + success, ok := result.(*CreateIncidentLinkCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IncidentsIncidentIdTranscriptTranscriptId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_link: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1ScheduledMaintenancesScheduledMaintenanceID deletes a scheduled maintenance event +CreateIncidentNote adds a note to an incident -Delete a scheduled maintenance event, preventing it from taking place. +Create a new note on for an incident. The visibility field on a note determines where it gets posted. */ -func (a *Client) DeleteV1ScheduledMaintenancesScheduledMaintenanceID(params *DeleteV1ScheduledMaintenancesScheduledMaintenanceIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ScheduledMaintenancesScheduledMaintenanceIDNoContent, error) { +func (a *Client) CreateIncidentNote(params *CreateIncidentNoteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentNoteCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1ScheduledMaintenancesScheduledMaintenanceIDParams() + params = NewCreateIncidentNoteParams() } op := &runtime.ClientOperation{ - ID: "deleteV1ScheduledMaintenancesScheduledMaintenanceId", - Method: "DELETE", - PathPattern: "/v1/scheduled_maintenances/{scheduled_maintenance_id}", + ID: "create_incident_note", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/notes", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1ScheduledMaintenancesScheduledMaintenanceIDReader{formats: a.formats}, + Reader: &CreateIncidentNoteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -504,35 +510,35 @@ func (a *Client) DeleteV1ScheduledMaintenancesScheduledMaintenanceID(params *Del if err != nil { return nil, err } - success, ok := result.(*DeleteV1ScheduledMaintenancesScheduledMaintenanceIDNoContent) + success, ok := result.(*CreateIncidentNoteCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1ScheduledMaintenancesScheduledMaintenanceId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_note: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVoted gets the current user s vote status for an a i generated incident summary +CreateIncidentRoleAssignment assigns a user to an incident -Get the current user's vote status for an AI-generated incident summary +Assign a role to a user for this incident */ -func (a *Client) GetV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVoted(params *GetV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVotedParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVotedOK, error) { +func (a *Client) CreateIncidentRoleAssignment(params *CreateIncidentRoleAssignmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentRoleAssignmentCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVotedParams() + params = NewCreateIncidentRoleAssignmentParams() } op := &runtime.ClientOperation{ - ID: "getV1AiSummarizeIncidentIncidentIdGeneratedSummaryIdVoted", - Method: "GET", - PathPattern: "/v1/ai/summarize_incident/{incident_id}/{generated_summary_id}/voted", + ID: "create_incident_role_assignment", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/role_assignments", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVotedReader{formats: a.formats}, + Reader: &CreateIncidentRoleAssignmentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -545,35 +551,35 @@ func (a *Client) GetV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVoted(param if err != nil { return nil, err } - success, ok := result.(*GetV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVotedOK) + success, ok := result.(*CreateIncidentRoleAssignmentCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1AiSummarizeIncidentIncidentIdGeneratedSummaryIdVoted: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_role_assignment: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Incidents lists incidents +CreateIncidentStatusPage adds a status page to an incident -List all of the incidents in the organization +Add a status page to an incident. */ -func (a *Client) GetV1Incidents(params *GetV1IncidentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsOK, error) { +func (a *Client) CreateIncidentStatusPage(params *CreateIncidentStatusPageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentStatusPageCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsParams() + params = NewCreateIncidentStatusPageParams() } op := &runtime.ClientOperation{ - ID: "getV1Incidents", - Method: "GET", - PathPattern: "/v1/incidents", + ID: "create_incident_status_page", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/status_pages", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsReader{formats: a.formats}, + Reader: &CreateIncidentStatusPageReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -586,35 +592,35 @@ func (a *Client) GetV1Incidents(params *GetV1IncidentsParams, authInfo runtime.C if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsOK) + success, ok := result.(*CreateIncidentStatusPageCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Incidents: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_status_page: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentID gets an incident +CreateIncidentTeamAssignment assigns a team to an incident -Retrieve a single incident from its ID +Assign a team for this incident */ -func (a *Client) GetV1IncidentsIncidentID(params *GetV1IncidentsIncidentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDOK, error) { +func (a *Client) CreateIncidentTeamAssignment(params *CreateIncidentTeamAssignmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentTeamAssignmentCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDParams() + params = NewCreateIncidentTeamAssignmentParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentId", - Method: "GET", - PathPattern: "/v1/incidents/{incident_id}", + ID: "create_incident_team_assignment", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/team_assignments", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDReader{formats: a.formats}, + Reader: &CreateIncidentTeamAssignmentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -627,35 +633,35 @@ func (a *Client) GetV1IncidentsIncidentID(params *GetV1IncidentsIncidentIDParams if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDOK) + success, ok := result.(*CreateIncidentTeamAssignmentCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_team_assignment: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDAttachments lists attachments for an incident +CreateScheduledMaintenance creates a scheduled maintenance event -List attachments for an incident +Create a new scheduled maintenance event */ -func (a *Client) GetV1IncidentsIncidentIDAttachments(params *GetV1IncidentsIncidentIDAttachmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDAttachmentsOK, error) { +func (a *Client) CreateScheduledMaintenance(params *CreateScheduledMaintenanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateScheduledMaintenanceCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDAttachmentsParams() + params = NewCreateScheduledMaintenanceParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdAttachments", - Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/attachments", + ID: "create_scheduled_maintenance", + Method: "POST", + PathPattern: "/v1/scheduled_maintenances", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDAttachmentsReader{formats: a.formats}, + Reader: &CreateScheduledMaintenanceReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -668,35 +674,35 @@ func (a *Client) GetV1IncidentsIncidentIDAttachments(params *GetV1IncidentsIncid if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDAttachmentsOK) + success, ok := result.(*CreateScheduledMaintenanceCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdAttachments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_scheduled_maintenance: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDChannel gets chat channel information for an incident +DeleteIncident archives an incident -Gives chat channel information for the specified incident +Archives an incident which will hide it from lists and metrics */ -func (a *Client) GetV1IncidentsIncidentIDChannel(params *GetV1IncidentsIncidentIDChannelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDChannelOK, error) { +func (a *Client) DeleteIncident(params *DeleteIncidentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDChannelParams() + params = NewDeleteIncidentParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdChannel", - Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/channel", + ID: "delete_incident", + Method: "DELETE", + PathPattern: "/v1/incidents/{incident_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDChannelReader{formats: a.formats}, + Reader: &DeleteIncidentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -709,35 +715,35 @@ func (a *Client) GetV1IncidentsIncidentIDChannel(params *GetV1IncidentsIncidentI if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDChannelOK) + success, ok := result.(*DeleteIncidentOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdChannel: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_incident: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDConferenceBridges retrieves all conference bridges for an incident +DeleteIncidentChatMessage deletes a chat message from an incident -Retrieve all conference bridges for an incident +Delete an existing generic chat message on an incident. */ -func (a *Client) GetV1IncidentsIncidentIDConferenceBridges(params *GetV1IncidentsIncidentIDConferenceBridgesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDConferenceBridgesOK, error) { +func (a *Client) DeleteIncidentChatMessage(params *DeleteIncidentChatMessageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentChatMessageOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDConferenceBridgesParams() + params = NewDeleteIncidentChatMessageParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdConferenceBridges", - Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/conference_bridges", + ID: "delete_incident_chat_message", + Method: "DELETE", + PathPattern: "/v1/incidents/{incident_id}/generic_chat_messages/{message_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDConferenceBridgesReader{formats: a.formats}, + Reader: &DeleteIncidentChatMessageReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -750,35 +756,35 @@ func (a *Client) GetV1IncidentsIncidentIDConferenceBridges(params *GetV1Incident if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDConferenceBridgesOK) + success, ok := result.(*DeleteIncidentChatMessageOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdConferenceBridges: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_incident_chat_message: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDConferenceBridgesIDTranslationsLanguageCode retrieves the translations for a specific conference bridge +DeleteIncidentEvent deletes an incident event -Retrieve the translations for a specific conference bridge +Delete an event for an incident */ -func (a *Client) GetV1IncidentsIncidentIDConferenceBridgesIDTranslationsLanguageCode(params *GetV1IncidentsIncidentIDConferenceBridgesIDTranslationsLanguageCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDConferenceBridgesIDTranslationsLanguageCodeOK, error) { +func (a *Client) DeleteIncidentEvent(params *DeleteIncidentEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentEventOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDConferenceBridgesIDTranslationsLanguageCodeParams() + params = NewDeleteIncidentEventParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdConferenceBridgesIdTranslationsLanguageCode", - Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/conference_bridges/{id}/translations/{language_code}", + ID: "delete_incident_event", + Method: "DELETE", + PathPattern: "/v1/incidents/{incident_id}/events/{event_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDConferenceBridgesIDTranslationsLanguageCodeReader{formats: a.formats}, + Reader: &DeleteIncidentEventReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -791,35 +797,35 @@ func (a *Client) GetV1IncidentsIncidentIDConferenceBridgesIDTranslationsLanguage if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDConferenceBridgesIDTranslationsLanguageCodeOK) + success, ok := result.(*DeleteIncidentEventOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdConferenceBridgesIdTranslationsLanguageCode: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_incident_event: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDEvents lists events for an incident +DeleteIncidentImpact removes impacted infrastructure from an incident -List all events for an incident. An event is a timeline entry. This can be filtered with params to retrieve events of a certain type. +Remove impacted infrastructure from an incident */ -func (a *Client) GetV1IncidentsIncidentIDEvents(params *GetV1IncidentsIncidentIDEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDEventsOK, error) { +func (a *Client) DeleteIncidentImpact(params *DeleteIncidentImpactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentImpactNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDEventsParams() + params = NewDeleteIncidentImpactParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdEvents", - Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/events", + ID: "delete_incident_impact", + Method: "DELETE", + PathPattern: "/v1/incidents/{incident_id}/impact/{type}/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDEventsReader{formats: a.formats}, + Reader: &DeleteIncidentImpactReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -832,35 +838,35 @@ func (a *Client) GetV1IncidentsIncidentIDEvents(params *GetV1IncidentsIncidentID if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDEventsOK) + success, ok := result.(*DeleteIncidentImpactNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_incident_impact: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDEventsEventID gets an incident event +DeleteIncidentLink removes a link from an incident -Retrieve a single event for an incident +Remove a link from an incident */ -func (a *Client) GetV1IncidentsIncidentIDEventsEventID(params *GetV1IncidentsIncidentIDEventsEventIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDEventsEventIDOK, error) { +func (a *Client) DeleteIncidentLink(params *DeleteIncidentLinkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentLinkNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDEventsEventIDParams() + params = NewDeleteIncidentLinkParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdEventsEventId", - Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/events/{event_id}", + ID: "delete_incident_link", + Method: "DELETE", + PathPattern: "/v1/incidents/{incident_id}/links/{link_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDEventsEventIDReader{formats: a.formats}, + Reader: &DeleteIncidentLinkReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -873,35 +879,35 @@ func (a *Client) GetV1IncidentsIncidentIDEventsEventID(params *GetV1IncidentsInc if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDEventsEventIDOK) + success, ok := result.(*DeleteIncidentLinkNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdEventsEventId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_incident_link: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDImpactType lists impacted infrastructure for an incident +DeleteIncidentRoleAssignment unassigns a user from an incident -List impacted infrastructure on an incident by specifying type +Unassign a role from a user */ -func (a *Client) GetV1IncidentsIncidentIDImpactType(params *GetV1IncidentsIncidentIDImpactTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDImpactTypeOK, error) { +func (a *Client) DeleteIncidentRoleAssignment(params *DeleteIncidentRoleAssignmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentRoleAssignmentOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDImpactTypeParams() + params = NewDeleteIncidentRoleAssignmentParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdImpactType", - Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/impact/{type}", + ID: "delete_incident_role_assignment", + Method: "DELETE", + PathPattern: "/v1/incidents/{incident_id}/role_assignments/{role_assignment_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDImpactTypeReader{formats: a.formats}, + Reader: &DeleteIncidentRoleAssignmentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -914,35 +920,35 @@ func (a *Client) GetV1IncidentsIncidentIDImpactType(params *GetV1IncidentsIncide if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDImpactTypeOK) + success, ok := result.(*DeleteIncidentRoleAssignmentOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdImpactType: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_incident_role_assignment: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDLinks lists links on an incident +DeleteIncidentTeamAssignment unassigns a team from an incident -List all the editable, external incident links attached to an incident +Unassign a team from an incident */ -func (a *Client) GetV1IncidentsIncidentIDLinks(params *GetV1IncidentsIncidentIDLinksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDLinksOK, error) { +func (a *Client) DeleteIncidentTeamAssignment(params *DeleteIncidentTeamAssignmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentTeamAssignmentNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDLinksParams() + params = NewDeleteIncidentTeamAssignmentParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdLinks", - Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/links", + ID: "delete_incident_team_assignment", + Method: "DELETE", + PathPattern: "/v1/incidents/{incident_id}/team_assignments/{team_assignment_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDLinksReader{formats: a.formats}, + Reader: &DeleteIncidentTeamAssignmentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -955,35 +961,35 @@ func (a *Client) GetV1IncidentsIncidentIDLinks(params *GetV1IncidentsIncidentIDL if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDLinksOK) + success, ok := result.(*DeleteIncidentTeamAssignmentNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdLinks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_incident_team_assignment: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDMilestones lists incident milestones +DeleteScheduledMaintenance deletes a scheduled maintenance event -List times and durations for each milestone on an incident +Delete a scheduled maintenance event, preventing it from taking place. */ -func (a *Client) GetV1IncidentsIncidentIDMilestones(params *GetV1IncidentsIncidentIDMilestonesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDMilestonesOK, error) { +func (a *Client) DeleteScheduledMaintenance(params *DeleteScheduledMaintenanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteScheduledMaintenanceNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDMilestonesParams() + params = NewDeleteScheduledMaintenanceParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdMilestones", - Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/milestones", + ID: "delete_scheduled_maintenance", + Method: "DELETE", + PathPattern: "/v1/scheduled_maintenances/{scheduled_maintenance_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDMilestonesReader{formats: a.formats}, + Reader: &DeleteScheduledMaintenanceReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -996,35 +1002,35 @@ func (a *Client) GetV1IncidentsIncidentIDMilestones(params *GetV1IncidentsIncide if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDMilestonesOK) + success, ok := result.(*DeleteScheduledMaintenanceNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdMilestones: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_scheduled_maintenance: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDRelatedChangeEvents lists related changes on an incident +DeleteTranscriptEntry deletes a transcript from an incident -List related changes that have been attached to an incident +Delete a transcript from an incident */ -func (a *Client) GetV1IncidentsIncidentIDRelatedChangeEvents(params *GetV1IncidentsIncidentIDRelatedChangeEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDRelatedChangeEventsOK, error) { +func (a *Client) DeleteTranscriptEntry(params *DeleteTranscriptEntryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTranscriptEntryOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDRelatedChangeEventsParams() + params = NewDeleteTranscriptEntryParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdRelatedChangeEvents", - Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/related_change_events", + ID: "delete_transcript_entry", + Method: "DELETE", + PathPattern: "/v1/incidents/{incident_id}/transcript/{transcript_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDRelatedChangeEventsReader{formats: a.formats}, + Reader: &DeleteTranscriptEntryReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1037,35 +1043,35 @@ func (a *Client) GetV1IncidentsIncidentIDRelatedChangeEvents(params *GetV1Incide if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDRelatedChangeEventsOK) + success, ok := result.(*DeleteTranscriptEntryOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdRelatedChangeEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_transcript_entry: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDRelationships lists incident relationships +GetAiIncidentSummaryVoteStatus gets the current user s vote status for an a i generated incident summary -List any parent/child relationships for an incident +Get the current user's vote status for an AI-generated incident summary */ -func (a *Client) GetV1IncidentsIncidentIDRelationships(params *GetV1IncidentsIncidentIDRelationshipsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDRelationshipsOK, error) { +func (a *Client) GetAiIncidentSummaryVoteStatus(params *GetAiIncidentSummaryVoteStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAiIncidentSummaryVoteStatusOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDRelationshipsParams() + params = NewGetAiIncidentSummaryVoteStatusParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdRelationships", + ID: "get_ai_incident_summary_vote_status", Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/relationships", + PathPattern: "/v1/ai/summarize_incident/{incident_id}/{generated_summary_id}/voted", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDRelationshipsReader{formats: a.formats}, + Reader: &GetAiIncidentSummaryVoteStatusReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1078,35 +1084,35 @@ func (a *Client) GetV1IncidentsIncidentIDRelationships(params *GetV1IncidentsInc if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDRelationshipsOK) + success, ok := result.(*GetAiIncidentSummaryVoteStatusOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdRelationships: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_ai_incident_summary_vote_status: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDRoleAssignments lists incident assignees +GetConferenceBridgeTranslation retrieves the translations for a specific conference bridge -Retrieve a list of all of the current role assignments for the incident +Retrieve the translations for a specific conference bridge */ -func (a *Client) GetV1IncidentsIncidentIDRoleAssignments(params *GetV1IncidentsIncidentIDRoleAssignmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDRoleAssignmentsOK, error) { +func (a *Client) GetConferenceBridgeTranslation(params *GetConferenceBridgeTranslationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetConferenceBridgeTranslationOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDRoleAssignmentsParams() + params = NewGetConferenceBridgeTranslationParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdRoleAssignments", + ID: "get_conference_bridge_translation", Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/role_assignments", + PathPattern: "/v1/incidents/{incident_id}/conference_bridges/{id}/translations/{language_code}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDRoleAssignmentsReader{formats: a.formats}, + Reader: &GetConferenceBridgeTranslationReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1119,35 +1125,35 @@ func (a *Client) GetV1IncidentsIncidentIDRoleAssignments(params *GetV1IncidentsI if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDRoleAssignmentsOK) + success, ok := result.(*GetConferenceBridgeTranslationOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdRoleAssignments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_conference_bridge_translation: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDSimilar lists similar incidents +GetIncident gets an incident -Retrieve a list of similar incidents +Retrieve a single incident from its ID */ -func (a *Client) GetV1IncidentsIncidentIDSimilar(params *GetV1IncidentsIncidentIDSimilarParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDSimilarOK, error) { +func (a *Client) GetIncident(params *GetIncidentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDSimilarParams() + params = NewGetIncidentParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdSimilar", + ID: "get_incident", Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/similar", + PathPattern: "/v1/incidents/{incident_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDSimilarReader{formats: a.formats}, + Reader: &GetIncidentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1160,35 +1166,35 @@ func (a *Client) GetV1IncidentsIncidentIDSimilar(params *GetV1IncidentsIncidentI if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDSimilarOK) + success, ok := result.(*GetIncidentOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdSimilar: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_incident: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDStatusPages lists status pages for an incident +GetIncidentChannel gets chat channel information for an incident -List status pages that are attached to an incident +Gives chat channel information for the specified incident */ -func (a *Client) GetV1IncidentsIncidentIDStatusPages(params *GetV1IncidentsIncidentIDStatusPagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDStatusPagesOK, error) { +func (a *Client) GetIncidentChannel(params *GetIncidentChannelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentChannelOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDStatusPagesParams() + params = NewGetIncidentChannelParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdStatusPages", + ID: "get_incident_channel", Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/status_pages", + PathPattern: "/v1/incidents/{incident_id}/channel", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDStatusPagesReader{formats: a.formats}, + Reader: &GetIncidentChannelReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1201,35 +1207,35 @@ func (a *Client) GetV1IncidentsIncidentIDStatusPages(params *GetV1IncidentsIncid if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDStatusPagesOK) + success, ok := result.(*GetIncidentChannelOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdStatusPages: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_incident_channel: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDTranscript lists all of the messages in the incident s transcript +GetIncidentEvent gets an incident event -Retrieve the transcript for a specific incident +Retrieve a single event for an incident */ -func (a *Client) GetV1IncidentsIncidentIDTranscript(params *GetV1IncidentsIncidentIDTranscriptParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDTranscriptOK, error) { +func (a *Client) GetIncidentEvent(params *GetIncidentEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentEventOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDTranscriptParams() + params = NewGetIncidentEventParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdTranscript", + ID: "get_incident_event", Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/transcript", + PathPattern: "/v1/incidents/{incident_id}/events/{event_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDTranscriptReader{formats: a.formats}, + Reader: &GetIncidentEventReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1242,35 +1248,35 @@ func (a *Client) GetV1IncidentsIncidentIDTranscript(params *GetV1IncidentsIncide if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDTranscriptOK) + success, ok := result.(*GetIncidentEventOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdTranscript: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_incident_event: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDUsersUserID gets the current user s incident role +GetIncidentRelationships lists incident relationships -Retrieve a user with current roles for an incident +List any parent/child relationships for an incident */ -func (a *Client) GetV1IncidentsIncidentIDUsersUserID(params *GetV1IncidentsIncidentIDUsersUserIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDUsersUserIDOK, error) { +func (a *Client) GetIncidentRelationships(params *GetIncidentRelationshipsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentRelationshipsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDUsersUserIDParams() + params = NewGetIncidentRelationshipsParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdUsersUserId", + ID: "get_incident_relationships", Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/users/{user_id}", + PathPattern: "/v1/incidents/{incident_id}/relationships", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDUsersUserIDReader{formats: a.formats}, + Reader: &GetIncidentRelationshipsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1283,35 +1289,35 @@ func (a *Client) GetV1IncidentsIncidentIDUsersUserID(params *GetV1IncidentsIncid if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDUsersUserIDOK) + success, ok := result.(*GetIncidentRelationshipsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdUsersUserId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_incident_relationships: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ScheduledMaintenances lists scheduled maintenance events +GetIncidentUser gets the current user s incident role -Lists all scheduled maintenance events +Retrieve a user with current roles for an incident */ -func (a *Client) GetV1ScheduledMaintenances(params *GetV1ScheduledMaintenancesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ScheduledMaintenancesOK, error) { +func (a *Client) GetIncidentUser(params *GetIncidentUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentUserOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ScheduledMaintenancesParams() + params = NewGetIncidentUserParams() } op := &runtime.ClientOperation{ - ID: "getV1ScheduledMaintenances", + ID: "get_incident_user", Method: "GET", - PathPattern: "/v1/scheduled_maintenances", + PathPattern: "/v1/incidents/{incident_id}/users/{user_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ScheduledMaintenancesReader{formats: a.formats}, + Reader: &GetIncidentUserReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1324,35 +1330,35 @@ func (a *Client) GetV1ScheduledMaintenances(params *GetV1ScheduledMaintenancesPa if err != nil { return nil, err } - success, ok := result.(*GetV1ScheduledMaintenancesOK) + success, ok := result.(*GetIncidentUserOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ScheduledMaintenances: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_incident_user: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ScheduledMaintenancesScheduledMaintenanceID gets a scheduled maintenance event +GetScheduledMaintenance gets a scheduled maintenance event Fetch the details of a scheduled maintenance event. */ -func (a *Client) GetV1ScheduledMaintenancesScheduledMaintenanceID(params *GetV1ScheduledMaintenancesScheduledMaintenanceIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ScheduledMaintenancesScheduledMaintenanceIDOK, error) { +func (a *Client) GetScheduledMaintenance(params *GetScheduledMaintenanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetScheduledMaintenanceOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ScheduledMaintenancesScheduledMaintenanceIDParams() + params = NewGetScheduledMaintenanceParams() } op := &runtime.ClientOperation{ - ID: "getV1ScheduledMaintenancesScheduledMaintenanceId", + ID: "get_scheduled_maintenance", Method: "GET", PathPattern: "/v1/scheduled_maintenances/{scheduled_maintenance_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ScheduledMaintenancesScheduledMaintenanceIDReader{formats: a.formats}, + Reader: &GetScheduledMaintenanceReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1365,35 +1371,35 @@ func (a *Client) GetV1ScheduledMaintenancesScheduledMaintenanceID(params *GetV1S if err != nil { return nil, err } - success, ok := result.(*GetV1ScheduledMaintenancesScheduledMaintenanceIDOK) + success, ok := result.(*GetScheduledMaintenanceOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ScheduledMaintenancesScheduledMaintenanceId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_scheduled_maintenance: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IncidentsIncidentID updates an incident +ListIncidentAttachments lists attachments for an incident -Updates an incident with provided parameters +List attachments for an incident */ -func (a *Client) PatchV1IncidentsIncidentID(params *PatchV1IncidentsIncidentIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDOK, error) { +func (a *Client) ListIncidentAttachments(params *ListIncidentAttachmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentAttachmentsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IncidentsIncidentIDParams() + params = NewListIncidentAttachmentsParams() } op := &runtime.ClientOperation{ - ID: "patchV1IncidentsIncidentId", - Method: "PATCH", - PathPattern: "/v1/incidents/{incident_id}", + ID: "list_incident_attachments", + Method: "GET", + PathPattern: "/v1/incidents/{incident_id}/attachments", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IncidentsIncidentIDReader{formats: a.formats}, + Reader: &ListIncidentAttachmentsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1406,35 +1412,35 @@ func (a *Client) PatchV1IncidentsIncidentID(params *PatchV1IncidentsIncidentIDPa if err != nil { return nil, err } - success, ok := result.(*PatchV1IncidentsIncidentIDOK) + success, ok := result.(*ListIncidentAttachmentsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IncidentsIncidentId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_attachments: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IncidentsIncidentIDEventsEventID updates an incident event +ListIncidentChangeEvents lists related changes on an incident -Update a single event for an incident +List related changes that have been attached to an incident */ -func (a *Client) PatchV1IncidentsIncidentIDEventsEventID(params *PatchV1IncidentsIncidentIDEventsEventIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDEventsEventIDOK, error) { +func (a *Client) ListIncidentChangeEvents(params *ListIncidentChangeEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentChangeEventsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IncidentsIncidentIDEventsEventIDParams() + params = NewListIncidentChangeEventsParams() } op := &runtime.ClientOperation{ - ID: "patchV1IncidentsIncidentIdEventsEventId", - Method: "PATCH", - PathPattern: "/v1/incidents/{incident_id}/events/{event_id}", + ID: "list_incident_change_events", + Method: "GET", + PathPattern: "/v1/incidents/{incident_id}/related_change_events", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IncidentsIncidentIDEventsEventIDReader{formats: a.formats}, + Reader: &ListIncidentChangeEventsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1447,35 +1453,35 @@ func (a *Client) PatchV1IncidentsIncidentIDEventsEventID(params *PatchV1Incident if err != nil { return nil, err } - success, ok := result.(*PatchV1IncidentsIncidentIDEventsEventIDOK) + success, ok := result.(*ListIncidentChangeEventsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IncidentsIncidentIdEventsEventId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_change_events: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IncidentsIncidentIDGenericChatMessagesMessageID updates a chat message on an incident +ListIncidentConferenceBridges retrieves all conference bridges for an incident -Update an existing generic chat message on an incident. +Retrieve all conference bridges for an incident */ -func (a *Client) PatchV1IncidentsIncidentIDGenericChatMessagesMessageID(params *PatchV1IncidentsIncidentIDGenericChatMessagesMessageIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDGenericChatMessagesMessageIDOK, error) { +func (a *Client) ListIncidentConferenceBridges(params *ListIncidentConferenceBridgesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentConferenceBridgesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IncidentsIncidentIDGenericChatMessagesMessageIDParams() + params = NewListIncidentConferenceBridgesParams() } op := &runtime.ClientOperation{ - ID: "patchV1IncidentsIncidentIdGenericChatMessagesMessageId", - Method: "PATCH", - PathPattern: "/v1/incidents/{incident_id}/generic_chat_messages/{message_id}", + ID: "list_incident_conference_bridges", + Method: "GET", + PathPattern: "/v1/incidents/{incident_id}/conference_bridges", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IncidentsIncidentIDGenericChatMessagesMessageIDReader{formats: a.formats}, + Reader: &ListIncidentConferenceBridgesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1488,42 +1494,35 @@ func (a *Client) PatchV1IncidentsIncidentIDGenericChatMessagesMessageID(params * if err != nil { return nil, err } - success, ok := result.(*PatchV1IncidentsIncidentIDGenericChatMessagesMessageIDOK) + success, ok := result.(*ListIncidentConferenceBridgesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IncidentsIncidentIdGenericChatMessagesMessageId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_conference_bridges: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - PatchV1IncidentsIncidentIDImpact updates impacts for an incident +ListIncidentEvents lists events for an incident - Allows updating an incident's impacted infrastructure, with the option to - -move the incident into a different milestone and provide a note to update -the incident timeline and any attached status pages. If this method is -requested with the PUT verb, impacts will be completely replaced with the -information in the request body, even if not provided (effectively clearing -all impacts). If this method is requested with the PATCH verb, the provided -impacts will be added or updated, but no impacts will be removed. +List all events for an incident. An event is a timeline entry. This can be filtered with params to retrieve events of a certain type. */ -func (a *Client) PatchV1IncidentsIncidentIDImpact(params *PatchV1IncidentsIncidentIDImpactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDImpactOK, error) { +func (a *Client) ListIncidentEvents(params *ListIncidentEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentEventsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IncidentsIncidentIDImpactParams() + params = NewListIncidentEventsParams() } op := &runtime.ClientOperation{ - ID: "patchV1IncidentsIncidentIdImpact", - Method: "PATCH", - PathPattern: "/v1/incidents/{incident_id}/impact", + ID: "list_incident_events", + Method: "GET", + PathPattern: "/v1/incidents/{incident_id}/events", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IncidentsIncidentIDImpactReader{formats: a.formats}, + Reader: &ListIncidentEventsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1536,35 +1535,35 @@ func (a *Client) PatchV1IncidentsIncidentIDImpact(params *PatchV1IncidentsIncide if err != nil { return nil, err } - success, ok := result.(*PatchV1IncidentsIncidentIDImpactOK) + success, ok := result.(*ListIncidentEventsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IncidentsIncidentIdImpact: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_events: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IncidentsIncidentIDNotesNoteID updates a note +ListIncidentImpacts lists impacted infrastructure for an incident -Updates the body of a note +List impacted infrastructure on an incident by specifying type */ -func (a *Client) PatchV1IncidentsIncidentIDNotesNoteID(params *PatchV1IncidentsIncidentIDNotesNoteIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDNotesNoteIDOK, error) { +func (a *Client) ListIncidentImpacts(params *ListIncidentImpactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentImpactsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IncidentsIncidentIDNotesNoteIDParams() + params = NewListIncidentImpactsParams() } op := &runtime.ClientOperation{ - ID: "patchV1IncidentsIncidentIdNotesNoteId", - Method: "PATCH", - PathPattern: "/v1/incidents/{incident_id}/notes/{note_id}", + ID: "list_incident_impacts", + Method: "GET", + PathPattern: "/v1/incidents/{incident_id}/impact/{type}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IncidentsIncidentIDNotesNoteIDReader{formats: a.formats}, + Reader: &ListIncidentImpactsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1577,35 +1576,35 @@ func (a *Client) PatchV1IncidentsIncidentIDNotesNoteID(params *PatchV1IncidentsI if err != nil { return nil, err } - success, ok := result.(*PatchV1IncidentsIncidentIDNotesNoteIDOK) + success, ok := result.(*ListIncidentImpactsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IncidentsIncidentIdNotesNoteId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_impacts: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IncidentsIncidentIDRelatedChangeEventsRelatedChangeEventID updates a change attached to an incident +ListIncidentLinks lists links on an incident -Update a change attached to an incident +List all the editable, external incident links attached to an incident */ -func (a *Client) PatchV1IncidentsIncidentIDRelatedChangeEventsRelatedChangeEventID(params *PatchV1IncidentsIncidentIDRelatedChangeEventsRelatedChangeEventIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDRelatedChangeEventsRelatedChangeEventIDOK, error) { +func (a *Client) ListIncidentLinks(params *ListIncidentLinksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentLinksOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IncidentsIncidentIDRelatedChangeEventsRelatedChangeEventIDParams() + params = NewListIncidentLinksParams() } op := &runtime.ClientOperation{ - ID: "patchV1IncidentsIncidentIdRelatedChangeEventsRelatedChangeEventId", - Method: "PATCH", - PathPattern: "/v1/incidents/{incident_id}/related_change_events/{related_change_event_id}", + ID: "list_incident_links", + Method: "GET", + PathPattern: "/v1/incidents/{incident_id}/links", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IncidentsIncidentIDRelatedChangeEventsRelatedChangeEventIDReader{formats: a.formats}, + Reader: &ListIncidentLinksReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1618,35 +1617,35 @@ func (a *Client) PatchV1IncidentsIncidentIDRelatedChangeEventsRelatedChangeEvent if err != nil { return nil, err } - success, ok := result.(*PatchV1IncidentsIncidentIDRelatedChangeEventsRelatedChangeEventIDOK) + success, ok := result.(*ListIncidentLinksOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IncidentsIncidentIdRelatedChangeEventsRelatedChangeEventId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_links: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1ScheduledMaintenancesScheduledMaintenanceID updates a scheduled maintenance event +ListIncidentMilestones lists incident milestones -Change the conditions of a scheduled maintenance event, including updating any status page announcements of changes. +List times and durations for each milestone on an incident */ -func (a *Client) PatchV1ScheduledMaintenancesScheduledMaintenanceID(params *PatchV1ScheduledMaintenancesScheduledMaintenanceIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1ScheduledMaintenancesScheduledMaintenanceIDOK, error) { +func (a *Client) ListIncidentMilestones(params *ListIncidentMilestonesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentMilestonesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1ScheduledMaintenancesScheduledMaintenanceIDParams() + params = NewListIncidentMilestonesParams() } op := &runtime.ClientOperation{ - ID: "patchV1ScheduledMaintenancesScheduledMaintenanceId", - Method: "PATCH", - PathPattern: "/v1/scheduled_maintenances/{scheduled_maintenance_id}", + ID: "list_incident_milestones", + Method: "GET", + PathPattern: "/v1/incidents/{incident_id}/milestones", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1ScheduledMaintenancesScheduledMaintenanceIDReader{formats: a.formats}, + Reader: &ListIncidentMilestonesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1659,35 +1658,35 @@ func (a *Client) PatchV1ScheduledMaintenancesScheduledMaintenanceID(params *Patc if err != nil { return nil, err } - success, ok := result.(*PatchV1ScheduledMaintenancesScheduledMaintenanceIDOK) + success, ok := result.(*ListIncidentMilestonesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1ScheduledMaintenancesScheduledMaintenanceId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_milestones: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1Incidents creates an incident +ListIncidentRoleAssignments lists incident assignees -Create a new incident +Retrieve a list of all of the current role assignments for the incident */ -func (a *Client) PostV1Incidents(params *PostV1IncidentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsCreated, error) { +func (a *Client) ListIncidentRoleAssignments(params *ListIncidentRoleAssignmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentRoleAssignmentsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsParams() + params = NewListIncidentRoleAssignmentsParams() } op := &runtime.ClientOperation{ - ID: "postV1Incidents", - Method: "POST", - PathPattern: "/v1/incidents", + ID: "list_incident_role_assignments", + Method: "GET", + PathPattern: "/v1/incidents/{incident_id}/role_assignments", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsReader{formats: a.formats}, + Reader: &ListIncidentRoleAssignmentsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1700,35 +1699,35 @@ func (a *Client) PostV1Incidents(params *PostV1IncidentsParams, authInfo runtime if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsCreated) + success, ok := result.(*ListIncidentRoleAssignmentsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1Incidents: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_role_assignments: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDAttachments adds an attachment to the incident timeline +ListIncidentStatusPages lists status pages for an incident -Allows adding image attachments to an incident +List status pages that are attached to an incident */ -func (a *Client) PostV1IncidentsIncidentIDAttachments(params *PostV1IncidentsIncidentIDAttachmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDAttachmentsCreated, error) { +func (a *Client) ListIncidentStatusPages(params *ListIncidentStatusPagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentStatusPagesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDAttachmentsParams() + params = NewListIncidentStatusPagesParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdAttachments", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/attachments", + ID: "list_incident_status_pages", + Method: "GET", + PathPattern: "/v1/incidents/{incident_id}/status_pages", ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"multipart/form-data"}, + ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDAttachmentsReader{formats: a.formats}, + Reader: &ListIncidentStatusPagesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1741,35 +1740,35 @@ func (a *Client) PostV1IncidentsIncidentIDAttachments(params *PostV1IncidentsInc if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDAttachmentsCreated) + success, ok := result.(*ListIncidentStatusPagesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdAttachments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_status_pages: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDGenericChatMessages adds a chat message to an incident +ListIncidents lists incidents -Create a new generic chat message on an incident timeline. These are independent of any specific chat provider. +List all of the incidents in the organization */ -func (a *Client) PostV1IncidentsIncidentIDGenericChatMessages(params *PostV1IncidentsIncidentIDGenericChatMessagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDGenericChatMessagesCreated, error) { +func (a *Client) ListIncidents(params *ListIncidentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDGenericChatMessagesParams() + params = NewListIncidentsParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdGenericChatMessages", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/generic_chat_messages", + ID: "list_incidents", + Method: "GET", + PathPattern: "/v1/incidents", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDGenericChatMessagesReader{formats: a.formats}, + Reader: &ListIncidentsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1782,35 +1781,35 @@ func (a *Client) PostV1IncidentsIncidentIDGenericChatMessages(params *PostV1Inci if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDGenericChatMessagesCreated) + success, ok := result.(*ListIncidentsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdGenericChatMessages: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incidents: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDImpactType adds impacted infrastructure to an incident +ListScheduledMaintenances lists scheduled maintenance events -Add impacted infrastructure to an incident +Lists all scheduled maintenance events */ -func (a *Client) PostV1IncidentsIncidentIDImpactType(params *PostV1IncidentsIncidentIDImpactTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDImpactTypeCreated, error) { +func (a *Client) ListScheduledMaintenances(params *ListScheduledMaintenancesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListScheduledMaintenancesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDImpactTypeParams() + params = NewListScheduledMaintenancesParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdImpactType", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/impact/{type}", + ID: "list_scheduled_maintenances", + Method: "GET", + PathPattern: "/v1/scheduled_maintenances", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDImpactTypeReader{formats: a.formats}, + Reader: &ListScheduledMaintenancesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1823,35 +1822,35 @@ func (a *Client) PostV1IncidentsIncidentIDImpactType(params *PostV1IncidentsInci if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDImpactTypeCreated) + success, ok := result.(*ListScheduledMaintenancesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdImpactType: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_scheduled_maintenances: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDLinks adds a link to an incident +ListSimilarIncidents lists similar incidents -Allows adding adhoc links to an incident as an attachment +Retrieve a list of similar incidents */ -func (a *Client) PostV1IncidentsIncidentIDLinks(params *PostV1IncidentsIncidentIDLinksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDLinksCreated, error) { +func (a *Client) ListSimilarIncidents(params *ListSimilarIncidentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSimilarIncidentsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDLinksParams() + params = NewListSimilarIncidentsParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdLinks", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/links", + ID: "list_similar_incidents", + Method: "GET", + PathPattern: "/v1/incidents/{incident_id}/similar", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDLinksReader{formats: a.formats}, + Reader: &ListSimilarIncidentsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1864,35 +1863,35 @@ func (a *Client) PostV1IncidentsIncidentIDLinks(params *PostV1IncidentsIncidentI if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDLinksCreated) + success, ok := result.(*ListSimilarIncidentsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdLinks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_similar_incidents: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDNotes adds a note to an incident +ListTranscriptEntries lists all of the messages in the incident s transcript -Create a new note on for an incident. The visibility field on a note determines where it gets posted. +Retrieve the transcript for a specific incident */ -func (a *Client) PostV1IncidentsIncidentIDNotes(params *PostV1IncidentsIncidentIDNotesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDNotesCreated, error) { +func (a *Client) ListTranscriptEntries(params *ListTranscriptEntriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTranscriptEntriesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDNotesParams() + params = NewListTranscriptEntriesParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdNotes", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/notes", + ID: "list_transcript_entries", + Method: "GET", + PathPattern: "/v1/incidents/{incident_id}/transcript", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDNotesReader{formats: a.formats}, + Reader: &ListTranscriptEntriesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1905,35 +1904,35 @@ func (a *Client) PostV1IncidentsIncidentIDNotes(params *PostV1IncidentsIncidentI if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDNotesCreated) + success, ok := result.(*ListTranscriptEntriesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdNotes: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_transcript_entries: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDRelatedChangeEvents adds a related change to an incident +ResolveIncident resolves an incident -Add a related change to an incident. Changes added to an incident can be causes, fixes, or suspects. To remove a change from an incident, the type field should be set to dismissed. +Resolves a currently active incident */ -func (a *Client) PostV1IncidentsIncidentIDRelatedChangeEvents(params *PostV1IncidentsIncidentIDRelatedChangeEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDRelatedChangeEventsCreated, error) { +func (a *Client) ResolveIncident(params *ResolveIncidentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ResolveIncidentOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDRelatedChangeEventsParams() + params = NewResolveIncidentParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdRelatedChangeEvents", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/related_change_events", + ID: "resolve_incident", + Method: "PUT", + PathPattern: "/v1/incidents/{incident_id}/resolve", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDRelatedChangeEventsReader{formats: a.formats}, + Reader: &ResolveIncidentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1946,35 +1945,35 @@ func (a *Client) PostV1IncidentsIncidentIDRelatedChangeEvents(params *PostV1Inci if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDRelatedChangeEventsCreated) + success, ok := result.(*ResolveIncidentOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdRelatedChangeEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for resolve_incident: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDRoleAssignments assigns a user to an incident +UnarchiveIncident unarchives an incident -Assign a role to a user for this incident +Unarchive an incident */ -func (a *Client) PostV1IncidentsIncidentIDRoleAssignments(params *PostV1IncidentsIncidentIDRoleAssignmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDRoleAssignmentsCreated, error) { +func (a *Client) UnarchiveIncident(params *UnarchiveIncidentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UnarchiveIncidentCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDRoleAssignmentsParams() + params = NewUnarchiveIncidentParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdRoleAssignments", + ID: "unarchive_incident", Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/role_assignments", + PathPattern: "/v1/incidents/{incident_id}/unarchive", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDRoleAssignmentsReader{formats: a.formats}, + Reader: &UnarchiveIncidentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1987,35 +1986,35 @@ func (a *Client) PostV1IncidentsIncidentIDRoleAssignments(params *PostV1Incident if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDRoleAssignmentsCreated) + success, ok := result.(*UnarchiveIncidentCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdRoleAssignments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for unarchive_incident: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDStatusPages adds a status page to an incident +UpdateIncident updates an incident -Add a status page to an incident. +Updates an incident with provided parameters */ -func (a *Client) PostV1IncidentsIncidentIDStatusPages(params *PostV1IncidentsIncidentIDStatusPagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDStatusPagesCreated, error) { +func (a *Client) UpdateIncident(params *UpdateIncidentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDStatusPagesParams() + params = NewUpdateIncidentParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdStatusPages", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/status_pages", + ID: "update_incident", + Method: "PATCH", + PathPattern: "/v1/incidents/{incident_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDStatusPagesReader{formats: a.formats}, + Reader: &UpdateIncidentReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2028,35 +2027,35 @@ func (a *Client) PostV1IncidentsIncidentIDStatusPages(params *PostV1IncidentsInc if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDStatusPagesCreated) + success, ok := result.(*UpdateIncidentOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdStatusPages: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_incident: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDTeamAssignments assigns a team to an incident +UpdateIncidentChangeEvent updates a change attached to an incident -Assign a team for this incident +Update a change attached to an incident */ -func (a *Client) PostV1IncidentsIncidentIDTeamAssignments(params *PostV1IncidentsIncidentIDTeamAssignmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDTeamAssignmentsCreated, error) { +func (a *Client) UpdateIncidentChangeEvent(params *UpdateIncidentChangeEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentChangeEventOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDTeamAssignmentsParams() + params = NewUpdateIncidentChangeEventParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdTeamAssignments", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/team_assignments", + ID: "update_incident_change_event", + Method: "PATCH", + PathPattern: "/v1/incidents/{incident_id}/related_change_events/{related_change_event_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDTeamAssignmentsReader{formats: a.formats}, + Reader: &UpdateIncidentChangeEventReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2069,35 +2068,35 @@ func (a *Client) PostV1IncidentsIncidentIDTeamAssignments(params *PostV1Incident if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDTeamAssignmentsCreated) + success, ok := result.(*UpdateIncidentChangeEventOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdTeamAssignments: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_incident_change_event: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDUnarchive unarchives an incident +UpdateIncidentChatMessage updates a chat message on an incident -Unarchive an incident +Update an existing generic chat message on an incident. */ -func (a *Client) PostV1IncidentsIncidentIDUnarchive(params *PostV1IncidentsIncidentIDUnarchiveParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDUnarchiveCreated, error) { +func (a *Client) UpdateIncidentChatMessage(params *UpdateIncidentChatMessageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentChatMessageOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDUnarchiveParams() + params = NewUpdateIncidentChatMessageParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdUnarchive", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/unarchive", + ID: "update_incident_chat_message", + Method: "PATCH", + PathPattern: "/v1/incidents/{incident_id}/generic_chat_messages/{message_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDUnarchiveReader{formats: a.formats}, + Reader: &UpdateIncidentChatMessageReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2110,35 +2109,35 @@ func (a *Client) PostV1IncidentsIncidentIDUnarchive(params *PostV1IncidentsIncid if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDUnarchiveCreated) + success, ok := result.(*UpdateIncidentChatMessageOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdUnarchive: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_incident_chat_message: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1ScheduledMaintenances creates a scheduled maintenance event +UpdateIncidentEvent updates an incident event -Create a new scheduled maintenance event +Update a single event for an incident */ -func (a *Client) PostV1ScheduledMaintenances(params *PostV1ScheduledMaintenancesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ScheduledMaintenancesCreated, error) { +func (a *Client) UpdateIncidentEvent(params *UpdateIncidentEventParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentEventOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1ScheduledMaintenancesParams() + params = NewUpdateIncidentEventParams() } op := &runtime.ClientOperation{ - ID: "postV1ScheduledMaintenances", - Method: "POST", - PathPattern: "/v1/scheduled_maintenances", + ID: "update_incident_event", + Method: "PATCH", + PathPattern: "/v1/incidents/{incident_id}/events/{event_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1ScheduledMaintenancesReader{formats: a.formats}, + Reader: &UpdateIncidentEventReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2151,35 +2150,42 @@ func (a *Client) PostV1ScheduledMaintenances(params *PostV1ScheduledMaintenances if err != nil { return nil, err } - success, ok := result.(*PostV1ScheduledMaintenancesCreated) + success, ok := result.(*UpdateIncidentEventOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1ScheduledMaintenances: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_incident_event: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVote votes on an a i generated incident summary + UpdateIncidentImpactPatch updates impacts for an incident -Vote on an AI-generated incident summary for the current user + Allows updating an incident's impacted infrastructure, with the option to + +move the incident into a different milestone and provide a note to update +the incident timeline and any attached status pages. If this method is +requested with the PUT verb, impacts will be completely replaced with the +information in the request body, even if not provided (effectively clearing +all impacts). If this method is requested with the PATCH verb, the provided +impacts will be added or updated, but no impacts will be removed. */ -func (a *Client) PutV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVote(params *PutV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVoteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVoteOK, error) { +func (a *Client) UpdateIncidentImpactPatch(params *UpdateIncidentImpactPatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentImpactPatchOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVoteParams() + params = NewUpdateIncidentImpactPatchParams() } op := &runtime.ClientOperation{ - ID: "putV1AiSummarizeIncidentIncidentIdGeneratedSummaryIdVote", - Method: "PUT", - PathPattern: "/v1/ai/summarize_incident/{incident_id}/{generated_summary_id}/vote", + ID: "update_incident_impact_patch", + Method: "PATCH", + PathPattern: "/v1/incidents/{incident_id}/impact", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVoteReader{formats: a.formats}, + Reader: &UpdateIncidentImpactPatchReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2192,35 +2198,42 @@ func (a *Client) PutV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVote(params if err != nil { return nil, err } - success, ok := result.(*PutV1AiSummarizeIncidentIncidentIDGeneratedSummaryIDVoteOK) + success, ok := result.(*UpdateIncidentImpactPatchOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1AiSummarizeIncidentIncidentIdGeneratedSummaryIdVote: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_incident_impact_patch: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1IncidentsIncidentIDClose closes an incident + UpdateIncidentImpactPut updates impacts for an incident -Closes an incident and optionally close all children + Allows updating an incident's impacted infrastructure, with the option to + +move the incident into a different milestone and provide a note to update +the incident timeline and any attached status pages. If this method is +requested with the PUT verb, impacts will be completely replaced with the +information in the request body, even if not provided (effectively clearing +all impacts). If this method is requested with the PATCH verb, the provided +impacts will be added or updated, but no impacts will be removed. */ -func (a *Client) PutV1IncidentsIncidentIDClose(params *PutV1IncidentsIncidentIDCloseParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1IncidentsIncidentIDCloseOK, error) { +func (a *Client) UpdateIncidentImpactPut(params *UpdateIncidentImpactPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentImpactPutOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1IncidentsIncidentIDCloseParams() + params = NewUpdateIncidentImpactPutParams() } op := &runtime.ClientOperation{ - ID: "putV1IncidentsIncidentIdClose", + ID: "update_incident_impact_put", Method: "PUT", - PathPattern: "/v1/incidents/{incident_id}/close", + PathPattern: "/v1/incidents/{incident_id}/impact", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1IncidentsIncidentIDCloseReader{formats: a.formats}, + Reader: &UpdateIncidentImpactPutReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2233,42 +2246,35 @@ func (a *Client) PutV1IncidentsIncidentIDClose(params *PutV1IncidentsIncidentIDC if err != nil { return nil, err } - success, ok := result.(*PutV1IncidentsIncidentIDCloseOK) + success, ok := result.(*UpdateIncidentImpactPutOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1IncidentsIncidentIdClose: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_incident_impact_put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - PutV1IncidentsIncidentIDImpact updates impacts for an incident +UpdateIncidentLink updates the external incident link - Allows updating an incident's impacted infrastructure, with the option to - -move the incident into a different milestone and provide a note to update -the incident timeline and any attached status pages. If this method is -requested with the PUT verb, impacts will be completely replaced with the -information in the request body, even if not provided (effectively clearing -all impacts). If this method is requested with the PATCH verb, the provided -impacts will be added or updated, but no impacts will be removed. +Update the external incident link attributes */ -func (a *Client) PutV1IncidentsIncidentIDImpact(params *PutV1IncidentsIncidentIDImpactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1IncidentsIncidentIDImpactOK, error) { +func (a *Client) UpdateIncidentLink(params *UpdateIncidentLinkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentLinkOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1IncidentsIncidentIDImpactParams() + params = NewUpdateIncidentLinkParams() } op := &runtime.ClientOperation{ - ID: "putV1IncidentsIncidentIdImpact", + ID: "update_incident_link", Method: "PUT", - PathPattern: "/v1/incidents/{incident_id}/impact", + PathPattern: "/v1/incidents/{incident_id}/links/{link_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1IncidentsIncidentIDImpactReader{formats: a.formats}, + Reader: &UpdateIncidentLinkReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2281,35 +2287,35 @@ func (a *Client) PutV1IncidentsIncidentIDImpact(params *PutV1IncidentsIncidentID if err != nil { return nil, err } - success, ok := result.(*PutV1IncidentsIncidentIDImpactOK) + success, ok := result.(*UpdateIncidentLinkOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1IncidentsIncidentIdImpact: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_incident_link: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1IncidentsIncidentIDLinksLinkID updates the external incident link +UpdateIncidentNote updates a note -Update the external incident link attributes +Updates the body of a note */ -func (a *Client) PutV1IncidentsIncidentIDLinksLinkID(params *PutV1IncidentsIncidentIDLinksLinkIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1IncidentsIncidentIDLinksLinkIDOK, error) { +func (a *Client) UpdateIncidentNote(params *UpdateIncidentNoteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentNoteOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1IncidentsIncidentIDLinksLinkIDParams() + params = NewUpdateIncidentNoteParams() } op := &runtime.ClientOperation{ - ID: "putV1IncidentsIncidentIdLinksLinkId", - Method: "PUT", - PathPattern: "/v1/incidents/{incident_id}/links/{link_id}", + ID: "update_incident_note", + Method: "PATCH", + PathPattern: "/v1/incidents/{incident_id}/notes/{note_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1IncidentsIncidentIDLinksLinkIDReader{formats: a.formats}, + Reader: &UpdateIncidentNoteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2322,41 +2328,35 @@ func (a *Client) PutV1IncidentsIncidentIDLinksLinkID(params *PutV1IncidentsIncid if err != nil { return nil, err } - success, ok := result.(*PutV1IncidentsIncidentIDLinksLinkIDOK) + success, ok := result.(*UpdateIncidentNoteOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1IncidentsIncidentIdLinksLinkId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_incident_note: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - PutV1IncidentsIncidentIDMilestonesBulkUpdate updates milestone times - - Update milestone times in bulk for a given incident. All milestone +UpdateScheduledMaintenance updates a scheduled maintenance event -times for an incident must occur in chronological order -corresponding to the configured order of milestones. If the result -of this request would cause any milestone(s) to appear out of place, -a 422 response will instead be returned. This includes milestones -not explicitly submitted or updated in this request. +Change the conditions of a scheduled maintenance event, including updating any status page announcements of changes. */ -func (a *Client) PutV1IncidentsIncidentIDMilestonesBulkUpdate(params *PutV1IncidentsIncidentIDMilestonesBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1IncidentsIncidentIDMilestonesBulkUpdateOK, error) { +func (a *Client) UpdateScheduledMaintenance(params *UpdateScheduledMaintenanceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateScheduledMaintenanceOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1IncidentsIncidentIDMilestonesBulkUpdateParams() + params = NewUpdateScheduledMaintenanceParams() } op := &runtime.ClientOperation{ - ID: "putV1IncidentsIncidentIdMilestonesBulkUpdate", - Method: "PUT", - PathPattern: "/v1/incidents/{incident_id}/milestones/bulk_update", + ID: "update_scheduled_maintenance", + Method: "PATCH", + PathPattern: "/v1/scheduled_maintenances/{scheduled_maintenance_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1IncidentsIncidentIDMilestonesBulkUpdateReader{formats: a.formats}, + Reader: &UpdateScheduledMaintenanceReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2369,35 +2369,35 @@ func (a *Client) PutV1IncidentsIncidentIDMilestonesBulkUpdate(params *PutV1Incid if err != nil { return nil, err } - success, ok := result.(*PutV1IncidentsIncidentIDMilestonesBulkUpdateOK) + success, ok := result.(*UpdateScheduledMaintenanceOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1IncidentsIncidentIdMilestonesBulkUpdate: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_scheduled_maintenance: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1IncidentsIncidentIDResolve resolves an incident +UpdateTranscriptAttribution updates the attribution of a transcript -Resolves a currently active incident +Update the attribution of a transcript */ -func (a *Client) PutV1IncidentsIncidentIDResolve(params *PutV1IncidentsIncidentIDResolveParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1IncidentsIncidentIDResolveOK, error) { +func (a *Client) UpdateTranscriptAttribution(params *UpdateTranscriptAttributionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTranscriptAttributionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1IncidentsIncidentIDResolveParams() + params = NewUpdateTranscriptAttributionParams() } op := &runtime.ClientOperation{ - ID: "putV1IncidentsIncidentIdResolve", + ID: "update_transcript_attribution", Method: "PUT", - PathPattern: "/v1/incidents/{incident_id}/resolve", + PathPattern: "/v1/incidents/{incident_id}/transcript/attribution", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1IncidentsIncidentIDResolveReader{formats: a.formats}, + Reader: &UpdateTranscriptAttributionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2410,35 +2410,35 @@ func (a *Client) PutV1IncidentsIncidentIDResolve(params *PutV1IncidentsIncidentI if err != nil { return nil, err } - success, ok := result.(*PutV1IncidentsIncidentIDResolveOK) + success, ok := result.(*UpdateTranscriptAttributionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1IncidentsIncidentIdResolve: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_transcript_attribution: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1IncidentsIncidentIDTranscriptAttribution updates the attribution of a transcript +VoteAiIncidentSummary votes on an a i generated incident summary -Update the attribution of a transcript +Vote on an AI-generated incident summary for the current user */ -func (a *Client) PutV1IncidentsIncidentIDTranscriptAttribution(params *PutV1IncidentsIncidentIDTranscriptAttributionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1IncidentsIncidentIDTranscriptAttributionOK, error) { +func (a *Client) VoteAiIncidentSummary(params *VoteAiIncidentSummaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VoteAiIncidentSummaryOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1IncidentsIncidentIDTranscriptAttributionParams() + params = NewVoteAiIncidentSummaryParams() } op := &runtime.ClientOperation{ - ID: "putV1IncidentsIncidentIdTranscriptAttribution", + ID: "vote_ai_incident_summary", Method: "PUT", - PathPattern: "/v1/incidents/{incident_id}/transcript/attribution", + PathPattern: "/v1/ai/summarize_incident/{incident_id}/{generated_summary_id}/vote", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1IncidentsIncidentIDTranscriptAttributionReader{formats: a.formats}, + Reader: &VoteAiIncidentSummaryReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2451,13 +2451,13 @@ func (a *Client) PutV1IncidentsIncidentIDTranscriptAttribution(params *PutV1Inci if err != nil { return nil, err } - success, ok := result.(*PutV1IncidentsIncidentIDTranscriptAttributionOK) + success, ok := result.(*VoteAiIncidentSummaryOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1IncidentsIncidentIdTranscriptAttribution: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for vote_ai_incident_summary: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/incidents/list_incident_attachments_parameters.go b/client/incidents/list_incident_attachments_parameters.go new file mode 100644 index 0000000..220ab1a --- /dev/null +++ b/client/incidents/list_incident_attachments_parameters.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListIncidentAttachmentsParams creates a new ListIncidentAttachmentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentAttachmentsParams() *ListIncidentAttachmentsParams { + return &ListIncidentAttachmentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentAttachmentsParamsWithTimeout creates a new ListIncidentAttachmentsParams object +// with the ability to set a timeout on a request. +func NewListIncidentAttachmentsParamsWithTimeout(timeout time.Duration) *ListIncidentAttachmentsParams { + return &ListIncidentAttachmentsParams{ + timeout: timeout, + } +} + +// NewListIncidentAttachmentsParamsWithContext creates a new ListIncidentAttachmentsParams object +// with the ability to set a context for a request. +func NewListIncidentAttachmentsParamsWithContext(ctx context.Context) *ListIncidentAttachmentsParams { + return &ListIncidentAttachmentsParams{ + Context: ctx, + } +} + +// NewListIncidentAttachmentsParamsWithHTTPClient creates a new ListIncidentAttachmentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentAttachmentsParamsWithHTTPClient(client *http.Client) *ListIncidentAttachmentsParams { + return &ListIncidentAttachmentsParams{ + HTTPClient: client, + } +} + +/* +ListIncidentAttachmentsParams contains all the parameters to send to the API endpoint + + for the list incident attachments operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentAttachmentsParams struct { + + // AttachableType. + AttachableType *string + + // IncidentID. + IncidentID string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident attachments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentAttachmentsParams) WithDefaults() *ListIncidentAttachmentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident attachments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentAttachmentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident attachments params +func (o *ListIncidentAttachmentsParams) WithTimeout(timeout time.Duration) *ListIncidentAttachmentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident attachments params +func (o *ListIncidentAttachmentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident attachments params +func (o *ListIncidentAttachmentsParams) WithContext(ctx context.Context) *ListIncidentAttachmentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident attachments params +func (o *ListIncidentAttachmentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident attachments params +func (o *ListIncidentAttachmentsParams) WithHTTPClient(client *http.Client) *ListIncidentAttachmentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident attachments params +func (o *ListIncidentAttachmentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAttachableType adds the attachableType to the list incident attachments params +func (o *ListIncidentAttachmentsParams) WithAttachableType(attachableType *string) *ListIncidentAttachmentsParams { + o.SetAttachableType(attachableType) + return o +} + +// SetAttachableType adds the attachableType to the list incident attachments params +func (o *ListIncidentAttachmentsParams) SetAttachableType(attachableType *string) { + o.AttachableType = attachableType +} + +// WithIncidentID adds the incidentID to the list incident attachments params +func (o *ListIncidentAttachmentsParams) WithIncidentID(incidentID string) *ListIncidentAttachmentsParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list incident attachments params +func (o *ListIncidentAttachmentsParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithPage adds the page to the list incident attachments params +func (o *ListIncidentAttachmentsParams) WithPage(page *int32) *ListIncidentAttachmentsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list incident attachments params +func (o *ListIncidentAttachmentsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list incident attachments params +func (o *ListIncidentAttachmentsParams) WithPerPage(perPage *int32) *ListIncidentAttachmentsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list incident attachments params +func (o *ListIncidentAttachmentsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentAttachmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AttachableType != nil { + + // query param attachable_type + var qrAttachableType string + + if o.AttachableType != nil { + qrAttachableType = *o.AttachableType + } + qAttachableType := qrAttachableType + if qAttachableType != "" { + + if err := r.SetQueryParam("attachable_type", qAttachableType); err != nil { + return err + } + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/list_incident_attachments_responses.go b/client/incidents/list_incident_attachments_responses.go new file mode 100644 index 0000000..842a2df --- /dev/null +++ b/client/incidents/list_incident_attachments_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentAttachmentsReader is a Reader for the ListIncidentAttachments structure. +type ListIncidentAttachmentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentAttachmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentAttachmentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentAttachmentsOK creates a ListIncidentAttachmentsOK with default headers values +func NewListIncidentAttachmentsOK() *ListIncidentAttachmentsOK { + return &ListIncidentAttachmentsOK{} +} + +/* +ListIncidentAttachmentsOK describes a response with status code 200, with default header values. + +List attachments for an incident +*/ +type ListIncidentAttachmentsOK struct { + Payload *models.AttachmentsTypedAttachmentEntityPaginated +} + +// IsSuccess returns true when this list incident attachments o k response has a 2xx status code +func (o *ListIncidentAttachmentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident attachments o k response has a 3xx status code +func (o *ListIncidentAttachmentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident attachments o k response has a 4xx status code +func (o *ListIncidentAttachmentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident attachments o k response has a 5xx status code +func (o *ListIncidentAttachmentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident attachments o k response a status code equal to that given +func (o *ListIncidentAttachmentsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentAttachmentsOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/attachments][%d] listIncidentAttachmentsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentAttachmentsOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/attachments][%d] listIncidentAttachmentsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentAttachmentsOK) GetPayload() *models.AttachmentsTypedAttachmentEntityPaginated { + return o.Payload +} + +func (o *ListIncidentAttachmentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AttachmentsTypedAttachmentEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/list_incident_change_events_parameters.go b/client/incidents/list_incident_change_events_parameters.go new file mode 100644 index 0000000..2552044 --- /dev/null +++ b/client/incidents/list_incident_change_events_parameters.go @@ -0,0 +1,249 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListIncidentChangeEventsParams creates a new ListIncidentChangeEventsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentChangeEventsParams() *ListIncidentChangeEventsParams { + return &ListIncidentChangeEventsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentChangeEventsParamsWithTimeout creates a new ListIncidentChangeEventsParams object +// with the ability to set a timeout on a request. +func NewListIncidentChangeEventsParamsWithTimeout(timeout time.Duration) *ListIncidentChangeEventsParams { + return &ListIncidentChangeEventsParams{ + timeout: timeout, + } +} + +// NewListIncidentChangeEventsParamsWithContext creates a new ListIncidentChangeEventsParams object +// with the ability to set a context for a request. +func NewListIncidentChangeEventsParamsWithContext(ctx context.Context) *ListIncidentChangeEventsParams { + return &ListIncidentChangeEventsParams{ + Context: ctx, + } +} + +// NewListIncidentChangeEventsParamsWithHTTPClient creates a new ListIncidentChangeEventsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentChangeEventsParamsWithHTTPClient(client *http.Client) *ListIncidentChangeEventsParams { + return &ListIncidentChangeEventsParams{ + HTTPClient: client, + } +} + +/* +ListIncidentChangeEventsParams contains all the parameters to send to the API endpoint + + for the list incident change events operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentChangeEventsParams struct { + + // IncidentID. + IncidentID string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Type. + + The type of the relation to the incident + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident change events params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentChangeEventsParams) WithDefaults() *ListIncidentChangeEventsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident change events params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentChangeEventsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident change events params +func (o *ListIncidentChangeEventsParams) WithTimeout(timeout time.Duration) *ListIncidentChangeEventsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident change events params +func (o *ListIncidentChangeEventsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident change events params +func (o *ListIncidentChangeEventsParams) WithContext(ctx context.Context) *ListIncidentChangeEventsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident change events params +func (o *ListIncidentChangeEventsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident change events params +func (o *ListIncidentChangeEventsParams) WithHTTPClient(client *http.Client) *ListIncidentChangeEventsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident change events params +func (o *ListIncidentChangeEventsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list incident change events params +func (o *ListIncidentChangeEventsParams) WithIncidentID(incidentID string) *ListIncidentChangeEventsParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list incident change events params +func (o *ListIncidentChangeEventsParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithPage adds the page to the list incident change events params +func (o *ListIncidentChangeEventsParams) WithPage(page *int32) *ListIncidentChangeEventsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list incident change events params +func (o *ListIncidentChangeEventsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list incident change events params +func (o *ListIncidentChangeEventsParams) WithPerPage(perPage *int32) *ListIncidentChangeEventsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list incident change events params +func (o *ListIncidentChangeEventsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithType adds the typeVar to the list incident change events params +func (o *ListIncidentChangeEventsParams) WithType(typeVar *string) *ListIncidentChangeEventsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the list incident change events params +func (o *ListIncidentChangeEventsParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentChangeEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/list_incident_change_events_responses.go b/client/incidents/list_incident_change_events_responses.go new file mode 100644 index 0000000..1125997 --- /dev/null +++ b/client/incidents/list_incident_change_events_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentChangeEventsReader is a Reader for the ListIncidentChangeEvents structure. +type ListIncidentChangeEventsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentChangeEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentChangeEventsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentChangeEventsOK creates a ListIncidentChangeEventsOK with default headers values +func NewListIncidentChangeEventsOK() *ListIncidentChangeEventsOK { + return &ListIncidentChangeEventsOK{} +} + +/* +ListIncidentChangeEventsOK describes a response with status code 200, with default header values. + +List related changes that have been attached to an incident +*/ +type ListIncidentChangeEventsOK struct { + Payload *models.IncidentsRelatedChangeEventEntityPaginated +} + +// IsSuccess returns true when this list incident change events o k response has a 2xx status code +func (o *ListIncidentChangeEventsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident change events o k response has a 3xx status code +func (o *ListIncidentChangeEventsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident change events o k response has a 4xx status code +func (o *ListIncidentChangeEventsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident change events o k response has a 5xx status code +func (o *ListIncidentChangeEventsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident change events o k response a status code equal to that given +func (o *ListIncidentChangeEventsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentChangeEventsOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/related_change_events][%d] listIncidentChangeEventsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentChangeEventsOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/related_change_events][%d] listIncidentChangeEventsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentChangeEventsOK) GetPayload() *models.IncidentsRelatedChangeEventEntityPaginated { + return o.Payload +} + +func (o *ListIncidentChangeEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRelatedChangeEventEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/list_incident_conference_bridges_parameters.go b/client/incidents/list_incident_conference_bridges_parameters.go new file mode 100644 index 0000000..3687c5f --- /dev/null +++ b/client/incidents/list_incident_conference_bridges_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListIncidentConferenceBridgesParams creates a new ListIncidentConferenceBridgesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentConferenceBridgesParams() *ListIncidentConferenceBridgesParams { + return &ListIncidentConferenceBridgesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentConferenceBridgesParamsWithTimeout creates a new ListIncidentConferenceBridgesParams object +// with the ability to set a timeout on a request. +func NewListIncidentConferenceBridgesParamsWithTimeout(timeout time.Duration) *ListIncidentConferenceBridgesParams { + return &ListIncidentConferenceBridgesParams{ + timeout: timeout, + } +} + +// NewListIncidentConferenceBridgesParamsWithContext creates a new ListIncidentConferenceBridgesParams object +// with the ability to set a context for a request. +func NewListIncidentConferenceBridgesParamsWithContext(ctx context.Context) *ListIncidentConferenceBridgesParams { + return &ListIncidentConferenceBridgesParams{ + Context: ctx, + } +} + +// NewListIncidentConferenceBridgesParamsWithHTTPClient creates a new ListIncidentConferenceBridgesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentConferenceBridgesParamsWithHTTPClient(client *http.Client) *ListIncidentConferenceBridgesParams { + return &ListIncidentConferenceBridgesParams{ + HTTPClient: client, + } +} + +/* +ListIncidentConferenceBridgesParams contains all the parameters to send to the API endpoint + + for the list incident conference bridges operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentConferenceBridgesParams struct { + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident conference bridges params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentConferenceBridgesParams) WithDefaults() *ListIncidentConferenceBridgesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident conference bridges params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentConferenceBridgesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident conference bridges params +func (o *ListIncidentConferenceBridgesParams) WithTimeout(timeout time.Duration) *ListIncidentConferenceBridgesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident conference bridges params +func (o *ListIncidentConferenceBridgesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident conference bridges params +func (o *ListIncidentConferenceBridgesParams) WithContext(ctx context.Context) *ListIncidentConferenceBridgesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident conference bridges params +func (o *ListIncidentConferenceBridgesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident conference bridges params +func (o *ListIncidentConferenceBridgesParams) WithHTTPClient(client *http.Client) *ListIncidentConferenceBridgesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident conference bridges params +func (o *ListIncidentConferenceBridgesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list incident conference bridges params +func (o *ListIncidentConferenceBridgesParams) WithIncidentID(incidentID string) *ListIncidentConferenceBridgesParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list incident conference bridges params +func (o *ListIncidentConferenceBridgesParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentConferenceBridgesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/list_incident_conference_bridges_responses.go b/client/incidents/list_incident_conference_bridges_responses.go new file mode 100644 index 0000000..4639dea --- /dev/null +++ b/client/incidents/list_incident_conference_bridges_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentConferenceBridgesReader is a Reader for the ListIncidentConferenceBridges structure. +type ListIncidentConferenceBridgesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentConferenceBridgesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentConferenceBridgesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentConferenceBridgesOK creates a ListIncidentConferenceBridgesOK with default headers values +func NewListIncidentConferenceBridgesOK() *ListIncidentConferenceBridgesOK { + return &ListIncidentConferenceBridgesOK{} +} + +/* +ListIncidentConferenceBridgesOK describes a response with status code 200, with default header values. + +Retrieve all conference bridges for an incident +*/ +type ListIncidentConferenceBridgesOK struct { + Payload *models.IncidentsConferenceBridgeEntity +} + +// IsSuccess returns true when this list incident conference bridges o k response has a 2xx status code +func (o *ListIncidentConferenceBridgesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident conference bridges o k response has a 3xx status code +func (o *ListIncidentConferenceBridgesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident conference bridges o k response has a 4xx status code +func (o *ListIncidentConferenceBridgesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident conference bridges o k response has a 5xx status code +func (o *ListIncidentConferenceBridgesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident conference bridges o k response a status code equal to that given +func (o *ListIncidentConferenceBridgesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentConferenceBridgesOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/conference_bridges][%d] listIncidentConferenceBridgesOK %+v", 200, o.Payload) +} + +func (o *ListIncidentConferenceBridgesOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/conference_bridges][%d] listIncidentConferenceBridgesOK %+v", 200, o.Payload) +} + +func (o *ListIncidentConferenceBridgesOK) GetPayload() *models.IncidentsConferenceBridgeEntity { + return o.Payload +} + +func (o *ListIncidentConferenceBridgesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsConferenceBridgeEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/list_incident_events_parameters.go b/client/incidents/list_incident_events_parameters.go new file mode 100644 index 0000000..d480a0a --- /dev/null +++ b/client/incidents/list_incident_events_parameters.go @@ -0,0 +1,271 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListIncidentEventsParams creates a new ListIncidentEventsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentEventsParams() *ListIncidentEventsParams { + return &ListIncidentEventsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentEventsParamsWithTimeout creates a new ListIncidentEventsParams object +// with the ability to set a timeout on a request. +func NewListIncidentEventsParamsWithTimeout(timeout time.Duration) *ListIncidentEventsParams { + return &ListIncidentEventsParams{ + timeout: timeout, + } +} + +// NewListIncidentEventsParamsWithContext creates a new ListIncidentEventsParams object +// with the ability to set a context for a request. +func NewListIncidentEventsParamsWithContext(ctx context.Context) *ListIncidentEventsParams { + return &ListIncidentEventsParams{ + Context: ctx, + } +} + +// NewListIncidentEventsParamsWithHTTPClient creates a new ListIncidentEventsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentEventsParamsWithHTTPClient(client *http.Client) *ListIncidentEventsParams { + return &ListIncidentEventsParams{ + HTTPClient: client, + } +} + +/* +ListIncidentEventsParams contains all the parameters to send to the API endpoint + + for the list incident events operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentEventsParams struct { + + // IncidentID. + IncidentID string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Types. + + A comma separated list of types of events to filter by. Possible values are: + - `add_task_list`: Task list was added + - `alert_event`: Someone was paged or took action on a linked alert + - `alert_linked`: An alert was linked to the incident + - `bulk_milestone_update`: When a milestone change occurs with no other changes + - `bulk_update`: When an incident note/update is posted or when impacted components are updated. If other changes occur together with either of these changes (e.g., milestone change), they are all bundled together into a bulk_update + - `change_type`: Updates to associated change events + - `chat_message`: Any chat message event in a linked chat app like Slack or MS Teams + - `children_changed`: When adding or updating child related incidents + - `external_link`: When an external link is added or updated + - `general_update`: Currently only describes Runbook stoppage events + - `generic_chat_message`: When an event or message is manually added to the timeline via the web UI or API + - `incident_attachment`: When attachments or files are added to the timeline + - `generic_resource_change`: Any changes to individual fields within the incident, including custom fields + - `incident_restriction`: When an incident is converted to private + - `incident_status`: Only used when an incident starts and changes to an `active` state + - `note`: When a message is posted to a status page directly and not via `/fh update` + - `role_update`: Any updates to assigned roles + - `runbook_attachment`: Any updates to a runbook + - `runbook_step_execution_update`: Any Runbook step events + - `task_update`: Task update events + - `team_assignment`: Team assignment events + - `ticket_update`: Updates to incident and follow-up tickets + */ + Types *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident events params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentEventsParams) WithDefaults() *ListIncidentEventsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident events params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentEventsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident events params +func (o *ListIncidentEventsParams) WithTimeout(timeout time.Duration) *ListIncidentEventsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident events params +func (o *ListIncidentEventsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident events params +func (o *ListIncidentEventsParams) WithContext(ctx context.Context) *ListIncidentEventsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident events params +func (o *ListIncidentEventsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident events params +func (o *ListIncidentEventsParams) WithHTTPClient(client *http.Client) *ListIncidentEventsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident events params +func (o *ListIncidentEventsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list incident events params +func (o *ListIncidentEventsParams) WithIncidentID(incidentID string) *ListIncidentEventsParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list incident events params +func (o *ListIncidentEventsParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithPage adds the page to the list incident events params +func (o *ListIncidentEventsParams) WithPage(page *int32) *ListIncidentEventsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list incident events params +func (o *ListIncidentEventsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list incident events params +func (o *ListIncidentEventsParams) WithPerPage(perPage *int32) *ListIncidentEventsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list incident events params +func (o *ListIncidentEventsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithTypes adds the types to the list incident events params +func (o *ListIncidentEventsParams) WithTypes(types *string) *ListIncidentEventsParams { + o.SetTypes(types) + return o +} + +// SetTypes adds the types to the list incident events params +func (o *ListIncidentEventsParams) SetTypes(types *string) { + o.Types = types +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Types != nil { + + // query param types + var qrTypes string + + if o.Types != nil { + qrTypes = *o.Types + } + qTypes := qrTypes + if qTypes != "" { + + if err := r.SetQueryParam("types", qTypes); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/list_incident_events_responses.go b/client/incidents/list_incident_events_responses.go new file mode 100644 index 0000000..0d32e0f --- /dev/null +++ b/client/incidents/list_incident_events_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentEventsReader is a Reader for the ListIncidentEvents structure. +type ListIncidentEventsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentEventsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentEventsOK creates a ListIncidentEventsOK with default headers values +func NewListIncidentEventsOK() *ListIncidentEventsOK { + return &ListIncidentEventsOK{} +} + +/* +ListIncidentEventsOK describes a response with status code 200, with default header values. + +List all events for an incident. An event is a timeline entry. This can be filtered with params to retrieve events of a certain type. +*/ +type ListIncidentEventsOK struct { + Payload *models.IncidentEventEntityPaginated +} + +// IsSuccess returns true when this list incident events o k response has a 2xx status code +func (o *ListIncidentEventsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident events o k response has a 3xx status code +func (o *ListIncidentEventsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident events o k response has a 4xx status code +func (o *ListIncidentEventsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident events o k response has a 5xx status code +func (o *ListIncidentEventsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident events o k response a status code equal to that given +func (o *ListIncidentEventsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentEventsOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/events][%d] listIncidentEventsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentEventsOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/events][%d] listIncidentEventsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentEventsOK) GetPayload() *models.IncidentEventEntityPaginated { + return o.Payload +} + +func (o *ListIncidentEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentEventEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/list_incident_impacts_parameters.go b/client/incidents/list_incident_impacts_parameters.go new file mode 100644 index 0000000..97ad22e --- /dev/null +++ b/client/incidents/list_incident_impacts_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListIncidentImpactsParams creates a new ListIncidentImpactsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentImpactsParams() *ListIncidentImpactsParams { + return &ListIncidentImpactsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentImpactsParamsWithTimeout creates a new ListIncidentImpactsParams object +// with the ability to set a timeout on a request. +func NewListIncidentImpactsParamsWithTimeout(timeout time.Duration) *ListIncidentImpactsParams { + return &ListIncidentImpactsParams{ + timeout: timeout, + } +} + +// NewListIncidentImpactsParamsWithContext creates a new ListIncidentImpactsParams object +// with the ability to set a context for a request. +func NewListIncidentImpactsParamsWithContext(ctx context.Context) *ListIncidentImpactsParams { + return &ListIncidentImpactsParams{ + Context: ctx, + } +} + +// NewListIncidentImpactsParamsWithHTTPClient creates a new ListIncidentImpactsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentImpactsParamsWithHTTPClient(client *http.Client) *ListIncidentImpactsParams { + return &ListIncidentImpactsParams{ + HTTPClient: client, + } +} + +/* +ListIncidentImpactsParams contains all the parameters to send to the API endpoint + + for the list incident impacts operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentImpactsParams struct { + + // IncidentID. + IncidentID string + + // Type. + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident impacts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentImpactsParams) WithDefaults() *ListIncidentImpactsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident impacts params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentImpactsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident impacts params +func (o *ListIncidentImpactsParams) WithTimeout(timeout time.Duration) *ListIncidentImpactsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident impacts params +func (o *ListIncidentImpactsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident impacts params +func (o *ListIncidentImpactsParams) WithContext(ctx context.Context) *ListIncidentImpactsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident impacts params +func (o *ListIncidentImpactsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident impacts params +func (o *ListIncidentImpactsParams) WithHTTPClient(client *http.Client) *ListIncidentImpactsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident impacts params +func (o *ListIncidentImpactsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list incident impacts params +func (o *ListIncidentImpactsParams) WithIncidentID(incidentID string) *ListIncidentImpactsParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list incident impacts params +func (o *ListIncidentImpactsParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithType adds the typeVar to the list incident impacts params +func (o *ListIncidentImpactsParams) WithType(typeVar string) *ListIncidentImpactsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the list incident impacts params +func (o *ListIncidentImpactsParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentImpactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param type + if err := r.SetPathParam("type", o.Type); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/list_incident_impacts_responses.go b/client/incidents/list_incident_impacts_responses.go new file mode 100644 index 0000000..4ebb5a6 --- /dev/null +++ b/client/incidents/list_incident_impacts_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentImpactsReader is a Reader for the ListIncidentImpacts structure. +type ListIncidentImpactsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentImpactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentImpactsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentImpactsOK creates a ListIncidentImpactsOK with default headers values +func NewListIncidentImpactsOK() *ListIncidentImpactsOK { + return &ListIncidentImpactsOK{} +} + +/* +ListIncidentImpactsOK describes a response with status code 200, with default header values. + +List impacted infrastructure on an incident by specifying type +*/ +type ListIncidentImpactsOK struct { + Payload *models.IncidentImpactEntityPaginated +} + +// IsSuccess returns true when this list incident impacts o k response has a 2xx status code +func (o *ListIncidentImpactsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident impacts o k response has a 3xx status code +func (o *ListIncidentImpactsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident impacts o k response has a 4xx status code +func (o *ListIncidentImpactsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident impacts o k response has a 5xx status code +func (o *ListIncidentImpactsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident impacts o k response a status code equal to that given +func (o *ListIncidentImpactsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentImpactsOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/impact/{type}][%d] listIncidentImpactsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentImpactsOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/impact/{type}][%d] listIncidentImpactsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentImpactsOK) GetPayload() *models.IncidentImpactEntityPaginated { + return o.Payload +} + +func (o *ListIncidentImpactsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentImpactEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/list_incident_links_parameters.go b/client/incidents/list_incident_links_parameters.go new file mode 100644 index 0000000..dfc7470 --- /dev/null +++ b/client/incidents/list_incident_links_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListIncidentLinksParams creates a new ListIncidentLinksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentLinksParams() *ListIncidentLinksParams { + return &ListIncidentLinksParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentLinksParamsWithTimeout creates a new ListIncidentLinksParams object +// with the ability to set a timeout on a request. +func NewListIncidentLinksParamsWithTimeout(timeout time.Duration) *ListIncidentLinksParams { + return &ListIncidentLinksParams{ + timeout: timeout, + } +} + +// NewListIncidentLinksParamsWithContext creates a new ListIncidentLinksParams object +// with the ability to set a context for a request. +func NewListIncidentLinksParamsWithContext(ctx context.Context) *ListIncidentLinksParams { + return &ListIncidentLinksParams{ + Context: ctx, + } +} + +// NewListIncidentLinksParamsWithHTTPClient creates a new ListIncidentLinksParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentLinksParamsWithHTTPClient(client *http.Client) *ListIncidentLinksParams { + return &ListIncidentLinksParams{ + HTTPClient: client, + } +} + +/* +ListIncidentLinksParams contains all the parameters to send to the API endpoint + + for the list incident links operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentLinksParams struct { + + // IncidentID. + IncidentID string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident links params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentLinksParams) WithDefaults() *ListIncidentLinksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident links params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentLinksParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident links params +func (o *ListIncidentLinksParams) WithTimeout(timeout time.Duration) *ListIncidentLinksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident links params +func (o *ListIncidentLinksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident links params +func (o *ListIncidentLinksParams) WithContext(ctx context.Context) *ListIncidentLinksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident links params +func (o *ListIncidentLinksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident links params +func (o *ListIncidentLinksParams) WithHTTPClient(client *http.Client) *ListIncidentLinksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident links params +func (o *ListIncidentLinksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list incident links params +func (o *ListIncidentLinksParams) WithIncidentID(incidentID string) *ListIncidentLinksParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list incident links params +func (o *ListIncidentLinksParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithPage adds the page to the list incident links params +func (o *ListIncidentLinksParams) WithPage(page *int32) *ListIncidentLinksParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list incident links params +func (o *ListIncidentLinksParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list incident links params +func (o *ListIncidentLinksParams) WithPerPage(perPage *int32) *ListIncidentLinksParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list incident links params +func (o *ListIncidentLinksParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentLinksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/list_incident_links_responses.go b/client/incidents/list_incident_links_responses.go new file mode 100644 index 0000000..29d7c03 --- /dev/null +++ b/client/incidents/list_incident_links_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentLinksReader is a Reader for the ListIncidentLinks structure. +type ListIncidentLinksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentLinksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentLinksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentLinksOK creates a ListIncidentLinksOK with default headers values +func NewListIncidentLinksOK() *ListIncidentLinksOK { + return &ListIncidentLinksOK{} +} + +/* +ListIncidentLinksOK describes a response with status code 200, with default header values. + +List all the editable, external incident links attached to an incident +*/ +type ListIncidentLinksOK struct { + Payload *models.AttachmentsLinkEntityPaginated +} + +// IsSuccess returns true when this list incident links o k response has a 2xx status code +func (o *ListIncidentLinksOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident links o k response has a 3xx status code +func (o *ListIncidentLinksOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident links o k response has a 4xx status code +func (o *ListIncidentLinksOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident links o k response has a 5xx status code +func (o *ListIncidentLinksOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident links o k response a status code equal to that given +func (o *ListIncidentLinksOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentLinksOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/links][%d] listIncidentLinksOK %+v", 200, o.Payload) +} + +func (o *ListIncidentLinksOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/links][%d] listIncidentLinksOK %+v", 200, o.Payload) +} + +func (o *ListIncidentLinksOK) GetPayload() *models.AttachmentsLinkEntityPaginated { + return o.Payload +} + +func (o *ListIncidentLinksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AttachmentsLinkEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/list_incident_milestones_parameters.go b/client/incidents/list_incident_milestones_parameters.go new file mode 100644 index 0000000..2f6bb9c --- /dev/null +++ b/client/incidents/list_incident_milestones_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListIncidentMilestonesParams creates a new ListIncidentMilestonesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentMilestonesParams() *ListIncidentMilestonesParams { + return &ListIncidentMilestonesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentMilestonesParamsWithTimeout creates a new ListIncidentMilestonesParams object +// with the ability to set a timeout on a request. +func NewListIncidentMilestonesParamsWithTimeout(timeout time.Duration) *ListIncidentMilestonesParams { + return &ListIncidentMilestonesParams{ + timeout: timeout, + } +} + +// NewListIncidentMilestonesParamsWithContext creates a new ListIncidentMilestonesParams object +// with the ability to set a context for a request. +func NewListIncidentMilestonesParamsWithContext(ctx context.Context) *ListIncidentMilestonesParams { + return &ListIncidentMilestonesParams{ + Context: ctx, + } +} + +// NewListIncidentMilestonesParamsWithHTTPClient creates a new ListIncidentMilestonesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentMilestonesParamsWithHTTPClient(client *http.Client) *ListIncidentMilestonesParams { + return &ListIncidentMilestonesParams{ + HTTPClient: client, + } +} + +/* +ListIncidentMilestonesParams contains all the parameters to send to the API endpoint + + for the list incident milestones operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentMilestonesParams struct { + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident milestones params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentMilestonesParams) WithDefaults() *ListIncidentMilestonesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident milestones params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentMilestonesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident milestones params +func (o *ListIncidentMilestonesParams) WithTimeout(timeout time.Duration) *ListIncidentMilestonesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident milestones params +func (o *ListIncidentMilestonesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident milestones params +func (o *ListIncidentMilestonesParams) WithContext(ctx context.Context) *ListIncidentMilestonesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident milestones params +func (o *ListIncidentMilestonesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident milestones params +func (o *ListIncidentMilestonesParams) WithHTTPClient(client *http.Client) *ListIncidentMilestonesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident milestones params +func (o *ListIncidentMilestonesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list incident milestones params +func (o *ListIncidentMilestonesParams) WithIncidentID(incidentID string) *ListIncidentMilestonesParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list incident milestones params +func (o *ListIncidentMilestonesParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentMilestonesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/list_incident_milestones_responses.go b/client/incidents/list_incident_milestones_responses.go new file mode 100644 index 0000000..77666ab --- /dev/null +++ b/client/incidents/list_incident_milestones_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentMilestonesReader is a Reader for the ListIncidentMilestones structure. +type ListIncidentMilestonesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentMilestonesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentMilestonesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentMilestonesOK creates a ListIncidentMilestonesOK with default headers values +func NewListIncidentMilestonesOK() *ListIncidentMilestonesOK { + return &ListIncidentMilestonesOK{} +} + +/* +ListIncidentMilestonesOK describes a response with status code 200, with default header values. + +List times and durations for each milestone on an incident +*/ +type ListIncidentMilestonesOK struct { + Payload *models.IncidentsMilestoneEntityPaginated +} + +// IsSuccess returns true when this list incident milestones o k response has a 2xx status code +func (o *ListIncidentMilestonesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident milestones o k response has a 3xx status code +func (o *ListIncidentMilestonesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident milestones o k response has a 4xx status code +func (o *ListIncidentMilestonesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident milestones o k response has a 5xx status code +func (o *ListIncidentMilestonesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident milestones o k response a status code equal to that given +func (o *ListIncidentMilestonesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentMilestonesOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/milestones][%d] listIncidentMilestonesOK %+v", 200, o.Payload) +} + +func (o *ListIncidentMilestonesOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/milestones][%d] listIncidentMilestonesOK %+v", 200, o.Payload) +} + +func (o *ListIncidentMilestonesOK) GetPayload() *models.IncidentsMilestoneEntityPaginated { + return o.Payload +} + +func (o *ListIncidentMilestonesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsMilestoneEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/list_incident_role_assignments_parameters.go b/client/incidents/list_incident_role_assignments_parameters.go new file mode 100644 index 0000000..1973ab2 --- /dev/null +++ b/client/incidents/list_incident_role_assignments_parameters.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListIncidentRoleAssignmentsParams creates a new ListIncidentRoleAssignmentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentRoleAssignmentsParams() *ListIncidentRoleAssignmentsParams { + return &ListIncidentRoleAssignmentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentRoleAssignmentsParamsWithTimeout creates a new ListIncidentRoleAssignmentsParams object +// with the ability to set a timeout on a request. +func NewListIncidentRoleAssignmentsParamsWithTimeout(timeout time.Duration) *ListIncidentRoleAssignmentsParams { + return &ListIncidentRoleAssignmentsParams{ + timeout: timeout, + } +} + +// NewListIncidentRoleAssignmentsParamsWithContext creates a new ListIncidentRoleAssignmentsParams object +// with the ability to set a context for a request. +func NewListIncidentRoleAssignmentsParamsWithContext(ctx context.Context) *ListIncidentRoleAssignmentsParams { + return &ListIncidentRoleAssignmentsParams{ + Context: ctx, + } +} + +// NewListIncidentRoleAssignmentsParamsWithHTTPClient creates a new ListIncidentRoleAssignmentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentRoleAssignmentsParamsWithHTTPClient(client *http.Client) *ListIncidentRoleAssignmentsParams { + return &ListIncidentRoleAssignmentsParams{ + HTTPClient: client, + } +} + +/* +ListIncidentRoleAssignmentsParams contains all the parameters to send to the API endpoint + + for the list incident role assignments operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentRoleAssignmentsParams struct { + + // IncidentID. + IncidentID string + + /* Status. + + Filter on status of the role assignment + */ + Status *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident role assignments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentRoleAssignmentsParams) WithDefaults() *ListIncidentRoleAssignmentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident role assignments params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentRoleAssignmentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident role assignments params +func (o *ListIncidentRoleAssignmentsParams) WithTimeout(timeout time.Duration) *ListIncidentRoleAssignmentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident role assignments params +func (o *ListIncidentRoleAssignmentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident role assignments params +func (o *ListIncidentRoleAssignmentsParams) WithContext(ctx context.Context) *ListIncidentRoleAssignmentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident role assignments params +func (o *ListIncidentRoleAssignmentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident role assignments params +func (o *ListIncidentRoleAssignmentsParams) WithHTTPClient(client *http.Client) *ListIncidentRoleAssignmentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident role assignments params +func (o *ListIncidentRoleAssignmentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list incident role assignments params +func (o *ListIncidentRoleAssignmentsParams) WithIncidentID(incidentID string) *ListIncidentRoleAssignmentsParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list incident role assignments params +func (o *ListIncidentRoleAssignmentsParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithStatus adds the status to the list incident role assignments params +func (o *ListIncidentRoleAssignmentsParams) WithStatus(status *string) *ListIncidentRoleAssignmentsParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the list incident role assignments params +func (o *ListIncidentRoleAssignmentsParams) SetStatus(status *string) { + o.Status = status +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentRoleAssignmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if o.Status != nil { + + // query param status + var qrStatus string + + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + + if err := r.SetQueryParam("status", qStatus); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/list_incident_role_assignments_responses.go b/client/incidents/list_incident_role_assignments_responses.go new file mode 100644 index 0000000..bf3bfd4 --- /dev/null +++ b/client/incidents/list_incident_role_assignments_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentRoleAssignmentsReader is a Reader for the ListIncidentRoleAssignments structure. +type ListIncidentRoleAssignmentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentRoleAssignmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentRoleAssignmentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentRoleAssignmentsOK creates a ListIncidentRoleAssignmentsOK with default headers values +func NewListIncidentRoleAssignmentsOK() *ListIncidentRoleAssignmentsOK { + return &ListIncidentRoleAssignmentsOK{} +} + +/* +ListIncidentRoleAssignmentsOK describes a response with status code 200, with default header values. + +Retrieve a list of all of the current role assignments for the incident +*/ +type ListIncidentRoleAssignmentsOK struct { + Payload *models.IncidentsRoleAssignmentEntityPaginated +} + +// IsSuccess returns true when this list incident role assignments o k response has a 2xx status code +func (o *ListIncidentRoleAssignmentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident role assignments o k response has a 3xx status code +func (o *ListIncidentRoleAssignmentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident role assignments o k response has a 4xx status code +func (o *ListIncidentRoleAssignmentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident role assignments o k response has a 5xx status code +func (o *ListIncidentRoleAssignmentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident role assignments o k response a status code equal to that given +func (o *ListIncidentRoleAssignmentsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentRoleAssignmentsOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/role_assignments][%d] listIncidentRoleAssignmentsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentRoleAssignmentsOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/role_assignments][%d] listIncidentRoleAssignmentsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentRoleAssignmentsOK) GetPayload() *models.IncidentsRoleAssignmentEntityPaginated { + return o.Payload +} + +func (o *ListIncidentRoleAssignmentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRoleAssignmentEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/list_incident_status_pages_parameters.go b/client/incidents/list_incident_status_pages_parameters.go new file mode 100644 index 0000000..221d0c3 --- /dev/null +++ b/client/incidents/list_incident_status_pages_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListIncidentStatusPagesParams creates a new ListIncidentStatusPagesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentStatusPagesParams() *ListIncidentStatusPagesParams { + return &ListIncidentStatusPagesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentStatusPagesParamsWithTimeout creates a new ListIncidentStatusPagesParams object +// with the ability to set a timeout on a request. +func NewListIncidentStatusPagesParamsWithTimeout(timeout time.Duration) *ListIncidentStatusPagesParams { + return &ListIncidentStatusPagesParams{ + timeout: timeout, + } +} + +// NewListIncidentStatusPagesParamsWithContext creates a new ListIncidentStatusPagesParams object +// with the ability to set a context for a request. +func NewListIncidentStatusPagesParamsWithContext(ctx context.Context) *ListIncidentStatusPagesParams { + return &ListIncidentStatusPagesParams{ + Context: ctx, + } +} + +// NewListIncidentStatusPagesParamsWithHTTPClient creates a new ListIncidentStatusPagesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentStatusPagesParamsWithHTTPClient(client *http.Client) *ListIncidentStatusPagesParams { + return &ListIncidentStatusPagesParams{ + HTTPClient: client, + } +} + +/* +ListIncidentStatusPagesParams contains all the parameters to send to the API endpoint + + for the list incident status pages operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentStatusPagesParams struct { + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident status pages params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentStatusPagesParams) WithDefaults() *ListIncidentStatusPagesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident status pages params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentStatusPagesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident status pages params +func (o *ListIncidentStatusPagesParams) WithTimeout(timeout time.Duration) *ListIncidentStatusPagesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident status pages params +func (o *ListIncidentStatusPagesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident status pages params +func (o *ListIncidentStatusPagesParams) WithContext(ctx context.Context) *ListIncidentStatusPagesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident status pages params +func (o *ListIncidentStatusPagesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident status pages params +func (o *ListIncidentStatusPagesParams) WithHTTPClient(client *http.Client) *ListIncidentStatusPagesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident status pages params +func (o *ListIncidentStatusPagesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list incident status pages params +func (o *ListIncidentStatusPagesParams) WithIncidentID(incidentID string) *ListIncidentStatusPagesParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list incident status pages params +func (o *ListIncidentStatusPagesParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentStatusPagesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/list_incident_status_pages_responses.go b/client/incidents/list_incident_status_pages_responses.go new file mode 100644 index 0000000..6b96f5b --- /dev/null +++ b/client/incidents/list_incident_status_pages_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentStatusPagesReader is a Reader for the ListIncidentStatusPages structure. +type ListIncidentStatusPagesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentStatusPagesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentStatusPagesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentStatusPagesOK creates a ListIncidentStatusPagesOK with default headers values +func NewListIncidentStatusPagesOK() *ListIncidentStatusPagesOK { + return &ListIncidentStatusPagesOK{} +} + +/* +ListIncidentStatusPagesOK describes a response with status code 200, with default header values. + +List status pages that are attached to an incident +*/ +type ListIncidentStatusPagesOK struct { + Payload *models.IncidentsStatusPageEntityPaginated +} + +// IsSuccess returns true when this list incident status pages o k response has a 2xx status code +func (o *ListIncidentStatusPagesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident status pages o k response has a 3xx status code +func (o *ListIncidentStatusPagesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident status pages o k response has a 4xx status code +func (o *ListIncidentStatusPagesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident status pages o k response has a 5xx status code +func (o *ListIncidentStatusPagesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident status pages o k response a status code equal to that given +func (o *ListIncidentStatusPagesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentStatusPagesOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/status_pages][%d] listIncidentStatusPagesOK %+v", 200, o.Payload) +} + +func (o *ListIncidentStatusPagesOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/status_pages][%d] listIncidentStatusPagesOK %+v", 200, o.Payload) +} + +func (o *ListIncidentStatusPagesOK) GetPayload() *models.IncidentsStatusPageEntityPaginated { + return o.Payload +} + +func (o *ListIncidentStatusPagesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsStatusPageEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/list_incidents_parameters.go b/client/incidents/list_incidents_parameters.go new file mode 100644 index 0000000..c026589 --- /dev/null +++ b/client/incidents/list_incidents_parameters.go @@ -0,0 +1,1236 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListIncidentsParams creates a new ListIncidentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentsParams() *ListIncidentsParams { + return &ListIncidentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentsParamsWithTimeout creates a new ListIncidentsParams object +// with the ability to set a timeout on a request. +func NewListIncidentsParamsWithTimeout(timeout time.Duration) *ListIncidentsParams { + return &ListIncidentsParams{ + timeout: timeout, + } +} + +// NewListIncidentsParamsWithContext creates a new ListIncidentsParams object +// with the ability to set a context for a request. +func NewListIncidentsParamsWithContext(ctx context.Context) *ListIncidentsParams { + return &ListIncidentsParams{ + Context: ctx, + } +} + +// NewListIncidentsParamsWithHTTPClient creates a new ListIncidentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentsParamsWithHTTPClient(client *http.Client) *ListIncidentsParams { + return &ListIncidentsParams{ + HTTPClient: client, + } +} + +/* +ListIncidentsParams contains all the parameters to send to the API endpoint + + for the list incidents operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentsParams struct { + + /* Archived. + + Return archived incidents + */ + Archived *bool + + /* AssignedTeams. + + A comma separated list of IDs for assigned teams or 'is_empty' to filter for incidents with no active team assignments + */ + AssignedTeams *string + + /* ClosedAtOrAfter. + + Filters for incidents that were closed at or after this time + + Format: date-time + */ + ClosedAtOrAfter *strfmt.DateTime + + /* ClosedAtOrBefore. + + Filters for incidents that were closed at or before this time + + Format: date-time + */ + ClosedAtOrBefore *strfmt.DateTime + + /* Conditions. + + A JSON string that defines 'logic' and 'user_data' + */ + Conditions *string + + /* CreatedAtOrAfter. + + Filters for incidents that were created at or after this time + + Format: date-time + */ + CreatedAtOrAfter *strfmt.DateTime + + /* CreatedAtOrBefore. + + Filters for incidents that were created at or before this time + + Format: date-time + */ + CreatedAtOrBefore *strfmt.DateTime + + /* CurrentMilestones. + + A comma separated list of current milestones + */ + CurrentMilestones *string + + /* EndDate. + + Filters for incidents that started on or before this date + + Format: date + */ + EndDate *strfmt.Date + + /* Environments. + + A comma separated list of environment IDs or 'is_empty' to filter for incidents with no impacted environments + */ + Environments *string + + /* ExcludedInfrastructureIds. + + A comma separated list of infrastructure IDs. Returns incidents that do not have the following infrastructure ids associated with them. + */ + ExcludedInfrastructureIds *string + + /* Functionalities. + + A comma separated list of functionality IDs or 'is_empty' to filter for incidents with no impacted functionalities + */ + Functionalities *string + + /* IncidentTypeID. + + A comma separated list of incident type IDs + */ + IncidentTypeID *string + + /* Name. + + A query to search incidents by their name + */ + Name *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Priorities. + + A text value of priority + */ + Priorities *string + + /* PriorityNotSet. + + Flag for including incidents where priority has not been set + */ + PriorityNotSet *bool + + /* Query. + + A text query for an incident that searches on name, summary, and desciption + */ + Query *string + + /* ResolvedAtOrAfter. + + Filters for incidents that were resolved at or after this time. Combine this with the `current_milestones` parameter if you wish to omit incidents that were re-opened and are still active. + + Format: date-time + */ + ResolvedAtOrAfter *strfmt.DateTime + + /* ResolvedAtOrBefore. + + Filters for incidents that were resolved at or before this time. Combine this with the `current_milestones` parameter if you wish to omit incidents that were re-opened and are still active. + + Format: date-time + */ + ResolvedAtOrBefore *strfmt.DateTime + + /* SavedSearchID. + + The id of a previously saved search. + */ + SavedSearchID *string + + /* Services. + + A comma separated list of service IDs or 'is_empty' to filter for incidents with no impacted services + */ + Services *string + + /* Severities. + + A text value of severity + */ + Severities *string + + /* SeverityNotSet. + + Flag for including incidents where severity has not been set + */ + SeverityNotSet *bool + + /* StartDate. + + Filters for incidents that started on or after this date + + Format: date + */ + StartDate *strfmt.Date + + /* Status. + + Incident status + */ + Status *string + + /* TagMatchStrategy. + + A matching strategy for the tags provided + */ + TagMatchStrategy *string + + /* Tags. + + A comma separated list of tags + */ + Tags *string + + /* Teams. + + A comma separated list of team IDs + */ + Teams *string + + /* UpdatedAfter. + + Filters for incidents that were updated after this date + + Format: date-time + */ + UpdatedAfter *strfmt.DateTime + + /* UpdatedBefore. + + Filters for incidents that were updated before this date + + Format: date-time + */ + UpdatedBefore *strfmt.DateTime + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incidents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentsParams) WithDefaults() *ListIncidentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incidents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incidents params +func (o *ListIncidentsParams) WithTimeout(timeout time.Duration) *ListIncidentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incidents params +func (o *ListIncidentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incidents params +func (o *ListIncidentsParams) WithContext(ctx context.Context) *ListIncidentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incidents params +func (o *ListIncidentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incidents params +func (o *ListIncidentsParams) WithHTTPClient(client *http.Client) *ListIncidentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incidents params +func (o *ListIncidentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithArchived adds the archived to the list incidents params +func (o *ListIncidentsParams) WithArchived(archived *bool) *ListIncidentsParams { + o.SetArchived(archived) + return o +} + +// SetArchived adds the archived to the list incidents params +func (o *ListIncidentsParams) SetArchived(archived *bool) { + o.Archived = archived +} + +// WithAssignedTeams adds the assignedTeams to the list incidents params +func (o *ListIncidentsParams) WithAssignedTeams(assignedTeams *string) *ListIncidentsParams { + o.SetAssignedTeams(assignedTeams) + return o +} + +// SetAssignedTeams adds the assignedTeams to the list incidents params +func (o *ListIncidentsParams) SetAssignedTeams(assignedTeams *string) { + o.AssignedTeams = assignedTeams +} + +// WithClosedAtOrAfter adds the closedAtOrAfter to the list incidents params +func (o *ListIncidentsParams) WithClosedAtOrAfter(closedAtOrAfter *strfmt.DateTime) *ListIncidentsParams { + o.SetClosedAtOrAfter(closedAtOrAfter) + return o +} + +// SetClosedAtOrAfter adds the closedAtOrAfter to the list incidents params +func (o *ListIncidentsParams) SetClosedAtOrAfter(closedAtOrAfter *strfmt.DateTime) { + o.ClosedAtOrAfter = closedAtOrAfter +} + +// WithClosedAtOrBefore adds the closedAtOrBefore to the list incidents params +func (o *ListIncidentsParams) WithClosedAtOrBefore(closedAtOrBefore *strfmt.DateTime) *ListIncidentsParams { + o.SetClosedAtOrBefore(closedAtOrBefore) + return o +} + +// SetClosedAtOrBefore adds the closedAtOrBefore to the list incidents params +func (o *ListIncidentsParams) SetClosedAtOrBefore(closedAtOrBefore *strfmt.DateTime) { + o.ClosedAtOrBefore = closedAtOrBefore +} + +// WithConditions adds the conditions to the list incidents params +func (o *ListIncidentsParams) WithConditions(conditions *string) *ListIncidentsParams { + o.SetConditions(conditions) + return o +} + +// SetConditions adds the conditions to the list incidents params +func (o *ListIncidentsParams) SetConditions(conditions *string) { + o.Conditions = conditions +} + +// WithCreatedAtOrAfter adds the createdAtOrAfter to the list incidents params +func (o *ListIncidentsParams) WithCreatedAtOrAfter(createdAtOrAfter *strfmt.DateTime) *ListIncidentsParams { + o.SetCreatedAtOrAfter(createdAtOrAfter) + return o +} + +// SetCreatedAtOrAfter adds the createdAtOrAfter to the list incidents params +func (o *ListIncidentsParams) SetCreatedAtOrAfter(createdAtOrAfter *strfmt.DateTime) { + o.CreatedAtOrAfter = createdAtOrAfter +} + +// WithCreatedAtOrBefore adds the createdAtOrBefore to the list incidents params +func (o *ListIncidentsParams) WithCreatedAtOrBefore(createdAtOrBefore *strfmt.DateTime) *ListIncidentsParams { + o.SetCreatedAtOrBefore(createdAtOrBefore) + return o +} + +// SetCreatedAtOrBefore adds the createdAtOrBefore to the list incidents params +func (o *ListIncidentsParams) SetCreatedAtOrBefore(createdAtOrBefore *strfmt.DateTime) { + o.CreatedAtOrBefore = createdAtOrBefore +} + +// WithCurrentMilestones adds the currentMilestones to the list incidents params +func (o *ListIncidentsParams) WithCurrentMilestones(currentMilestones *string) *ListIncidentsParams { + o.SetCurrentMilestones(currentMilestones) + return o +} + +// SetCurrentMilestones adds the currentMilestones to the list incidents params +func (o *ListIncidentsParams) SetCurrentMilestones(currentMilestones *string) { + o.CurrentMilestones = currentMilestones +} + +// WithEndDate adds the endDate to the list incidents params +func (o *ListIncidentsParams) WithEndDate(endDate *strfmt.Date) *ListIncidentsParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the list incidents params +func (o *ListIncidentsParams) SetEndDate(endDate *strfmt.Date) { + o.EndDate = endDate +} + +// WithEnvironments adds the environments to the list incidents params +func (o *ListIncidentsParams) WithEnvironments(environments *string) *ListIncidentsParams { + o.SetEnvironments(environments) + return o +} + +// SetEnvironments adds the environments to the list incidents params +func (o *ListIncidentsParams) SetEnvironments(environments *string) { + o.Environments = environments +} + +// WithExcludedInfrastructureIds adds the excludedInfrastructureIds to the list incidents params +func (o *ListIncidentsParams) WithExcludedInfrastructureIds(excludedInfrastructureIds *string) *ListIncidentsParams { + o.SetExcludedInfrastructureIds(excludedInfrastructureIds) + return o +} + +// SetExcludedInfrastructureIds adds the excludedInfrastructureIds to the list incidents params +func (o *ListIncidentsParams) SetExcludedInfrastructureIds(excludedInfrastructureIds *string) { + o.ExcludedInfrastructureIds = excludedInfrastructureIds +} + +// WithFunctionalities adds the functionalities to the list incidents params +func (o *ListIncidentsParams) WithFunctionalities(functionalities *string) *ListIncidentsParams { + o.SetFunctionalities(functionalities) + return o +} + +// SetFunctionalities adds the functionalities to the list incidents params +func (o *ListIncidentsParams) SetFunctionalities(functionalities *string) { + o.Functionalities = functionalities +} + +// WithIncidentTypeID adds the incidentTypeID to the list incidents params +func (o *ListIncidentsParams) WithIncidentTypeID(incidentTypeID *string) *ListIncidentsParams { + o.SetIncidentTypeID(incidentTypeID) + return o +} + +// SetIncidentTypeID adds the incidentTypeId to the list incidents params +func (o *ListIncidentsParams) SetIncidentTypeID(incidentTypeID *string) { + o.IncidentTypeID = incidentTypeID +} + +// WithName adds the name to the list incidents params +func (o *ListIncidentsParams) WithName(name *string) *ListIncidentsParams { + o.SetName(name) + return o +} + +// SetName adds the name to the list incidents params +func (o *ListIncidentsParams) SetName(name *string) { + o.Name = name +} + +// WithPage adds the page to the list incidents params +func (o *ListIncidentsParams) WithPage(page *int32) *ListIncidentsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list incidents params +func (o *ListIncidentsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list incidents params +func (o *ListIncidentsParams) WithPerPage(perPage *int32) *ListIncidentsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list incidents params +func (o *ListIncidentsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithPriorities adds the priorities to the list incidents params +func (o *ListIncidentsParams) WithPriorities(priorities *string) *ListIncidentsParams { + o.SetPriorities(priorities) + return o +} + +// SetPriorities adds the priorities to the list incidents params +func (o *ListIncidentsParams) SetPriorities(priorities *string) { + o.Priorities = priorities +} + +// WithPriorityNotSet adds the priorityNotSet to the list incidents params +func (o *ListIncidentsParams) WithPriorityNotSet(priorityNotSet *bool) *ListIncidentsParams { + o.SetPriorityNotSet(priorityNotSet) + return o +} + +// SetPriorityNotSet adds the priorityNotSet to the list incidents params +func (o *ListIncidentsParams) SetPriorityNotSet(priorityNotSet *bool) { + o.PriorityNotSet = priorityNotSet +} + +// WithQuery adds the query to the list incidents params +func (o *ListIncidentsParams) WithQuery(query *string) *ListIncidentsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list incidents params +func (o *ListIncidentsParams) SetQuery(query *string) { + o.Query = query +} + +// WithResolvedAtOrAfter adds the resolvedAtOrAfter to the list incidents params +func (o *ListIncidentsParams) WithResolvedAtOrAfter(resolvedAtOrAfter *strfmt.DateTime) *ListIncidentsParams { + o.SetResolvedAtOrAfter(resolvedAtOrAfter) + return o +} + +// SetResolvedAtOrAfter adds the resolvedAtOrAfter to the list incidents params +func (o *ListIncidentsParams) SetResolvedAtOrAfter(resolvedAtOrAfter *strfmt.DateTime) { + o.ResolvedAtOrAfter = resolvedAtOrAfter +} + +// WithResolvedAtOrBefore adds the resolvedAtOrBefore to the list incidents params +func (o *ListIncidentsParams) WithResolvedAtOrBefore(resolvedAtOrBefore *strfmt.DateTime) *ListIncidentsParams { + o.SetResolvedAtOrBefore(resolvedAtOrBefore) + return o +} + +// SetResolvedAtOrBefore adds the resolvedAtOrBefore to the list incidents params +func (o *ListIncidentsParams) SetResolvedAtOrBefore(resolvedAtOrBefore *strfmt.DateTime) { + o.ResolvedAtOrBefore = resolvedAtOrBefore +} + +// WithSavedSearchID adds the savedSearchID to the list incidents params +func (o *ListIncidentsParams) WithSavedSearchID(savedSearchID *string) *ListIncidentsParams { + o.SetSavedSearchID(savedSearchID) + return o +} + +// SetSavedSearchID adds the savedSearchId to the list incidents params +func (o *ListIncidentsParams) SetSavedSearchID(savedSearchID *string) { + o.SavedSearchID = savedSearchID +} + +// WithServices adds the services to the list incidents params +func (o *ListIncidentsParams) WithServices(services *string) *ListIncidentsParams { + o.SetServices(services) + return o +} + +// SetServices adds the services to the list incidents params +func (o *ListIncidentsParams) SetServices(services *string) { + o.Services = services +} + +// WithSeverities adds the severities to the list incidents params +func (o *ListIncidentsParams) WithSeverities(severities *string) *ListIncidentsParams { + o.SetSeverities(severities) + return o +} + +// SetSeverities adds the severities to the list incidents params +func (o *ListIncidentsParams) SetSeverities(severities *string) { + o.Severities = severities +} + +// WithSeverityNotSet adds the severityNotSet to the list incidents params +func (o *ListIncidentsParams) WithSeverityNotSet(severityNotSet *bool) *ListIncidentsParams { + o.SetSeverityNotSet(severityNotSet) + return o +} + +// SetSeverityNotSet adds the severityNotSet to the list incidents params +func (o *ListIncidentsParams) SetSeverityNotSet(severityNotSet *bool) { + o.SeverityNotSet = severityNotSet +} + +// WithStartDate adds the startDate to the list incidents params +func (o *ListIncidentsParams) WithStartDate(startDate *strfmt.Date) *ListIncidentsParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the list incidents params +func (o *ListIncidentsParams) SetStartDate(startDate *strfmt.Date) { + o.StartDate = startDate +} + +// WithStatus adds the status to the list incidents params +func (o *ListIncidentsParams) WithStatus(status *string) *ListIncidentsParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the list incidents params +func (o *ListIncidentsParams) SetStatus(status *string) { + o.Status = status +} + +// WithTagMatchStrategy adds the tagMatchStrategy to the list incidents params +func (o *ListIncidentsParams) WithTagMatchStrategy(tagMatchStrategy *string) *ListIncidentsParams { + o.SetTagMatchStrategy(tagMatchStrategy) + return o +} + +// SetTagMatchStrategy adds the tagMatchStrategy to the list incidents params +func (o *ListIncidentsParams) SetTagMatchStrategy(tagMatchStrategy *string) { + o.TagMatchStrategy = tagMatchStrategy +} + +// WithTags adds the tags to the list incidents params +func (o *ListIncidentsParams) WithTags(tags *string) *ListIncidentsParams { + o.SetTags(tags) + return o +} + +// SetTags adds the tags to the list incidents params +func (o *ListIncidentsParams) SetTags(tags *string) { + o.Tags = tags +} + +// WithTeams adds the teams to the list incidents params +func (o *ListIncidentsParams) WithTeams(teams *string) *ListIncidentsParams { + o.SetTeams(teams) + return o +} + +// SetTeams adds the teams to the list incidents params +func (o *ListIncidentsParams) SetTeams(teams *string) { + o.Teams = teams +} + +// WithUpdatedAfter adds the updatedAfter to the list incidents params +func (o *ListIncidentsParams) WithUpdatedAfter(updatedAfter *strfmt.DateTime) *ListIncidentsParams { + o.SetUpdatedAfter(updatedAfter) + return o +} + +// SetUpdatedAfter adds the updatedAfter to the list incidents params +func (o *ListIncidentsParams) SetUpdatedAfter(updatedAfter *strfmt.DateTime) { + o.UpdatedAfter = updatedAfter +} + +// WithUpdatedBefore adds the updatedBefore to the list incidents params +func (o *ListIncidentsParams) WithUpdatedBefore(updatedBefore *strfmt.DateTime) *ListIncidentsParams { + o.SetUpdatedBefore(updatedBefore) + return o +} + +// SetUpdatedBefore adds the updatedBefore to the list incidents params +func (o *ListIncidentsParams) SetUpdatedBefore(updatedBefore *strfmt.DateTime) { + o.UpdatedBefore = updatedBefore +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Archived != nil { + + // query param archived + var qrArchived bool + + if o.Archived != nil { + qrArchived = *o.Archived + } + qArchived := swag.FormatBool(qrArchived) + if qArchived != "" { + + if err := r.SetQueryParam("archived", qArchived); err != nil { + return err + } + } + } + + if o.AssignedTeams != nil { + + // query param assigned_teams + var qrAssignedTeams string + + if o.AssignedTeams != nil { + qrAssignedTeams = *o.AssignedTeams + } + qAssignedTeams := qrAssignedTeams + if qAssignedTeams != "" { + + if err := r.SetQueryParam("assigned_teams", qAssignedTeams); err != nil { + return err + } + } + } + + if o.ClosedAtOrAfter != nil { + + // query param closed_at_or_after + var qrClosedAtOrAfter strfmt.DateTime + + if o.ClosedAtOrAfter != nil { + qrClosedAtOrAfter = *o.ClosedAtOrAfter + } + qClosedAtOrAfter := qrClosedAtOrAfter.String() + if qClosedAtOrAfter != "" { + + if err := r.SetQueryParam("closed_at_or_after", qClosedAtOrAfter); err != nil { + return err + } + } + } + + if o.ClosedAtOrBefore != nil { + + // query param closed_at_or_before + var qrClosedAtOrBefore strfmt.DateTime + + if o.ClosedAtOrBefore != nil { + qrClosedAtOrBefore = *o.ClosedAtOrBefore + } + qClosedAtOrBefore := qrClosedAtOrBefore.String() + if qClosedAtOrBefore != "" { + + if err := r.SetQueryParam("closed_at_or_before", qClosedAtOrBefore); err != nil { + return err + } + } + } + + if o.Conditions != nil { + + // query param conditions + var qrConditions string + + if o.Conditions != nil { + qrConditions = *o.Conditions + } + qConditions := qrConditions + if qConditions != "" { + + if err := r.SetQueryParam("conditions", qConditions); err != nil { + return err + } + } + } + + if o.CreatedAtOrAfter != nil { + + // query param created_at_or_after + var qrCreatedAtOrAfter strfmt.DateTime + + if o.CreatedAtOrAfter != nil { + qrCreatedAtOrAfter = *o.CreatedAtOrAfter + } + qCreatedAtOrAfter := qrCreatedAtOrAfter.String() + if qCreatedAtOrAfter != "" { + + if err := r.SetQueryParam("created_at_or_after", qCreatedAtOrAfter); err != nil { + return err + } + } + } + + if o.CreatedAtOrBefore != nil { + + // query param created_at_or_before + var qrCreatedAtOrBefore strfmt.DateTime + + if o.CreatedAtOrBefore != nil { + qrCreatedAtOrBefore = *o.CreatedAtOrBefore + } + qCreatedAtOrBefore := qrCreatedAtOrBefore.String() + if qCreatedAtOrBefore != "" { + + if err := r.SetQueryParam("created_at_or_before", qCreatedAtOrBefore); err != nil { + return err + } + } + } + + if o.CurrentMilestones != nil { + + // query param current_milestones + var qrCurrentMilestones string + + if o.CurrentMilestones != nil { + qrCurrentMilestones = *o.CurrentMilestones + } + qCurrentMilestones := qrCurrentMilestones + if qCurrentMilestones != "" { + + if err := r.SetQueryParam("current_milestones", qCurrentMilestones); err != nil { + return err + } + } + } + + if o.EndDate != nil { + + // query param end_date + var qrEndDate strfmt.Date + + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate.String() + if qEndDate != "" { + + if err := r.SetQueryParam("end_date", qEndDate); err != nil { + return err + } + } + } + + if o.Environments != nil { + + // query param environments + var qrEnvironments string + + if o.Environments != nil { + qrEnvironments = *o.Environments + } + qEnvironments := qrEnvironments + if qEnvironments != "" { + + if err := r.SetQueryParam("environments", qEnvironments); err != nil { + return err + } + } + } + + if o.ExcludedInfrastructureIds != nil { + + // query param excluded_infrastructure_ids + var qrExcludedInfrastructureIds string + + if o.ExcludedInfrastructureIds != nil { + qrExcludedInfrastructureIds = *o.ExcludedInfrastructureIds + } + qExcludedInfrastructureIds := qrExcludedInfrastructureIds + if qExcludedInfrastructureIds != "" { + + if err := r.SetQueryParam("excluded_infrastructure_ids", qExcludedInfrastructureIds); err != nil { + return err + } + } + } + + if o.Functionalities != nil { + + // query param functionalities + var qrFunctionalities string + + if o.Functionalities != nil { + qrFunctionalities = *o.Functionalities + } + qFunctionalities := qrFunctionalities + if qFunctionalities != "" { + + if err := r.SetQueryParam("functionalities", qFunctionalities); err != nil { + return err + } + } + } + + if o.IncidentTypeID != nil { + + // query param incident_type_id + var qrIncidentTypeID string + + if o.IncidentTypeID != nil { + qrIncidentTypeID = *o.IncidentTypeID + } + qIncidentTypeID := qrIncidentTypeID + if qIncidentTypeID != "" { + + if err := r.SetQueryParam("incident_type_id", qIncidentTypeID); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Priorities != nil { + + // query param priorities + var qrPriorities string + + if o.Priorities != nil { + qrPriorities = *o.Priorities + } + qPriorities := qrPriorities + if qPriorities != "" { + + if err := r.SetQueryParam("priorities", qPriorities); err != nil { + return err + } + } + } + + if o.PriorityNotSet != nil { + + // query param priority_not_set + var qrPriorityNotSet bool + + if o.PriorityNotSet != nil { + qrPriorityNotSet = *o.PriorityNotSet + } + qPriorityNotSet := swag.FormatBool(qrPriorityNotSet) + if qPriorityNotSet != "" { + + if err := r.SetQueryParam("priority_not_set", qPriorityNotSet); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if o.ResolvedAtOrAfter != nil { + + // query param resolved_at_or_after + var qrResolvedAtOrAfter strfmt.DateTime + + if o.ResolvedAtOrAfter != nil { + qrResolvedAtOrAfter = *o.ResolvedAtOrAfter + } + qResolvedAtOrAfter := qrResolvedAtOrAfter.String() + if qResolvedAtOrAfter != "" { + + if err := r.SetQueryParam("resolved_at_or_after", qResolvedAtOrAfter); err != nil { + return err + } + } + } + + if o.ResolvedAtOrBefore != nil { + + // query param resolved_at_or_before + var qrResolvedAtOrBefore strfmt.DateTime + + if o.ResolvedAtOrBefore != nil { + qrResolvedAtOrBefore = *o.ResolvedAtOrBefore + } + qResolvedAtOrBefore := qrResolvedAtOrBefore.String() + if qResolvedAtOrBefore != "" { + + if err := r.SetQueryParam("resolved_at_or_before", qResolvedAtOrBefore); err != nil { + return err + } + } + } + + if o.SavedSearchID != nil { + + // query param saved_search_id + var qrSavedSearchID string + + if o.SavedSearchID != nil { + qrSavedSearchID = *o.SavedSearchID + } + qSavedSearchID := qrSavedSearchID + if qSavedSearchID != "" { + + if err := r.SetQueryParam("saved_search_id", qSavedSearchID); err != nil { + return err + } + } + } + + if o.Services != nil { + + // query param services + var qrServices string + + if o.Services != nil { + qrServices = *o.Services + } + qServices := qrServices + if qServices != "" { + + if err := r.SetQueryParam("services", qServices); err != nil { + return err + } + } + } + + if o.Severities != nil { + + // query param severities + var qrSeverities string + + if o.Severities != nil { + qrSeverities = *o.Severities + } + qSeverities := qrSeverities + if qSeverities != "" { + + if err := r.SetQueryParam("severities", qSeverities); err != nil { + return err + } + } + } + + if o.SeverityNotSet != nil { + + // query param severity_not_set + var qrSeverityNotSet bool + + if o.SeverityNotSet != nil { + qrSeverityNotSet = *o.SeverityNotSet + } + qSeverityNotSet := swag.FormatBool(qrSeverityNotSet) + if qSeverityNotSet != "" { + + if err := r.SetQueryParam("severity_not_set", qSeverityNotSet); err != nil { + return err + } + } + } + + if o.StartDate != nil { + + // query param start_date + var qrStartDate strfmt.Date + + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate.String() + if qStartDate != "" { + + if err := r.SetQueryParam("start_date", qStartDate); err != nil { + return err + } + } + } + + if o.Status != nil { + + // query param status + var qrStatus string + + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + + if err := r.SetQueryParam("status", qStatus); err != nil { + return err + } + } + } + + if o.TagMatchStrategy != nil { + + // query param tag_match_strategy + var qrTagMatchStrategy string + + if o.TagMatchStrategy != nil { + qrTagMatchStrategy = *o.TagMatchStrategy + } + qTagMatchStrategy := qrTagMatchStrategy + if qTagMatchStrategy != "" { + + if err := r.SetQueryParam("tag_match_strategy", qTagMatchStrategy); err != nil { + return err + } + } + } + + if o.Tags != nil { + + // query param tags + var qrTags string + + if o.Tags != nil { + qrTags = *o.Tags + } + qTags := qrTags + if qTags != "" { + + if err := r.SetQueryParam("tags", qTags); err != nil { + return err + } + } + } + + if o.Teams != nil { + + // query param teams + var qrTeams string + + if o.Teams != nil { + qrTeams = *o.Teams + } + qTeams := qrTeams + if qTeams != "" { + + if err := r.SetQueryParam("teams", qTeams); err != nil { + return err + } + } + } + + if o.UpdatedAfter != nil { + + // query param updated_after + var qrUpdatedAfter strfmt.DateTime + + if o.UpdatedAfter != nil { + qrUpdatedAfter = *o.UpdatedAfter + } + qUpdatedAfter := qrUpdatedAfter.String() + if qUpdatedAfter != "" { + + if err := r.SetQueryParam("updated_after", qUpdatedAfter); err != nil { + return err + } + } + } + + if o.UpdatedBefore != nil { + + // query param updated_before + var qrUpdatedBefore strfmt.DateTime + + if o.UpdatedBefore != nil { + qrUpdatedBefore = *o.UpdatedBefore + } + qUpdatedBefore := qrUpdatedBefore.String() + if qUpdatedBefore != "" { + + if err := r.SetQueryParam("updated_before", qUpdatedBefore); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/list_incidents_responses.go b/client/incidents/list_incidents_responses.go new file mode 100644 index 0000000..b64a4f9 --- /dev/null +++ b/client/incidents/list_incidents_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentsReader is a Reader for the ListIncidents structure. +type ListIncidentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentsOK creates a ListIncidentsOK with default headers values +func NewListIncidentsOK() *ListIncidentsOK { + return &ListIncidentsOK{} +} + +/* +ListIncidentsOK describes a response with status code 200, with default header values. + +List all of the incidents in the organization +*/ +type ListIncidentsOK struct { + Payload *models.IncidentEntityPaginated +} + +// IsSuccess returns true when this list incidents o k response has a 2xx status code +func (o *ListIncidentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incidents o k response has a 3xx status code +func (o *ListIncidentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incidents o k response has a 4xx status code +func (o *ListIncidentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incidents o k response has a 5xx status code +func (o *ListIncidentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incidents o k response a status code equal to that given +func (o *ListIncidentsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentsOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents][%d] listIncidentsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentsOK) String() string { + return fmt.Sprintf("[GET /v1/incidents][%d] listIncidentsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentsOK) GetPayload() *models.IncidentEntityPaginated { + return o.Payload +} + +func (o *ListIncidentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/list_scheduled_maintenances_parameters.go b/client/incidents/list_scheduled_maintenances_parameters.go new file mode 100644 index 0000000..e4dbff0 --- /dev/null +++ b/client/incidents/list_scheduled_maintenances_parameters.go @@ -0,0 +1,230 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListScheduledMaintenancesParams creates a new ListScheduledMaintenancesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListScheduledMaintenancesParams() *ListScheduledMaintenancesParams { + return &ListScheduledMaintenancesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListScheduledMaintenancesParamsWithTimeout creates a new ListScheduledMaintenancesParams object +// with the ability to set a timeout on a request. +func NewListScheduledMaintenancesParamsWithTimeout(timeout time.Duration) *ListScheduledMaintenancesParams { + return &ListScheduledMaintenancesParams{ + timeout: timeout, + } +} + +// NewListScheduledMaintenancesParamsWithContext creates a new ListScheduledMaintenancesParams object +// with the ability to set a context for a request. +func NewListScheduledMaintenancesParamsWithContext(ctx context.Context) *ListScheduledMaintenancesParams { + return &ListScheduledMaintenancesParams{ + Context: ctx, + } +} + +// NewListScheduledMaintenancesParamsWithHTTPClient creates a new ListScheduledMaintenancesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListScheduledMaintenancesParamsWithHTTPClient(client *http.Client) *ListScheduledMaintenancesParams { + return &ListScheduledMaintenancesParams{ + HTTPClient: client, + } +} + +/* +ListScheduledMaintenancesParams contains all the parameters to send to the API endpoint + + for the list scheduled maintenances operation. + + Typically these are written to a http.Request. +*/ +type ListScheduledMaintenancesParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + Filter scheduled_maintenances with a query on their name + */ + Query *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list scheduled maintenances params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListScheduledMaintenancesParams) WithDefaults() *ListScheduledMaintenancesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list scheduled maintenances params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListScheduledMaintenancesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list scheduled maintenances params +func (o *ListScheduledMaintenancesParams) WithTimeout(timeout time.Duration) *ListScheduledMaintenancesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list scheduled maintenances params +func (o *ListScheduledMaintenancesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list scheduled maintenances params +func (o *ListScheduledMaintenancesParams) WithContext(ctx context.Context) *ListScheduledMaintenancesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list scheduled maintenances params +func (o *ListScheduledMaintenancesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list scheduled maintenances params +func (o *ListScheduledMaintenancesParams) WithHTTPClient(client *http.Client) *ListScheduledMaintenancesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list scheduled maintenances params +func (o *ListScheduledMaintenancesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list scheduled maintenances params +func (o *ListScheduledMaintenancesParams) WithPage(page *int32) *ListScheduledMaintenancesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list scheduled maintenances params +func (o *ListScheduledMaintenancesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list scheduled maintenances params +func (o *ListScheduledMaintenancesParams) WithPerPage(perPage *int32) *ListScheduledMaintenancesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list scheduled maintenances params +func (o *ListScheduledMaintenancesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list scheduled maintenances params +func (o *ListScheduledMaintenancesParams) WithQuery(query *string) *ListScheduledMaintenancesParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list scheduled maintenances params +func (o *ListScheduledMaintenancesParams) SetQuery(query *string) { + o.Query = query +} + +// WriteToRequest writes these params to a swagger request +func (o *ListScheduledMaintenancesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/list_scheduled_maintenances_responses.go b/client/incidents/list_scheduled_maintenances_responses.go new file mode 100644 index 0000000..304bec6 --- /dev/null +++ b/client/incidents/list_scheduled_maintenances_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListScheduledMaintenancesReader is a Reader for the ListScheduledMaintenances structure. +type ListScheduledMaintenancesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListScheduledMaintenancesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListScheduledMaintenancesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListScheduledMaintenancesOK creates a ListScheduledMaintenancesOK with default headers values +func NewListScheduledMaintenancesOK() *ListScheduledMaintenancesOK { + return &ListScheduledMaintenancesOK{} +} + +/* +ListScheduledMaintenancesOK describes a response with status code 200, with default header values. + +Lists all scheduled maintenance events +*/ +type ListScheduledMaintenancesOK struct { + Payload *models.ScheduledMaintenanceEntity +} + +// IsSuccess returns true when this list scheduled maintenances o k response has a 2xx status code +func (o *ListScheduledMaintenancesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list scheduled maintenances o k response has a 3xx status code +func (o *ListScheduledMaintenancesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list scheduled maintenances o k response has a 4xx status code +func (o *ListScheduledMaintenancesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list scheduled maintenances o k response has a 5xx status code +func (o *ListScheduledMaintenancesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list scheduled maintenances o k response a status code equal to that given +func (o *ListScheduledMaintenancesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListScheduledMaintenancesOK) Error() string { + return fmt.Sprintf("[GET /v1/scheduled_maintenances][%d] listScheduledMaintenancesOK %+v", 200, o.Payload) +} + +func (o *ListScheduledMaintenancesOK) String() string { + return fmt.Sprintf("[GET /v1/scheduled_maintenances][%d] listScheduledMaintenancesOK %+v", 200, o.Payload) +} + +func (o *ListScheduledMaintenancesOK) GetPayload() *models.ScheduledMaintenanceEntity { + return o.Payload +} + +func (o *ListScheduledMaintenancesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ScheduledMaintenanceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/list_similar_incidents_parameters.go b/client/incidents/list_similar_incidents_parameters.go new file mode 100644 index 0000000..9bd454a --- /dev/null +++ b/client/incidents/list_similar_incidents_parameters.go @@ -0,0 +1,231 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListSimilarIncidentsParams creates a new ListSimilarIncidentsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSimilarIncidentsParams() *ListSimilarIncidentsParams { + return &ListSimilarIncidentsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSimilarIncidentsParamsWithTimeout creates a new ListSimilarIncidentsParams object +// with the ability to set a timeout on a request. +func NewListSimilarIncidentsParamsWithTimeout(timeout time.Duration) *ListSimilarIncidentsParams { + return &ListSimilarIncidentsParams{ + timeout: timeout, + } +} + +// NewListSimilarIncidentsParamsWithContext creates a new ListSimilarIncidentsParams object +// with the ability to set a context for a request. +func NewListSimilarIncidentsParamsWithContext(ctx context.Context) *ListSimilarIncidentsParams { + return &ListSimilarIncidentsParams{ + Context: ctx, + } +} + +// NewListSimilarIncidentsParamsWithHTTPClient creates a new ListSimilarIncidentsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSimilarIncidentsParamsWithHTTPClient(client *http.Client) *ListSimilarIncidentsParams { + return &ListSimilarIncidentsParams{ + HTTPClient: client, + } +} + +/* +ListSimilarIncidentsParams contains all the parameters to send to the API endpoint + + for the list similar incidents operation. + + Typically these are written to a http.Request. +*/ +type ListSimilarIncidentsParams struct { + + // IncidentID. + IncidentID string + + // Limit. + // + // Format: int32 + // Default: 5 + Limit *int32 + + // Threshold. + // + // Format: float + // Default: 0.2 + Threshold *float32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list similar incidents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSimilarIncidentsParams) WithDefaults() *ListSimilarIncidentsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list similar incidents params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSimilarIncidentsParams) SetDefaults() { + var ( + limitDefault = int32(5) + + thresholdDefault = float32(0.2) + ) + + val := ListSimilarIncidentsParams{ + Limit: &limitDefault, + Threshold: &thresholdDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the list similar incidents params +func (o *ListSimilarIncidentsParams) WithTimeout(timeout time.Duration) *ListSimilarIncidentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list similar incidents params +func (o *ListSimilarIncidentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list similar incidents params +func (o *ListSimilarIncidentsParams) WithContext(ctx context.Context) *ListSimilarIncidentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list similar incidents params +func (o *ListSimilarIncidentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list similar incidents params +func (o *ListSimilarIncidentsParams) WithHTTPClient(client *http.Client) *ListSimilarIncidentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list similar incidents params +func (o *ListSimilarIncidentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list similar incidents params +func (o *ListSimilarIncidentsParams) WithIncidentID(incidentID string) *ListSimilarIncidentsParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list similar incidents params +func (o *ListSimilarIncidentsParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithLimit adds the limit to the list similar incidents params +func (o *ListSimilarIncidentsParams) WithLimit(limit *int32) *ListSimilarIncidentsParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the list similar incidents params +func (o *ListSimilarIncidentsParams) SetLimit(limit *int32) { + o.Limit = limit +} + +// WithThreshold adds the threshold to the list similar incidents params +func (o *ListSimilarIncidentsParams) WithThreshold(threshold *float32) *ListSimilarIncidentsParams { + o.SetThreshold(threshold) + return o +} + +// SetThreshold adds the threshold to the list similar incidents params +func (o *ListSimilarIncidentsParams) SetThreshold(threshold *float32) { + o.Threshold = threshold +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSimilarIncidentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if o.Limit != nil { + + // query param limit + var qrLimit int32 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt32(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Threshold != nil { + + // query param threshold + var qrThreshold float32 + + if o.Threshold != nil { + qrThreshold = *o.Threshold + } + qThreshold := swag.FormatFloat32(qrThreshold) + if qThreshold != "" { + + if err := r.SetQueryParam("threshold", qThreshold); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/list_similar_incidents_responses.go b/client/incidents/list_similar_incidents_responses.go new file mode 100644 index 0000000..155788f --- /dev/null +++ b/client/incidents/list_similar_incidents_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListSimilarIncidentsReader is a Reader for the ListSimilarIncidents structure. +type ListSimilarIncidentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSimilarIncidentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSimilarIncidentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListSimilarIncidentsOK creates a ListSimilarIncidentsOK with default headers values +func NewListSimilarIncidentsOK() *ListSimilarIncidentsOK { + return &ListSimilarIncidentsOK{} +} + +/* +ListSimilarIncidentsOK describes a response with status code 200, with default header values. + +Retrieve a list of similar incidents +*/ +type ListSimilarIncidentsOK struct { + Payload *models.SimilarIncidentEntityPaginated +} + +// IsSuccess returns true when this list similar incidents o k response has a 2xx status code +func (o *ListSimilarIncidentsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list similar incidents o k response has a 3xx status code +func (o *ListSimilarIncidentsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list similar incidents o k response has a 4xx status code +func (o *ListSimilarIncidentsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list similar incidents o k response has a 5xx status code +func (o *ListSimilarIncidentsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list similar incidents o k response a status code equal to that given +func (o *ListSimilarIncidentsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListSimilarIncidentsOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/similar][%d] listSimilarIncidentsOK %+v", 200, o.Payload) +} + +func (o *ListSimilarIncidentsOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/similar][%d] listSimilarIncidentsOK %+v", 200, o.Payload) +} + +func (o *ListSimilarIncidentsOK) GetPayload() *models.SimilarIncidentEntityPaginated { + return o.Payload +} + +func (o *ListSimilarIncidentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SimilarIncidentEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/list_transcript_entries_parameters.go b/client/incidents/list_transcript_entries_parameters.go new file mode 100644 index 0000000..4bbda6e --- /dev/null +++ b/client/incidents/list_transcript_entries_parameters.go @@ -0,0 +1,263 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListTranscriptEntriesParams creates a new ListTranscriptEntriesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListTranscriptEntriesParams() *ListTranscriptEntriesParams { + return &ListTranscriptEntriesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListTranscriptEntriesParamsWithTimeout creates a new ListTranscriptEntriesParams object +// with the ability to set a timeout on a request. +func NewListTranscriptEntriesParamsWithTimeout(timeout time.Duration) *ListTranscriptEntriesParams { + return &ListTranscriptEntriesParams{ + timeout: timeout, + } +} + +// NewListTranscriptEntriesParamsWithContext creates a new ListTranscriptEntriesParams object +// with the ability to set a context for a request. +func NewListTranscriptEntriesParamsWithContext(ctx context.Context) *ListTranscriptEntriesParams { + return &ListTranscriptEntriesParams{ + Context: ctx, + } +} + +// NewListTranscriptEntriesParamsWithHTTPClient creates a new ListTranscriptEntriesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListTranscriptEntriesParamsWithHTTPClient(client *http.Client) *ListTranscriptEntriesParams { + return &ListTranscriptEntriesParams{ + HTTPClient: client, + } +} + +/* +ListTranscriptEntriesParams contains all the parameters to send to the API endpoint + + for the list transcript entries operation. + + Typically these are written to a http.Request. +*/ +type ListTranscriptEntriesParams struct { + + /* After. + + The ID of the transcript entry to start after. + */ + After *string + + /* Before. + + The ID of the transcript entry to start before. + */ + Before *string + + // IncidentID. + IncidentID string + + /* Sort. + + The order to sort the transcript entries. + + Default: "asc" + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list transcript entries params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTranscriptEntriesParams) WithDefaults() *ListTranscriptEntriesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list transcript entries params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTranscriptEntriesParams) SetDefaults() { + var ( + sortDefault = string("asc") + ) + + val := ListTranscriptEntriesParams{ + Sort: &sortDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the list transcript entries params +func (o *ListTranscriptEntriesParams) WithTimeout(timeout time.Duration) *ListTranscriptEntriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list transcript entries params +func (o *ListTranscriptEntriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list transcript entries params +func (o *ListTranscriptEntriesParams) WithContext(ctx context.Context) *ListTranscriptEntriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list transcript entries params +func (o *ListTranscriptEntriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list transcript entries params +func (o *ListTranscriptEntriesParams) WithHTTPClient(client *http.Client) *ListTranscriptEntriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list transcript entries params +func (o *ListTranscriptEntriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAfter adds the after to the list transcript entries params +func (o *ListTranscriptEntriesParams) WithAfter(after *string) *ListTranscriptEntriesParams { + o.SetAfter(after) + return o +} + +// SetAfter adds the after to the list transcript entries params +func (o *ListTranscriptEntriesParams) SetAfter(after *string) { + o.After = after +} + +// WithBefore adds the before to the list transcript entries params +func (o *ListTranscriptEntriesParams) WithBefore(before *string) *ListTranscriptEntriesParams { + o.SetBefore(before) + return o +} + +// SetBefore adds the before to the list transcript entries params +func (o *ListTranscriptEntriesParams) SetBefore(before *string) { + o.Before = before +} + +// WithIncidentID adds the incidentID to the list transcript entries params +func (o *ListTranscriptEntriesParams) WithIncidentID(incidentID string) *ListTranscriptEntriesParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list transcript entries params +func (o *ListTranscriptEntriesParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithSort adds the sort to the list transcript entries params +func (o *ListTranscriptEntriesParams) WithSort(sort *string) *ListTranscriptEntriesParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the list transcript entries params +func (o *ListTranscriptEntriesParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *ListTranscriptEntriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.After != nil { + + // query param after + var qrAfter string + + if o.After != nil { + qrAfter = *o.After + } + qAfter := qrAfter + if qAfter != "" { + + if err := r.SetQueryParam("after", qAfter); err != nil { + return err + } + } + } + + if o.Before != nil { + + // query param before + var qrBefore string + + if o.Before != nil { + qrBefore = *o.Before + } + qBefore := qrBefore + if qBefore != "" { + + if err := r.SetQueryParam("before", qBefore); err != nil { + return err + } + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if o.Sort != nil { + + // query param sort + var qrSort string + + if o.Sort != nil { + qrSort = *o.Sort + } + qSort := qrSort + if qSort != "" { + + if err := r.SetQueryParam("sort", qSort); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/list_transcript_entries_responses.go b/client/incidents/list_transcript_entries_responses.go new file mode 100644 index 0000000..fe4e2a0 --- /dev/null +++ b/client/incidents/list_transcript_entries_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListTranscriptEntriesReader is a Reader for the ListTranscriptEntries structure. +type ListTranscriptEntriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListTranscriptEntriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListTranscriptEntriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListTranscriptEntriesOK creates a ListTranscriptEntriesOK with default headers values +func NewListTranscriptEntriesOK() *ListTranscriptEntriesOK { + return &ListTranscriptEntriesOK{} +} + +/* +ListTranscriptEntriesOK describes a response with status code 200, with default header values. + +Retrieve the transcript for a specific incident +*/ +type ListTranscriptEntriesOK struct { + Payload *models.PublicAPIV1IncidentsTranscriptEntity +} + +// IsSuccess returns true when this list transcript entries o k response has a 2xx status code +func (o *ListTranscriptEntriesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list transcript entries o k response has a 3xx status code +func (o *ListTranscriptEntriesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list transcript entries o k response has a 4xx status code +func (o *ListTranscriptEntriesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list transcript entries o k response has a 5xx status code +func (o *ListTranscriptEntriesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list transcript entries o k response a status code equal to that given +func (o *ListTranscriptEntriesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListTranscriptEntriesOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/transcript][%d] listTranscriptEntriesOK %+v", 200, o.Payload) +} + +func (o *ListTranscriptEntriesOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/transcript][%d] listTranscriptEntriesOK %+v", 200, o.Payload) +} + +func (o *ListTranscriptEntriesOK) GetPayload() *models.PublicAPIV1IncidentsTranscriptEntity { + return o.Payload +} + +func (o *ListTranscriptEntriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PublicAPIV1IncidentsTranscriptEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/resolve_incident_parameters.go b/client/incidents/resolve_incident_parameters.go new file mode 100644 index 0000000..30810b2 --- /dev/null +++ b/client/incidents/resolve_incident_parameters.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewResolveIncidentParams creates a new ResolveIncidentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewResolveIncidentParams() *ResolveIncidentParams { + return &ResolveIncidentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewResolveIncidentParamsWithTimeout creates a new ResolveIncidentParams object +// with the ability to set a timeout on a request. +func NewResolveIncidentParamsWithTimeout(timeout time.Duration) *ResolveIncidentParams { + return &ResolveIncidentParams{ + timeout: timeout, + } +} + +// NewResolveIncidentParamsWithContext creates a new ResolveIncidentParams object +// with the ability to set a context for a request. +func NewResolveIncidentParamsWithContext(ctx context.Context) *ResolveIncidentParams { + return &ResolveIncidentParams{ + Context: ctx, + } +} + +// NewResolveIncidentParamsWithHTTPClient creates a new ResolveIncidentParams object +// with the ability to set a custom HTTPClient for a request. +func NewResolveIncidentParamsWithHTTPClient(client *http.Client) *ResolveIncidentParams { + return &ResolveIncidentParams{ + HTTPClient: client, + } +} + +/* +ResolveIncidentParams contains all the parameters to send to the API endpoint + + for the resolve incident operation. + + Typically these are written to a http.Request. +*/ +type ResolveIncidentParams struct { + + // IncidentID. + IncidentID string + + /* Milestone. + + The slug of any milestone in the post-incident or closed phase to set on the incident (and its children, if `resolve_children` os set). Must be one of the configured milestones available on this incident. + */ + Milestone *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the resolve incident params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResolveIncidentParams) WithDefaults() *ResolveIncidentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the resolve incident params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResolveIncidentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the resolve incident params +func (o *ResolveIncidentParams) WithTimeout(timeout time.Duration) *ResolveIncidentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the resolve incident params +func (o *ResolveIncidentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the resolve incident params +func (o *ResolveIncidentParams) WithContext(ctx context.Context) *ResolveIncidentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the resolve incident params +func (o *ResolveIncidentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the resolve incident params +func (o *ResolveIncidentParams) WithHTTPClient(client *http.Client) *ResolveIncidentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the resolve incident params +func (o *ResolveIncidentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the resolve incident params +func (o *ResolveIncidentParams) WithIncidentID(incidentID string) *ResolveIncidentParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the resolve incident params +func (o *ResolveIncidentParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithMilestone adds the milestone to the resolve incident params +func (o *ResolveIncidentParams) WithMilestone(milestone *string) *ResolveIncidentParams { + o.SetMilestone(milestone) + return o +} + +// SetMilestone adds the milestone to the resolve incident params +func (o *ResolveIncidentParams) SetMilestone(milestone *string) { + o.Milestone = milestone +} + +// WriteToRequest writes these params to a swagger request +func (o *ResolveIncidentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if o.Milestone != nil { + + // form param milestone + var frMilestone string + if o.Milestone != nil { + frMilestone = *o.Milestone + } + fMilestone := frMilestone + if fMilestone != "" { + if err := r.SetFormParam("milestone", fMilestone); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/resolve_incident_responses.go b/client/incidents/resolve_incident_responses.go new file mode 100644 index 0000000..494e4f3 --- /dev/null +++ b/client/incidents/resolve_incident_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ResolveIncidentReader is a Reader for the ResolveIncident structure. +type ResolveIncidentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ResolveIncidentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewResolveIncidentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewResolveIncidentOK creates a ResolveIncidentOK with default headers values +func NewResolveIncidentOK() *ResolveIncidentOK { + return &ResolveIncidentOK{} +} + +/* +ResolveIncidentOK describes a response with status code 200, with default header values. + +Resolves a currently active incident +*/ +type ResolveIncidentOK struct { + Payload *models.IncidentEntity +} + +// IsSuccess returns true when this resolve incident o k response has a 2xx status code +func (o *ResolveIncidentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this resolve incident o k response has a 3xx status code +func (o *ResolveIncidentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this resolve incident o k response has a 4xx status code +func (o *ResolveIncidentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this resolve incident o k response has a 5xx status code +func (o *ResolveIncidentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this resolve incident o k response a status code equal to that given +func (o *ResolveIncidentOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ResolveIncidentOK) Error() string { + return fmt.Sprintf("[PUT /v1/incidents/{incident_id}/resolve][%d] resolveIncidentOK %+v", 200, o.Payload) +} + +func (o *ResolveIncidentOK) String() string { + return fmt.Sprintf("[PUT /v1/incidents/{incident_id}/resolve][%d] resolveIncidentOK %+v", 200, o.Payload) +} + +func (o *ResolveIncidentOK) GetPayload() *models.IncidentEntity { + return o.Payload +} + +func (o *ResolveIncidentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/unarchive_incident_parameters.go b/client/incidents/unarchive_incident_parameters.go new file mode 100644 index 0000000..e38f2dd --- /dev/null +++ b/client/incidents/unarchive_incident_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUnarchiveIncidentParams creates a new UnarchiveIncidentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUnarchiveIncidentParams() *UnarchiveIncidentParams { + return &UnarchiveIncidentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUnarchiveIncidentParamsWithTimeout creates a new UnarchiveIncidentParams object +// with the ability to set a timeout on a request. +func NewUnarchiveIncidentParamsWithTimeout(timeout time.Duration) *UnarchiveIncidentParams { + return &UnarchiveIncidentParams{ + timeout: timeout, + } +} + +// NewUnarchiveIncidentParamsWithContext creates a new UnarchiveIncidentParams object +// with the ability to set a context for a request. +func NewUnarchiveIncidentParamsWithContext(ctx context.Context) *UnarchiveIncidentParams { + return &UnarchiveIncidentParams{ + Context: ctx, + } +} + +// NewUnarchiveIncidentParamsWithHTTPClient creates a new UnarchiveIncidentParams object +// with the ability to set a custom HTTPClient for a request. +func NewUnarchiveIncidentParamsWithHTTPClient(client *http.Client) *UnarchiveIncidentParams { + return &UnarchiveIncidentParams{ + HTTPClient: client, + } +} + +/* +UnarchiveIncidentParams contains all the parameters to send to the API endpoint + + for the unarchive incident operation. + + Typically these are written to a http.Request. +*/ +type UnarchiveIncidentParams struct { + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the unarchive incident params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UnarchiveIncidentParams) WithDefaults() *UnarchiveIncidentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the unarchive incident params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UnarchiveIncidentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the unarchive incident params +func (o *UnarchiveIncidentParams) WithTimeout(timeout time.Duration) *UnarchiveIncidentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the unarchive incident params +func (o *UnarchiveIncidentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the unarchive incident params +func (o *UnarchiveIncidentParams) WithContext(ctx context.Context) *UnarchiveIncidentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the unarchive incident params +func (o *UnarchiveIncidentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the unarchive incident params +func (o *UnarchiveIncidentParams) WithHTTPClient(client *http.Client) *UnarchiveIncidentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the unarchive incident params +func (o *UnarchiveIncidentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the unarchive incident params +func (o *UnarchiveIncidentParams) WithIncidentID(incidentID string) *UnarchiveIncidentParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the unarchive incident params +func (o *UnarchiveIncidentParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *UnarchiveIncidentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/unarchive_incident_responses.go b/client/incidents/unarchive_incident_responses.go new file mode 100644 index 0000000..8551c6f --- /dev/null +++ b/client/incidents/unarchive_incident_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UnarchiveIncidentReader is a Reader for the UnarchiveIncident structure. +type UnarchiveIncidentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UnarchiveIncidentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewUnarchiveIncidentCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUnarchiveIncidentCreated creates a UnarchiveIncidentCreated with default headers values +func NewUnarchiveIncidentCreated() *UnarchiveIncidentCreated { + return &UnarchiveIncidentCreated{} +} + +/* +UnarchiveIncidentCreated describes a response with status code 201, with default header values. + +Unarchive an incident +*/ +type UnarchiveIncidentCreated struct { + Payload *models.IncidentEntity +} + +// IsSuccess returns true when this unarchive incident created response has a 2xx status code +func (o *UnarchiveIncidentCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this unarchive incident created response has a 3xx status code +func (o *UnarchiveIncidentCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this unarchive incident created response has a 4xx status code +func (o *UnarchiveIncidentCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this unarchive incident created response has a 5xx status code +func (o *UnarchiveIncidentCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this unarchive incident created response a status code equal to that given +func (o *UnarchiveIncidentCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *UnarchiveIncidentCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/unarchive][%d] unarchiveIncidentCreated %+v", 201, o.Payload) +} + +func (o *UnarchiveIncidentCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/unarchive][%d] unarchiveIncidentCreated %+v", 201, o.Payload) +} + +func (o *UnarchiveIncidentCreated) GetPayload() *models.IncidentEntity { + return o.Payload +} + +func (o *UnarchiveIncidentCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/update_incident_change_event_parameters.go b/client/incidents/update_incident_change_event_parameters.go new file mode 100644 index 0000000..f21d284 --- /dev/null +++ b/client/incidents/update_incident_change_event_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateIncidentChangeEventParams creates a new UpdateIncidentChangeEventParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIncidentChangeEventParams() *UpdateIncidentChangeEventParams { + return &UpdateIncidentChangeEventParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIncidentChangeEventParamsWithTimeout creates a new UpdateIncidentChangeEventParams object +// with the ability to set a timeout on a request. +func NewUpdateIncidentChangeEventParamsWithTimeout(timeout time.Duration) *UpdateIncidentChangeEventParams { + return &UpdateIncidentChangeEventParams{ + timeout: timeout, + } +} + +// NewUpdateIncidentChangeEventParamsWithContext creates a new UpdateIncidentChangeEventParams object +// with the ability to set a context for a request. +func NewUpdateIncidentChangeEventParamsWithContext(ctx context.Context) *UpdateIncidentChangeEventParams { + return &UpdateIncidentChangeEventParams{ + Context: ctx, + } +} + +// NewUpdateIncidentChangeEventParamsWithHTTPClient creates a new UpdateIncidentChangeEventParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIncidentChangeEventParamsWithHTTPClient(client *http.Client) *UpdateIncidentChangeEventParams { + return &UpdateIncidentChangeEventParams{ + HTTPClient: client, + } +} + +/* +UpdateIncidentChangeEventParams contains all the parameters to send to the API endpoint + + for the update incident change event operation. + + Typically these are written to a http.Request. +*/ +type UpdateIncidentChangeEventParams struct { + + // IncidentID. + IncidentID string + + // RelatedChangeEventID. + RelatedChangeEventID string + + // UpdateIncidentChangeEvent. + UpdateIncidentChangeEvent *models.UpdateIncidentChangeEvent + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update incident change event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentChangeEventParams) WithDefaults() *UpdateIncidentChangeEventParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update incident change event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentChangeEventParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update incident change event params +func (o *UpdateIncidentChangeEventParams) WithTimeout(timeout time.Duration) *UpdateIncidentChangeEventParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update incident change event params +func (o *UpdateIncidentChangeEventParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update incident change event params +func (o *UpdateIncidentChangeEventParams) WithContext(ctx context.Context) *UpdateIncidentChangeEventParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update incident change event params +func (o *UpdateIncidentChangeEventParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update incident change event params +func (o *UpdateIncidentChangeEventParams) WithHTTPClient(client *http.Client) *UpdateIncidentChangeEventParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update incident change event params +func (o *UpdateIncidentChangeEventParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the update incident change event params +func (o *UpdateIncidentChangeEventParams) WithIncidentID(incidentID string) *UpdateIncidentChangeEventParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the update incident change event params +func (o *UpdateIncidentChangeEventParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithRelatedChangeEventID adds the relatedChangeEventID to the update incident change event params +func (o *UpdateIncidentChangeEventParams) WithRelatedChangeEventID(relatedChangeEventID string) *UpdateIncidentChangeEventParams { + o.SetRelatedChangeEventID(relatedChangeEventID) + return o +} + +// SetRelatedChangeEventID adds the relatedChangeEventId to the update incident change event params +func (o *UpdateIncidentChangeEventParams) SetRelatedChangeEventID(relatedChangeEventID string) { + o.RelatedChangeEventID = relatedChangeEventID +} + +// WithUpdateIncidentChangeEvent adds the updateIncidentChangeEvent to the update incident change event params +func (o *UpdateIncidentChangeEventParams) WithUpdateIncidentChangeEvent(updateIncidentChangeEvent *models.UpdateIncidentChangeEvent) *UpdateIncidentChangeEventParams { + o.SetUpdateIncidentChangeEvent(updateIncidentChangeEvent) + return o +} + +// SetUpdateIncidentChangeEvent adds the updateIncidentChangeEvent to the update incident change event params +func (o *UpdateIncidentChangeEventParams) SetUpdateIncidentChangeEvent(updateIncidentChangeEvent *models.UpdateIncidentChangeEvent) { + o.UpdateIncidentChangeEvent = updateIncidentChangeEvent +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIncidentChangeEventParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param related_change_event_id + if err := r.SetPathParam("related_change_event_id", o.RelatedChangeEventID); err != nil { + return err + } + if o.UpdateIncidentChangeEvent != nil { + if err := r.SetBodyParam(o.UpdateIncidentChangeEvent); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/update_incident_change_event_responses.go b/client/incidents/update_incident_change_event_responses.go new file mode 100644 index 0000000..076f836 --- /dev/null +++ b/client/incidents/update_incident_change_event_responses.go @@ -0,0 +1,236 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateIncidentChangeEventReader is a Reader for the UpdateIncidentChangeEvent structure. +type UpdateIncidentChangeEventReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIncidentChangeEventReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIncidentChangeEventOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateIncidentChangeEventBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUpdateIncidentChangeEventConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIncidentChangeEventOK creates a UpdateIncidentChangeEventOK with default headers values +func NewUpdateIncidentChangeEventOK() *UpdateIncidentChangeEventOK { + return &UpdateIncidentChangeEventOK{} +} + +/* +UpdateIncidentChangeEventOK describes a response with status code 200, with default header values. + +Update a change attached to an incident +*/ +type UpdateIncidentChangeEventOK struct { + Payload *models.IncidentsRelatedChangeEventEntity +} + +// IsSuccess returns true when this update incident change event o k response has a 2xx status code +func (o *UpdateIncidentChangeEventOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update incident change event o k response has a 3xx status code +func (o *UpdateIncidentChangeEventOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident change event o k response has a 4xx status code +func (o *UpdateIncidentChangeEventOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update incident change event o k response has a 5xx status code +func (o *UpdateIncidentChangeEventOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident change event o k response a status code equal to that given +func (o *UpdateIncidentChangeEventOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateIncidentChangeEventOK) Error() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/related_change_events/{related_change_event_id}][%d] updateIncidentChangeEventOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentChangeEventOK) String() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/related_change_events/{related_change_event_id}][%d] updateIncidentChangeEventOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentChangeEventOK) GetPayload() *models.IncidentsRelatedChangeEventEntity { + return o.Payload +} + +func (o *UpdateIncidentChangeEventOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRelatedChangeEventEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateIncidentChangeEventBadRequest creates a UpdateIncidentChangeEventBadRequest with default headers values +func NewUpdateIncidentChangeEventBadRequest() *UpdateIncidentChangeEventBadRequest { + return &UpdateIncidentChangeEventBadRequest{} +} + +/* +UpdateIncidentChangeEventBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type UpdateIncidentChangeEventBadRequest struct { + Payload *models.ErrorEntity +} + +// IsSuccess returns true when this update incident change event bad request response has a 2xx status code +func (o *UpdateIncidentChangeEventBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update incident change event bad request response has a 3xx status code +func (o *UpdateIncidentChangeEventBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident change event bad request response has a 4xx status code +func (o *UpdateIncidentChangeEventBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update incident change event bad request response has a 5xx status code +func (o *UpdateIncidentChangeEventBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident change event bad request response a status code equal to that given +func (o *UpdateIncidentChangeEventBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *UpdateIncidentChangeEventBadRequest) Error() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/related_change_events/{related_change_event_id}][%d] updateIncidentChangeEventBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateIncidentChangeEventBadRequest) String() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/related_change_events/{related_change_event_id}][%d] updateIncidentChangeEventBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateIncidentChangeEventBadRequest) GetPayload() *models.ErrorEntity { + return o.Payload +} + +func (o *UpdateIncidentChangeEventBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateIncidentChangeEventConflict creates a UpdateIncidentChangeEventConflict with default headers values +func NewUpdateIncidentChangeEventConflict() *UpdateIncidentChangeEventConflict { + return &UpdateIncidentChangeEventConflict{} +} + +/* +UpdateIncidentChangeEventConflict describes a response with status code 409, with default header values. + +Already Added +*/ +type UpdateIncidentChangeEventConflict struct { + Payload *models.ErrorEntity +} + +// IsSuccess returns true when this update incident change event conflict response has a 2xx status code +func (o *UpdateIncidentChangeEventConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update incident change event conflict response has a 3xx status code +func (o *UpdateIncidentChangeEventConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident change event conflict response has a 4xx status code +func (o *UpdateIncidentChangeEventConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this update incident change event conflict response has a 5xx status code +func (o *UpdateIncidentChangeEventConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident change event conflict response a status code equal to that given +func (o *UpdateIncidentChangeEventConflict) IsCode(code int) bool { + return code == 409 +} + +func (o *UpdateIncidentChangeEventConflict) Error() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/related_change_events/{related_change_event_id}][%d] updateIncidentChangeEventConflict %+v", 409, o.Payload) +} + +func (o *UpdateIncidentChangeEventConflict) String() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/related_change_events/{related_change_event_id}][%d] updateIncidentChangeEventConflict %+v", 409, o.Payload) +} + +func (o *UpdateIncidentChangeEventConflict) GetPayload() *models.ErrorEntity { + return o.Payload +} + +func (o *UpdateIncidentChangeEventConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/update_incident_chat_message_parameters.go b/client/incidents/update_incident_chat_message_parameters.go new file mode 100644 index 0000000..bed2d6d --- /dev/null +++ b/client/incidents/update_incident_chat_message_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateIncidentChatMessageParams creates a new UpdateIncidentChatMessageParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIncidentChatMessageParams() *UpdateIncidentChatMessageParams { + return &UpdateIncidentChatMessageParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIncidentChatMessageParamsWithTimeout creates a new UpdateIncidentChatMessageParams object +// with the ability to set a timeout on a request. +func NewUpdateIncidentChatMessageParamsWithTimeout(timeout time.Duration) *UpdateIncidentChatMessageParams { + return &UpdateIncidentChatMessageParams{ + timeout: timeout, + } +} + +// NewUpdateIncidentChatMessageParamsWithContext creates a new UpdateIncidentChatMessageParams object +// with the ability to set a context for a request. +func NewUpdateIncidentChatMessageParamsWithContext(ctx context.Context) *UpdateIncidentChatMessageParams { + return &UpdateIncidentChatMessageParams{ + Context: ctx, + } +} + +// NewUpdateIncidentChatMessageParamsWithHTTPClient creates a new UpdateIncidentChatMessageParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIncidentChatMessageParamsWithHTTPClient(client *http.Client) *UpdateIncidentChatMessageParams { + return &UpdateIncidentChatMessageParams{ + HTTPClient: client, + } +} + +/* +UpdateIncidentChatMessageParams contains all the parameters to send to the API endpoint + + for the update incident chat message operation. + + Typically these are written to a http.Request. +*/ +type UpdateIncidentChatMessageParams struct { + + // IncidentID. + IncidentID string + + // MessageID. + MessageID string + + // UpdateIncidentChatMessage. + UpdateIncidentChatMessage *models.UpdateIncidentChatMessage + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update incident chat message params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentChatMessageParams) WithDefaults() *UpdateIncidentChatMessageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update incident chat message params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentChatMessageParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update incident chat message params +func (o *UpdateIncidentChatMessageParams) WithTimeout(timeout time.Duration) *UpdateIncidentChatMessageParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update incident chat message params +func (o *UpdateIncidentChatMessageParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update incident chat message params +func (o *UpdateIncidentChatMessageParams) WithContext(ctx context.Context) *UpdateIncidentChatMessageParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update incident chat message params +func (o *UpdateIncidentChatMessageParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update incident chat message params +func (o *UpdateIncidentChatMessageParams) WithHTTPClient(client *http.Client) *UpdateIncidentChatMessageParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update incident chat message params +func (o *UpdateIncidentChatMessageParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the update incident chat message params +func (o *UpdateIncidentChatMessageParams) WithIncidentID(incidentID string) *UpdateIncidentChatMessageParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the update incident chat message params +func (o *UpdateIncidentChatMessageParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithMessageID adds the messageID to the update incident chat message params +func (o *UpdateIncidentChatMessageParams) WithMessageID(messageID string) *UpdateIncidentChatMessageParams { + o.SetMessageID(messageID) + return o +} + +// SetMessageID adds the messageId to the update incident chat message params +func (o *UpdateIncidentChatMessageParams) SetMessageID(messageID string) { + o.MessageID = messageID +} + +// WithUpdateIncidentChatMessage adds the updateIncidentChatMessage to the update incident chat message params +func (o *UpdateIncidentChatMessageParams) WithUpdateIncidentChatMessage(updateIncidentChatMessage *models.UpdateIncidentChatMessage) *UpdateIncidentChatMessageParams { + o.SetUpdateIncidentChatMessage(updateIncidentChatMessage) + return o +} + +// SetUpdateIncidentChatMessage adds the updateIncidentChatMessage to the update incident chat message params +func (o *UpdateIncidentChatMessageParams) SetUpdateIncidentChatMessage(updateIncidentChatMessage *models.UpdateIncidentChatMessage) { + o.UpdateIncidentChatMessage = updateIncidentChatMessage +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIncidentChatMessageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param message_id + if err := r.SetPathParam("message_id", o.MessageID); err != nil { + return err + } + if o.UpdateIncidentChatMessage != nil { + if err := r.SetBodyParam(o.UpdateIncidentChatMessage); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/update_incident_chat_message_responses.go b/client/incidents/update_incident_chat_message_responses.go new file mode 100644 index 0000000..e0ef7de --- /dev/null +++ b/client/incidents/update_incident_chat_message_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateIncidentChatMessageReader is a Reader for the UpdateIncidentChatMessage structure. +type UpdateIncidentChatMessageReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIncidentChatMessageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIncidentChatMessageOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIncidentChatMessageOK creates a UpdateIncidentChatMessageOK with default headers values +func NewUpdateIncidentChatMessageOK() *UpdateIncidentChatMessageOK { + return &UpdateIncidentChatMessageOK{} +} + +/* +UpdateIncidentChatMessageOK describes a response with status code 200, with default header values. + +Update an existing generic chat message on an incident. +*/ +type UpdateIncidentChatMessageOK struct { + Payload *models.EventGenericChatMessageEntity +} + +// IsSuccess returns true when this update incident chat message o k response has a 2xx status code +func (o *UpdateIncidentChatMessageOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update incident chat message o k response has a 3xx status code +func (o *UpdateIncidentChatMessageOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident chat message o k response has a 4xx status code +func (o *UpdateIncidentChatMessageOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update incident chat message o k response has a 5xx status code +func (o *UpdateIncidentChatMessageOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident chat message o k response a status code equal to that given +func (o *UpdateIncidentChatMessageOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateIncidentChatMessageOK) Error() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/generic_chat_messages/{message_id}][%d] updateIncidentChatMessageOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentChatMessageOK) String() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/generic_chat_messages/{message_id}][%d] updateIncidentChatMessageOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentChatMessageOK) GetPayload() *models.EventGenericChatMessageEntity { + return o.Payload +} + +func (o *UpdateIncidentChatMessageOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.EventGenericChatMessageEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/update_incident_event_parameters.go b/client/incidents/update_incident_event_parameters.go new file mode 100644 index 0000000..a009965 --- /dev/null +++ b/client/incidents/update_incident_event_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateIncidentEventParams creates a new UpdateIncidentEventParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIncidentEventParams() *UpdateIncidentEventParams { + return &UpdateIncidentEventParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIncidentEventParamsWithTimeout creates a new UpdateIncidentEventParams object +// with the ability to set a timeout on a request. +func NewUpdateIncidentEventParamsWithTimeout(timeout time.Duration) *UpdateIncidentEventParams { + return &UpdateIncidentEventParams{ + timeout: timeout, + } +} + +// NewUpdateIncidentEventParamsWithContext creates a new UpdateIncidentEventParams object +// with the ability to set a context for a request. +func NewUpdateIncidentEventParamsWithContext(ctx context.Context) *UpdateIncidentEventParams { + return &UpdateIncidentEventParams{ + Context: ctx, + } +} + +// NewUpdateIncidentEventParamsWithHTTPClient creates a new UpdateIncidentEventParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIncidentEventParamsWithHTTPClient(client *http.Client) *UpdateIncidentEventParams { + return &UpdateIncidentEventParams{ + HTTPClient: client, + } +} + +/* +UpdateIncidentEventParams contains all the parameters to send to the API endpoint + + for the update incident event operation. + + Typically these are written to a http.Request. +*/ +type UpdateIncidentEventParams struct { + + // EventID. + EventID string + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update incident event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentEventParams) WithDefaults() *UpdateIncidentEventParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update incident event params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentEventParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update incident event params +func (o *UpdateIncidentEventParams) WithTimeout(timeout time.Duration) *UpdateIncidentEventParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update incident event params +func (o *UpdateIncidentEventParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update incident event params +func (o *UpdateIncidentEventParams) WithContext(ctx context.Context) *UpdateIncidentEventParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update incident event params +func (o *UpdateIncidentEventParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update incident event params +func (o *UpdateIncidentEventParams) WithHTTPClient(client *http.Client) *UpdateIncidentEventParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update incident event params +func (o *UpdateIncidentEventParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEventID adds the eventID to the update incident event params +func (o *UpdateIncidentEventParams) WithEventID(eventID string) *UpdateIncidentEventParams { + o.SetEventID(eventID) + return o +} + +// SetEventID adds the eventId to the update incident event params +func (o *UpdateIncidentEventParams) SetEventID(eventID string) { + o.EventID = eventID +} + +// WithIncidentID adds the incidentID to the update incident event params +func (o *UpdateIncidentEventParams) WithIncidentID(incidentID string) *UpdateIncidentEventParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the update incident event params +func (o *UpdateIncidentEventParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIncidentEventParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param event_id + if err := r.SetPathParam("event_id", o.EventID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/update_incident_event_responses.go b/client/incidents/update_incident_event_responses.go new file mode 100644 index 0000000..8304c36 --- /dev/null +++ b/client/incidents/update_incident_event_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateIncidentEventReader is a Reader for the UpdateIncidentEvent structure. +type UpdateIncidentEventReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIncidentEventReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIncidentEventOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIncidentEventOK creates a UpdateIncidentEventOK with default headers values +func NewUpdateIncidentEventOK() *UpdateIncidentEventOK { + return &UpdateIncidentEventOK{} +} + +/* +UpdateIncidentEventOK describes a response with status code 200, with default header values. + +Update a single event for an incident +*/ +type UpdateIncidentEventOK struct { + Payload *models.IncidentEventEntity +} + +// IsSuccess returns true when this update incident event o k response has a 2xx status code +func (o *UpdateIncidentEventOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update incident event o k response has a 3xx status code +func (o *UpdateIncidentEventOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident event o k response has a 4xx status code +func (o *UpdateIncidentEventOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update incident event o k response has a 5xx status code +func (o *UpdateIncidentEventOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident event o k response a status code equal to that given +func (o *UpdateIncidentEventOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateIncidentEventOK) Error() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/events/{event_id}][%d] updateIncidentEventOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentEventOK) String() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/events/{event_id}][%d] updateIncidentEventOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentEventOK) GetPayload() *models.IncidentEventEntity { + return o.Payload +} + +func (o *UpdateIncidentEventOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentEventEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/update_incident_impact_patch_parameters.go b/client/incidents/update_incident_impact_patch_parameters.go new file mode 100644 index 0000000..7ce9b64 --- /dev/null +++ b/client/incidents/update_incident_impact_patch_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateIncidentImpactPatchParams creates a new UpdateIncidentImpactPatchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIncidentImpactPatchParams() *UpdateIncidentImpactPatchParams { + return &UpdateIncidentImpactPatchParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIncidentImpactPatchParamsWithTimeout creates a new UpdateIncidentImpactPatchParams object +// with the ability to set a timeout on a request. +func NewUpdateIncidentImpactPatchParamsWithTimeout(timeout time.Duration) *UpdateIncidentImpactPatchParams { + return &UpdateIncidentImpactPatchParams{ + timeout: timeout, + } +} + +// NewUpdateIncidentImpactPatchParamsWithContext creates a new UpdateIncidentImpactPatchParams object +// with the ability to set a context for a request. +func NewUpdateIncidentImpactPatchParamsWithContext(ctx context.Context) *UpdateIncidentImpactPatchParams { + return &UpdateIncidentImpactPatchParams{ + Context: ctx, + } +} + +// NewUpdateIncidentImpactPatchParamsWithHTTPClient creates a new UpdateIncidentImpactPatchParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIncidentImpactPatchParamsWithHTTPClient(client *http.Client) *UpdateIncidentImpactPatchParams { + return &UpdateIncidentImpactPatchParams{ + HTTPClient: client, + } +} + +/* +UpdateIncidentImpactPatchParams contains all the parameters to send to the API endpoint + + for the update incident impact patch operation. + + Typically these are written to a http.Request. +*/ +type UpdateIncidentImpactPatchParams struct { + + // IncidentID. + IncidentID string + + // UpdateIncidentImpactPatch. + UpdateIncidentImpactPatch *models.UpdateIncidentImpactPatch + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update incident impact patch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentImpactPatchParams) WithDefaults() *UpdateIncidentImpactPatchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update incident impact patch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentImpactPatchParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update incident impact patch params +func (o *UpdateIncidentImpactPatchParams) WithTimeout(timeout time.Duration) *UpdateIncidentImpactPatchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update incident impact patch params +func (o *UpdateIncidentImpactPatchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update incident impact patch params +func (o *UpdateIncidentImpactPatchParams) WithContext(ctx context.Context) *UpdateIncidentImpactPatchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update incident impact patch params +func (o *UpdateIncidentImpactPatchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update incident impact patch params +func (o *UpdateIncidentImpactPatchParams) WithHTTPClient(client *http.Client) *UpdateIncidentImpactPatchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update incident impact patch params +func (o *UpdateIncidentImpactPatchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the update incident impact patch params +func (o *UpdateIncidentImpactPatchParams) WithIncidentID(incidentID string) *UpdateIncidentImpactPatchParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the update incident impact patch params +func (o *UpdateIncidentImpactPatchParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithUpdateIncidentImpactPatch adds the updateIncidentImpactPatch to the update incident impact patch params +func (o *UpdateIncidentImpactPatchParams) WithUpdateIncidentImpactPatch(updateIncidentImpactPatch *models.UpdateIncidentImpactPatch) *UpdateIncidentImpactPatchParams { + o.SetUpdateIncidentImpactPatch(updateIncidentImpactPatch) + return o +} + +// SetUpdateIncidentImpactPatch adds the updateIncidentImpactPatch to the update incident impact patch params +func (o *UpdateIncidentImpactPatchParams) SetUpdateIncidentImpactPatch(updateIncidentImpactPatch *models.UpdateIncidentImpactPatch) { + o.UpdateIncidentImpactPatch = updateIncidentImpactPatch +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIncidentImpactPatchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + if o.UpdateIncidentImpactPatch != nil { + if err := r.SetBodyParam(o.UpdateIncidentImpactPatch); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/update_incident_impact_patch_responses.go b/client/incidents/update_incident_impact_patch_responses.go new file mode 100644 index 0000000..40d86dc --- /dev/null +++ b/client/incidents/update_incident_impact_patch_responses.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateIncidentImpactPatchReader is a Reader for the UpdateIncidentImpactPatch structure. +type UpdateIncidentImpactPatchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIncidentImpactPatchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIncidentImpactPatchOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIncidentImpactPatchOK creates a UpdateIncidentImpactPatchOK with default headers values +func NewUpdateIncidentImpactPatchOK() *UpdateIncidentImpactPatchOK { + return &UpdateIncidentImpactPatchOK{} +} + +/* + UpdateIncidentImpactPatchOK describes a response with status code 200, with default header values. + + Allows updating an incident's impacted infrastructure, with the option to + +move the incident into a different milestone and provide a note to update +the incident timeline and any attached status pages. If this method is +requested with the PUT verb, impacts will be completely replaced with the +information in the request body, even if not provided (effectively clearing +all impacts). If this method is requested with the PATCH verb, the provided +impacts will be added or updated, but no impacts will be removed. +*/ +type UpdateIncidentImpactPatchOK struct { + Payload *models.IncidentEntity +} + +// IsSuccess returns true when this update incident impact patch o k response has a 2xx status code +func (o *UpdateIncidentImpactPatchOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update incident impact patch o k response has a 3xx status code +func (o *UpdateIncidentImpactPatchOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident impact patch o k response has a 4xx status code +func (o *UpdateIncidentImpactPatchOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update incident impact patch o k response has a 5xx status code +func (o *UpdateIncidentImpactPatchOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident impact patch o k response a status code equal to that given +func (o *UpdateIncidentImpactPatchOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateIncidentImpactPatchOK) Error() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/impact][%d] updateIncidentImpactPatchOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentImpactPatchOK) String() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/impact][%d] updateIncidentImpactPatchOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentImpactPatchOK) GetPayload() *models.IncidentEntity { + return o.Payload +} + +func (o *UpdateIncidentImpactPatchOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/update_incident_impact_put_parameters.go b/client/incidents/update_incident_impact_put_parameters.go new file mode 100644 index 0000000..c12f192 --- /dev/null +++ b/client/incidents/update_incident_impact_put_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateIncidentImpactPutParams creates a new UpdateIncidentImpactPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIncidentImpactPutParams() *UpdateIncidentImpactPutParams { + return &UpdateIncidentImpactPutParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIncidentImpactPutParamsWithTimeout creates a new UpdateIncidentImpactPutParams object +// with the ability to set a timeout on a request. +func NewUpdateIncidentImpactPutParamsWithTimeout(timeout time.Duration) *UpdateIncidentImpactPutParams { + return &UpdateIncidentImpactPutParams{ + timeout: timeout, + } +} + +// NewUpdateIncidentImpactPutParamsWithContext creates a new UpdateIncidentImpactPutParams object +// with the ability to set a context for a request. +func NewUpdateIncidentImpactPutParamsWithContext(ctx context.Context) *UpdateIncidentImpactPutParams { + return &UpdateIncidentImpactPutParams{ + Context: ctx, + } +} + +// NewUpdateIncidentImpactPutParamsWithHTTPClient creates a new UpdateIncidentImpactPutParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIncidentImpactPutParamsWithHTTPClient(client *http.Client) *UpdateIncidentImpactPutParams { + return &UpdateIncidentImpactPutParams{ + HTTPClient: client, + } +} + +/* +UpdateIncidentImpactPutParams contains all the parameters to send to the API endpoint + + for the update incident impact put operation. + + Typically these are written to a http.Request. +*/ +type UpdateIncidentImpactPutParams struct { + + // IncidentID. + IncidentID string + + // UpdateIncidentImpactPut. + UpdateIncidentImpactPut *models.UpdateIncidentImpactPut + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update incident impact put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentImpactPutParams) WithDefaults() *UpdateIncidentImpactPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update incident impact put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentImpactPutParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update incident impact put params +func (o *UpdateIncidentImpactPutParams) WithTimeout(timeout time.Duration) *UpdateIncidentImpactPutParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update incident impact put params +func (o *UpdateIncidentImpactPutParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update incident impact put params +func (o *UpdateIncidentImpactPutParams) WithContext(ctx context.Context) *UpdateIncidentImpactPutParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update incident impact put params +func (o *UpdateIncidentImpactPutParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update incident impact put params +func (o *UpdateIncidentImpactPutParams) WithHTTPClient(client *http.Client) *UpdateIncidentImpactPutParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update incident impact put params +func (o *UpdateIncidentImpactPutParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the update incident impact put params +func (o *UpdateIncidentImpactPutParams) WithIncidentID(incidentID string) *UpdateIncidentImpactPutParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the update incident impact put params +func (o *UpdateIncidentImpactPutParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithUpdateIncidentImpactPut adds the updateIncidentImpactPut to the update incident impact put params +func (o *UpdateIncidentImpactPutParams) WithUpdateIncidentImpactPut(updateIncidentImpactPut *models.UpdateIncidentImpactPut) *UpdateIncidentImpactPutParams { + o.SetUpdateIncidentImpactPut(updateIncidentImpactPut) + return o +} + +// SetUpdateIncidentImpactPut adds the updateIncidentImpactPut to the update incident impact put params +func (o *UpdateIncidentImpactPutParams) SetUpdateIncidentImpactPut(updateIncidentImpactPut *models.UpdateIncidentImpactPut) { + o.UpdateIncidentImpactPut = updateIncidentImpactPut +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIncidentImpactPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + if o.UpdateIncidentImpactPut != nil { + if err := r.SetBodyParam(o.UpdateIncidentImpactPut); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/update_incident_impact_put_responses.go b/client/incidents/update_incident_impact_put_responses.go new file mode 100644 index 0000000..e42bd91 --- /dev/null +++ b/client/incidents/update_incident_impact_put_responses.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateIncidentImpactPutReader is a Reader for the UpdateIncidentImpactPut structure. +type UpdateIncidentImpactPutReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIncidentImpactPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIncidentImpactPutOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIncidentImpactPutOK creates a UpdateIncidentImpactPutOK with default headers values +func NewUpdateIncidentImpactPutOK() *UpdateIncidentImpactPutOK { + return &UpdateIncidentImpactPutOK{} +} + +/* + UpdateIncidentImpactPutOK describes a response with status code 200, with default header values. + + Allows updating an incident's impacted infrastructure, with the option to + +move the incident into a different milestone and provide a note to update +the incident timeline and any attached status pages. If this method is +requested with the PUT verb, impacts will be completely replaced with the +information in the request body, even if not provided (effectively clearing +all impacts). If this method is requested with the PATCH verb, the provided +impacts will be added or updated, but no impacts will be removed. +*/ +type UpdateIncidentImpactPutOK struct { + Payload *models.IncidentEntity +} + +// IsSuccess returns true when this update incident impact put o k response has a 2xx status code +func (o *UpdateIncidentImpactPutOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update incident impact put o k response has a 3xx status code +func (o *UpdateIncidentImpactPutOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident impact put o k response has a 4xx status code +func (o *UpdateIncidentImpactPutOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update incident impact put o k response has a 5xx status code +func (o *UpdateIncidentImpactPutOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident impact put o k response a status code equal to that given +func (o *UpdateIncidentImpactPutOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateIncidentImpactPutOK) Error() string { + return fmt.Sprintf("[PUT /v1/incidents/{incident_id}/impact][%d] updateIncidentImpactPutOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentImpactPutOK) String() string { + return fmt.Sprintf("[PUT /v1/incidents/{incident_id}/impact][%d] updateIncidentImpactPutOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentImpactPutOK) GetPayload() *models.IncidentEntity { + return o.Payload +} + +func (o *UpdateIncidentImpactPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/update_incident_link_parameters.go b/client/incidents/update_incident_link_parameters.go new file mode 100644 index 0000000..623a966 --- /dev/null +++ b/client/incidents/update_incident_link_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateIncidentLinkParams creates a new UpdateIncidentLinkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIncidentLinkParams() *UpdateIncidentLinkParams { + return &UpdateIncidentLinkParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIncidentLinkParamsWithTimeout creates a new UpdateIncidentLinkParams object +// with the ability to set a timeout on a request. +func NewUpdateIncidentLinkParamsWithTimeout(timeout time.Duration) *UpdateIncidentLinkParams { + return &UpdateIncidentLinkParams{ + timeout: timeout, + } +} + +// NewUpdateIncidentLinkParamsWithContext creates a new UpdateIncidentLinkParams object +// with the ability to set a context for a request. +func NewUpdateIncidentLinkParamsWithContext(ctx context.Context) *UpdateIncidentLinkParams { + return &UpdateIncidentLinkParams{ + Context: ctx, + } +} + +// NewUpdateIncidentLinkParamsWithHTTPClient creates a new UpdateIncidentLinkParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIncidentLinkParamsWithHTTPClient(client *http.Client) *UpdateIncidentLinkParams { + return &UpdateIncidentLinkParams{ + HTTPClient: client, + } +} + +/* +UpdateIncidentLinkParams contains all the parameters to send to the API endpoint + + for the update incident link operation. + + Typically these are written to a http.Request. +*/ +type UpdateIncidentLinkParams struct { + + // IncidentID. + IncidentID string + + // LinkID. + LinkID string + + // UpdateIncidentLink. + UpdateIncidentLink *models.UpdateIncidentLink + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update incident link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentLinkParams) WithDefaults() *UpdateIncidentLinkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update incident link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentLinkParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update incident link params +func (o *UpdateIncidentLinkParams) WithTimeout(timeout time.Duration) *UpdateIncidentLinkParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update incident link params +func (o *UpdateIncidentLinkParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update incident link params +func (o *UpdateIncidentLinkParams) WithContext(ctx context.Context) *UpdateIncidentLinkParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update incident link params +func (o *UpdateIncidentLinkParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update incident link params +func (o *UpdateIncidentLinkParams) WithHTTPClient(client *http.Client) *UpdateIncidentLinkParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update incident link params +func (o *UpdateIncidentLinkParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the update incident link params +func (o *UpdateIncidentLinkParams) WithIncidentID(incidentID string) *UpdateIncidentLinkParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the update incident link params +func (o *UpdateIncidentLinkParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithLinkID adds the linkID to the update incident link params +func (o *UpdateIncidentLinkParams) WithLinkID(linkID string) *UpdateIncidentLinkParams { + o.SetLinkID(linkID) + return o +} + +// SetLinkID adds the linkId to the update incident link params +func (o *UpdateIncidentLinkParams) SetLinkID(linkID string) { + o.LinkID = linkID +} + +// WithUpdateIncidentLink adds the updateIncidentLink to the update incident link params +func (o *UpdateIncidentLinkParams) WithUpdateIncidentLink(updateIncidentLink *models.UpdateIncidentLink) *UpdateIncidentLinkParams { + o.SetUpdateIncidentLink(updateIncidentLink) + return o +} + +// SetUpdateIncidentLink adds the updateIncidentLink to the update incident link params +func (o *UpdateIncidentLinkParams) SetUpdateIncidentLink(updateIncidentLink *models.UpdateIncidentLink) { + o.UpdateIncidentLink = updateIncidentLink +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIncidentLinkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param link_id + if err := r.SetPathParam("link_id", o.LinkID); err != nil { + return err + } + if o.UpdateIncidentLink != nil { + if err := r.SetBodyParam(o.UpdateIncidentLink); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/update_incident_link_responses.go b/client/incidents/update_incident_link_responses.go new file mode 100644 index 0000000..332642b --- /dev/null +++ b/client/incidents/update_incident_link_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateIncidentLinkReader is a Reader for the UpdateIncidentLink structure. +type UpdateIncidentLinkReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIncidentLinkReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIncidentLinkOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIncidentLinkOK creates a UpdateIncidentLinkOK with default headers values +func NewUpdateIncidentLinkOK() *UpdateIncidentLinkOK { + return &UpdateIncidentLinkOK{} +} + +/* +UpdateIncidentLinkOK describes a response with status code 200, with default header values. + +Update the external incident link attributes +*/ +type UpdateIncidentLinkOK struct { +} + +// IsSuccess returns true when this update incident link o k response has a 2xx status code +func (o *UpdateIncidentLinkOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update incident link o k response has a 3xx status code +func (o *UpdateIncidentLinkOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident link o k response has a 4xx status code +func (o *UpdateIncidentLinkOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update incident link o k response has a 5xx status code +func (o *UpdateIncidentLinkOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident link o k response a status code equal to that given +func (o *UpdateIncidentLinkOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateIncidentLinkOK) Error() string { + return fmt.Sprintf("[PUT /v1/incidents/{incident_id}/links/{link_id}][%d] updateIncidentLinkOK ", 200) +} + +func (o *UpdateIncidentLinkOK) String() string { + return fmt.Sprintf("[PUT /v1/incidents/{incident_id}/links/{link_id}][%d] updateIncidentLinkOK ", 200) +} + +func (o *UpdateIncidentLinkOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/incidents/update_incident_note_parameters.go b/client/incidents/update_incident_note_parameters.go new file mode 100644 index 0000000..f2d9413 --- /dev/null +++ b/client/incidents/update_incident_note_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateIncidentNoteParams creates a new UpdateIncidentNoteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIncidentNoteParams() *UpdateIncidentNoteParams { + return &UpdateIncidentNoteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIncidentNoteParamsWithTimeout creates a new UpdateIncidentNoteParams object +// with the ability to set a timeout on a request. +func NewUpdateIncidentNoteParamsWithTimeout(timeout time.Duration) *UpdateIncidentNoteParams { + return &UpdateIncidentNoteParams{ + timeout: timeout, + } +} + +// NewUpdateIncidentNoteParamsWithContext creates a new UpdateIncidentNoteParams object +// with the ability to set a context for a request. +func NewUpdateIncidentNoteParamsWithContext(ctx context.Context) *UpdateIncidentNoteParams { + return &UpdateIncidentNoteParams{ + Context: ctx, + } +} + +// NewUpdateIncidentNoteParamsWithHTTPClient creates a new UpdateIncidentNoteParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIncidentNoteParamsWithHTTPClient(client *http.Client) *UpdateIncidentNoteParams { + return &UpdateIncidentNoteParams{ + HTTPClient: client, + } +} + +/* +UpdateIncidentNoteParams contains all the parameters to send to the API endpoint + + for the update incident note operation. + + Typically these are written to a http.Request. +*/ +type UpdateIncidentNoteParams struct { + + // IncidentID. + IncidentID string + + // NoteID. + NoteID string + + // UpdateIncidentNote. + UpdateIncidentNote *models.UpdateIncidentNote + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update incident note params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentNoteParams) WithDefaults() *UpdateIncidentNoteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update incident note params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentNoteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update incident note params +func (o *UpdateIncidentNoteParams) WithTimeout(timeout time.Duration) *UpdateIncidentNoteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update incident note params +func (o *UpdateIncidentNoteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update incident note params +func (o *UpdateIncidentNoteParams) WithContext(ctx context.Context) *UpdateIncidentNoteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update incident note params +func (o *UpdateIncidentNoteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update incident note params +func (o *UpdateIncidentNoteParams) WithHTTPClient(client *http.Client) *UpdateIncidentNoteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update incident note params +func (o *UpdateIncidentNoteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the update incident note params +func (o *UpdateIncidentNoteParams) WithIncidentID(incidentID string) *UpdateIncidentNoteParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the update incident note params +func (o *UpdateIncidentNoteParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithNoteID adds the noteID to the update incident note params +func (o *UpdateIncidentNoteParams) WithNoteID(noteID string) *UpdateIncidentNoteParams { + o.SetNoteID(noteID) + return o +} + +// SetNoteID adds the noteId to the update incident note params +func (o *UpdateIncidentNoteParams) SetNoteID(noteID string) { + o.NoteID = noteID +} + +// WithUpdateIncidentNote adds the updateIncidentNote to the update incident note params +func (o *UpdateIncidentNoteParams) WithUpdateIncidentNote(updateIncidentNote *models.UpdateIncidentNote) *UpdateIncidentNoteParams { + o.SetUpdateIncidentNote(updateIncidentNote) + return o +} + +// SetUpdateIncidentNote adds the updateIncidentNote to the update incident note params +func (o *UpdateIncidentNoteParams) SetUpdateIncidentNote(updateIncidentNote *models.UpdateIncidentNote) { + o.UpdateIncidentNote = updateIncidentNote +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIncidentNoteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param note_id + if err := r.SetPathParam("note_id", o.NoteID); err != nil { + return err + } + if o.UpdateIncidentNote != nil { + if err := r.SetBodyParam(o.UpdateIncidentNote); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/update_incident_note_responses.go b/client/incidents/update_incident_note_responses.go new file mode 100644 index 0000000..4acff9b --- /dev/null +++ b/client/incidents/update_incident_note_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateIncidentNoteReader is a Reader for the UpdateIncidentNote structure. +type UpdateIncidentNoteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIncidentNoteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIncidentNoteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIncidentNoteOK creates a UpdateIncidentNoteOK with default headers values +func NewUpdateIncidentNoteOK() *UpdateIncidentNoteOK { + return &UpdateIncidentNoteOK{} +} + +/* +UpdateIncidentNoteOK describes a response with status code 200, with default header values. + +Updates the body of a note +*/ +type UpdateIncidentNoteOK struct { + Payload *models.EventNoteEntity +} + +// IsSuccess returns true when this update incident note o k response has a 2xx status code +func (o *UpdateIncidentNoteOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update incident note o k response has a 3xx status code +func (o *UpdateIncidentNoteOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident note o k response has a 4xx status code +func (o *UpdateIncidentNoteOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update incident note o k response has a 5xx status code +func (o *UpdateIncidentNoteOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident note o k response a status code equal to that given +func (o *UpdateIncidentNoteOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateIncidentNoteOK) Error() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/notes/{note_id}][%d] updateIncidentNoteOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentNoteOK) String() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/notes/{note_id}][%d] updateIncidentNoteOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentNoteOK) GetPayload() *models.EventNoteEntity { + return o.Payload +} + +func (o *UpdateIncidentNoteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.EventNoteEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/update_incident_parameters.go b/client/incidents/update_incident_parameters.go new file mode 100644 index 0000000..0d79a07 --- /dev/null +++ b/client/incidents/update_incident_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateIncidentParams creates a new UpdateIncidentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIncidentParams() *UpdateIncidentParams { + return &UpdateIncidentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIncidentParamsWithTimeout creates a new UpdateIncidentParams object +// with the ability to set a timeout on a request. +func NewUpdateIncidentParamsWithTimeout(timeout time.Duration) *UpdateIncidentParams { + return &UpdateIncidentParams{ + timeout: timeout, + } +} + +// NewUpdateIncidentParamsWithContext creates a new UpdateIncidentParams object +// with the ability to set a context for a request. +func NewUpdateIncidentParamsWithContext(ctx context.Context) *UpdateIncidentParams { + return &UpdateIncidentParams{ + Context: ctx, + } +} + +// NewUpdateIncidentParamsWithHTTPClient creates a new UpdateIncidentParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIncidentParamsWithHTTPClient(client *http.Client) *UpdateIncidentParams { + return &UpdateIncidentParams{ + HTTPClient: client, + } +} + +/* +UpdateIncidentParams contains all the parameters to send to the API endpoint + + for the update incident operation. + + Typically these are written to a http.Request. +*/ +type UpdateIncidentParams struct { + + // IncidentID. + IncidentID string + + // UpdateIncident. + UpdateIncident *models.UpdateIncident + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update incident params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentParams) WithDefaults() *UpdateIncidentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update incident params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update incident params +func (o *UpdateIncidentParams) WithTimeout(timeout time.Duration) *UpdateIncidentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update incident params +func (o *UpdateIncidentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update incident params +func (o *UpdateIncidentParams) WithContext(ctx context.Context) *UpdateIncidentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update incident params +func (o *UpdateIncidentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update incident params +func (o *UpdateIncidentParams) WithHTTPClient(client *http.Client) *UpdateIncidentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update incident params +func (o *UpdateIncidentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the update incident params +func (o *UpdateIncidentParams) WithIncidentID(incidentID string) *UpdateIncidentParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the update incident params +func (o *UpdateIncidentParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithUpdateIncident adds the updateIncident to the update incident params +func (o *UpdateIncidentParams) WithUpdateIncident(updateIncident *models.UpdateIncident) *UpdateIncidentParams { + o.SetUpdateIncident(updateIncident) + return o +} + +// SetUpdateIncident adds the updateIncident to the update incident params +func (o *UpdateIncidentParams) SetUpdateIncident(updateIncident *models.UpdateIncident) { + o.UpdateIncident = updateIncident +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIncidentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + if o.UpdateIncident != nil { + if err := r.SetBodyParam(o.UpdateIncident); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/update_incident_responses.go b/client/incidents/update_incident_responses.go new file mode 100644 index 0000000..08bb659 --- /dev/null +++ b/client/incidents/update_incident_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateIncidentReader is a Reader for the UpdateIncident structure. +type UpdateIncidentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIncidentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIncidentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIncidentOK creates a UpdateIncidentOK with default headers values +func NewUpdateIncidentOK() *UpdateIncidentOK { + return &UpdateIncidentOK{} +} + +/* +UpdateIncidentOK describes a response with status code 200, with default header values. + +Updates an incident with provided parameters +*/ +type UpdateIncidentOK struct { + Payload *models.IncidentEntity +} + +// IsSuccess returns true when this update incident o k response has a 2xx status code +func (o *UpdateIncidentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update incident o k response has a 3xx status code +func (o *UpdateIncidentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident o k response has a 4xx status code +func (o *UpdateIncidentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update incident o k response has a 5xx status code +func (o *UpdateIncidentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident o k response a status code equal to that given +func (o *UpdateIncidentOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateIncidentOK) Error() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}][%d] updateIncidentOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentOK) String() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}][%d] updateIncidentOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentOK) GetPayload() *models.IncidentEntity { + return o.Payload +} + +func (o *UpdateIncidentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/update_scheduled_maintenance_parameters.go b/client/incidents/update_scheduled_maintenance_parameters.go new file mode 100644 index 0000000..3a270dc --- /dev/null +++ b/client/incidents/update_scheduled_maintenance_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateScheduledMaintenanceParams creates a new UpdateScheduledMaintenanceParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateScheduledMaintenanceParams() *UpdateScheduledMaintenanceParams { + return &UpdateScheduledMaintenanceParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateScheduledMaintenanceParamsWithTimeout creates a new UpdateScheduledMaintenanceParams object +// with the ability to set a timeout on a request. +func NewUpdateScheduledMaintenanceParamsWithTimeout(timeout time.Duration) *UpdateScheduledMaintenanceParams { + return &UpdateScheduledMaintenanceParams{ + timeout: timeout, + } +} + +// NewUpdateScheduledMaintenanceParamsWithContext creates a new UpdateScheduledMaintenanceParams object +// with the ability to set a context for a request. +func NewUpdateScheduledMaintenanceParamsWithContext(ctx context.Context) *UpdateScheduledMaintenanceParams { + return &UpdateScheduledMaintenanceParams{ + Context: ctx, + } +} + +// NewUpdateScheduledMaintenanceParamsWithHTTPClient creates a new UpdateScheduledMaintenanceParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateScheduledMaintenanceParamsWithHTTPClient(client *http.Client) *UpdateScheduledMaintenanceParams { + return &UpdateScheduledMaintenanceParams{ + HTTPClient: client, + } +} + +/* +UpdateScheduledMaintenanceParams contains all the parameters to send to the API endpoint + + for the update scheduled maintenance operation. + + Typically these are written to a http.Request. +*/ +type UpdateScheduledMaintenanceParams struct { + + // ScheduledMaintenanceID. + ScheduledMaintenanceID string + + // UpdateScheduledMaintenance. + UpdateScheduledMaintenance *models.UpdateScheduledMaintenance + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update scheduled maintenance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateScheduledMaintenanceParams) WithDefaults() *UpdateScheduledMaintenanceParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update scheduled maintenance params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateScheduledMaintenanceParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update scheduled maintenance params +func (o *UpdateScheduledMaintenanceParams) WithTimeout(timeout time.Duration) *UpdateScheduledMaintenanceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update scheduled maintenance params +func (o *UpdateScheduledMaintenanceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update scheduled maintenance params +func (o *UpdateScheduledMaintenanceParams) WithContext(ctx context.Context) *UpdateScheduledMaintenanceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update scheduled maintenance params +func (o *UpdateScheduledMaintenanceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update scheduled maintenance params +func (o *UpdateScheduledMaintenanceParams) WithHTTPClient(client *http.Client) *UpdateScheduledMaintenanceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update scheduled maintenance params +func (o *UpdateScheduledMaintenanceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithScheduledMaintenanceID adds the scheduledMaintenanceID to the update scheduled maintenance params +func (o *UpdateScheduledMaintenanceParams) WithScheduledMaintenanceID(scheduledMaintenanceID string) *UpdateScheduledMaintenanceParams { + o.SetScheduledMaintenanceID(scheduledMaintenanceID) + return o +} + +// SetScheduledMaintenanceID adds the scheduledMaintenanceId to the update scheduled maintenance params +func (o *UpdateScheduledMaintenanceParams) SetScheduledMaintenanceID(scheduledMaintenanceID string) { + o.ScheduledMaintenanceID = scheduledMaintenanceID +} + +// WithUpdateScheduledMaintenance adds the updateScheduledMaintenance to the update scheduled maintenance params +func (o *UpdateScheduledMaintenanceParams) WithUpdateScheduledMaintenance(updateScheduledMaintenance *models.UpdateScheduledMaintenance) *UpdateScheduledMaintenanceParams { + o.SetUpdateScheduledMaintenance(updateScheduledMaintenance) + return o +} + +// SetUpdateScheduledMaintenance adds the updateScheduledMaintenance to the update scheduled maintenance params +func (o *UpdateScheduledMaintenanceParams) SetUpdateScheduledMaintenance(updateScheduledMaintenance *models.UpdateScheduledMaintenance) { + o.UpdateScheduledMaintenance = updateScheduledMaintenance +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateScheduledMaintenanceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param scheduled_maintenance_id + if err := r.SetPathParam("scheduled_maintenance_id", o.ScheduledMaintenanceID); err != nil { + return err + } + if o.UpdateScheduledMaintenance != nil { + if err := r.SetBodyParam(o.UpdateScheduledMaintenance); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/update_scheduled_maintenance_responses.go b/client/incidents/update_scheduled_maintenance_responses.go new file mode 100644 index 0000000..505da59 --- /dev/null +++ b/client/incidents/update_scheduled_maintenance_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateScheduledMaintenanceReader is a Reader for the UpdateScheduledMaintenance structure. +type UpdateScheduledMaintenanceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateScheduledMaintenanceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateScheduledMaintenanceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateScheduledMaintenanceOK creates a UpdateScheduledMaintenanceOK with default headers values +func NewUpdateScheduledMaintenanceOK() *UpdateScheduledMaintenanceOK { + return &UpdateScheduledMaintenanceOK{} +} + +/* +UpdateScheduledMaintenanceOK describes a response with status code 200, with default header values. + +Change the conditions of a scheduled maintenance event, including updating any status page announcements of changes. +*/ +type UpdateScheduledMaintenanceOK struct { + Payload *models.ScheduledMaintenanceEntity +} + +// IsSuccess returns true when this update scheduled maintenance o k response has a 2xx status code +func (o *UpdateScheduledMaintenanceOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update scheduled maintenance o k response has a 3xx status code +func (o *UpdateScheduledMaintenanceOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update scheduled maintenance o k response has a 4xx status code +func (o *UpdateScheduledMaintenanceOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update scheduled maintenance o k response has a 5xx status code +func (o *UpdateScheduledMaintenanceOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update scheduled maintenance o k response a status code equal to that given +func (o *UpdateScheduledMaintenanceOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateScheduledMaintenanceOK) Error() string { + return fmt.Sprintf("[PATCH /v1/scheduled_maintenances/{scheduled_maintenance_id}][%d] updateScheduledMaintenanceOK %+v", 200, o.Payload) +} + +func (o *UpdateScheduledMaintenanceOK) String() string { + return fmt.Sprintf("[PATCH /v1/scheduled_maintenances/{scheduled_maintenance_id}][%d] updateScheduledMaintenanceOK %+v", 200, o.Payload) +} + +func (o *UpdateScheduledMaintenanceOK) GetPayload() *models.ScheduledMaintenanceEntity { + return o.Payload +} + +func (o *UpdateScheduledMaintenanceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ScheduledMaintenanceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/incidents/update_transcript_attribution_parameters.go b/client/incidents/update_transcript_attribution_parameters.go new file mode 100644 index 0000000..af2fee6 --- /dev/null +++ b/client/incidents/update_transcript_attribution_parameters.go @@ -0,0 +1,302 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateTranscriptAttributionParams creates a new UpdateTranscriptAttributionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateTranscriptAttributionParams() *UpdateTranscriptAttributionParams { + return &UpdateTranscriptAttributionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateTranscriptAttributionParamsWithTimeout creates a new UpdateTranscriptAttributionParams object +// with the ability to set a timeout on a request. +func NewUpdateTranscriptAttributionParamsWithTimeout(timeout time.Duration) *UpdateTranscriptAttributionParams { + return &UpdateTranscriptAttributionParams{ + timeout: timeout, + } +} + +// NewUpdateTranscriptAttributionParamsWithContext creates a new UpdateTranscriptAttributionParams object +// with the ability to set a context for a request. +func NewUpdateTranscriptAttributionParamsWithContext(ctx context.Context) *UpdateTranscriptAttributionParams { + return &UpdateTranscriptAttributionParams{ + Context: ctx, + } +} + +// NewUpdateTranscriptAttributionParamsWithHTTPClient creates a new UpdateTranscriptAttributionParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateTranscriptAttributionParamsWithHTTPClient(client *http.Client) *UpdateTranscriptAttributionParams { + return &UpdateTranscriptAttributionParams{ + HTTPClient: client, + } +} + +/* +UpdateTranscriptAttributionParams contains all the parameters to send to the API endpoint + + for the update transcript attribution operation. + + Typically these are written to a http.Request. +*/ +type UpdateTranscriptAttributionParams struct { + + /* ConferenceBridgeID. + + The ID of the conference bridge to attribute the transcript to. + */ + ConferenceBridgeID *string + + /* FromSpeaker. + + The speaker to attribute the transcript to. + */ + FromSpeaker *string + + /* FromUserID. + + The user to attribute the transcript to. + */ + FromUserID *string + + // IncidentID. + IncidentID string + + /* ToUserID. + + The ID of the user to attribute the transcript to. + */ + ToUserID string + + /* TranscriptID. + + The ID of the specific transcript entry to change attribution for. + */ + TranscriptID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update transcript attribution params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTranscriptAttributionParams) WithDefaults() *UpdateTranscriptAttributionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update transcript attribution params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTranscriptAttributionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) WithTimeout(timeout time.Duration) *UpdateTranscriptAttributionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) WithContext(ctx context.Context) *UpdateTranscriptAttributionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) WithHTTPClient(client *http.Client) *UpdateTranscriptAttributionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConferenceBridgeID adds the conferenceBridgeID to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) WithConferenceBridgeID(conferenceBridgeID *string) *UpdateTranscriptAttributionParams { + o.SetConferenceBridgeID(conferenceBridgeID) + return o +} + +// SetConferenceBridgeID adds the conferenceBridgeId to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) SetConferenceBridgeID(conferenceBridgeID *string) { + o.ConferenceBridgeID = conferenceBridgeID +} + +// WithFromSpeaker adds the fromSpeaker to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) WithFromSpeaker(fromSpeaker *string) *UpdateTranscriptAttributionParams { + o.SetFromSpeaker(fromSpeaker) + return o +} + +// SetFromSpeaker adds the fromSpeaker to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) SetFromSpeaker(fromSpeaker *string) { + o.FromSpeaker = fromSpeaker +} + +// WithFromUserID adds the fromUserID to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) WithFromUserID(fromUserID *string) *UpdateTranscriptAttributionParams { + o.SetFromUserID(fromUserID) + return o +} + +// SetFromUserID adds the fromUserId to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) SetFromUserID(fromUserID *string) { + o.FromUserID = fromUserID +} + +// WithIncidentID adds the incidentID to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) WithIncidentID(incidentID string) *UpdateTranscriptAttributionParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithToUserID adds the toUserID to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) WithToUserID(toUserID string) *UpdateTranscriptAttributionParams { + o.SetToUserID(toUserID) + return o +} + +// SetToUserID adds the toUserId to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) SetToUserID(toUserID string) { + o.ToUserID = toUserID +} + +// WithTranscriptID adds the transcriptID to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) WithTranscriptID(transcriptID *string) *UpdateTranscriptAttributionParams { + o.SetTranscriptID(transcriptID) + return o +} + +// SetTranscriptID adds the transcriptId to the update transcript attribution params +func (o *UpdateTranscriptAttributionParams) SetTranscriptID(transcriptID *string) { + o.TranscriptID = transcriptID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateTranscriptAttributionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ConferenceBridgeID != nil { + + // form param conference_bridge_id + var frConferenceBridgeID string + if o.ConferenceBridgeID != nil { + frConferenceBridgeID = *o.ConferenceBridgeID + } + fConferenceBridgeID := frConferenceBridgeID + if fConferenceBridgeID != "" { + if err := r.SetFormParam("conference_bridge_id", fConferenceBridgeID); err != nil { + return err + } + } + } + + if o.FromSpeaker != nil { + + // form param from_speaker + var frFromSpeaker string + if o.FromSpeaker != nil { + frFromSpeaker = *o.FromSpeaker + } + fFromSpeaker := frFromSpeaker + if fFromSpeaker != "" { + if err := r.SetFormParam("from_speaker", fFromSpeaker); err != nil { + return err + } + } + } + + if o.FromUserID != nil { + + // form param from_user_id + var frFromUserID string + if o.FromUserID != nil { + frFromUserID = *o.FromUserID + } + fFromUserID := frFromUserID + if fFromUserID != "" { + if err := r.SetFormParam("from_user_id", fFromUserID); err != nil { + return err + } + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // form param to_user_id + frToUserID := o.ToUserID + fToUserID := frToUserID + if fToUserID != "" { + if err := r.SetFormParam("to_user_id", fToUserID); err != nil { + return err + } + } + + if o.TranscriptID != nil { + + // form param transcript_id + var frTranscriptID string + if o.TranscriptID != nil { + frTranscriptID = *o.TranscriptID + } + fTranscriptID := frTranscriptID + if fTranscriptID != "" { + if err := r.SetFormParam("transcript_id", fTranscriptID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/update_transcript_attribution_responses.go b/client/incidents/update_transcript_attribution_responses.go new file mode 100644 index 0000000..f4dfef8 --- /dev/null +++ b/client/incidents/update_transcript_attribution_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateTranscriptAttributionReader is a Reader for the UpdateTranscriptAttribution structure. +type UpdateTranscriptAttributionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateTranscriptAttributionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateTranscriptAttributionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateTranscriptAttributionOK creates a UpdateTranscriptAttributionOK with default headers values +func NewUpdateTranscriptAttributionOK() *UpdateTranscriptAttributionOK { + return &UpdateTranscriptAttributionOK{} +} + +/* +UpdateTranscriptAttributionOK describes a response with status code 200, with default header values. + +Update the attribution of a transcript +*/ +type UpdateTranscriptAttributionOK struct { +} + +// IsSuccess returns true when this update transcript attribution o k response has a 2xx status code +func (o *UpdateTranscriptAttributionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update transcript attribution o k response has a 3xx status code +func (o *UpdateTranscriptAttributionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update transcript attribution o k response has a 4xx status code +func (o *UpdateTranscriptAttributionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update transcript attribution o k response has a 5xx status code +func (o *UpdateTranscriptAttributionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update transcript attribution o k response a status code equal to that given +func (o *UpdateTranscriptAttributionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateTranscriptAttributionOK) Error() string { + return fmt.Sprintf("[PUT /v1/incidents/{incident_id}/transcript/attribution][%d] updateTranscriptAttributionOK ", 200) +} + +func (o *UpdateTranscriptAttributionOK) String() string { + return fmt.Sprintf("[PUT /v1/incidents/{incident_id}/transcript/attribution][%d] updateTranscriptAttributionOK ", 200) +} + +func (o *UpdateTranscriptAttributionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/incidents/vote_ai_incident_summary_parameters.go b/client/incidents/vote_ai_incident_summary_parameters.go new file mode 100644 index 0000000..03b09f9 --- /dev/null +++ b/client/incidents/vote_ai_incident_summary_parameters.go @@ -0,0 +1,190 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewVoteAiIncidentSummaryParams creates a new VoteAiIncidentSummaryParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewVoteAiIncidentSummaryParams() *VoteAiIncidentSummaryParams { + return &VoteAiIncidentSummaryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewVoteAiIncidentSummaryParamsWithTimeout creates a new VoteAiIncidentSummaryParams object +// with the ability to set a timeout on a request. +func NewVoteAiIncidentSummaryParamsWithTimeout(timeout time.Duration) *VoteAiIncidentSummaryParams { + return &VoteAiIncidentSummaryParams{ + timeout: timeout, + } +} + +// NewVoteAiIncidentSummaryParamsWithContext creates a new VoteAiIncidentSummaryParams object +// with the ability to set a context for a request. +func NewVoteAiIncidentSummaryParamsWithContext(ctx context.Context) *VoteAiIncidentSummaryParams { + return &VoteAiIncidentSummaryParams{ + Context: ctx, + } +} + +// NewVoteAiIncidentSummaryParamsWithHTTPClient creates a new VoteAiIncidentSummaryParams object +// with the ability to set a custom HTTPClient for a request. +func NewVoteAiIncidentSummaryParamsWithHTTPClient(client *http.Client) *VoteAiIncidentSummaryParams { + return &VoteAiIncidentSummaryParams{ + HTTPClient: client, + } +} + +/* +VoteAiIncidentSummaryParams contains all the parameters to send to the API endpoint + + for the vote ai incident summary operation. + + Typically these are written to a http.Request. +*/ +type VoteAiIncidentSummaryParams struct { + + // Direction. + Direction string + + // GeneratedSummaryID. + GeneratedSummaryID string + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the vote ai incident summary params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *VoteAiIncidentSummaryParams) WithDefaults() *VoteAiIncidentSummaryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the vote ai incident summary params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *VoteAiIncidentSummaryParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the vote ai incident summary params +func (o *VoteAiIncidentSummaryParams) WithTimeout(timeout time.Duration) *VoteAiIncidentSummaryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the vote ai incident summary params +func (o *VoteAiIncidentSummaryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the vote ai incident summary params +func (o *VoteAiIncidentSummaryParams) WithContext(ctx context.Context) *VoteAiIncidentSummaryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the vote ai incident summary params +func (o *VoteAiIncidentSummaryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the vote ai incident summary params +func (o *VoteAiIncidentSummaryParams) WithHTTPClient(client *http.Client) *VoteAiIncidentSummaryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the vote ai incident summary params +func (o *VoteAiIncidentSummaryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDirection adds the direction to the vote ai incident summary params +func (o *VoteAiIncidentSummaryParams) WithDirection(direction string) *VoteAiIncidentSummaryParams { + o.SetDirection(direction) + return o +} + +// SetDirection adds the direction to the vote ai incident summary params +func (o *VoteAiIncidentSummaryParams) SetDirection(direction string) { + o.Direction = direction +} + +// WithGeneratedSummaryID adds the generatedSummaryID to the vote ai incident summary params +func (o *VoteAiIncidentSummaryParams) WithGeneratedSummaryID(generatedSummaryID string) *VoteAiIncidentSummaryParams { + o.SetGeneratedSummaryID(generatedSummaryID) + return o +} + +// SetGeneratedSummaryID adds the generatedSummaryId to the vote ai incident summary params +func (o *VoteAiIncidentSummaryParams) SetGeneratedSummaryID(generatedSummaryID string) { + o.GeneratedSummaryID = generatedSummaryID +} + +// WithIncidentID adds the incidentID to the vote ai incident summary params +func (o *VoteAiIncidentSummaryParams) WithIncidentID(incidentID string) *VoteAiIncidentSummaryParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the vote ai incident summary params +func (o *VoteAiIncidentSummaryParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *VoteAiIncidentSummaryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // form param direction + frDirection := o.Direction + fDirection := frDirection + if fDirection != "" { + if err := r.SetFormParam("direction", fDirection); err != nil { + return err + } + } + + // path param generated_summary_id + if err := r.SetPathParam("generated_summary_id", o.GeneratedSummaryID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/incidents/vote_ai_incident_summary_responses.go b/client/incidents/vote_ai_incident_summary_responses.go new file mode 100644 index 0000000..c05d916 --- /dev/null +++ b/client/incidents/vote_ai_incident_summary_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package incidents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// VoteAiIncidentSummaryReader is a Reader for the VoteAiIncidentSummary structure. +type VoteAiIncidentSummaryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VoteAiIncidentSummaryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewVoteAiIncidentSummaryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewVoteAiIncidentSummaryOK creates a VoteAiIncidentSummaryOK with default headers values +func NewVoteAiIncidentSummaryOK() *VoteAiIncidentSummaryOK { + return &VoteAiIncidentSummaryOK{} +} + +/* +VoteAiIncidentSummaryOK describes a response with status code 200, with default header values. + +Vote on an AI-generated incident summary for the current user +*/ +type VoteAiIncidentSummaryOK struct { + Payload *models.AIEntitiesIncidentSummaryEntity +} + +// IsSuccess returns true when this vote ai incident summary o k response has a 2xx status code +func (o *VoteAiIncidentSummaryOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this vote ai incident summary o k response has a 3xx status code +func (o *VoteAiIncidentSummaryOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this vote ai incident summary o k response has a 4xx status code +func (o *VoteAiIncidentSummaryOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this vote ai incident summary o k response has a 5xx status code +func (o *VoteAiIncidentSummaryOK) IsServerError() bool { + return false +} + +// IsCode returns true when this vote ai incident summary o k response a status code equal to that given +func (o *VoteAiIncidentSummaryOK) IsCode(code int) bool { + return code == 200 +} + +func (o *VoteAiIncidentSummaryOK) Error() string { + return fmt.Sprintf("[PUT /v1/ai/summarize_incident/{incident_id}/{generated_summary_id}/vote][%d] voteAiIncidentSummaryOK %+v", 200, o.Payload) +} + +func (o *VoteAiIncidentSummaryOK) String() string { + return fmt.Sprintf("[PUT /v1/ai/summarize_incident/{incident_id}/{generated_summary_id}/vote][%d] voteAiIncidentSummaryOK %+v", 200, o.Payload) +} + +func (o *VoteAiIncidentSummaryOK) GetPayload() *models.AIEntitiesIncidentSummaryEntity { + return o.Payload +} + +func (o *VoteAiIncidentSummaryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.AIEntitiesIncidentSummaryEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/create_connection_parameters.go b/client/integrations/create_connection_parameters.go new file mode 100644 index 0000000..a48c37c --- /dev/null +++ b/client/integrations/create_connection_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateConnectionParams creates a new CreateConnectionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateConnectionParams() *CreateConnectionParams { + return &CreateConnectionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateConnectionParamsWithTimeout creates a new CreateConnectionParams object +// with the ability to set a timeout on a request. +func NewCreateConnectionParamsWithTimeout(timeout time.Duration) *CreateConnectionParams { + return &CreateConnectionParams{ + timeout: timeout, + } +} + +// NewCreateConnectionParamsWithContext creates a new CreateConnectionParams object +// with the ability to set a context for a request. +func NewCreateConnectionParamsWithContext(ctx context.Context) *CreateConnectionParams { + return &CreateConnectionParams{ + Context: ctx, + } +} + +// NewCreateConnectionParamsWithHTTPClient creates a new CreateConnectionParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateConnectionParamsWithHTTPClient(client *http.Client) *CreateConnectionParams { + return &CreateConnectionParams{ + HTTPClient: client, + } +} + +/* +CreateConnectionParams contains all the parameters to send to the API endpoint + + for the create connection operation. + + Typically these are written to a http.Request. +*/ +type CreateConnectionParams struct { + + // Slug. + Slug string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateConnectionParams) WithDefaults() *CreateConnectionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateConnectionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create connection params +func (o *CreateConnectionParams) WithTimeout(timeout time.Duration) *CreateConnectionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create connection params +func (o *CreateConnectionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create connection params +func (o *CreateConnectionParams) WithContext(ctx context.Context) *CreateConnectionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create connection params +func (o *CreateConnectionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create connection params +func (o *CreateConnectionParams) WithHTTPClient(client *http.Client) *CreateConnectionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create connection params +func (o *CreateConnectionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSlug adds the slug to the create connection params +func (o *CreateConnectionParams) WithSlug(slug string) *CreateConnectionParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the create connection params +func (o *CreateConnectionParams) SetSlug(slug string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateConnectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param slug + if err := r.SetPathParam("slug", o.Slug); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/create_connection_responses.go b/client/integrations/create_connection_responses.go new file mode 100644 index 0000000..3a07b07 --- /dev/null +++ b/client/integrations/create_connection_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateConnectionReader is a Reader for the CreateConnection structure. +type CreateConnectionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateConnectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateConnectionCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateConnectionCreated creates a CreateConnectionCreated with default headers values +func NewCreateConnectionCreated() *CreateConnectionCreated { + return &CreateConnectionCreated{} +} + +/* +CreateConnectionCreated describes a response with status code 201, with default header values. + +Create a new integration connection +*/ +type CreateConnectionCreated struct { + Payload *models.IntegrationsConnectionEntity +} + +// IsSuccess returns true when this create connection created response has a 2xx status code +func (o *CreateConnectionCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create connection created response has a 3xx status code +func (o *CreateConnectionCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create connection created response has a 4xx status code +func (o *CreateConnectionCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create connection created response has a 5xx status code +func (o *CreateConnectionCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create connection created response a status code equal to that given +func (o *CreateConnectionCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateConnectionCreated) Error() string { + return fmt.Sprintf("[POST /v1/integrations/connections/{slug}][%d] createConnectionCreated %+v", 201, o.Payload) +} + +func (o *CreateConnectionCreated) String() string { + return fmt.Sprintf("[POST /v1/integrations/connections/{slug}][%d] createConnectionCreated %+v", 201, o.Payload) +} + +func (o *CreateConnectionCreated) GetPayload() *models.IntegrationsConnectionEntity { + return o.Payload +} + +func (o *CreateConnectionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/create_slack_emoji_action_parameters.go b/client/integrations/create_slack_emoji_action_parameters.go new file mode 100644 index 0000000..92440e1 --- /dev/null +++ b/client/integrations/create_slack_emoji_action_parameters.go @@ -0,0 +1,209 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateSlackEmojiActionParams creates a new CreateSlackEmojiActionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateSlackEmojiActionParams() *CreateSlackEmojiActionParams { + return &CreateSlackEmojiActionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateSlackEmojiActionParamsWithTimeout creates a new CreateSlackEmojiActionParams object +// with the ability to set a timeout on a request. +func NewCreateSlackEmojiActionParamsWithTimeout(timeout time.Duration) *CreateSlackEmojiActionParams { + return &CreateSlackEmojiActionParams{ + timeout: timeout, + } +} + +// NewCreateSlackEmojiActionParamsWithContext creates a new CreateSlackEmojiActionParams object +// with the ability to set a context for a request. +func NewCreateSlackEmojiActionParamsWithContext(ctx context.Context) *CreateSlackEmojiActionParams { + return &CreateSlackEmojiActionParams{ + Context: ctx, + } +} + +// NewCreateSlackEmojiActionParamsWithHTTPClient creates a new CreateSlackEmojiActionParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateSlackEmojiActionParamsWithHTTPClient(client *http.Client) *CreateSlackEmojiActionParams { + return &CreateSlackEmojiActionParams{ + HTTPClient: client, + } +} + +/* +CreateSlackEmojiActionParams contains all the parameters to send to the API endpoint + + for the create slack emoji action operation. + + Typically these are written to a http.Request. +*/ +type CreateSlackEmojiActionParams struct { + + /* ConnectionID. + + Slack Connection UUID + */ + ConnectionID string + + /* EmojiName. + + The name of the emoji to associate with this action + */ + EmojiName string + + /* IncidentTypeID. + + The ID of the incident type to associate with this emoji action + */ + IncidentTypeID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create slack emoji action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSlackEmojiActionParams) WithDefaults() *CreateSlackEmojiActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create slack emoji action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSlackEmojiActionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create slack emoji action params +func (o *CreateSlackEmojiActionParams) WithTimeout(timeout time.Duration) *CreateSlackEmojiActionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create slack emoji action params +func (o *CreateSlackEmojiActionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create slack emoji action params +func (o *CreateSlackEmojiActionParams) WithContext(ctx context.Context) *CreateSlackEmojiActionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create slack emoji action params +func (o *CreateSlackEmojiActionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create slack emoji action params +func (o *CreateSlackEmojiActionParams) WithHTTPClient(client *http.Client) *CreateSlackEmojiActionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create slack emoji action params +func (o *CreateSlackEmojiActionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the create slack emoji action params +func (o *CreateSlackEmojiActionParams) WithConnectionID(connectionID string) *CreateSlackEmojiActionParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the create slack emoji action params +func (o *CreateSlackEmojiActionParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WithEmojiName adds the emojiName to the create slack emoji action params +func (o *CreateSlackEmojiActionParams) WithEmojiName(emojiName string) *CreateSlackEmojiActionParams { + o.SetEmojiName(emojiName) + return o +} + +// SetEmojiName adds the emojiName to the create slack emoji action params +func (o *CreateSlackEmojiActionParams) SetEmojiName(emojiName string) { + o.EmojiName = emojiName +} + +// WithIncidentTypeID adds the incidentTypeID to the create slack emoji action params +func (o *CreateSlackEmojiActionParams) WithIncidentTypeID(incidentTypeID *string) *CreateSlackEmojiActionParams { + o.SetIncidentTypeID(incidentTypeID) + return o +} + +// SetIncidentTypeID adds the incidentTypeId to the create slack emoji action params +func (o *CreateSlackEmojiActionParams) SetIncidentTypeID(incidentTypeID *string) { + o.IncidentTypeID = incidentTypeID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateSlackEmojiActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + + // form param emoji_name + frEmojiName := o.EmojiName + fEmojiName := frEmojiName + if fEmojiName != "" { + if err := r.SetFormParam("emoji_name", fEmojiName); err != nil { + return err + } + } + + if o.IncidentTypeID != nil { + + // form param incident_type_id + var frIncidentTypeID string + if o.IncidentTypeID != nil { + frIncidentTypeID = *o.IncidentTypeID + } + fIncidentTypeID := frIncidentTypeID + if fIncidentTypeID != "" { + if err := r.SetFormParam("incident_type_id", fIncidentTypeID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/create_slack_emoji_action_responses.go b/client/integrations/create_slack_emoji_action_responses.go new file mode 100644 index 0000000..daa5c50 --- /dev/null +++ b/client/integrations/create_slack_emoji_action_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateSlackEmojiActionReader is a Reader for the CreateSlackEmojiAction structure. +type CreateSlackEmojiActionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateSlackEmojiActionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateSlackEmojiActionCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateSlackEmojiActionCreated creates a CreateSlackEmojiActionCreated with default headers values +func NewCreateSlackEmojiActionCreated() *CreateSlackEmojiActionCreated { + return &CreateSlackEmojiActionCreated{} +} + +/* +CreateSlackEmojiActionCreated describes a response with status code 201, with default header values. + +Creates a new Slack emoji action +*/ +type CreateSlackEmojiActionCreated struct { +} + +// IsSuccess returns true when this create slack emoji action created response has a 2xx status code +func (o *CreateSlackEmojiActionCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create slack emoji action created response has a 3xx status code +func (o *CreateSlackEmojiActionCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create slack emoji action created response has a 4xx status code +func (o *CreateSlackEmojiActionCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create slack emoji action created response has a 5xx status code +func (o *CreateSlackEmojiActionCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create slack emoji action created response a status code equal to that given +func (o *CreateSlackEmojiActionCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateSlackEmojiActionCreated) Error() string { + return fmt.Sprintf("[POST /v1/integrations/slack/connections/{connection_id}/emoji_actions][%d] createSlackEmojiActionCreated ", 201) +} + +func (o *CreateSlackEmojiActionCreated) String() string { + return fmt.Sprintf("[POST /v1/integrations/slack/connections/{connection_id}/emoji_actions][%d] createSlackEmojiActionCreated ", 201) +} + +func (o *CreateSlackEmojiActionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/integrations/delete_slack_emoji_action_parameters.go b/client/integrations/delete_slack_emoji_action_parameters.go new file mode 100644 index 0000000..bde2dc7 --- /dev/null +++ b/client/integrations/delete_slack_emoji_action_parameters.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteSlackEmojiActionParams creates a new DeleteSlackEmojiActionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteSlackEmojiActionParams() *DeleteSlackEmojiActionParams { + return &DeleteSlackEmojiActionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSlackEmojiActionParamsWithTimeout creates a new DeleteSlackEmojiActionParams object +// with the ability to set a timeout on a request. +func NewDeleteSlackEmojiActionParamsWithTimeout(timeout time.Duration) *DeleteSlackEmojiActionParams { + return &DeleteSlackEmojiActionParams{ + timeout: timeout, + } +} + +// NewDeleteSlackEmojiActionParamsWithContext creates a new DeleteSlackEmojiActionParams object +// with the ability to set a context for a request. +func NewDeleteSlackEmojiActionParamsWithContext(ctx context.Context) *DeleteSlackEmojiActionParams { + return &DeleteSlackEmojiActionParams{ + Context: ctx, + } +} + +// NewDeleteSlackEmojiActionParamsWithHTTPClient creates a new DeleteSlackEmojiActionParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteSlackEmojiActionParamsWithHTTPClient(client *http.Client) *DeleteSlackEmojiActionParams { + return &DeleteSlackEmojiActionParams{ + HTTPClient: client, + } +} + +/* +DeleteSlackEmojiActionParams contains all the parameters to send to the API endpoint + + for the delete slack emoji action operation. + + Typically these are written to a http.Request. +*/ +type DeleteSlackEmojiActionParams struct { + + /* ConnectionID. + + Slack Connection UUID + */ + ConnectionID string + + // EmojiActionID. + EmojiActionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete slack emoji action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSlackEmojiActionParams) WithDefaults() *DeleteSlackEmojiActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete slack emoji action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSlackEmojiActionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete slack emoji action params +func (o *DeleteSlackEmojiActionParams) WithTimeout(timeout time.Duration) *DeleteSlackEmojiActionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete slack emoji action params +func (o *DeleteSlackEmojiActionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete slack emoji action params +func (o *DeleteSlackEmojiActionParams) WithContext(ctx context.Context) *DeleteSlackEmojiActionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete slack emoji action params +func (o *DeleteSlackEmojiActionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete slack emoji action params +func (o *DeleteSlackEmojiActionParams) WithHTTPClient(client *http.Client) *DeleteSlackEmojiActionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete slack emoji action params +func (o *DeleteSlackEmojiActionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the delete slack emoji action params +func (o *DeleteSlackEmojiActionParams) WithConnectionID(connectionID string) *DeleteSlackEmojiActionParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the delete slack emoji action params +func (o *DeleteSlackEmojiActionParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WithEmojiActionID adds the emojiActionID to the delete slack emoji action params +func (o *DeleteSlackEmojiActionParams) WithEmojiActionID(emojiActionID string) *DeleteSlackEmojiActionParams { + o.SetEmojiActionID(emojiActionID) + return o +} + +// SetEmojiActionID adds the emojiActionId to the delete slack emoji action params +func (o *DeleteSlackEmojiActionParams) SetEmojiActionID(emojiActionID string) { + o.EmojiActionID = emojiActionID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSlackEmojiActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + + // path param emoji_action_id + if err := r.SetPathParam("emoji_action_id", o.EmojiActionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/delete_slack_emoji_action_responses.go b/client/integrations/delete_slack_emoji_action_responses.go new file mode 100644 index 0000000..e1b29d8 --- /dev/null +++ b/client/integrations/delete_slack_emoji_action_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteSlackEmojiActionReader is a Reader for the DeleteSlackEmojiAction structure. +type DeleteSlackEmojiActionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSlackEmojiActionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteSlackEmojiActionNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteSlackEmojiActionNoContent creates a DeleteSlackEmojiActionNoContent with default headers values +func NewDeleteSlackEmojiActionNoContent() *DeleteSlackEmojiActionNoContent { + return &DeleteSlackEmojiActionNoContent{} +} + +/* +DeleteSlackEmojiActionNoContent describes a response with status code 204, with default header values. + +Deletes a Slack emoji action +*/ +type DeleteSlackEmojiActionNoContent struct { +} + +// IsSuccess returns true when this delete slack emoji action no content response has a 2xx status code +func (o *DeleteSlackEmojiActionNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete slack emoji action no content response has a 3xx status code +func (o *DeleteSlackEmojiActionNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete slack emoji action no content response has a 4xx status code +func (o *DeleteSlackEmojiActionNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete slack emoji action no content response has a 5xx status code +func (o *DeleteSlackEmojiActionNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete slack emoji action no content response a status code equal to that given +func (o *DeleteSlackEmojiActionNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteSlackEmojiActionNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/integrations/slack/connections/{connection_id}/emoji_actions/{emoji_action_id}][%d] deleteSlackEmojiActionNoContent ", 204) +} + +func (o *DeleteSlackEmojiActionNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/integrations/slack/connections/{connection_id}/emoji_actions/{emoji_action_id}][%d] deleteSlackEmojiActionNoContent ", 204) +} + +func (o *DeleteSlackEmojiActionNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/integrations/delete_statuspage_connection_parameters.go b/client/integrations/delete_statuspage_connection_parameters.go new file mode 100644 index 0000000..f303df5 --- /dev/null +++ b/client/integrations/delete_statuspage_connection_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteStatuspageConnectionParams creates a new DeleteStatuspageConnectionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteStatuspageConnectionParams() *DeleteStatuspageConnectionParams { + return &DeleteStatuspageConnectionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteStatuspageConnectionParamsWithTimeout creates a new DeleteStatuspageConnectionParams object +// with the ability to set a timeout on a request. +func NewDeleteStatuspageConnectionParamsWithTimeout(timeout time.Duration) *DeleteStatuspageConnectionParams { + return &DeleteStatuspageConnectionParams{ + timeout: timeout, + } +} + +// NewDeleteStatuspageConnectionParamsWithContext creates a new DeleteStatuspageConnectionParams object +// with the ability to set a context for a request. +func NewDeleteStatuspageConnectionParamsWithContext(ctx context.Context) *DeleteStatuspageConnectionParams { + return &DeleteStatuspageConnectionParams{ + Context: ctx, + } +} + +// NewDeleteStatuspageConnectionParamsWithHTTPClient creates a new DeleteStatuspageConnectionParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteStatuspageConnectionParamsWithHTTPClient(client *http.Client) *DeleteStatuspageConnectionParams { + return &DeleteStatuspageConnectionParams{ + HTTPClient: client, + } +} + +/* +DeleteStatuspageConnectionParams contains all the parameters to send to the API endpoint + + for the delete statuspage connection operation. + + Typically these are written to a http.Request. +*/ +type DeleteStatuspageConnectionParams struct { + + /* ConnectionID. + + Connection UUID + */ + ConnectionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete statuspage connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteStatuspageConnectionParams) WithDefaults() *DeleteStatuspageConnectionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete statuspage connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteStatuspageConnectionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete statuspage connection params +func (o *DeleteStatuspageConnectionParams) WithTimeout(timeout time.Duration) *DeleteStatuspageConnectionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete statuspage connection params +func (o *DeleteStatuspageConnectionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete statuspage connection params +func (o *DeleteStatuspageConnectionParams) WithContext(ctx context.Context) *DeleteStatuspageConnectionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete statuspage connection params +func (o *DeleteStatuspageConnectionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete statuspage connection params +func (o *DeleteStatuspageConnectionParams) WithHTTPClient(client *http.Client) *DeleteStatuspageConnectionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete statuspage connection params +func (o *DeleteStatuspageConnectionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the delete statuspage connection params +func (o *DeleteStatuspageConnectionParams) WithConnectionID(connectionID string) *DeleteStatuspageConnectionParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the delete statuspage connection params +func (o *DeleteStatuspageConnectionParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteStatuspageConnectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/delete_statuspage_connection_responses.go b/client/integrations/delete_statuspage_connection_responses.go new file mode 100644 index 0000000..4beecef --- /dev/null +++ b/client/integrations/delete_statuspage_connection_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteStatuspageConnectionReader is a Reader for the DeleteStatuspageConnection structure. +type DeleteStatuspageConnectionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteStatuspageConnectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteStatuspageConnectionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteStatuspageConnectionOK creates a DeleteStatuspageConnectionOK with default headers values +func NewDeleteStatuspageConnectionOK() *DeleteStatuspageConnectionOK { + return &DeleteStatuspageConnectionOK{} +} + +/* +DeleteStatuspageConnectionOK describes a response with status code 200, with default header values. + +Deletes the given Statuspage integration connection. +*/ +type DeleteStatuspageConnectionOK struct { + Payload *models.IntegrationsStatuspageConnectionEntity +} + +// IsSuccess returns true when this delete statuspage connection o k response has a 2xx status code +func (o *DeleteStatuspageConnectionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete statuspage connection o k response has a 3xx status code +func (o *DeleteStatuspageConnectionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete statuspage connection o k response has a 4xx status code +func (o *DeleteStatuspageConnectionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete statuspage connection o k response has a 5xx status code +func (o *DeleteStatuspageConnectionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete statuspage connection o k response a status code equal to that given +func (o *DeleteStatuspageConnectionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteStatuspageConnectionOK) Error() string { + return fmt.Sprintf("[DELETE /v1/integrations/statuspage/connections/{connection_id}][%d] deleteStatuspageConnectionOK %+v", 200, o.Payload) +} + +func (o *DeleteStatuspageConnectionOK) String() string { + return fmt.Sprintf("[DELETE /v1/integrations/statuspage/connections/{connection_id}][%d] deleteStatuspageConnectionOK %+v", 200, o.Payload) +} + +func (o *DeleteStatuspageConnectionOK) GetPayload() *models.IntegrationsStatuspageConnectionEntity { + return o.Payload +} + +func (o *DeleteStatuspageConnectionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsStatuspageConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/get_aws_cloudtrail_batch_parameters.go b/client/integrations/get_aws_cloudtrail_batch_parameters.go new file mode 100644 index 0000000..eb4a63f --- /dev/null +++ b/client/integrations/get_aws_cloudtrail_batch_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetAwsCloudtrailBatchParams creates a new GetAwsCloudtrailBatchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetAwsCloudtrailBatchParams() *GetAwsCloudtrailBatchParams { + return &GetAwsCloudtrailBatchParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAwsCloudtrailBatchParamsWithTimeout creates a new GetAwsCloudtrailBatchParams object +// with the ability to set a timeout on a request. +func NewGetAwsCloudtrailBatchParamsWithTimeout(timeout time.Duration) *GetAwsCloudtrailBatchParams { + return &GetAwsCloudtrailBatchParams{ + timeout: timeout, + } +} + +// NewGetAwsCloudtrailBatchParamsWithContext creates a new GetAwsCloudtrailBatchParams object +// with the ability to set a context for a request. +func NewGetAwsCloudtrailBatchParamsWithContext(ctx context.Context) *GetAwsCloudtrailBatchParams { + return &GetAwsCloudtrailBatchParams{ + Context: ctx, + } +} + +// NewGetAwsCloudtrailBatchParamsWithHTTPClient creates a new GetAwsCloudtrailBatchParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAwsCloudtrailBatchParamsWithHTTPClient(client *http.Client) *GetAwsCloudtrailBatchParams { + return &GetAwsCloudtrailBatchParams{ + HTTPClient: client, + } +} + +/* +GetAwsCloudtrailBatchParams contains all the parameters to send to the API endpoint + + for the get aws cloudtrail batch operation. + + Typically these are written to a http.Request. +*/ +type GetAwsCloudtrailBatchParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get aws cloudtrail batch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAwsCloudtrailBatchParams) WithDefaults() *GetAwsCloudtrailBatchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get aws cloudtrail batch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAwsCloudtrailBatchParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get aws cloudtrail batch params +func (o *GetAwsCloudtrailBatchParams) WithTimeout(timeout time.Duration) *GetAwsCloudtrailBatchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get aws cloudtrail batch params +func (o *GetAwsCloudtrailBatchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get aws cloudtrail batch params +func (o *GetAwsCloudtrailBatchParams) WithContext(ctx context.Context) *GetAwsCloudtrailBatchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get aws cloudtrail batch params +func (o *GetAwsCloudtrailBatchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get aws cloudtrail batch params +func (o *GetAwsCloudtrailBatchParams) WithHTTPClient(client *http.Client) *GetAwsCloudtrailBatchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get aws cloudtrail batch params +func (o *GetAwsCloudtrailBatchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get aws cloudtrail batch params +func (o *GetAwsCloudtrailBatchParams) WithID(id string) *GetAwsCloudtrailBatchParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get aws cloudtrail batch params +func (o *GetAwsCloudtrailBatchParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAwsCloudtrailBatchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/get_aws_cloudtrail_batch_responses.go b/client/integrations/get_aws_cloudtrail_batch_responses.go new file mode 100644 index 0000000..f0f6357 --- /dev/null +++ b/client/integrations/get_aws_cloudtrail_batch_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetAwsCloudtrailBatchReader is a Reader for the GetAwsCloudtrailBatch structure. +type GetAwsCloudtrailBatchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAwsCloudtrailBatchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAwsCloudtrailBatchOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAwsCloudtrailBatchOK creates a GetAwsCloudtrailBatchOK with default headers values +func NewGetAwsCloudtrailBatchOK() *GetAwsCloudtrailBatchOK { + return &GetAwsCloudtrailBatchOK{} +} + +/* +GetAwsCloudtrailBatchOK describes a response with status code 200, with default header values. + +Retrieve a single CloudTrail batch. +*/ +type GetAwsCloudtrailBatchOK struct { + Payload *models.IntegrationsAwsCloudtrailBatchEntity +} + +// IsSuccess returns true when this get aws cloudtrail batch o k response has a 2xx status code +func (o *GetAwsCloudtrailBatchOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get aws cloudtrail batch o k response has a 3xx status code +func (o *GetAwsCloudtrailBatchOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get aws cloudtrail batch o k response has a 4xx status code +func (o *GetAwsCloudtrailBatchOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get aws cloudtrail batch o k response has a 5xx status code +func (o *GetAwsCloudtrailBatchOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get aws cloudtrail batch o k response a status code equal to that given +func (o *GetAwsCloudtrailBatchOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetAwsCloudtrailBatchOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/aws/cloudtrail_batches/{id}][%d] getAwsCloudtrailBatchOK %+v", 200, o.Payload) +} + +func (o *GetAwsCloudtrailBatchOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/aws/cloudtrail_batches/{id}][%d] getAwsCloudtrailBatchOK %+v", 200, o.Payload) +} + +func (o *GetAwsCloudtrailBatchOK) GetPayload() *models.IntegrationsAwsCloudtrailBatchEntity { + return o.Payload +} + +func (o *GetAwsCloudtrailBatchOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsAwsCloudtrailBatchEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/get_aws_connection_parameters.go b/client/integrations/get_aws_connection_parameters.go new file mode 100644 index 0000000..4c01a3b --- /dev/null +++ b/client/integrations/get_aws_connection_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetAwsConnectionParams creates a new GetAwsConnectionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetAwsConnectionParams() *GetAwsConnectionParams { + return &GetAwsConnectionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAwsConnectionParamsWithTimeout creates a new GetAwsConnectionParams object +// with the ability to set a timeout on a request. +func NewGetAwsConnectionParamsWithTimeout(timeout time.Duration) *GetAwsConnectionParams { + return &GetAwsConnectionParams{ + timeout: timeout, + } +} + +// NewGetAwsConnectionParamsWithContext creates a new GetAwsConnectionParams object +// with the ability to set a context for a request. +func NewGetAwsConnectionParamsWithContext(ctx context.Context) *GetAwsConnectionParams { + return &GetAwsConnectionParams{ + Context: ctx, + } +} + +// NewGetAwsConnectionParamsWithHTTPClient creates a new GetAwsConnectionParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAwsConnectionParamsWithHTTPClient(client *http.Client) *GetAwsConnectionParams { + return &GetAwsConnectionParams{ + HTTPClient: client, + } +} + +/* +GetAwsConnectionParams contains all the parameters to send to the API endpoint + + for the get aws connection operation. + + Typically these are written to a http.Request. +*/ +type GetAwsConnectionParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get aws connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAwsConnectionParams) WithDefaults() *GetAwsConnectionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get aws connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAwsConnectionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get aws connection params +func (o *GetAwsConnectionParams) WithTimeout(timeout time.Duration) *GetAwsConnectionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get aws connection params +func (o *GetAwsConnectionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get aws connection params +func (o *GetAwsConnectionParams) WithContext(ctx context.Context) *GetAwsConnectionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get aws connection params +func (o *GetAwsConnectionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get aws connection params +func (o *GetAwsConnectionParams) WithHTTPClient(client *http.Client) *GetAwsConnectionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get aws connection params +func (o *GetAwsConnectionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get aws connection params +func (o *GetAwsConnectionParams) WithID(id string) *GetAwsConnectionParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get aws connection params +func (o *GetAwsConnectionParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAwsConnectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/get_aws_connection_responses.go b/client/integrations/get_aws_connection_responses.go new file mode 100644 index 0000000..521f4c6 --- /dev/null +++ b/client/integrations/get_aws_connection_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetAwsConnectionReader is a Reader for the GetAwsConnection structure. +type GetAwsConnectionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAwsConnectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAwsConnectionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetAwsConnectionOK creates a GetAwsConnectionOK with default headers values +func NewGetAwsConnectionOK() *GetAwsConnectionOK { + return &GetAwsConnectionOK{} +} + +/* +GetAwsConnectionOK describes a response with status code 200, with default header values. + +Retrieves the information about the AWS connection. +*/ +type GetAwsConnectionOK struct { + Payload *models.IntegrationsAwsConnectionEntity +} + +// IsSuccess returns true when this get aws connection o k response has a 2xx status code +func (o *GetAwsConnectionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get aws connection o k response has a 3xx status code +func (o *GetAwsConnectionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get aws connection o k response has a 4xx status code +func (o *GetAwsConnectionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get aws connection o k response has a 5xx status code +func (o *GetAwsConnectionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get aws connection o k response a status code equal to that given +func (o *GetAwsConnectionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetAwsConnectionOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/aws/connections/{id}][%d] getAwsConnectionOK %+v", 200, o.Payload) +} + +func (o *GetAwsConnectionOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/aws/connections/{id}][%d] getAwsConnectionOK %+v", 200, o.Payload) +} + +func (o *GetAwsConnectionOK) GetPayload() *models.IntegrationsAwsConnectionEntity { + return o.Payload +} + +func (o *GetAwsConnectionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsAwsConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/get_integration_parameters.go b/client/integrations/get_integration_parameters.go new file mode 100644 index 0000000..eae3edc --- /dev/null +++ b/client/integrations/get_integration_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetIntegrationParams creates a new GetIntegrationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetIntegrationParams() *GetIntegrationParams { + return &GetIntegrationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetIntegrationParamsWithTimeout creates a new GetIntegrationParams object +// with the ability to set a timeout on a request. +func NewGetIntegrationParamsWithTimeout(timeout time.Duration) *GetIntegrationParams { + return &GetIntegrationParams{ + timeout: timeout, + } +} + +// NewGetIntegrationParamsWithContext creates a new GetIntegrationParams object +// with the ability to set a context for a request. +func NewGetIntegrationParamsWithContext(ctx context.Context) *GetIntegrationParams { + return &GetIntegrationParams{ + Context: ctx, + } +} + +// NewGetIntegrationParamsWithHTTPClient creates a new GetIntegrationParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetIntegrationParamsWithHTTPClient(client *http.Client) *GetIntegrationParams { + return &GetIntegrationParams{ + HTTPClient: client, + } +} + +/* +GetIntegrationParams contains all the parameters to send to the API endpoint + + for the get integration operation. + + Typically these are written to a http.Request. +*/ +type GetIntegrationParams struct { + + /* IntegrationID. + + Integration UUID + */ + IntegrationID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get integration params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIntegrationParams) WithDefaults() *GetIntegrationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get integration params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIntegrationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get integration params +func (o *GetIntegrationParams) WithTimeout(timeout time.Duration) *GetIntegrationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get integration params +func (o *GetIntegrationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get integration params +func (o *GetIntegrationParams) WithContext(ctx context.Context) *GetIntegrationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get integration params +func (o *GetIntegrationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get integration params +func (o *GetIntegrationParams) WithHTTPClient(client *http.Client) *GetIntegrationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get integration params +func (o *GetIntegrationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIntegrationID adds the integrationID to the get integration params +func (o *GetIntegrationParams) WithIntegrationID(integrationID string) *GetIntegrationParams { + o.SetIntegrationID(integrationID) + return o +} + +// SetIntegrationID adds the integrationId to the get integration params +func (o *GetIntegrationParams) SetIntegrationID(integrationID string) { + o.IntegrationID = integrationID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetIntegrationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param integration_id + if err := r.SetPathParam("integration_id", o.IntegrationID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/get_integration_responses.go b/client/integrations/get_integration_responses.go new file mode 100644 index 0000000..47a6d8a --- /dev/null +++ b/client/integrations/get_integration_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetIntegrationReader is a Reader for the GetIntegration structure. +type GetIntegrationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetIntegrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetIntegrationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetIntegrationOK creates a GetIntegrationOK with default headers values +func NewGetIntegrationOK() *GetIntegrationOK { + return &GetIntegrationOK{} +} + +/* +GetIntegrationOK describes a response with status code 200, with default header values. + +Retrieve a single integration +*/ +type GetIntegrationOK struct { + Payload *models.IntegrationsIntegrationEntity +} + +// IsSuccess returns true when this get integration o k response has a 2xx status code +func (o *GetIntegrationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get integration o k response has a 3xx status code +func (o *GetIntegrationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get integration o k response has a 4xx status code +func (o *GetIntegrationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get integration o k response has a 5xx status code +func (o *GetIntegrationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get integration o k response a status code equal to that given +func (o *GetIntegrationOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetIntegrationOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/{integration_id}][%d] getIntegrationOK %+v", 200, o.Payload) +} + +func (o *GetIntegrationOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/{integration_id}][%d] getIntegrationOK %+v", 200, o.Payload) +} + +func (o *GetIntegrationOK) GetPayload() *models.IntegrationsIntegrationEntity { + return o.Payload +} + +func (o *GetIntegrationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsIntegrationEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/get_slack_emoji_action_parameters.go b/client/integrations/get_slack_emoji_action_parameters.go new file mode 100644 index 0000000..a686a4e --- /dev/null +++ b/client/integrations/get_slack_emoji_action_parameters.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSlackEmojiActionParams creates a new GetSlackEmojiActionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSlackEmojiActionParams() *GetSlackEmojiActionParams { + return &GetSlackEmojiActionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSlackEmojiActionParamsWithTimeout creates a new GetSlackEmojiActionParams object +// with the ability to set a timeout on a request. +func NewGetSlackEmojiActionParamsWithTimeout(timeout time.Duration) *GetSlackEmojiActionParams { + return &GetSlackEmojiActionParams{ + timeout: timeout, + } +} + +// NewGetSlackEmojiActionParamsWithContext creates a new GetSlackEmojiActionParams object +// with the ability to set a context for a request. +func NewGetSlackEmojiActionParamsWithContext(ctx context.Context) *GetSlackEmojiActionParams { + return &GetSlackEmojiActionParams{ + Context: ctx, + } +} + +// NewGetSlackEmojiActionParamsWithHTTPClient creates a new GetSlackEmojiActionParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSlackEmojiActionParamsWithHTTPClient(client *http.Client) *GetSlackEmojiActionParams { + return &GetSlackEmojiActionParams{ + HTTPClient: client, + } +} + +/* +GetSlackEmojiActionParams contains all the parameters to send to the API endpoint + + for the get slack emoji action operation. + + Typically these are written to a http.Request. +*/ +type GetSlackEmojiActionParams struct { + + /* ConnectionID. + + Slack Connection UUID + */ + ConnectionID string + + // EmojiActionID. + EmojiActionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get slack emoji action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSlackEmojiActionParams) WithDefaults() *GetSlackEmojiActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get slack emoji action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSlackEmojiActionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get slack emoji action params +func (o *GetSlackEmojiActionParams) WithTimeout(timeout time.Duration) *GetSlackEmojiActionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get slack emoji action params +func (o *GetSlackEmojiActionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get slack emoji action params +func (o *GetSlackEmojiActionParams) WithContext(ctx context.Context) *GetSlackEmojiActionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get slack emoji action params +func (o *GetSlackEmojiActionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get slack emoji action params +func (o *GetSlackEmojiActionParams) WithHTTPClient(client *http.Client) *GetSlackEmojiActionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get slack emoji action params +func (o *GetSlackEmojiActionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the get slack emoji action params +func (o *GetSlackEmojiActionParams) WithConnectionID(connectionID string) *GetSlackEmojiActionParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the get slack emoji action params +func (o *GetSlackEmojiActionParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WithEmojiActionID adds the emojiActionID to the get slack emoji action params +func (o *GetSlackEmojiActionParams) WithEmojiActionID(emojiActionID string) *GetSlackEmojiActionParams { + o.SetEmojiActionID(emojiActionID) + return o +} + +// SetEmojiActionID adds the emojiActionId to the get slack emoji action params +func (o *GetSlackEmojiActionParams) SetEmojiActionID(emojiActionID string) { + o.EmojiActionID = emojiActionID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSlackEmojiActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + + // path param emoji_action_id + if err := r.SetPathParam("emoji_action_id", o.EmojiActionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/get_slack_emoji_action_responses.go b/client/integrations/get_slack_emoji_action_responses.go new file mode 100644 index 0000000..5f755a2 --- /dev/null +++ b/client/integrations/get_slack_emoji_action_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSlackEmojiActionReader is a Reader for the GetSlackEmojiAction structure. +type GetSlackEmojiActionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSlackEmojiActionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSlackEmojiActionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSlackEmojiActionOK creates a GetSlackEmojiActionOK with default headers values +func NewGetSlackEmojiActionOK() *GetSlackEmojiActionOK { + return &GetSlackEmojiActionOK{} +} + +/* +GetSlackEmojiActionOK describes a response with status code 200, with default header values. + +Retrieves a Slack emoji action +*/ +type GetSlackEmojiActionOK struct { +} + +// IsSuccess returns true when this get slack emoji action o k response has a 2xx status code +func (o *GetSlackEmojiActionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get slack emoji action o k response has a 3xx status code +func (o *GetSlackEmojiActionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get slack emoji action o k response has a 4xx status code +func (o *GetSlackEmojiActionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get slack emoji action o k response has a 5xx status code +func (o *GetSlackEmojiActionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get slack emoji action o k response a status code equal to that given +func (o *GetSlackEmojiActionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetSlackEmojiActionOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/slack/connections/{connection_id}/emoji_actions/{emoji_action_id}][%d] getSlackEmojiActionOK ", 200) +} + +func (o *GetSlackEmojiActionOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/slack/connections/{connection_id}/emoji_actions/{emoji_action_id}][%d] getSlackEmojiActionOK ", 200) +} + +func (o *GetSlackEmojiActionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/integrations/get_statuspage_connection_parameters.go b/client/integrations/get_statuspage_connection_parameters.go new file mode 100644 index 0000000..311195a --- /dev/null +++ b/client/integrations/get_statuspage_connection_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetStatuspageConnectionParams creates a new GetStatuspageConnectionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetStatuspageConnectionParams() *GetStatuspageConnectionParams { + return &GetStatuspageConnectionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetStatuspageConnectionParamsWithTimeout creates a new GetStatuspageConnectionParams object +// with the ability to set a timeout on a request. +func NewGetStatuspageConnectionParamsWithTimeout(timeout time.Duration) *GetStatuspageConnectionParams { + return &GetStatuspageConnectionParams{ + timeout: timeout, + } +} + +// NewGetStatuspageConnectionParamsWithContext creates a new GetStatuspageConnectionParams object +// with the ability to set a context for a request. +func NewGetStatuspageConnectionParamsWithContext(ctx context.Context) *GetStatuspageConnectionParams { + return &GetStatuspageConnectionParams{ + Context: ctx, + } +} + +// NewGetStatuspageConnectionParamsWithHTTPClient creates a new GetStatuspageConnectionParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetStatuspageConnectionParamsWithHTTPClient(client *http.Client) *GetStatuspageConnectionParams { + return &GetStatuspageConnectionParams{ + HTTPClient: client, + } +} + +/* +GetStatuspageConnectionParams contains all the parameters to send to the API endpoint + + for the get statuspage connection operation. + + Typically these are written to a http.Request. +*/ +type GetStatuspageConnectionParams struct { + + /* ConnectionID. + + Connection UUID + */ + ConnectionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get statuspage connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetStatuspageConnectionParams) WithDefaults() *GetStatuspageConnectionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get statuspage connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetStatuspageConnectionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get statuspage connection params +func (o *GetStatuspageConnectionParams) WithTimeout(timeout time.Duration) *GetStatuspageConnectionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get statuspage connection params +func (o *GetStatuspageConnectionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get statuspage connection params +func (o *GetStatuspageConnectionParams) WithContext(ctx context.Context) *GetStatuspageConnectionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get statuspage connection params +func (o *GetStatuspageConnectionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get statuspage connection params +func (o *GetStatuspageConnectionParams) WithHTTPClient(client *http.Client) *GetStatuspageConnectionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get statuspage connection params +func (o *GetStatuspageConnectionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the get statuspage connection params +func (o *GetStatuspageConnectionParams) WithConnectionID(connectionID string) *GetStatuspageConnectionParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the get statuspage connection params +func (o *GetStatuspageConnectionParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetStatuspageConnectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/get_statuspage_connection_responses.go b/client/integrations/get_statuspage_connection_responses.go new file mode 100644 index 0000000..16b7bce --- /dev/null +++ b/client/integrations/get_statuspage_connection_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetStatuspageConnectionReader is a Reader for the GetStatuspageConnection structure. +type GetStatuspageConnectionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetStatuspageConnectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetStatuspageConnectionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetStatuspageConnectionOK creates a GetStatuspageConnectionOK with default headers values +func NewGetStatuspageConnectionOK() *GetStatuspageConnectionOK { + return &GetStatuspageConnectionOK{} +} + +/* +GetStatuspageConnectionOK describes a response with status code 200, with default header values. + +Retrieve the information about the Statuspage connection. +*/ +type GetStatuspageConnectionOK struct { + Payload *models.IntegrationsStatuspageConnectionEntity +} + +// IsSuccess returns true when this get statuspage connection o k response has a 2xx status code +func (o *GetStatuspageConnectionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get statuspage connection o k response has a 3xx status code +func (o *GetStatuspageConnectionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get statuspage connection o k response has a 4xx status code +func (o *GetStatuspageConnectionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get statuspage connection o k response has a 5xx status code +func (o *GetStatuspageConnectionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get statuspage connection o k response a status code equal to that given +func (o *GetStatuspageConnectionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetStatuspageConnectionOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/statuspage/connections/{connection_id}][%d] getStatuspageConnectionOK %+v", 200, o.Payload) +} + +func (o *GetStatuspageConnectionOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/statuspage/connections/{connection_id}][%d] getStatuspageConnectionOK %+v", 200, o.Payload) +} + +func (o *GetStatuspageConnectionOK) GetPayload() *models.IntegrationsStatuspageConnectionEntity { + return o.Payload +} + +func (o *GetStatuspageConnectionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsStatuspageConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/get_zendesk_customer_support_issue_parameters.go b/client/integrations/get_zendesk_customer_support_issue_parameters.go new file mode 100644 index 0000000..5acbb94 --- /dev/null +++ b/client/integrations/get_zendesk_customer_support_issue_parameters.go @@ -0,0 +1,190 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetZendeskCustomerSupportIssueParams creates a new GetZendeskCustomerSupportIssueParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetZendeskCustomerSupportIssueParams() *GetZendeskCustomerSupportIssueParams { + return &GetZendeskCustomerSupportIssueParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetZendeskCustomerSupportIssueParamsWithTimeout creates a new GetZendeskCustomerSupportIssueParams object +// with the ability to set a timeout on a request. +func NewGetZendeskCustomerSupportIssueParamsWithTimeout(timeout time.Duration) *GetZendeskCustomerSupportIssueParams { + return &GetZendeskCustomerSupportIssueParams{ + timeout: timeout, + } +} + +// NewGetZendeskCustomerSupportIssueParamsWithContext creates a new GetZendeskCustomerSupportIssueParams object +// with the ability to set a context for a request. +func NewGetZendeskCustomerSupportIssueParamsWithContext(ctx context.Context) *GetZendeskCustomerSupportIssueParams { + return &GetZendeskCustomerSupportIssueParams{ + Context: ctx, + } +} + +// NewGetZendeskCustomerSupportIssueParamsWithHTTPClient creates a new GetZendeskCustomerSupportIssueParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetZendeskCustomerSupportIssueParamsWithHTTPClient(client *http.Client) *GetZendeskCustomerSupportIssueParams { + return &GetZendeskCustomerSupportIssueParams{ + HTTPClient: client, + } +} + +/* +GetZendeskCustomerSupportIssueParams contains all the parameters to send to the API endpoint + + for the get zendesk customer support issue operation. + + Typically these are written to a http.Request. +*/ +type GetZendeskCustomerSupportIssueParams struct { + + /* Include. + + Use to include attached_incidents + */ + Include *string + + /* TicketID. + + Zendesk ticket ID + */ + TicketID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get zendesk customer support issue params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetZendeskCustomerSupportIssueParams) WithDefaults() *GetZendeskCustomerSupportIssueParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get zendesk customer support issue params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetZendeskCustomerSupportIssueParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get zendesk customer support issue params +func (o *GetZendeskCustomerSupportIssueParams) WithTimeout(timeout time.Duration) *GetZendeskCustomerSupportIssueParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get zendesk customer support issue params +func (o *GetZendeskCustomerSupportIssueParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get zendesk customer support issue params +func (o *GetZendeskCustomerSupportIssueParams) WithContext(ctx context.Context) *GetZendeskCustomerSupportIssueParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get zendesk customer support issue params +func (o *GetZendeskCustomerSupportIssueParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get zendesk customer support issue params +func (o *GetZendeskCustomerSupportIssueParams) WithHTTPClient(client *http.Client) *GetZendeskCustomerSupportIssueParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get zendesk customer support issue params +func (o *GetZendeskCustomerSupportIssueParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInclude adds the include to the get zendesk customer support issue params +func (o *GetZendeskCustomerSupportIssueParams) WithInclude(include *string) *GetZendeskCustomerSupportIssueParams { + o.SetInclude(include) + return o +} + +// SetInclude adds the include to the get zendesk customer support issue params +func (o *GetZendeskCustomerSupportIssueParams) SetInclude(include *string) { + o.Include = include +} + +// WithTicketID adds the ticketID to the get zendesk customer support issue params +func (o *GetZendeskCustomerSupportIssueParams) WithTicketID(ticketID string) *GetZendeskCustomerSupportIssueParams { + o.SetTicketID(ticketID) + return o +} + +// SetTicketID adds the ticketId to the get zendesk customer support issue params +func (o *GetZendeskCustomerSupportIssueParams) SetTicketID(ticketID string) { + o.TicketID = ticketID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetZendeskCustomerSupportIssueParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Include != nil { + + // query param include + var qrInclude string + + if o.Include != nil { + qrInclude = *o.Include + } + qInclude := qrInclude + if qInclude != "" { + + if err := r.SetQueryParam("include", qInclude); err != nil { + return err + } + } + } + + // query param ticket_id + qrTicketID := o.TicketID + qTicketID := qrTicketID + if qTicketID != "" { + + if err := r.SetQueryParam("ticket_id", qTicketID); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/get_zendesk_customer_support_issue_responses.go b/client/integrations/get_zendesk_customer_support_issue_responses.go new file mode 100644 index 0000000..05acbf5 --- /dev/null +++ b/client/integrations/get_zendesk_customer_support_issue_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetZendeskCustomerSupportIssueReader is a Reader for the GetZendeskCustomerSupportIssue structure. +type GetZendeskCustomerSupportIssueReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetZendeskCustomerSupportIssueReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetZendeskCustomerSupportIssueOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetZendeskCustomerSupportIssueOK creates a GetZendeskCustomerSupportIssueOK with default headers values +func NewGetZendeskCustomerSupportIssueOK() *GetZendeskCustomerSupportIssueOK { + return &GetZendeskCustomerSupportIssueOK{} +} + +/* +GetZendeskCustomerSupportIssueOK describes a response with status code 200, with default header values. + +Search for Zendesk tickets +*/ +type GetZendeskCustomerSupportIssueOK struct { +} + +// IsSuccess returns true when this get zendesk customer support issue o k response has a 2xx status code +func (o *GetZendeskCustomerSupportIssueOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get zendesk customer support issue o k response has a 3xx status code +func (o *GetZendeskCustomerSupportIssueOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get zendesk customer support issue o k response has a 4xx status code +func (o *GetZendeskCustomerSupportIssueOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get zendesk customer support issue o k response has a 5xx status code +func (o *GetZendeskCustomerSupportIssueOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get zendesk customer support issue o k response a status code equal to that given +func (o *GetZendeskCustomerSupportIssueOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetZendeskCustomerSupportIssueOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/zendesk/search][%d] getZendeskCustomerSupportIssueOK ", 200) +} + +func (o *GetZendeskCustomerSupportIssueOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/zendesk/search][%d] getZendeskCustomerSupportIssueOK ", 200) +} + +func (o *GetZendeskCustomerSupportIssueOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/integrations/integrations_client.go b/client/integrations/integrations_client.go index 3fe6b96..d4368ee 100644 --- a/client/integrations/integrations_client.go +++ b/client/integrations/integrations_client.go @@ -30,96 +30,96 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionID(params *DeleteV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDNoContent, error) + CreateConnection(params *CreateConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateConnectionCreated, error) - DeleteV1IntegrationsStatuspageConnectionsConnectionID(params *DeleteV1IntegrationsStatuspageConnectionsConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IntegrationsStatuspageConnectionsConnectionIDOK, error) + CreateSlackEmojiAction(params *CreateSlackEmojiActionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSlackEmojiActionCreated, error) - GetV1Integrations(params *GetV1IntegrationsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsOK, error) + DeleteSlackEmojiAction(params *DeleteSlackEmojiActionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSlackEmojiActionNoContent, error) - GetV1IntegrationsAuthedProvidersIntegrationSlugConnectionID(params *GetV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDOK, error) + DeleteStatuspageConnection(params *DeleteStatuspageConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteStatuspageConnectionOK, error) - GetV1IntegrationsAwsCloudtrailBatches(params *GetV1IntegrationsAwsCloudtrailBatchesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsAwsCloudtrailBatchesOK, error) + GetAwsCloudtrailBatch(params *GetAwsCloudtrailBatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAwsCloudtrailBatchOK, error) - GetV1IntegrationsAwsCloudtrailBatchesID(params *GetV1IntegrationsAwsCloudtrailBatchesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsAwsCloudtrailBatchesIDOK, error) + GetAwsConnection(params *GetAwsConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAwsConnectionOK, error) - GetV1IntegrationsAwsCloudtrailBatchesIDEvents(params *GetV1IntegrationsAwsCloudtrailBatchesIDEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsAwsCloudtrailBatchesIDEventsOK, error) + GetIntegration(params *GetIntegrationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIntegrationOK, error) - GetV1IntegrationsAwsConnections(params *GetV1IntegrationsAwsConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsAwsConnectionsOK, error) + GetSlackEmojiAction(params *GetSlackEmojiActionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSlackEmojiActionOK, error) - GetV1IntegrationsAwsConnectionsID(params *GetV1IntegrationsAwsConnectionsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsAwsConnectionsIDOK, error) + GetStatuspageConnection(params *GetStatuspageConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetStatuspageConnectionOK, error) - GetV1IntegrationsConfluenceCloudConnectionsIDSpaceSearch(params *GetV1IntegrationsConfluenceCloudConnectionsIDSpaceSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsConfluenceCloudConnectionsIDSpaceSearchOK, error) + GetZendeskCustomerSupportIssue(params *GetZendeskCustomerSupportIssueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetZendeskCustomerSupportIssueOK, error) - GetV1IntegrationsConnections(params *GetV1IntegrationsConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsConnectionsOK, error) + ListAuthedProviders(params *ListAuthedProvidersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAuthedProvidersOK, error) - GetV1IntegrationsFieldMapsFieldMapIDAvailableFields(params *GetV1IntegrationsFieldMapsFieldMapIDAvailableFieldsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsFieldMapsFieldMapIDAvailableFieldsOK, error) + ListAwsCloudtrailBatchEvents(params *ListAwsCloudtrailBatchEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAwsCloudtrailBatchEventsOK, error) - GetV1IntegrationsIntegrationID(params *GetV1IntegrationsIntegrationIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsIntegrationIDOK, error) + ListAwsCloudtrailBatches(params *ListAwsCloudtrailBatchesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAwsCloudtrailBatchesOK, error) - GetV1IntegrationsSlackConnectionsConnectionIDEmojiActions(params *GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsOK, error) + ListAwsConnections(params *ListAwsConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAwsConnectionsOK, error) - GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionID(params *GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDOK, error) + ListConnectionStatuses(params *ListConnectionStatusesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConnectionStatusesOK, error) - GetV1IntegrationsSlackConnectionsConnectionIDWorkspaces(params *GetV1IntegrationsSlackConnectionsConnectionIDWorkspacesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsSlackConnectionsConnectionIDWorkspacesOK, error) + ListConnectionStatusesBySlug(params *ListConnectionStatusesBySlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConnectionStatusesBySlugOK, error) - GetV1IntegrationsSlackUsergroups(params *GetV1IntegrationsSlackUsergroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsSlackUsergroupsOK, error) + ListConnections(params *ListConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConnectionsOK, error) - GetV1IntegrationsStatuses(params *GetV1IntegrationsStatusesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsStatusesOK, error) + ListFieldMapAvailableFields(params *ListFieldMapAvailableFieldsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListFieldMapAvailableFieldsOK, error) - GetV1IntegrationsStatusesSlug(params *GetV1IntegrationsStatusesSlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsStatusesSlugOK, error) + ListIntegrations(params *ListIntegrationsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIntegrationsOK, error) - GetV1IntegrationsStatuspageConnections(params *GetV1IntegrationsStatuspageConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsStatuspageConnectionsOK, error) + ListSlackEmojiActions(params *ListSlackEmojiActionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSlackEmojiActionsOK, error) - GetV1IntegrationsStatuspageConnectionsConnectionID(params *GetV1IntegrationsStatuspageConnectionsConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsStatuspageConnectionsConnectionIDOK, error) + ListSlackUsergroups(params *ListSlackUsergroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSlackUsergroupsOK, error) - GetV1IntegrationsStatuspageConnectionsConnectionIDPages(params *GetV1IntegrationsStatuspageConnectionsConnectionIDPagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsStatuspageConnectionsConnectionIDPagesOK, error) + ListSlackWorkspaces(params *ListSlackWorkspacesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSlackWorkspacesOK, error) - GetV1IntegrationsZendeskConnectionIDTicketsSearch(params *GetV1IntegrationsZendeskConnectionIDTicketsSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsZendeskConnectionIDTicketsSearchOK, error) + ListStatuspageConnectionPages(params *ListStatuspageConnectionPagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListStatuspageConnectionPagesOK, error) - GetV1IntegrationsZendeskSearch(params *GetV1IntegrationsZendeskSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsZendeskSearchOK, error) + ListStatuspageConnections(params *ListStatuspageConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListStatuspageConnectionsOK, error) - PatchV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDAuthedProviderID(params *PatchV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDAuthedProviderIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDAuthedProviderIDOK, error) + RefreshConnection(params *RefreshConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RefreshConnectionOK, error) - PatchV1IntegrationsAwsCloudtrailBatchesID(params *PatchV1IntegrationsAwsCloudtrailBatchesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsAwsCloudtrailBatchesIDOK, error) + SearchConfluenceSpaces(params *SearchConfluenceSpacesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SearchConfluenceSpacesOK, error) - PatchV1IntegrationsAwsConnectionsID(params *PatchV1IntegrationsAwsConnectionsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsAwsConnectionsIDOK, error) + SearchZendeskTickets(params *SearchZendeskTicketsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SearchZendeskTicketsOK, error) - PatchV1IntegrationsConnectionsSlugConnectionID(params *PatchV1IntegrationsConnectionsSlugConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsConnectionsSlugConnectionIDOK, error) + UpdateAuthedProvider(params *UpdateAuthedProviderParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAuthedProviderOK, error) - PatchV1IntegrationsConnectionsSlugConnectionIDRefresh(params *PatchV1IntegrationsConnectionsSlugConnectionIDRefreshParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsConnectionsSlugConnectionIDRefreshOK, error) + UpdateAwsCloudtrailBatch(params *UpdateAwsCloudtrailBatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAwsCloudtrailBatchOK, error) - PatchV1IntegrationsFieldMapsFieldMapID(params *PatchV1IntegrationsFieldMapsFieldMapIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsFieldMapsFieldMapIDOK, error) + UpdateAwsConnection(params *UpdateAwsConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAwsConnectionOK, error) - PatchV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionID(params *PatchV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDOK, error) + UpdateConnection(params *UpdateConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConnectionOK, error) - PatchV1IntegrationsStatuspageConnectionsConnectionID(params *PatchV1IntegrationsStatuspageConnectionsConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsStatuspageConnectionsConnectionIDOK, error) + UpdateFieldMap(params *UpdateFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateFieldMapOK, error) - PostV1IntegrationsConnectionsSlug(params *PostV1IntegrationsConnectionsSlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IntegrationsConnectionsSlugCreated, error) + UpdateSlackEmojiAction(params *UpdateSlackEmojiActionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSlackEmojiActionOK, error) - PostV1IntegrationsSlackConnectionsConnectionIDEmojiActions(params *PostV1IntegrationsSlackConnectionsConnectionIDEmojiActionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IntegrationsSlackConnectionsConnectionIDEmojiActionsCreated, error) + UpdateStatuspageConnection(params *UpdateStatuspageConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateStatuspageConnectionOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionID deletes a slack emoji action +CreateConnection creates a new integration connection -Deletes a Slack emoji action +Create a new integration connection */ -func (a *Client) DeleteV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionID(params *DeleteV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDNoContent, error) { +func (a *Client) CreateConnection(params *CreateConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateConnectionCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDParams() + params = NewCreateConnectionParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IntegrationsSlackConnectionsConnectionIdEmojiActionsEmojiActionId", - Method: "DELETE", - PathPattern: "/v1/integrations/slack/connections/{connection_id}/emoji_actions/{emoji_action_id}", + ID: "create_connection", + Method: "POST", + PathPattern: "/v1/integrations/connections/{slug}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDReader{formats: a.formats}, + Reader: &CreateConnectionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -132,35 +132,35 @@ func (a *Client) DeleteV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmo if err != nil { return nil, err } - success, ok := result.(*DeleteV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDNoContent) + success, ok := result.(*CreateConnectionCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IntegrationsSlackConnectionsConnectionIdEmojiActionsEmojiActionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_connection: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1IntegrationsStatuspageConnectionsConnectionID deletes a statuspage connection +CreateSlackEmojiAction creates a new slack emoji action -Deletes the given Statuspage integration connection. +Creates a new Slack emoji action */ -func (a *Client) DeleteV1IntegrationsStatuspageConnectionsConnectionID(params *DeleteV1IntegrationsStatuspageConnectionsConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IntegrationsStatuspageConnectionsConnectionIDOK, error) { +func (a *Client) CreateSlackEmojiAction(params *CreateSlackEmojiActionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSlackEmojiActionCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IntegrationsStatuspageConnectionsConnectionIDParams() + params = NewCreateSlackEmojiActionParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IntegrationsStatuspageConnectionsConnectionId", - Method: "DELETE", - PathPattern: "/v1/integrations/statuspage/connections/{connection_id}", + ID: "create_slack_emoji_action", + Method: "POST", + PathPattern: "/v1/integrations/slack/connections/{connection_id}/emoji_actions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IntegrationsStatuspageConnectionsConnectionIDReader{formats: a.formats}, + Reader: &CreateSlackEmojiActionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -173,35 +173,35 @@ func (a *Client) DeleteV1IntegrationsStatuspageConnectionsConnectionID(params *D if err != nil { return nil, err } - success, ok := result.(*DeleteV1IntegrationsStatuspageConnectionsConnectionIDOK) + success, ok := result.(*CreateSlackEmojiActionCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IntegrationsStatuspageConnectionsConnectionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_slack_emoji_action: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Integrations lists integrations +DeleteSlackEmojiAction deletes a slack emoji action -Lists the available and configured integrations +Deletes a Slack emoji action */ -func (a *Client) GetV1Integrations(params *GetV1IntegrationsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsOK, error) { +func (a *Client) DeleteSlackEmojiAction(params *DeleteSlackEmojiActionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSlackEmojiActionNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsParams() + params = NewDeleteSlackEmojiActionParams() } op := &runtime.ClientOperation{ - ID: "getV1Integrations", - Method: "GET", - PathPattern: "/v1/integrations", + ID: "delete_slack_emoji_action", + Method: "DELETE", + PathPattern: "/v1/integrations/slack/connections/{connection_id}/emoji_actions/{emoji_action_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsReader{formats: a.formats}, + Reader: &DeleteSlackEmojiActionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -214,35 +214,35 @@ func (a *Client) GetV1Integrations(params *GetV1IntegrationsParams, authInfo run if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsOK) + success, ok := result.(*DeleteSlackEmojiActionNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Integrations: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_slack_emoji_action: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsAuthedProvidersIntegrationSlugConnectionID lists the available and configured integrations +DeleteStatuspageConnection deletes a statuspage connection -Lists the available and configured integrations +Deletes the given Statuspage integration connection. */ -func (a *Client) GetV1IntegrationsAuthedProvidersIntegrationSlugConnectionID(params *GetV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDOK, error) { +func (a *Client) DeleteStatuspageConnection(params *DeleteStatuspageConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteStatuspageConnectionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDParams() + params = NewDeleteStatuspageConnectionParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsAuthedProvidersIntegrationSlugConnectionId", - Method: "GET", - PathPattern: "/v1/integrations/authed_providers/{integration_slug}/{connection_id}", + ID: "delete_statuspage_connection", + Method: "DELETE", + PathPattern: "/v1/integrations/statuspage/connections/{connection_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDReader{formats: a.formats}, + Reader: &DeleteStatuspageConnectionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -255,35 +255,35 @@ func (a *Client) GetV1IntegrationsAuthedProvidersIntegrationSlugConnectionID(par if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDOK) + success, ok := result.(*DeleteStatuspageConnectionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsAuthedProvidersIntegrationSlugConnectionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_statuspage_connection: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsAwsCloudtrailBatches lists cloud trail batches +GetAwsCloudtrailBatch gets a cloud trail batch -Lists CloudTrail batches for the authenticated organization. +Retrieve a single CloudTrail batch. */ -func (a *Client) GetV1IntegrationsAwsCloudtrailBatches(params *GetV1IntegrationsAwsCloudtrailBatchesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsAwsCloudtrailBatchesOK, error) { +func (a *Client) GetAwsCloudtrailBatch(params *GetAwsCloudtrailBatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAwsCloudtrailBatchOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsAwsCloudtrailBatchesParams() + params = NewGetAwsCloudtrailBatchParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsAwsCloudtrailBatches", + ID: "get_aws_cloudtrail_batch", Method: "GET", - PathPattern: "/v1/integrations/aws/cloudtrail_batches", + PathPattern: "/v1/integrations/aws/cloudtrail_batches/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsAwsCloudtrailBatchesReader{formats: a.formats}, + Reader: &GetAwsCloudtrailBatchReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -296,35 +296,35 @@ func (a *Client) GetV1IntegrationsAwsCloudtrailBatches(params *GetV1Integrations if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsAwsCloudtrailBatchesOK) + success, ok := result.(*GetAwsCloudtrailBatchOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsAwsCloudtrailBatches: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_aws_cloudtrail_batch: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsAwsCloudtrailBatchesID gets a cloud trail batch +GetAwsConnection gets an a w s connection -Retrieve a single CloudTrail batch. +Retrieves the information about the AWS connection. */ -func (a *Client) GetV1IntegrationsAwsCloudtrailBatchesID(params *GetV1IntegrationsAwsCloudtrailBatchesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsAwsCloudtrailBatchesIDOK, error) { +func (a *Client) GetAwsConnection(params *GetAwsConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAwsConnectionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsAwsCloudtrailBatchesIDParams() + params = NewGetAwsConnectionParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsAwsCloudtrailBatchesId", + ID: "get_aws_connection", Method: "GET", - PathPattern: "/v1/integrations/aws/cloudtrail_batches/{id}", + PathPattern: "/v1/integrations/aws/connections/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsAwsCloudtrailBatchesIDReader{formats: a.formats}, + Reader: &GetAwsConnectionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -337,35 +337,35 @@ func (a *Client) GetV1IntegrationsAwsCloudtrailBatchesID(params *GetV1Integratio if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsAwsCloudtrailBatchesIDOK) + success, ok := result.(*GetAwsConnectionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsAwsCloudtrailBatchesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_aws_connection: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsAwsCloudtrailBatchesIDEvents lists events for an a w s cloud trail batch +GetIntegration gets an integration -List events for an AWS CloudTrail batch +Retrieve a single integration */ -func (a *Client) GetV1IntegrationsAwsCloudtrailBatchesIDEvents(params *GetV1IntegrationsAwsCloudtrailBatchesIDEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsAwsCloudtrailBatchesIDEventsOK, error) { +func (a *Client) GetIntegration(params *GetIntegrationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIntegrationOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsAwsCloudtrailBatchesIDEventsParams() + params = NewGetIntegrationParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsAwsCloudtrailBatchesIdEvents", + ID: "get_integration", Method: "GET", - PathPattern: "/v1/integrations/aws/cloudtrail_batches/{id}/events", + PathPattern: "/v1/integrations/{integration_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsAwsCloudtrailBatchesIDEventsReader{formats: a.formats}, + Reader: &GetIntegrationReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -378,35 +378,35 @@ func (a *Client) GetV1IntegrationsAwsCloudtrailBatchesIDEvents(params *GetV1Inte if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsAwsCloudtrailBatchesIDEventsOK) + success, ok := result.(*GetIntegrationOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsAwsCloudtrailBatchesIdEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_integration: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsAwsConnections lists a w s connections +GetSlackEmojiAction gets a slack emoji action -Lists the available and configured AWS integration connections for the authenticated organization. +Retrieves a Slack emoji action */ -func (a *Client) GetV1IntegrationsAwsConnections(params *GetV1IntegrationsAwsConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsAwsConnectionsOK, error) { +func (a *Client) GetSlackEmojiAction(params *GetSlackEmojiActionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSlackEmojiActionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsAwsConnectionsParams() + params = NewGetSlackEmojiActionParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsAwsConnections", + ID: "get_slack_emoji_action", Method: "GET", - PathPattern: "/v1/integrations/aws/connections", + PathPattern: "/v1/integrations/slack/connections/{connection_id}/emoji_actions/{emoji_action_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsAwsConnectionsReader{formats: a.formats}, + Reader: &GetSlackEmojiActionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -419,35 +419,35 @@ func (a *Client) GetV1IntegrationsAwsConnections(params *GetV1IntegrationsAwsCon if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsAwsConnectionsOK) + success, ok := result.(*GetSlackEmojiActionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsAwsConnections: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_slack_emoji_action: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsAwsConnectionsID gets an a w s connection +GetStatuspageConnection gets a statuspage connection -Retrieves the information about the AWS connection. +Retrieve the information about the Statuspage connection. */ -func (a *Client) GetV1IntegrationsAwsConnectionsID(params *GetV1IntegrationsAwsConnectionsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsAwsConnectionsIDOK, error) { +func (a *Client) GetStatuspageConnection(params *GetStatuspageConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetStatuspageConnectionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsAwsConnectionsIDParams() + params = NewGetStatuspageConnectionParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsAwsConnectionsId", + ID: "get_statuspage_connection", Method: "GET", - PathPattern: "/v1/integrations/aws/connections/{id}", + PathPattern: "/v1/integrations/statuspage/connections/{connection_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsAwsConnectionsIDReader{formats: a.formats}, + Reader: &GetStatuspageConnectionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -460,35 +460,35 @@ func (a *Client) GetV1IntegrationsAwsConnectionsID(params *GetV1IntegrationsAwsC if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsAwsConnectionsIDOK) + success, ok := result.(*GetStatuspageConnectionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsAwsConnectionsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_statuspage_connection: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsConfluenceCloudConnectionsIDSpaceSearch lists confluence spaces +GetZendeskCustomerSupportIssue searches for zendesk tickets -Lists available space keys for the Confluence integration connection. +Search for Zendesk tickets */ -func (a *Client) GetV1IntegrationsConfluenceCloudConnectionsIDSpaceSearch(params *GetV1IntegrationsConfluenceCloudConnectionsIDSpaceSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsConfluenceCloudConnectionsIDSpaceSearchOK, error) { +func (a *Client) GetZendeskCustomerSupportIssue(params *GetZendeskCustomerSupportIssueParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetZendeskCustomerSupportIssueOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsConfluenceCloudConnectionsIDSpaceSearchParams() + params = NewGetZendeskCustomerSupportIssueParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsConfluenceCloudConnectionsIdSpaceSearch", + ID: "get_zendesk_customer_support_issue", Method: "GET", - PathPattern: "/v1/integrations/confluence_cloud/connections/{id}/space/search", + PathPattern: "/v1/integrations/zendesk/search", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsConfluenceCloudConnectionsIDSpaceSearchReader{formats: a.formats}, + Reader: &GetZendeskCustomerSupportIssueReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -501,35 +501,35 @@ func (a *Client) GetV1IntegrationsConfluenceCloudConnectionsIDSpaceSearch(params if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsConfluenceCloudConnectionsIDSpaceSearchOK) + success, ok := result.(*GetZendeskCustomerSupportIssueOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsConfluenceCloudConnectionsIdSpaceSearch: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_zendesk_customer_support_issue: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsConnections lists integration connections +ListAuthedProviders lists the available and configured integrations -List available integration connections +Lists the available and configured integrations */ -func (a *Client) GetV1IntegrationsConnections(params *GetV1IntegrationsConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsConnectionsOK, error) { +func (a *Client) ListAuthedProviders(params *ListAuthedProvidersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAuthedProvidersOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsConnectionsParams() + params = NewListAuthedProvidersParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsConnections", + ID: "list_authed_providers", Method: "GET", - PathPattern: "/v1/integrations/connections", + PathPattern: "/v1/integrations/authed_providers/{integration_slug}/{connection_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsConnectionsReader{formats: a.formats}, + Reader: &ListAuthedProvidersReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -542,35 +542,35 @@ func (a *Client) GetV1IntegrationsConnections(params *GetV1IntegrationsConnectio if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsConnectionsOK) + success, ok := result.(*ListAuthedProvidersOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsConnections: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_authed_providers: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsFieldMapsFieldMapIDAvailableFields lists available fields for field mapping +ListAwsCloudtrailBatchEvents lists events for an a w s cloud trail batch -Get a description of the fields to which data can be mapped +List events for an AWS CloudTrail batch */ -func (a *Client) GetV1IntegrationsFieldMapsFieldMapIDAvailableFields(params *GetV1IntegrationsFieldMapsFieldMapIDAvailableFieldsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsFieldMapsFieldMapIDAvailableFieldsOK, error) { +func (a *Client) ListAwsCloudtrailBatchEvents(params *ListAwsCloudtrailBatchEventsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAwsCloudtrailBatchEventsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsFieldMapsFieldMapIDAvailableFieldsParams() + params = NewListAwsCloudtrailBatchEventsParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsFieldMapsFieldMapIdAvailableFields", + ID: "list_aws_cloudtrail_batch_events", Method: "GET", - PathPattern: "/v1/integrations/field_maps/{field_map_id}/available_fields", + PathPattern: "/v1/integrations/aws/cloudtrail_batches/{id}/events", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsFieldMapsFieldMapIDAvailableFieldsReader{formats: a.formats}, + Reader: &ListAwsCloudtrailBatchEventsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -583,35 +583,35 @@ func (a *Client) GetV1IntegrationsFieldMapsFieldMapIDAvailableFields(params *Get if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsFieldMapsFieldMapIDAvailableFieldsOK) + success, ok := result.(*ListAwsCloudtrailBatchEventsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsFieldMapsFieldMapIdAvailableFields: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_aws_cloudtrail_batch_events: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsIntegrationID gets an integration +ListAwsCloudtrailBatches lists cloud trail batches -Retrieve a single integration +Lists CloudTrail batches for the authenticated organization. */ -func (a *Client) GetV1IntegrationsIntegrationID(params *GetV1IntegrationsIntegrationIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsIntegrationIDOK, error) { +func (a *Client) ListAwsCloudtrailBatches(params *ListAwsCloudtrailBatchesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAwsCloudtrailBatchesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsIntegrationIDParams() + params = NewListAwsCloudtrailBatchesParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsIntegrationId", + ID: "list_aws_cloudtrail_batches", Method: "GET", - PathPattern: "/v1/integrations/{integration_id}", + PathPattern: "/v1/integrations/aws/cloudtrail_batches", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsIntegrationIDReader{formats: a.formats}, + Reader: &ListAwsCloudtrailBatchesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -624,35 +624,35 @@ func (a *Client) GetV1IntegrationsIntegrationID(params *GetV1IntegrationsIntegra if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsIntegrationIDOK) + success, ok := result.(*ListAwsCloudtrailBatchesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsIntegrationId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_aws_cloudtrail_batches: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsSlackConnectionsConnectionIDEmojiActions lists slack emoji actions +ListAwsConnections lists a w s connections -Lists Slack emoji actions +Lists the available and configured AWS integration connections for the authenticated organization. */ -func (a *Client) GetV1IntegrationsSlackConnectionsConnectionIDEmojiActions(params *GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsOK, error) { +func (a *Client) ListAwsConnections(params *ListAwsConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAwsConnectionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsParams() + params = NewListAwsConnectionsParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsSlackConnectionsConnectionIdEmojiActions", + ID: "list_aws_connections", Method: "GET", - PathPattern: "/v1/integrations/slack/connections/{connection_id}/emoji_actions", + PathPattern: "/v1/integrations/aws/connections", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsReader{formats: a.formats}, + Reader: &ListAwsConnectionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -665,35 +665,35 @@ func (a *Client) GetV1IntegrationsSlackConnectionsConnectionIDEmojiActions(param if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsOK) + success, ok := result.(*ListAwsConnectionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsSlackConnectionsConnectionIdEmojiActions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_aws_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionID gets a slack emoji action +ListConnectionStatuses gets integration connection status -Retrieves a Slack emoji action +Retrieve overall integration connection status */ -func (a *Client) GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionID(params *GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDOK, error) { +func (a *Client) ListConnectionStatuses(params *ListConnectionStatusesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConnectionStatusesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDParams() + params = NewListConnectionStatusesParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsSlackConnectionsConnectionIdEmojiActionsEmojiActionId", + ID: "list_connection_statuses", Method: "GET", - PathPattern: "/v1/integrations/slack/connections/{connection_id}/emoji_actions/{emoji_action_id}", + PathPattern: "/v1/integrations/statuses", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDReader{formats: a.formats}, + Reader: &ListConnectionStatusesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -706,35 +706,35 @@ func (a *Client) GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiA if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDOK) + success, ok := result.(*ListConnectionStatusesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsSlackConnectionsConnectionIdEmojiActionsEmojiActionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_connection_statuses: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsSlackConnectionsConnectionIDWorkspaces lists slack workspaces +ListConnectionStatusesBySlug gets an integration connection status -Lists all Slack workspaces +Retrieve a single integration connection status */ -func (a *Client) GetV1IntegrationsSlackConnectionsConnectionIDWorkspaces(params *GetV1IntegrationsSlackConnectionsConnectionIDWorkspacesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsSlackConnectionsConnectionIDWorkspacesOK, error) { +func (a *Client) ListConnectionStatusesBySlug(params *ListConnectionStatusesBySlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConnectionStatusesBySlugOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsSlackConnectionsConnectionIDWorkspacesParams() + params = NewListConnectionStatusesBySlugParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsSlackConnectionsConnectionIdWorkspaces", + ID: "list_connection_statuses_by_slug", Method: "GET", - PathPattern: "/v1/integrations/slack/connections/{connection_id}/workspaces", + PathPattern: "/v1/integrations/statuses/{slug}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsSlackConnectionsConnectionIDWorkspacesReader{formats: a.formats}, + Reader: &ListConnectionStatusesBySlugReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -747,35 +747,35 @@ func (a *Client) GetV1IntegrationsSlackConnectionsConnectionIDWorkspaces(params if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsSlackConnectionsConnectionIDWorkspacesOK) + success, ok := result.(*ListConnectionStatusesBySlugOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsSlackConnectionsConnectionIdWorkspaces: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_connection_statuses_by_slug: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsSlackUsergroups lists slack user groups +ListConnections lists integration connections -Lists all Slack user groups +List available integration connections */ -func (a *Client) GetV1IntegrationsSlackUsergroups(params *GetV1IntegrationsSlackUsergroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsSlackUsergroupsOK, error) { +func (a *Client) ListConnections(params *ListConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConnectionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsSlackUsergroupsParams() + params = NewListConnectionsParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsSlackUsergroups", + ID: "list_connections", Method: "GET", - PathPattern: "/v1/integrations/slack/usergroups", + PathPattern: "/v1/integrations/connections", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsSlackUsergroupsReader{formats: a.formats}, + Reader: &ListConnectionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -788,35 +788,35 @@ func (a *Client) GetV1IntegrationsSlackUsergroups(params *GetV1IntegrationsSlack if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsSlackUsergroupsOK) + success, ok := result.(*ListConnectionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsSlackUsergroups: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsStatuses gets integration connection status +ListFieldMapAvailableFields lists available fields for field mapping -Retrieve overall integration connection status +Get a description of the fields to which data can be mapped */ -func (a *Client) GetV1IntegrationsStatuses(params *GetV1IntegrationsStatusesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsStatusesOK, error) { +func (a *Client) ListFieldMapAvailableFields(params *ListFieldMapAvailableFieldsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListFieldMapAvailableFieldsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsStatusesParams() + params = NewListFieldMapAvailableFieldsParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsStatuses", + ID: "list_field_map_available_fields", Method: "GET", - PathPattern: "/v1/integrations/statuses", + PathPattern: "/v1/integrations/field_maps/{field_map_id}/available_fields", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsStatusesReader{formats: a.formats}, + Reader: &ListFieldMapAvailableFieldsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -829,35 +829,35 @@ func (a *Client) GetV1IntegrationsStatuses(params *GetV1IntegrationsStatusesPara if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsStatusesOK) + success, ok := result.(*ListFieldMapAvailableFieldsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsStatuses: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_field_map_available_fields: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsStatusesSlug gets an integration connection status +ListIntegrations lists integrations -Retrieve a single integration connection status +Lists the available and configured integrations */ -func (a *Client) GetV1IntegrationsStatusesSlug(params *GetV1IntegrationsStatusesSlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsStatusesSlugOK, error) { +func (a *Client) ListIntegrations(params *ListIntegrationsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIntegrationsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsStatusesSlugParams() + params = NewListIntegrationsParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsStatusesSlug", + ID: "list_integrations", Method: "GET", - PathPattern: "/v1/integrations/statuses/{slug}", + PathPattern: "/v1/integrations", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsStatusesSlugReader{formats: a.formats}, + Reader: &ListIntegrationsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -870,35 +870,35 @@ func (a *Client) GetV1IntegrationsStatusesSlug(params *GetV1IntegrationsStatuses if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsStatusesSlugOK) + success, ok := result.(*ListIntegrationsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsStatusesSlug: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_integrations: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsStatuspageConnections lists statuspage connections +ListSlackEmojiActions lists slack emoji actions -Lists the available and configured Statuspage integrations connections for the authenticated organization. +Lists Slack emoji actions */ -func (a *Client) GetV1IntegrationsStatuspageConnections(params *GetV1IntegrationsStatuspageConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsStatuspageConnectionsOK, error) { +func (a *Client) ListSlackEmojiActions(params *ListSlackEmojiActionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSlackEmojiActionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsStatuspageConnectionsParams() + params = NewListSlackEmojiActionsParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsStatuspageConnections", + ID: "list_slack_emoji_actions", Method: "GET", - PathPattern: "/v1/integrations/statuspage/connections", + PathPattern: "/v1/integrations/slack/connections/{connection_id}/emoji_actions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsStatuspageConnectionsReader{formats: a.formats}, + Reader: &ListSlackEmojiActionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -911,35 +911,35 @@ func (a *Client) GetV1IntegrationsStatuspageConnections(params *GetV1Integration if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsStatuspageConnectionsOK) + success, ok := result.(*ListSlackEmojiActionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsStatuspageConnections: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_slack_emoji_actions: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsStatuspageConnectionsConnectionID gets a statuspage connection +ListSlackUsergroups lists slack user groups -Retrieve the information about the Statuspage connection. +Lists all Slack user groups */ -func (a *Client) GetV1IntegrationsStatuspageConnectionsConnectionID(params *GetV1IntegrationsStatuspageConnectionsConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsStatuspageConnectionsConnectionIDOK, error) { +func (a *Client) ListSlackUsergroups(params *ListSlackUsergroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSlackUsergroupsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsStatuspageConnectionsConnectionIDParams() + params = NewListSlackUsergroupsParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsStatuspageConnectionsConnectionId", + ID: "list_slack_usergroups", Method: "GET", - PathPattern: "/v1/integrations/statuspage/connections/{connection_id}", + PathPattern: "/v1/integrations/slack/usergroups", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsStatuspageConnectionsConnectionIDReader{formats: a.formats}, + Reader: &ListSlackUsergroupsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -952,35 +952,35 @@ func (a *Client) GetV1IntegrationsStatuspageConnectionsConnectionID(params *GetV if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsStatuspageConnectionsConnectionIDOK) + success, ok := result.(*ListSlackUsergroupsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsStatuspageConnectionsConnectionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_slack_usergroups: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsStatuspageConnectionsConnectionIDPages lists status page pages for a connection +ListSlackWorkspaces lists slack workspaces -Lists available page IDs for the Statuspage integration connection. +Lists all Slack workspaces */ -func (a *Client) GetV1IntegrationsStatuspageConnectionsConnectionIDPages(params *GetV1IntegrationsStatuspageConnectionsConnectionIDPagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsStatuspageConnectionsConnectionIDPagesOK, error) { +func (a *Client) ListSlackWorkspaces(params *ListSlackWorkspacesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSlackWorkspacesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsStatuspageConnectionsConnectionIDPagesParams() + params = NewListSlackWorkspacesParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsStatuspageConnectionsConnectionIdPages", + ID: "list_slack_workspaces", Method: "GET", - PathPattern: "/v1/integrations/statuspage/connections/{connection_id}/pages", + PathPattern: "/v1/integrations/slack/connections/{connection_id}/workspaces", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsStatuspageConnectionsConnectionIDPagesReader{formats: a.formats}, + Reader: &ListSlackWorkspacesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -993,35 +993,35 @@ func (a *Client) GetV1IntegrationsStatuspageConnectionsConnectionIDPages(params if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsStatuspageConnectionsConnectionIDPagesOK) + success, ok := result.(*ListSlackWorkspacesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsStatuspageConnectionsConnectionIdPages: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_slack_workspaces: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsZendeskConnectionIDTicketsSearch searches for zendesk tickets +ListStatuspageConnectionPages lists status page pages for a connection -Search for Zendesk tickets +Lists available page IDs for the Statuspage integration connection. */ -func (a *Client) GetV1IntegrationsZendeskConnectionIDTicketsSearch(params *GetV1IntegrationsZendeskConnectionIDTicketsSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsZendeskConnectionIDTicketsSearchOK, error) { +func (a *Client) ListStatuspageConnectionPages(params *ListStatuspageConnectionPagesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListStatuspageConnectionPagesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsZendeskConnectionIDTicketsSearchParams() + params = NewListStatuspageConnectionPagesParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsZendeskConnectionIdTicketsSearch", + ID: "list_statuspage_connection_pages", Method: "GET", - PathPattern: "/v1/integrations/zendesk/{connection_id}/tickets/search", + PathPattern: "/v1/integrations/statuspage/connections/{connection_id}/pages", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsZendeskConnectionIDTicketsSearchReader{formats: a.formats}, + Reader: &ListStatuspageConnectionPagesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1034,35 +1034,35 @@ func (a *Client) GetV1IntegrationsZendeskConnectionIDTicketsSearch(params *GetV1 if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsZendeskConnectionIDTicketsSearchOK) + success, ok := result.(*ListStatuspageConnectionPagesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsZendeskConnectionIdTicketsSearch: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_statuspage_connection_pages: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IntegrationsZendeskSearch searches for zendesk tickets +ListStatuspageConnections lists statuspage connections -Search for Zendesk tickets +Lists the available and configured Statuspage integrations connections for the authenticated organization. */ -func (a *Client) GetV1IntegrationsZendeskSearch(params *GetV1IntegrationsZendeskSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IntegrationsZendeskSearchOK, error) { +func (a *Client) ListStatuspageConnections(params *ListStatuspageConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListStatuspageConnectionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IntegrationsZendeskSearchParams() + params = NewListStatuspageConnectionsParams() } op := &runtime.ClientOperation{ - ID: "getV1IntegrationsZendeskSearch", + ID: "list_statuspage_connections", Method: "GET", - PathPattern: "/v1/integrations/zendesk/search", + PathPattern: "/v1/integrations/statuspage/connections", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IntegrationsZendeskSearchReader{formats: a.formats}, + Reader: &ListStatuspageConnectionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1075,35 +1075,35 @@ func (a *Client) GetV1IntegrationsZendeskSearch(params *GetV1IntegrationsZendesk if err != nil { return nil, err } - success, ok := result.(*GetV1IntegrationsZendeskSearchOK) + success, ok := result.(*ListStatuspageConnectionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IntegrationsZendeskSearch: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_statuspage_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDAuthedProviderID gets an authed provider +RefreshConnection refreshes an integration connection -Retrieve a single authed provider +Refresh the integration connection with the provided data */ -func (a *Client) PatchV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDAuthedProviderID(params *PatchV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDAuthedProviderIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDAuthedProviderIDOK, error) { +func (a *Client) RefreshConnection(params *RefreshConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RefreshConnectionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDAuthedProviderIDParams() + params = NewRefreshConnectionParams() } op := &runtime.ClientOperation{ - ID: "patchV1IntegrationsAuthedProvidersIntegrationSlugConnectionIdAuthedProviderId", + ID: "refresh_connection", Method: "PATCH", - PathPattern: "/v1/integrations/authed_providers/{integration_slug}/{connection_id}/{authed_provider_id}", + PathPattern: "/v1/integrations/connections/{slug}/{connection_id}/refresh", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDAuthedProviderIDReader{formats: a.formats}, + Reader: &RefreshConnectionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1116,35 +1116,35 @@ func (a *Client) PatchV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDAu if err != nil { return nil, err } - success, ok := result.(*PatchV1IntegrationsAuthedProvidersIntegrationSlugConnectionIDAuthedProviderIDOK) + success, ok := result.(*RefreshConnectionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IntegrationsAuthedProvidersIntegrationSlugConnectionIdAuthedProviderId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for refresh_connection: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IntegrationsAwsCloudtrailBatchesID updates a cloud trail batch +SearchConfluenceSpaces lists confluence spaces -Update a CloudTrail batch with new information. +Lists available space keys for the Confluence integration connection. */ -func (a *Client) PatchV1IntegrationsAwsCloudtrailBatchesID(params *PatchV1IntegrationsAwsCloudtrailBatchesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsAwsCloudtrailBatchesIDOK, error) { +func (a *Client) SearchConfluenceSpaces(params *SearchConfluenceSpacesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SearchConfluenceSpacesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IntegrationsAwsCloudtrailBatchesIDParams() + params = NewSearchConfluenceSpacesParams() } op := &runtime.ClientOperation{ - ID: "patchV1IntegrationsAwsCloudtrailBatchesId", - Method: "PATCH", - PathPattern: "/v1/integrations/aws/cloudtrail_batches/{id}", + ID: "search_confluence_spaces", + Method: "GET", + PathPattern: "/v1/integrations/confluence_cloud/connections/{id}/space/search", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IntegrationsAwsCloudtrailBatchesIDReader{formats: a.formats}, + Reader: &SearchConfluenceSpacesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1157,35 +1157,35 @@ func (a *Client) PatchV1IntegrationsAwsCloudtrailBatchesID(params *PatchV1Integr if err != nil { return nil, err } - success, ok := result.(*PatchV1IntegrationsAwsCloudtrailBatchesIDOK) + success, ok := result.(*SearchConfluenceSpacesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IntegrationsAwsCloudtrailBatchesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for search_confluence_spaces: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IntegrationsAwsConnectionsID updates an a w s connection +SearchZendeskTickets searches for zendesk tickets -Update the AWS connection with the provided data. +Search for Zendesk tickets */ -func (a *Client) PatchV1IntegrationsAwsConnectionsID(params *PatchV1IntegrationsAwsConnectionsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsAwsConnectionsIDOK, error) { +func (a *Client) SearchZendeskTickets(params *SearchZendeskTicketsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SearchZendeskTicketsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IntegrationsAwsConnectionsIDParams() + params = NewSearchZendeskTicketsParams() } op := &runtime.ClientOperation{ - ID: "patchV1IntegrationsAwsConnectionsId", - Method: "PATCH", - PathPattern: "/v1/integrations/aws/connections/{id}", + ID: "search_zendesk_tickets", + Method: "GET", + PathPattern: "/v1/integrations/zendesk/{connection_id}/tickets/search", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IntegrationsAwsConnectionsIDReader{formats: a.formats}, + Reader: &SearchZendeskTicketsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1198,35 +1198,35 @@ func (a *Client) PatchV1IntegrationsAwsConnectionsID(params *PatchV1Integrations if err != nil { return nil, err } - success, ok := result.(*PatchV1IntegrationsAwsConnectionsIDOK) + success, ok := result.(*SearchZendeskTicketsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IntegrationsAwsConnectionsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for search_zendesk_tickets: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IntegrationsConnectionsSlugConnectionID updates an integration connection +UpdateAuthedProvider gets an authed provider -Update the integration connection with the provided data +Retrieve a single authed provider */ -func (a *Client) PatchV1IntegrationsConnectionsSlugConnectionID(params *PatchV1IntegrationsConnectionsSlugConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsConnectionsSlugConnectionIDOK, error) { +func (a *Client) UpdateAuthedProvider(params *UpdateAuthedProviderParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAuthedProviderOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IntegrationsConnectionsSlugConnectionIDParams() + params = NewUpdateAuthedProviderParams() } op := &runtime.ClientOperation{ - ID: "patchV1IntegrationsConnectionsSlugConnectionId", + ID: "update_authed_provider", Method: "PATCH", - PathPattern: "/v1/integrations/connections/{slug}/{connection_id}", + PathPattern: "/v1/integrations/authed_providers/{integration_slug}/{connection_id}/{authed_provider_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IntegrationsConnectionsSlugConnectionIDReader{formats: a.formats}, + Reader: &UpdateAuthedProviderReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1239,35 +1239,35 @@ func (a *Client) PatchV1IntegrationsConnectionsSlugConnectionID(params *PatchV1I if err != nil { return nil, err } - success, ok := result.(*PatchV1IntegrationsConnectionsSlugConnectionIDOK) + success, ok := result.(*UpdateAuthedProviderOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IntegrationsConnectionsSlugConnectionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_authed_provider: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IntegrationsConnectionsSlugConnectionIDRefresh refreshes an integration connection +UpdateAwsCloudtrailBatch updates a cloud trail batch -Refresh the integration connection with the provided data +Update a CloudTrail batch with new information. */ -func (a *Client) PatchV1IntegrationsConnectionsSlugConnectionIDRefresh(params *PatchV1IntegrationsConnectionsSlugConnectionIDRefreshParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsConnectionsSlugConnectionIDRefreshOK, error) { +func (a *Client) UpdateAwsCloudtrailBatch(params *UpdateAwsCloudtrailBatchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAwsCloudtrailBatchOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IntegrationsConnectionsSlugConnectionIDRefreshParams() + params = NewUpdateAwsCloudtrailBatchParams() } op := &runtime.ClientOperation{ - ID: "patchV1IntegrationsConnectionsSlugConnectionIdRefresh", + ID: "update_aws_cloudtrail_batch", Method: "PATCH", - PathPattern: "/v1/integrations/connections/{slug}/{connection_id}/refresh", + PathPattern: "/v1/integrations/aws/cloudtrail_batches/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IntegrationsConnectionsSlugConnectionIDRefreshReader{formats: a.formats}, + Reader: &UpdateAwsCloudtrailBatchReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1280,35 +1280,35 @@ func (a *Client) PatchV1IntegrationsConnectionsSlugConnectionIDRefresh(params *P if err != nil { return nil, err } - success, ok := result.(*PatchV1IntegrationsConnectionsSlugConnectionIDRefreshOK) + success, ok := result.(*UpdateAwsCloudtrailBatchOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IntegrationsConnectionsSlugConnectionIdRefresh: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_aws_cloudtrail_batch: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IntegrationsFieldMapsFieldMapID updates field mapping +UpdateAwsConnection updates an a w s connection -Update field mapping +Update the AWS connection with the provided data. */ -func (a *Client) PatchV1IntegrationsFieldMapsFieldMapID(params *PatchV1IntegrationsFieldMapsFieldMapIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsFieldMapsFieldMapIDOK, error) { +func (a *Client) UpdateAwsConnection(params *UpdateAwsConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAwsConnectionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IntegrationsFieldMapsFieldMapIDParams() + params = NewUpdateAwsConnectionParams() } op := &runtime.ClientOperation{ - ID: "patchV1IntegrationsFieldMapsFieldMapId", + ID: "update_aws_connection", Method: "PATCH", - PathPattern: "/v1/integrations/field_maps/{field_map_id}", + PathPattern: "/v1/integrations/aws/connections/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IntegrationsFieldMapsFieldMapIDReader{formats: a.formats}, + Reader: &UpdateAwsConnectionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1321,35 +1321,35 @@ func (a *Client) PatchV1IntegrationsFieldMapsFieldMapID(params *PatchV1Integrati if err != nil { return nil, err } - success, ok := result.(*PatchV1IntegrationsFieldMapsFieldMapIDOK) + success, ok := result.(*UpdateAwsConnectionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IntegrationsFieldMapsFieldMapId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_aws_connection: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionID updates a slack emoji action +UpdateConnection updates an integration connection -Updates a Slack emoji action +Update the integration connection with the provided data */ -func (a *Client) PatchV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionID(params *PatchV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDOK, error) { +func (a *Client) UpdateConnection(params *UpdateConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConnectionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDParams() + params = NewUpdateConnectionParams() } op := &runtime.ClientOperation{ - ID: "patchV1IntegrationsSlackConnectionsConnectionIdEmojiActionsEmojiActionId", + ID: "update_connection", Method: "PATCH", - PathPattern: "/v1/integrations/slack/connections/{connection_id}/emoji_actions/{emoji_action_id}", + PathPattern: "/v1/integrations/connections/{slug}/{connection_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDReader{formats: a.formats}, + Reader: &UpdateConnectionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1362,35 +1362,35 @@ func (a *Client) PatchV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmoj if err != nil { return nil, err } - success, ok := result.(*PatchV1IntegrationsSlackConnectionsConnectionIDEmojiActionsEmojiActionIDOK) + success, ok := result.(*UpdateConnectionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IntegrationsSlackConnectionsConnectionIdEmojiActionsEmojiActionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_connection: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IntegrationsStatuspageConnectionsConnectionID updates a statuspage connection +UpdateFieldMap updates field mapping -Update the given Statuspage integration connection. +Update field mapping */ -func (a *Client) PatchV1IntegrationsStatuspageConnectionsConnectionID(params *PatchV1IntegrationsStatuspageConnectionsConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IntegrationsStatuspageConnectionsConnectionIDOK, error) { +func (a *Client) UpdateFieldMap(params *UpdateFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateFieldMapOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IntegrationsStatuspageConnectionsConnectionIDParams() + params = NewUpdateFieldMapParams() } op := &runtime.ClientOperation{ - ID: "patchV1IntegrationsStatuspageConnectionsConnectionId", + ID: "update_field_map", Method: "PATCH", - PathPattern: "/v1/integrations/statuspage/connections/{connection_id}", + PathPattern: "/v1/integrations/field_maps/{field_map_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IntegrationsStatuspageConnectionsConnectionIDReader{formats: a.formats}, + Reader: &UpdateFieldMapReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1403,35 +1403,35 @@ func (a *Client) PatchV1IntegrationsStatuspageConnectionsConnectionID(params *Pa if err != nil { return nil, err } - success, ok := result.(*PatchV1IntegrationsStatuspageConnectionsConnectionIDOK) + success, ok := result.(*UpdateFieldMapOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IntegrationsStatuspageConnectionsConnectionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_field_map: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IntegrationsConnectionsSlug creates a new integration connection +UpdateSlackEmojiAction updates a slack emoji action -Create a new integration connection +Updates a Slack emoji action */ -func (a *Client) PostV1IntegrationsConnectionsSlug(params *PostV1IntegrationsConnectionsSlugParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IntegrationsConnectionsSlugCreated, error) { +func (a *Client) UpdateSlackEmojiAction(params *UpdateSlackEmojiActionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSlackEmojiActionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IntegrationsConnectionsSlugParams() + params = NewUpdateSlackEmojiActionParams() } op := &runtime.ClientOperation{ - ID: "postV1IntegrationsConnectionsSlug", - Method: "POST", - PathPattern: "/v1/integrations/connections/{slug}", + ID: "update_slack_emoji_action", + Method: "PATCH", + PathPattern: "/v1/integrations/slack/connections/{connection_id}/emoji_actions/{emoji_action_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IntegrationsConnectionsSlugReader{formats: a.formats}, + Reader: &UpdateSlackEmojiActionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1444,35 +1444,35 @@ func (a *Client) PostV1IntegrationsConnectionsSlug(params *PostV1IntegrationsCon if err != nil { return nil, err } - success, ok := result.(*PostV1IntegrationsConnectionsSlugCreated) + success, ok := result.(*UpdateSlackEmojiActionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IntegrationsConnectionsSlug: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_slack_emoji_action: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IntegrationsSlackConnectionsConnectionIDEmojiActions creates a new slack emoji action +UpdateStatuspageConnection updates a statuspage connection -Creates a new Slack emoji action +Update the given Statuspage integration connection. */ -func (a *Client) PostV1IntegrationsSlackConnectionsConnectionIDEmojiActions(params *PostV1IntegrationsSlackConnectionsConnectionIDEmojiActionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IntegrationsSlackConnectionsConnectionIDEmojiActionsCreated, error) { +func (a *Client) UpdateStatuspageConnection(params *UpdateStatuspageConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateStatuspageConnectionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IntegrationsSlackConnectionsConnectionIDEmojiActionsParams() + params = NewUpdateStatuspageConnectionParams() } op := &runtime.ClientOperation{ - ID: "postV1IntegrationsSlackConnectionsConnectionIdEmojiActions", - Method: "POST", - PathPattern: "/v1/integrations/slack/connections/{connection_id}/emoji_actions", + ID: "update_statuspage_connection", + Method: "PATCH", + PathPattern: "/v1/integrations/statuspage/connections/{connection_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IntegrationsSlackConnectionsConnectionIDEmojiActionsReader{formats: a.formats}, + Reader: &UpdateStatuspageConnectionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1485,13 +1485,13 @@ func (a *Client) PostV1IntegrationsSlackConnectionsConnectionIDEmojiActions(para if err != nil { return nil, err } - success, ok := result.(*PostV1IntegrationsSlackConnectionsConnectionIDEmojiActionsCreated) + success, ok := result.(*UpdateStatuspageConnectionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IntegrationsSlackConnectionsConnectionIdEmojiActions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_statuspage_connection: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/integrations/list_authed_providers_parameters.go b/client/integrations/list_authed_providers_parameters.go new file mode 100644 index 0000000..1155201 --- /dev/null +++ b/client/integrations/list_authed_providers_parameters.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListAuthedProvidersParams creates a new ListAuthedProvidersParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListAuthedProvidersParams() *ListAuthedProvidersParams { + return &ListAuthedProvidersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListAuthedProvidersParamsWithTimeout creates a new ListAuthedProvidersParams object +// with the ability to set a timeout on a request. +func NewListAuthedProvidersParamsWithTimeout(timeout time.Duration) *ListAuthedProvidersParams { + return &ListAuthedProvidersParams{ + timeout: timeout, + } +} + +// NewListAuthedProvidersParamsWithContext creates a new ListAuthedProvidersParams object +// with the ability to set a context for a request. +func NewListAuthedProvidersParamsWithContext(ctx context.Context) *ListAuthedProvidersParams { + return &ListAuthedProvidersParams{ + Context: ctx, + } +} + +// NewListAuthedProvidersParamsWithHTTPClient creates a new ListAuthedProvidersParams object +// with the ability to set a custom HTTPClient for a request. +func NewListAuthedProvidersParamsWithHTTPClient(client *http.Client) *ListAuthedProvidersParams { + return &ListAuthedProvidersParams{ + HTTPClient: client, + } +} + +/* +ListAuthedProvidersParams contains all the parameters to send to the API endpoint + + for the list authed providers operation. + + Typically these are written to a http.Request. +*/ +type ListAuthedProvidersParams struct { + + /* ConnectionID. + + Connection ID + */ + ConnectionID string + + /* IntegrationSlug. + + Integration slug + */ + IntegrationSlug string + + /* Query. + + Query for users by name + */ + Query *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list authed providers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAuthedProvidersParams) WithDefaults() *ListAuthedProvidersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list authed providers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAuthedProvidersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list authed providers params +func (o *ListAuthedProvidersParams) WithTimeout(timeout time.Duration) *ListAuthedProvidersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list authed providers params +func (o *ListAuthedProvidersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list authed providers params +func (o *ListAuthedProvidersParams) WithContext(ctx context.Context) *ListAuthedProvidersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list authed providers params +func (o *ListAuthedProvidersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list authed providers params +func (o *ListAuthedProvidersParams) WithHTTPClient(client *http.Client) *ListAuthedProvidersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list authed providers params +func (o *ListAuthedProvidersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the list authed providers params +func (o *ListAuthedProvidersParams) WithConnectionID(connectionID string) *ListAuthedProvidersParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the list authed providers params +func (o *ListAuthedProvidersParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WithIntegrationSlug adds the integrationSlug to the list authed providers params +func (o *ListAuthedProvidersParams) WithIntegrationSlug(integrationSlug string) *ListAuthedProvidersParams { + o.SetIntegrationSlug(integrationSlug) + return o +} + +// SetIntegrationSlug adds the integrationSlug to the list authed providers params +func (o *ListAuthedProvidersParams) SetIntegrationSlug(integrationSlug string) { + o.IntegrationSlug = integrationSlug +} + +// WithQuery adds the query to the list authed providers params +func (o *ListAuthedProvidersParams) WithQuery(query *string) *ListAuthedProvidersParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list authed providers params +func (o *ListAuthedProvidersParams) SetQuery(query *string) { + o.Query = query +} + +// WriteToRequest writes these params to a swagger request +func (o *ListAuthedProvidersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + + // path param integration_slug + if err := r.SetPathParam("integration_slug", o.IntegrationSlug); err != nil { + return err + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/list_authed_providers_responses.go b/client/integrations/list_authed_providers_responses.go new file mode 100644 index 0000000..2a096da --- /dev/null +++ b/client/integrations/list_authed_providers_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListAuthedProvidersReader is a Reader for the ListAuthedProviders structure. +type ListAuthedProvidersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListAuthedProvidersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListAuthedProvidersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListAuthedProvidersOK creates a ListAuthedProvidersOK with default headers values +func NewListAuthedProvidersOK() *ListAuthedProvidersOK { + return &ListAuthedProvidersOK{} +} + +/* +ListAuthedProvidersOK describes a response with status code 200, with default header values. + +Lists the available and configured integrations +*/ +type ListAuthedProvidersOK struct { + Payload *models.IntegrationsAuthedProviderEntityPaginated +} + +// IsSuccess returns true when this list authed providers o k response has a 2xx status code +func (o *ListAuthedProvidersOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list authed providers o k response has a 3xx status code +func (o *ListAuthedProvidersOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list authed providers o k response has a 4xx status code +func (o *ListAuthedProvidersOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list authed providers o k response has a 5xx status code +func (o *ListAuthedProvidersOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list authed providers o k response a status code equal to that given +func (o *ListAuthedProvidersOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListAuthedProvidersOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/authed_providers/{integration_slug}/{connection_id}][%d] listAuthedProvidersOK %+v", 200, o.Payload) +} + +func (o *ListAuthedProvidersOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/authed_providers/{integration_slug}/{connection_id}][%d] listAuthedProvidersOK %+v", 200, o.Payload) +} + +func (o *ListAuthedProvidersOK) GetPayload() *models.IntegrationsAuthedProviderEntityPaginated { + return o.Payload +} + +func (o *ListAuthedProvidersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsAuthedProviderEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/list_aws_cloudtrail_batch_events_parameters.go b/client/integrations/list_aws_cloudtrail_batch_events_parameters.go new file mode 100644 index 0000000..386cb08 --- /dev/null +++ b/client/integrations/list_aws_cloudtrail_batch_events_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListAwsCloudtrailBatchEventsParams creates a new ListAwsCloudtrailBatchEventsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListAwsCloudtrailBatchEventsParams() *ListAwsCloudtrailBatchEventsParams { + return &ListAwsCloudtrailBatchEventsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListAwsCloudtrailBatchEventsParamsWithTimeout creates a new ListAwsCloudtrailBatchEventsParams object +// with the ability to set a timeout on a request. +func NewListAwsCloudtrailBatchEventsParamsWithTimeout(timeout time.Duration) *ListAwsCloudtrailBatchEventsParams { + return &ListAwsCloudtrailBatchEventsParams{ + timeout: timeout, + } +} + +// NewListAwsCloudtrailBatchEventsParamsWithContext creates a new ListAwsCloudtrailBatchEventsParams object +// with the ability to set a context for a request. +func NewListAwsCloudtrailBatchEventsParamsWithContext(ctx context.Context) *ListAwsCloudtrailBatchEventsParams { + return &ListAwsCloudtrailBatchEventsParams{ + Context: ctx, + } +} + +// NewListAwsCloudtrailBatchEventsParamsWithHTTPClient creates a new ListAwsCloudtrailBatchEventsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListAwsCloudtrailBatchEventsParamsWithHTTPClient(client *http.Client) *ListAwsCloudtrailBatchEventsParams { + return &ListAwsCloudtrailBatchEventsParams{ + HTTPClient: client, + } +} + +/* +ListAwsCloudtrailBatchEventsParams contains all the parameters to send to the API endpoint + + for the list aws cloudtrail batch events operation. + + Typically these are written to a http.Request. +*/ +type ListAwsCloudtrailBatchEventsParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list aws cloudtrail batch events params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAwsCloudtrailBatchEventsParams) WithDefaults() *ListAwsCloudtrailBatchEventsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list aws cloudtrail batch events params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAwsCloudtrailBatchEventsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list aws cloudtrail batch events params +func (o *ListAwsCloudtrailBatchEventsParams) WithTimeout(timeout time.Duration) *ListAwsCloudtrailBatchEventsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list aws cloudtrail batch events params +func (o *ListAwsCloudtrailBatchEventsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list aws cloudtrail batch events params +func (o *ListAwsCloudtrailBatchEventsParams) WithContext(ctx context.Context) *ListAwsCloudtrailBatchEventsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list aws cloudtrail batch events params +func (o *ListAwsCloudtrailBatchEventsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list aws cloudtrail batch events params +func (o *ListAwsCloudtrailBatchEventsParams) WithHTTPClient(client *http.Client) *ListAwsCloudtrailBatchEventsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list aws cloudtrail batch events params +func (o *ListAwsCloudtrailBatchEventsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the list aws cloudtrail batch events params +func (o *ListAwsCloudtrailBatchEventsParams) WithID(id string) *ListAwsCloudtrailBatchEventsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the list aws cloudtrail batch events params +func (o *ListAwsCloudtrailBatchEventsParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ListAwsCloudtrailBatchEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/list_aws_cloudtrail_batch_events_responses.go b/client/integrations/list_aws_cloudtrail_batch_events_responses.go new file mode 100644 index 0000000..caab071 --- /dev/null +++ b/client/integrations/list_aws_cloudtrail_batch_events_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListAwsCloudtrailBatchEventsReader is a Reader for the ListAwsCloudtrailBatchEvents structure. +type ListAwsCloudtrailBatchEventsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListAwsCloudtrailBatchEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListAwsCloudtrailBatchEventsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListAwsCloudtrailBatchEventsOK creates a ListAwsCloudtrailBatchEventsOK with default headers values +func NewListAwsCloudtrailBatchEventsOK() *ListAwsCloudtrailBatchEventsOK { + return &ListAwsCloudtrailBatchEventsOK{} +} + +/* +ListAwsCloudtrailBatchEventsOK describes a response with status code 200, with default header values. + +List events for an AWS CloudTrail batch +*/ +type ListAwsCloudtrailBatchEventsOK struct { + Payload *models.ChangeEventEntity +} + +// IsSuccess returns true when this list aws cloudtrail batch events o k response has a 2xx status code +func (o *ListAwsCloudtrailBatchEventsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list aws cloudtrail batch events o k response has a 3xx status code +func (o *ListAwsCloudtrailBatchEventsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list aws cloudtrail batch events o k response has a 4xx status code +func (o *ListAwsCloudtrailBatchEventsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list aws cloudtrail batch events o k response has a 5xx status code +func (o *ListAwsCloudtrailBatchEventsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list aws cloudtrail batch events o k response a status code equal to that given +func (o *ListAwsCloudtrailBatchEventsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListAwsCloudtrailBatchEventsOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/aws/cloudtrail_batches/{id}/events][%d] listAwsCloudtrailBatchEventsOK %+v", 200, o.Payload) +} + +func (o *ListAwsCloudtrailBatchEventsOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/aws/cloudtrail_batches/{id}/events][%d] listAwsCloudtrailBatchEventsOK %+v", 200, o.Payload) +} + +func (o *ListAwsCloudtrailBatchEventsOK) GetPayload() *models.ChangeEventEntity { + return o.Payload +} + +func (o *ListAwsCloudtrailBatchEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChangeEventEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/list_aws_cloudtrail_batches_parameters.go b/client/integrations/list_aws_cloudtrail_batches_parameters.go new file mode 100644 index 0000000..cd0fefd --- /dev/null +++ b/client/integrations/list_aws_cloudtrail_batches_parameters.go @@ -0,0 +1,230 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListAwsCloudtrailBatchesParams creates a new ListAwsCloudtrailBatchesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListAwsCloudtrailBatchesParams() *ListAwsCloudtrailBatchesParams { + return &ListAwsCloudtrailBatchesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListAwsCloudtrailBatchesParamsWithTimeout creates a new ListAwsCloudtrailBatchesParams object +// with the ability to set a timeout on a request. +func NewListAwsCloudtrailBatchesParamsWithTimeout(timeout time.Duration) *ListAwsCloudtrailBatchesParams { + return &ListAwsCloudtrailBatchesParams{ + timeout: timeout, + } +} + +// NewListAwsCloudtrailBatchesParamsWithContext creates a new ListAwsCloudtrailBatchesParams object +// with the ability to set a context for a request. +func NewListAwsCloudtrailBatchesParamsWithContext(ctx context.Context) *ListAwsCloudtrailBatchesParams { + return &ListAwsCloudtrailBatchesParams{ + Context: ctx, + } +} + +// NewListAwsCloudtrailBatchesParamsWithHTTPClient creates a new ListAwsCloudtrailBatchesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListAwsCloudtrailBatchesParamsWithHTTPClient(client *http.Client) *ListAwsCloudtrailBatchesParams { + return &ListAwsCloudtrailBatchesParams{ + HTTPClient: client, + } +} + +/* +ListAwsCloudtrailBatchesParams contains all the parameters to send to the API endpoint + + for the list aws cloudtrail batches operation. + + Typically these are written to a http.Request. +*/ +type ListAwsCloudtrailBatchesParams struct { + + /* ConnectionID. + + AWS connection ID + */ + ConnectionID *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list aws cloudtrail batches params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAwsCloudtrailBatchesParams) WithDefaults() *ListAwsCloudtrailBatchesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list aws cloudtrail batches params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAwsCloudtrailBatchesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list aws cloudtrail batches params +func (o *ListAwsCloudtrailBatchesParams) WithTimeout(timeout time.Duration) *ListAwsCloudtrailBatchesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list aws cloudtrail batches params +func (o *ListAwsCloudtrailBatchesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list aws cloudtrail batches params +func (o *ListAwsCloudtrailBatchesParams) WithContext(ctx context.Context) *ListAwsCloudtrailBatchesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list aws cloudtrail batches params +func (o *ListAwsCloudtrailBatchesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list aws cloudtrail batches params +func (o *ListAwsCloudtrailBatchesParams) WithHTTPClient(client *http.Client) *ListAwsCloudtrailBatchesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list aws cloudtrail batches params +func (o *ListAwsCloudtrailBatchesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the list aws cloudtrail batches params +func (o *ListAwsCloudtrailBatchesParams) WithConnectionID(connectionID *string) *ListAwsCloudtrailBatchesParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the list aws cloudtrail batches params +func (o *ListAwsCloudtrailBatchesParams) SetConnectionID(connectionID *string) { + o.ConnectionID = connectionID +} + +// WithPage adds the page to the list aws cloudtrail batches params +func (o *ListAwsCloudtrailBatchesParams) WithPage(page *int32) *ListAwsCloudtrailBatchesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list aws cloudtrail batches params +func (o *ListAwsCloudtrailBatchesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list aws cloudtrail batches params +func (o *ListAwsCloudtrailBatchesParams) WithPerPage(perPage *int32) *ListAwsCloudtrailBatchesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list aws cloudtrail batches params +func (o *ListAwsCloudtrailBatchesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListAwsCloudtrailBatchesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ConnectionID != nil { + + // query param connection_id + var qrConnectionID string + + if o.ConnectionID != nil { + qrConnectionID = *o.ConnectionID + } + qConnectionID := qrConnectionID + if qConnectionID != "" { + + if err := r.SetQueryParam("connection_id", qConnectionID); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/list_aws_cloudtrail_batches_responses.go b/client/integrations/list_aws_cloudtrail_batches_responses.go new file mode 100644 index 0000000..e640f6e --- /dev/null +++ b/client/integrations/list_aws_cloudtrail_batches_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListAwsCloudtrailBatchesReader is a Reader for the ListAwsCloudtrailBatches structure. +type ListAwsCloudtrailBatchesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListAwsCloudtrailBatchesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListAwsCloudtrailBatchesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListAwsCloudtrailBatchesOK creates a ListAwsCloudtrailBatchesOK with default headers values +func NewListAwsCloudtrailBatchesOK() *ListAwsCloudtrailBatchesOK { + return &ListAwsCloudtrailBatchesOK{} +} + +/* +ListAwsCloudtrailBatchesOK describes a response with status code 200, with default header values. + +Lists CloudTrail batches for the authenticated organization. +*/ +type ListAwsCloudtrailBatchesOK struct { + Payload *models.IntegrationsAwsCloudtrailBatchEntityPaginated +} + +// IsSuccess returns true when this list aws cloudtrail batches o k response has a 2xx status code +func (o *ListAwsCloudtrailBatchesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list aws cloudtrail batches o k response has a 3xx status code +func (o *ListAwsCloudtrailBatchesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list aws cloudtrail batches o k response has a 4xx status code +func (o *ListAwsCloudtrailBatchesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list aws cloudtrail batches o k response has a 5xx status code +func (o *ListAwsCloudtrailBatchesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list aws cloudtrail batches o k response a status code equal to that given +func (o *ListAwsCloudtrailBatchesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListAwsCloudtrailBatchesOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/aws/cloudtrail_batches][%d] listAwsCloudtrailBatchesOK %+v", 200, o.Payload) +} + +func (o *ListAwsCloudtrailBatchesOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/aws/cloudtrail_batches][%d] listAwsCloudtrailBatchesOK %+v", 200, o.Payload) +} + +func (o *ListAwsCloudtrailBatchesOK) GetPayload() *models.IntegrationsAwsCloudtrailBatchEntityPaginated { + return o.Payload +} + +func (o *ListAwsCloudtrailBatchesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsAwsCloudtrailBatchEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/list_aws_connections_parameters.go b/client/integrations/list_aws_connections_parameters.go new file mode 100644 index 0000000..32bcd9a --- /dev/null +++ b/client/integrations/list_aws_connections_parameters.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListAwsConnectionsParams creates a new ListAwsConnectionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListAwsConnectionsParams() *ListAwsConnectionsParams { + return &ListAwsConnectionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListAwsConnectionsParamsWithTimeout creates a new ListAwsConnectionsParams object +// with the ability to set a timeout on a request. +func NewListAwsConnectionsParamsWithTimeout(timeout time.Duration) *ListAwsConnectionsParams { + return &ListAwsConnectionsParams{ + timeout: timeout, + } +} + +// NewListAwsConnectionsParamsWithContext creates a new ListAwsConnectionsParams object +// with the ability to set a context for a request. +func NewListAwsConnectionsParamsWithContext(ctx context.Context) *ListAwsConnectionsParams { + return &ListAwsConnectionsParams{ + Context: ctx, + } +} + +// NewListAwsConnectionsParamsWithHTTPClient creates a new ListAwsConnectionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListAwsConnectionsParamsWithHTTPClient(client *http.Client) *ListAwsConnectionsParams { + return &ListAwsConnectionsParams{ + HTTPClient: client, + } +} + +/* +ListAwsConnectionsParams contains all the parameters to send to the API endpoint + + for the list aws connections operation. + + Typically these are written to a http.Request. +*/ +type ListAwsConnectionsParams struct { + + /* AwsAccountID. + + AWS account ID containing the role to be assumed + */ + AwsAccountID *string + + /* ExternalID. + + The external ID supplied when assuming the role + */ + ExternalID *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* TargetArn. + + ARN of the role to be assumed + */ + TargetArn *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list aws connections params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAwsConnectionsParams) WithDefaults() *ListAwsConnectionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list aws connections params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAwsConnectionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list aws connections params +func (o *ListAwsConnectionsParams) WithTimeout(timeout time.Duration) *ListAwsConnectionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list aws connections params +func (o *ListAwsConnectionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list aws connections params +func (o *ListAwsConnectionsParams) WithContext(ctx context.Context) *ListAwsConnectionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list aws connections params +func (o *ListAwsConnectionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list aws connections params +func (o *ListAwsConnectionsParams) WithHTTPClient(client *http.Client) *ListAwsConnectionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list aws connections params +func (o *ListAwsConnectionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAwsAccountID adds the awsAccountID to the list aws connections params +func (o *ListAwsConnectionsParams) WithAwsAccountID(awsAccountID *string) *ListAwsConnectionsParams { + o.SetAwsAccountID(awsAccountID) + return o +} + +// SetAwsAccountID adds the awsAccountId to the list aws connections params +func (o *ListAwsConnectionsParams) SetAwsAccountID(awsAccountID *string) { + o.AwsAccountID = awsAccountID +} + +// WithExternalID adds the externalID to the list aws connections params +func (o *ListAwsConnectionsParams) WithExternalID(externalID *string) *ListAwsConnectionsParams { + o.SetExternalID(externalID) + return o +} + +// SetExternalID adds the externalId to the list aws connections params +func (o *ListAwsConnectionsParams) SetExternalID(externalID *string) { + o.ExternalID = externalID +} + +// WithPage adds the page to the list aws connections params +func (o *ListAwsConnectionsParams) WithPage(page *int32) *ListAwsConnectionsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list aws connections params +func (o *ListAwsConnectionsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list aws connections params +func (o *ListAwsConnectionsParams) WithPerPage(perPage *int32) *ListAwsConnectionsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list aws connections params +func (o *ListAwsConnectionsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithTargetArn adds the targetArn to the list aws connections params +func (o *ListAwsConnectionsParams) WithTargetArn(targetArn *string) *ListAwsConnectionsParams { + o.SetTargetArn(targetArn) + return o +} + +// SetTargetArn adds the targetArn to the list aws connections params +func (o *ListAwsConnectionsParams) SetTargetArn(targetArn *string) { + o.TargetArn = targetArn +} + +// WriteToRequest writes these params to a swagger request +func (o *ListAwsConnectionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AwsAccountID != nil { + + // query param aws_account_id + var qrAwsAccountID string + + if o.AwsAccountID != nil { + qrAwsAccountID = *o.AwsAccountID + } + qAwsAccountID := qrAwsAccountID + if qAwsAccountID != "" { + + if err := r.SetQueryParam("aws_account_id", qAwsAccountID); err != nil { + return err + } + } + } + + if o.ExternalID != nil { + + // query param external_id + var qrExternalID string + + if o.ExternalID != nil { + qrExternalID = *o.ExternalID + } + qExternalID := qrExternalID + if qExternalID != "" { + + if err := r.SetQueryParam("external_id", qExternalID); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.TargetArn != nil { + + // query param target_arn + var qrTargetArn string + + if o.TargetArn != nil { + qrTargetArn = *o.TargetArn + } + qTargetArn := qrTargetArn + if qTargetArn != "" { + + if err := r.SetQueryParam("target_arn", qTargetArn); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/list_aws_connections_responses.go b/client/integrations/list_aws_connections_responses.go new file mode 100644 index 0000000..0fd00ca --- /dev/null +++ b/client/integrations/list_aws_connections_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListAwsConnectionsReader is a Reader for the ListAwsConnections structure. +type ListAwsConnectionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListAwsConnectionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListAwsConnectionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListAwsConnectionsOK creates a ListAwsConnectionsOK with default headers values +func NewListAwsConnectionsOK() *ListAwsConnectionsOK { + return &ListAwsConnectionsOK{} +} + +/* +ListAwsConnectionsOK describes a response with status code 200, with default header values. + +Lists the available and configured AWS integration connections for the authenticated organization. +*/ +type ListAwsConnectionsOK struct { + Payload *models.IntegrationsAwsConnectionEntityPaginated +} + +// IsSuccess returns true when this list aws connections o k response has a 2xx status code +func (o *ListAwsConnectionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list aws connections o k response has a 3xx status code +func (o *ListAwsConnectionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list aws connections o k response has a 4xx status code +func (o *ListAwsConnectionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list aws connections o k response has a 5xx status code +func (o *ListAwsConnectionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list aws connections o k response a status code equal to that given +func (o *ListAwsConnectionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListAwsConnectionsOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/aws/connections][%d] listAwsConnectionsOK %+v", 200, o.Payload) +} + +func (o *ListAwsConnectionsOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/aws/connections][%d] listAwsConnectionsOK %+v", 200, o.Payload) +} + +func (o *ListAwsConnectionsOK) GetPayload() *models.IntegrationsAwsConnectionEntityPaginated { + return o.Payload +} + +func (o *ListAwsConnectionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsAwsConnectionEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/list_connection_statuses_by_slug_parameters.go b/client/integrations/list_connection_statuses_by_slug_parameters.go new file mode 100644 index 0000000..732d502 --- /dev/null +++ b/client/integrations/list_connection_statuses_by_slug_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListConnectionStatusesBySlugParams creates a new ListConnectionStatusesBySlugParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListConnectionStatusesBySlugParams() *ListConnectionStatusesBySlugParams { + return &ListConnectionStatusesBySlugParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListConnectionStatusesBySlugParamsWithTimeout creates a new ListConnectionStatusesBySlugParams object +// with the ability to set a timeout on a request. +func NewListConnectionStatusesBySlugParamsWithTimeout(timeout time.Duration) *ListConnectionStatusesBySlugParams { + return &ListConnectionStatusesBySlugParams{ + timeout: timeout, + } +} + +// NewListConnectionStatusesBySlugParamsWithContext creates a new ListConnectionStatusesBySlugParams object +// with the ability to set a context for a request. +func NewListConnectionStatusesBySlugParamsWithContext(ctx context.Context) *ListConnectionStatusesBySlugParams { + return &ListConnectionStatusesBySlugParams{ + Context: ctx, + } +} + +// NewListConnectionStatusesBySlugParamsWithHTTPClient creates a new ListConnectionStatusesBySlugParams object +// with the ability to set a custom HTTPClient for a request. +func NewListConnectionStatusesBySlugParamsWithHTTPClient(client *http.Client) *ListConnectionStatusesBySlugParams { + return &ListConnectionStatusesBySlugParams{ + HTTPClient: client, + } +} + +/* +ListConnectionStatusesBySlugParams contains all the parameters to send to the API endpoint + + for the list connection statuses by slug operation. + + Typically these are written to a http.Request. +*/ +type ListConnectionStatusesBySlugParams struct { + + // Slug. + Slug string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list connection statuses by slug params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListConnectionStatusesBySlugParams) WithDefaults() *ListConnectionStatusesBySlugParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list connection statuses by slug params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListConnectionStatusesBySlugParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list connection statuses by slug params +func (o *ListConnectionStatusesBySlugParams) WithTimeout(timeout time.Duration) *ListConnectionStatusesBySlugParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list connection statuses by slug params +func (o *ListConnectionStatusesBySlugParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list connection statuses by slug params +func (o *ListConnectionStatusesBySlugParams) WithContext(ctx context.Context) *ListConnectionStatusesBySlugParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list connection statuses by slug params +func (o *ListConnectionStatusesBySlugParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list connection statuses by slug params +func (o *ListConnectionStatusesBySlugParams) WithHTTPClient(client *http.Client) *ListConnectionStatusesBySlugParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list connection statuses by slug params +func (o *ListConnectionStatusesBySlugParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSlug adds the slug to the list connection statuses by slug params +func (o *ListConnectionStatusesBySlugParams) WithSlug(slug string) *ListConnectionStatusesBySlugParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the list connection statuses by slug params +func (o *ListConnectionStatusesBySlugParams) SetSlug(slug string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *ListConnectionStatusesBySlugParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param slug + if err := r.SetPathParam("slug", o.Slug); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/list_connection_statuses_by_slug_responses.go b/client/integrations/list_connection_statuses_by_slug_responses.go new file mode 100644 index 0000000..4ee27c1 --- /dev/null +++ b/client/integrations/list_connection_statuses_by_slug_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListConnectionStatusesBySlugReader is a Reader for the ListConnectionStatusesBySlug structure. +type ListConnectionStatusesBySlugReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListConnectionStatusesBySlugReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListConnectionStatusesBySlugOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListConnectionStatusesBySlugOK creates a ListConnectionStatusesBySlugOK with default headers values +func NewListConnectionStatusesBySlugOK() *ListConnectionStatusesBySlugOK { + return &ListConnectionStatusesBySlugOK{} +} + +/* +ListConnectionStatusesBySlugOK describes a response with status code 200, with default header values. + +Retrieve a single integration connection status +*/ +type ListConnectionStatusesBySlugOK struct { + Payload *models.IntegrationsConnectionStatusEntity +} + +// IsSuccess returns true when this list connection statuses by slug o k response has a 2xx status code +func (o *ListConnectionStatusesBySlugOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list connection statuses by slug o k response has a 3xx status code +func (o *ListConnectionStatusesBySlugOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list connection statuses by slug o k response has a 4xx status code +func (o *ListConnectionStatusesBySlugOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list connection statuses by slug o k response has a 5xx status code +func (o *ListConnectionStatusesBySlugOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list connection statuses by slug o k response a status code equal to that given +func (o *ListConnectionStatusesBySlugOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListConnectionStatusesBySlugOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/statuses/{slug}][%d] listConnectionStatusesBySlugOK %+v", 200, o.Payload) +} + +func (o *ListConnectionStatusesBySlugOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/statuses/{slug}][%d] listConnectionStatusesBySlugOK %+v", 200, o.Payload) +} + +func (o *ListConnectionStatusesBySlugOK) GetPayload() *models.IntegrationsConnectionStatusEntity { + return o.Payload +} + +func (o *ListConnectionStatusesBySlugOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsConnectionStatusEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/list_connection_statuses_parameters.go b/client/integrations/list_connection_statuses_parameters.go new file mode 100644 index 0000000..cb67ed2 --- /dev/null +++ b/client/integrations/list_connection_statuses_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListConnectionStatusesParams creates a new ListConnectionStatusesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListConnectionStatusesParams() *ListConnectionStatusesParams { + return &ListConnectionStatusesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListConnectionStatusesParamsWithTimeout creates a new ListConnectionStatusesParams object +// with the ability to set a timeout on a request. +func NewListConnectionStatusesParamsWithTimeout(timeout time.Duration) *ListConnectionStatusesParams { + return &ListConnectionStatusesParams{ + timeout: timeout, + } +} + +// NewListConnectionStatusesParamsWithContext creates a new ListConnectionStatusesParams object +// with the ability to set a context for a request. +func NewListConnectionStatusesParamsWithContext(ctx context.Context) *ListConnectionStatusesParams { + return &ListConnectionStatusesParams{ + Context: ctx, + } +} + +// NewListConnectionStatusesParamsWithHTTPClient creates a new ListConnectionStatusesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListConnectionStatusesParamsWithHTTPClient(client *http.Client) *ListConnectionStatusesParams { + return &ListConnectionStatusesParams{ + HTTPClient: client, + } +} + +/* +ListConnectionStatusesParams contains all the parameters to send to the API endpoint + + for the list connection statuses operation. + + Typically these are written to a http.Request. +*/ +type ListConnectionStatusesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list connection statuses params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListConnectionStatusesParams) WithDefaults() *ListConnectionStatusesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list connection statuses params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListConnectionStatusesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list connection statuses params +func (o *ListConnectionStatusesParams) WithTimeout(timeout time.Duration) *ListConnectionStatusesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list connection statuses params +func (o *ListConnectionStatusesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list connection statuses params +func (o *ListConnectionStatusesParams) WithContext(ctx context.Context) *ListConnectionStatusesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list connection statuses params +func (o *ListConnectionStatusesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list connection statuses params +func (o *ListConnectionStatusesParams) WithHTTPClient(client *http.Client) *ListConnectionStatusesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list connection statuses params +func (o *ListConnectionStatusesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListConnectionStatusesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/list_connection_statuses_responses.go b/client/integrations/list_connection_statuses_responses.go new file mode 100644 index 0000000..c33ce16 --- /dev/null +++ b/client/integrations/list_connection_statuses_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListConnectionStatusesReader is a Reader for the ListConnectionStatuses structure. +type ListConnectionStatusesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListConnectionStatusesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListConnectionStatusesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListConnectionStatusesOK creates a ListConnectionStatusesOK with default headers values +func NewListConnectionStatusesOK() *ListConnectionStatusesOK { + return &ListConnectionStatusesOK{} +} + +/* +ListConnectionStatusesOK describes a response with status code 200, with default header values. + +Retrieve overall integration connection status +*/ +type ListConnectionStatusesOK struct { + Payload *models.IntegrationsConnectionStatusEntity +} + +// IsSuccess returns true when this list connection statuses o k response has a 2xx status code +func (o *ListConnectionStatusesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list connection statuses o k response has a 3xx status code +func (o *ListConnectionStatusesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list connection statuses o k response has a 4xx status code +func (o *ListConnectionStatusesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list connection statuses o k response has a 5xx status code +func (o *ListConnectionStatusesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list connection statuses o k response a status code equal to that given +func (o *ListConnectionStatusesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListConnectionStatusesOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/statuses][%d] listConnectionStatusesOK %+v", 200, o.Payload) +} + +func (o *ListConnectionStatusesOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/statuses][%d] listConnectionStatusesOK %+v", 200, o.Payload) +} + +func (o *ListConnectionStatusesOK) GetPayload() *models.IntegrationsConnectionStatusEntity { + return o.Payload +} + +func (o *ListConnectionStatusesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsConnectionStatusEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/list_connections_parameters.go b/client/integrations/list_connections_parameters.go new file mode 100644 index 0000000..233d16f --- /dev/null +++ b/client/integrations/list_connections_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListConnectionsParams creates a new ListConnectionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListConnectionsParams() *ListConnectionsParams { + return &ListConnectionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListConnectionsParamsWithTimeout creates a new ListConnectionsParams object +// with the ability to set a timeout on a request. +func NewListConnectionsParamsWithTimeout(timeout time.Duration) *ListConnectionsParams { + return &ListConnectionsParams{ + timeout: timeout, + } +} + +// NewListConnectionsParamsWithContext creates a new ListConnectionsParams object +// with the ability to set a context for a request. +func NewListConnectionsParamsWithContext(ctx context.Context) *ListConnectionsParams { + return &ListConnectionsParams{ + Context: ctx, + } +} + +// NewListConnectionsParamsWithHTTPClient creates a new ListConnectionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListConnectionsParamsWithHTTPClient(client *http.Client) *ListConnectionsParams { + return &ListConnectionsParams{ + HTTPClient: client, + } +} + +/* +ListConnectionsParams contains all the parameters to send to the API endpoint + + for the list connections operation. + + Typically these are written to a http.Request. +*/ +type ListConnectionsParams struct { + + /* IntegrationSlug. + + Only return installed integrations with the supplied slugs (types). + */ + IntegrationSlug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list connections params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListConnectionsParams) WithDefaults() *ListConnectionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list connections params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListConnectionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list connections params +func (o *ListConnectionsParams) WithTimeout(timeout time.Duration) *ListConnectionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list connections params +func (o *ListConnectionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list connections params +func (o *ListConnectionsParams) WithContext(ctx context.Context) *ListConnectionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list connections params +func (o *ListConnectionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list connections params +func (o *ListConnectionsParams) WithHTTPClient(client *http.Client) *ListConnectionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list connections params +func (o *ListConnectionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIntegrationSlug adds the integrationSlug to the list connections params +func (o *ListConnectionsParams) WithIntegrationSlug(integrationSlug *string) *ListConnectionsParams { + o.SetIntegrationSlug(integrationSlug) + return o +} + +// SetIntegrationSlug adds the integrationSlug to the list connections params +func (o *ListConnectionsParams) SetIntegrationSlug(integrationSlug *string) { + o.IntegrationSlug = integrationSlug +} + +// WriteToRequest writes these params to a swagger request +func (o *ListConnectionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.IntegrationSlug != nil { + + // query param integration_slug + var qrIntegrationSlug string + + if o.IntegrationSlug != nil { + qrIntegrationSlug = *o.IntegrationSlug + } + qIntegrationSlug := qrIntegrationSlug + if qIntegrationSlug != "" { + + if err := r.SetQueryParam("integration_slug", qIntegrationSlug); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/list_connections_responses.go b/client/integrations/list_connections_responses.go new file mode 100644 index 0000000..c7327e0 --- /dev/null +++ b/client/integrations/list_connections_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListConnectionsReader is a Reader for the ListConnections structure. +type ListConnectionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListConnectionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListConnectionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListConnectionsOK creates a ListConnectionsOK with default headers values +func NewListConnectionsOK() *ListConnectionsOK { + return &ListConnectionsOK{} +} + +/* +ListConnectionsOK describes a response with status code 200, with default header values. + +List available integration connections +*/ +type ListConnectionsOK struct { + Payload *models.IntegrationsConnectionEntityPaginated +} + +// IsSuccess returns true when this list connections o k response has a 2xx status code +func (o *ListConnectionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list connections o k response has a 3xx status code +func (o *ListConnectionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list connections o k response has a 4xx status code +func (o *ListConnectionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list connections o k response has a 5xx status code +func (o *ListConnectionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list connections o k response a status code equal to that given +func (o *ListConnectionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListConnectionsOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/connections][%d] listConnectionsOK %+v", 200, o.Payload) +} + +func (o *ListConnectionsOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/connections][%d] listConnectionsOK %+v", 200, o.Payload) +} + +func (o *ListConnectionsOK) GetPayload() *models.IntegrationsConnectionEntityPaginated { + return o.Payload +} + +func (o *ListConnectionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsConnectionEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/list_field_map_available_fields_parameters.go b/client/integrations/list_field_map_available_fields_parameters.go new file mode 100644 index 0000000..c2b4847 --- /dev/null +++ b/client/integrations/list_field_map_available_fields_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListFieldMapAvailableFieldsParams creates a new ListFieldMapAvailableFieldsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListFieldMapAvailableFieldsParams() *ListFieldMapAvailableFieldsParams { + return &ListFieldMapAvailableFieldsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListFieldMapAvailableFieldsParamsWithTimeout creates a new ListFieldMapAvailableFieldsParams object +// with the ability to set a timeout on a request. +func NewListFieldMapAvailableFieldsParamsWithTimeout(timeout time.Duration) *ListFieldMapAvailableFieldsParams { + return &ListFieldMapAvailableFieldsParams{ + timeout: timeout, + } +} + +// NewListFieldMapAvailableFieldsParamsWithContext creates a new ListFieldMapAvailableFieldsParams object +// with the ability to set a context for a request. +func NewListFieldMapAvailableFieldsParamsWithContext(ctx context.Context) *ListFieldMapAvailableFieldsParams { + return &ListFieldMapAvailableFieldsParams{ + Context: ctx, + } +} + +// NewListFieldMapAvailableFieldsParamsWithHTTPClient creates a new ListFieldMapAvailableFieldsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListFieldMapAvailableFieldsParamsWithHTTPClient(client *http.Client) *ListFieldMapAvailableFieldsParams { + return &ListFieldMapAvailableFieldsParams{ + HTTPClient: client, + } +} + +/* +ListFieldMapAvailableFieldsParams contains all the parameters to send to the API endpoint + + for the list field map available fields operation. + + Typically these are written to a http.Request. +*/ +type ListFieldMapAvailableFieldsParams struct { + + // FieldMapID. + FieldMapID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list field map available fields params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListFieldMapAvailableFieldsParams) WithDefaults() *ListFieldMapAvailableFieldsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list field map available fields params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListFieldMapAvailableFieldsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list field map available fields params +func (o *ListFieldMapAvailableFieldsParams) WithTimeout(timeout time.Duration) *ListFieldMapAvailableFieldsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list field map available fields params +func (o *ListFieldMapAvailableFieldsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list field map available fields params +func (o *ListFieldMapAvailableFieldsParams) WithContext(ctx context.Context) *ListFieldMapAvailableFieldsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list field map available fields params +func (o *ListFieldMapAvailableFieldsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list field map available fields params +func (o *ListFieldMapAvailableFieldsParams) WithHTTPClient(client *http.Client) *ListFieldMapAvailableFieldsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list field map available fields params +func (o *ListFieldMapAvailableFieldsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFieldMapID adds the fieldMapID to the list field map available fields params +func (o *ListFieldMapAvailableFieldsParams) WithFieldMapID(fieldMapID string) *ListFieldMapAvailableFieldsParams { + o.SetFieldMapID(fieldMapID) + return o +} + +// SetFieldMapID adds the fieldMapId to the list field map available fields params +func (o *ListFieldMapAvailableFieldsParams) SetFieldMapID(fieldMapID string) { + o.FieldMapID = fieldMapID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListFieldMapAvailableFieldsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param field_map_id + if err := r.SetPathParam("field_map_id", o.FieldMapID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/list_field_map_available_fields_responses.go b/client/integrations/list_field_map_available_fields_responses.go new file mode 100644 index 0000000..4ad086d --- /dev/null +++ b/client/integrations/list_field_map_available_fields_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListFieldMapAvailableFieldsReader is a Reader for the ListFieldMapAvailableFields structure. +type ListFieldMapAvailableFieldsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListFieldMapAvailableFieldsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListFieldMapAvailableFieldsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListFieldMapAvailableFieldsOK creates a ListFieldMapAvailableFieldsOK with default headers values +func NewListFieldMapAvailableFieldsOK() *ListFieldMapAvailableFieldsOK { + return &ListFieldMapAvailableFieldsOK{} +} + +/* +ListFieldMapAvailableFieldsOK describes a response with status code 200, with default header values. + +Get a description of the fields to which data can be mapped +*/ +type ListFieldMapAvailableFieldsOK struct { + Payload *models.FieldMappingMappableFieldEntity +} + +// IsSuccess returns true when this list field map available fields o k response has a 2xx status code +func (o *ListFieldMapAvailableFieldsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list field map available fields o k response has a 3xx status code +func (o *ListFieldMapAvailableFieldsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list field map available fields o k response has a 4xx status code +func (o *ListFieldMapAvailableFieldsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list field map available fields o k response has a 5xx status code +func (o *ListFieldMapAvailableFieldsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list field map available fields o k response a status code equal to that given +func (o *ListFieldMapAvailableFieldsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListFieldMapAvailableFieldsOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/field_maps/{field_map_id}/available_fields][%d] listFieldMapAvailableFieldsOK %+v", 200, o.Payload) +} + +func (o *ListFieldMapAvailableFieldsOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/field_maps/{field_map_id}/available_fields][%d] listFieldMapAvailableFieldsOK %+v", 200, o.Payload) +} + +func (o *ListFieldMapAvailableFieldsOK) GetPayload() *models.FieldMappingMappableFieldEntity { + return o.Payload +} + +func (o *ListFieldMapAvailableFieldsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FieldMappingMappableFieldEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/list_integrations_parameters.go b/client/integrations/list_integrations_parameters.go new file mode 100644 index 0000000..a1aa7be --- /dev/null +++ b/client/integrations/list_integrations_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListIntegrationsParams creates a new ListIntegrationsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIntegrationsParams() *ListIntegrationsParams { + return &ListIntegrationsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIntegrationsParamsWithTimeout creates a new ListIntegrationsParams object +// with the ability to set a timeout on a request. +func NewListIntegrationsParamsWithTimeout(timeout time.Duration) *ListIntegrationsParams { + return &ListIntegrationsParams{ + timeout: timeout, + } +} + +// NewListIntegrationsParamsWithContext creates a new ListIntegrationsParams object +// with the ability to set a context for a request. +func NewListIntegrationsParamsWithContext(ctx context.Context) *ListIntegrationsParams { + return &ListIntegrationsParams{ + Context: ctx, + } +} + +// NewListIntegrationsParamsWithHTTPClient creates a new ListIntegrationsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIntegrationsParamsWithHTTPClient(client *http.Client) *ListIntegrationsParams { + return &ListIntegrationsParams{ + HTTPClient: client, + } +} + +/* +ListIntegrationsParams contains all the parameters to send to the API endpoint + + for the list integrations operation. + + Typically these are written to a http.Request. +*/ +type ListIntegrationsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list integrations params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIntegrationsParams) WithDefaults() *ListIntegrationsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list integrations params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIntegrationsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list integrations params +func (o *ListIntegrationsParams) WithTimeout(timeout time.Duration) *ListIntegrationsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list integrations params +func (o *ListIntegrationsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list integrations params +func (o *ListIntegrationsParams) WithContext(ctx context.Context) *ListIntegrationsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list integrations params +func (o *ListIntegrationsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list integrations params +func (o *ListIntegrationsParams) WithHTTPClient(client *http.Client) *ListIntegrationsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list integrations params +func (o *ListIntegrationsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIntegrationsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/list_integrations_responses.go b/client/integrations/list_integrations_responses.go new file mode 100644 index 0000000..274c7c9 --- /dev/null +++ b/client/integrations/list_integrations_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIntegrationsReader is a Reader for the ListIntegrations structure. +type ListIntegrationsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIntegrationsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIntegrationsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIntegrationsOK creates a ListIntegrationsOK with default headers values +func NewListIntegrationsOK() *ListIntegrationsOK { + return &ListIntegrationsOK{} +} + +/* +ListIntegrationsOK describes a response with status code 200, with default header values. + +Lists the available and configured integrations +*/ +type ListIntegrationsOK struct { + Payload *models.IntegrationsIntegrationEntityPaginated +} + +// IsSuccess returns true when this list integrations o k response has a 2xx status code +func (o *ListIntegrationsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list integrations o k response has a 3xx status code +func (o *ListIntegrationsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list integrations o k response has a 4xx status code +func (o *ListIntegrationsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list integrations o k response has a 5xx status code +func (o *ListIntegrationsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list integrations o k response a status code equal to that given +func (o *ListIntegrationsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIntegrationsOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations][%d] listIntegrationsOK %+v", 200, o.Payload) +} + +func (o *ListIntegrationsOK) String() string { + return fmt.Sprintf("[GET /v1/integrations][%d] listIntegrationsOK %+v", 200, o.Payload) +} + +func (o *ListIntegrationsOK) GetPayload() *models.IntegrationsIntegrationEntityPaginated { + return o.Payload +} + +func (o *ListIntegrationsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsIntegrationEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/list_slack_emoji_actions_parameters.go b/client/integrations/list_slack_emoji_actions_parameters.go new file mode 100644 index 0000000..f608ed2 --- /dev/null +++ b/client/integrations/list_slack_emoji_actions_parameters.go @@ -0,0 +1,218 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListSlackEmojiActionsParams creates a new ListSlackEmojiActionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSlackEmojiActionsParams() *ListSlackEmojiActionsParams { + return &ListSlackEmojiActionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSlackEmojiActionsParamsWithTimeout creates a new ListSlackEmojiActionsParams object +// with the ability to set a timeout on a request. +func NewListSlackEmojiActionsParamsWithTimeout(timeout time.Duration) *ListSlackEmojiActionsParams { + return &ListSlackEmojiActionsParams{ + timeout: timeout, + } +} + +// NewListSlackEmojiActionsParamsWithContext creates a new ListSlackEmojiActionsParams object +// with the ability to set a context for a request. +func NewListSlackEmojiActionsParamsWithContext(ctx context.Context) *ListSlackEmojiActionsParams { + return &ListSlackEmojiActionsParams{ + Context: ctx, + } +} + +// NewListSlackEmojiActionsParamsWithHTTPClient creates a new ListSlackEmojiActionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSlackEmojiActionsParamsWithHTTPClient(client *http.Client) *ListSlackEmojiActionsParams { + return &ListSlackEmojiActionsParams{ + HTTPClient: client, + } +} + +/* +ListSlackEmojiActionsParams contains all the parameters to send to the API endpoint + + for the list slack emoji actions operation. + + Typically these are written to a http.Request. +*/ +type ListSlackEmojiActionsParams struct { + + /* ConnectionID. + + Slack Connection UUID + */ + ConnectionID string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list slack emoji actions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSlackEmojiActionsParams) WithDefaults() *ListSlackEmojiActionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list slack emoji actions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSlackEmojiActionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list slack emoji actions params +func (o *ListSlackEmojiActionsParams) WithTimeout(timeout time.Duration) *ListSlackEmojiActionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list slack emoji actions params +func (o *ListSlackEmojiActionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list slack emoji actions params +func (o *ListSlackEmojiActionsParams) WithContext(ctx context.Context) *ListSlackEmojiActionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list slack emoji actions params +func (o *ListSlackEmojiActionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list slack emoji actions params +func (o *ListSlackEmojiActionsParams) WithHTTPClient(client *http.Client) *ListSlackEmojiActionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list slack emoji actions params +func (o *ListSlackEmojiActionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the list slack emoji actions params +func (o *ListSlackEmojiActionsParams) WithConnectionID(connectionID string) *ListSlackEmojiActionsParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the list slack emoji actions params +func (o *ListSlackEmojiActionsParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WithPage adds the page to the list slack emoji actions params +func (o *ListSlackEmojiActionsParams) WithPage(page *int32) *ListSlackEmojiActionsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list slack emoji actions params +func (o *ListSlackEmojiActionsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list slack emoji actions params +func (o *ListSlackEmojiActionsParams) WithPerPage(perPage *int32) *ListSlackEmojiActionsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list slack emoji actions params +func (o *ListSlackEmojiActionsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSlackEmojiActionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/list_slack_emoji_actions_responses.go b/client/integrations/list_slack_emoji_actions_responses.go new file mode 100644 index 0000000..894019c --- /dev/null +++ b/client/integrations/list_slack_emoji_actions_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListSlackEmojiActionsReader is a Reader for the ListSlackEmojiActions structure. +type ListSlackEmojiActionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSlackEmojiActionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSlackEmojiActionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListSlackEmojiActionsOK creates a ListSlackEmojiActionsOK with default headers values +func NewListSlackEmojiActionsOK() *ListSlackEmojiActionsOK { + return &ListSlackEmojiActionsOK{} +} + +/* +ListSlackEmojiActionsOK describes a response with status code 200, with default header values. + +Lists Slack emoji actions +*/ +type ListSlackEmojiActionsOK struct { +} + +// IsSuccess returns true when this list slack emoji actions o k response has a 2xx status code +func (o *ListSlackEmojiActionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list slack emoji actions o k response has a 3xx status code +func (o *ListSlackEmojiActionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list slack emoji actions o k response has a 4xx status code +func (o *ListSlackEmojiActionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list slack emoji actions o k response has a 5xx status code +func (o *ListSlackEmojiActionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list slack emoji actions o k response a status code equal to that given +func (o *ListSlackEmojiActionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListSlackEmojiActionsOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/slack/connections/{connection_id}/emoji_actions][%d] listSlackEmojiActionsOK ", 200) +} + +func (o *ListSlackEmojiActionsOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/slack/connections/{connection_id}/emoji_actions][%d] listSlackEmojiActionsOK ", 200) +} + +func (o *ListSlackEmojiActionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/integrations/list_slack_usergroups_parameters.go b/client/integrations/list_slack_usergroups_parameters.go new file mode 100644 index 0000000..b329148 --- /dev/null +++ b/client/integrations/list_slack_usergroups_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListSlackUsergroupsParams creates a new ListSlackUsergroupsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSlackUsergroupsParams() *ListSlackUsergroupsParams { + return &ListSlackUsergroupsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSlackUsergroupsParamsWithTimeout creates a new ListSlackUsergroupsParams object +// with the ability to set a timeout on a request. +func NewListSlackUsergroupsParamsWithTimeout(timeout time.Duration) *ListSlackUsergroupsParams { + return &ListSlackUsergroupsParams{ + timeout: timeout, + } +} + +// NewListSlackUsergroupsParamsWithContext creates a new ListSlackUsergroupsParams object +// with the ability to set a context for a request. +func NewListSlackUsergroupsParamsWithContext(ctx context.Context) *ListSlackUsergroupsParams { + return &ListSlackUsergroupsParams{ + Context: ctx, + } +} + +// NewListSlackUsergroupsParamsWithHTTPClient creates a new ListSlackUsergroupsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSlackUsergroupsParamsWithHTTPClient(client *http.Client) *ListSlackUsergroupsParams { + return &ListSlackUsergroupsParams{ + HTTPClient: client, + } +} + +/* +ListSlackUsergroupsParams contains all the parameters to send to the API endpoint + + for the list slack usergroups operation. + + Typically these are written to a http.Request. +*/ +type ListSlackUsergroupsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list slack usergroups params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSlackUsergroupsParams) WithDefaults() *ListSlackUsergroupsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list slack usergroups params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSlackUsergroupsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list slack usergroups params +func (o *ListSlackUsergroupsParams) WithTimeout(timeout time.Duration) *ListSlackUsergroupsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list slack usergroups params +func (o *ListSlackUsergroupsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list slack usergroups params +func (o *ListSlackUsergroupsParams) WithContext(ctx context.Context) *ListSlackUsergroupsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list slack usergroups params +func (o *ListSlackUsergroupsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list slack usergroups params +func (o *ListSlackUsergroupsParams) WithHTTPClient(client *http.Client) *ListSlackUsergroupsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list slack usergroups params +func (o *ListSlackUsergroupsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSlackUsergroupsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/list_slack_usergroups_responses.go b/client/integrations/list_slack_usergroups_responses.go new file mode 100644 index 0000000..70cf0df --- /dev/null +++ b/client/integrations/list_slack_usergroups_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListSlackUsergroupsReader is a Reader for the ListSlackUsergroups structure. +type ListSlackUsergroupsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSlackUsergroupsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSlackUsergroupsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListSlackUsergroupsOK creates a ListSlackUsergroupsOK with default headers values +func NewListSlackUsergroupsOK() *ListSlackUsergroupsOK { + return &ListSlackUsergroupsOK{} +} + +/* +ListSlackUsergroupsOK describes a response with status code 200, with default header values. + +Lists all Slack user groups +*/ +type ListSlackUsergroupsOK struct { + Payload *models.IntegrationsSlackUsergroupEntity +} + +// IsSuccess returns true when this list slack usergroups o k response has a 2xx status code +func (o *ListSlackUsergroupsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list slack usergroups o k response has a 3xx status code +func (o *ListSlackUsergroupsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list slack usergroups o k response has a 4xx status code +func (o *ListSlackUsergroupsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list slack usergroups o k response has a 5xx status code +func (o *ListSlackUsergroupsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list slack usergroups o k response a status code equal to that given +func (o *ListSlackUsergroupsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListSlackUsergroupsOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/slack/usergroups][%d] listSlackUsergroupsOK %+v", 200, o.Payload) +} + +func (o *ListSlackUsergroupsOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/slack/usergroups][%d] listSlackUsergroupsOK %+v", 200, o.Payload) +} + +func (o *ListSlackUsergroupsOK) GetPayload() *models.IntegrationsSlackUsergroupEntity { + return o.Payload +} + +func (o *ListSlackUsergroupsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsSlackUsergroupEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/list_slack_workspaces_parameters.go b/client/integrations/list_slack_workspaces_parameters.go new file mode 100644 index 0000000..2fb2710 --- /dev/null +++ b/client/integrations/list_slack_workspaces_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListSlackWorkspacesParams creates a new ListSlackWorkspacesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSlackWorkspacesParams() *ListSlackWorkspacesParams { + return &ListSlackWorkspacesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSlackWorkspacesParamsWithTimeout creates a new ListSlackWorkspacesParams object +// with the ability to set a timeout on a request. +func NewListSlackWorkspacesParamsWithTimeout(timeout time.Duration) *ListSlackWorkspacesParams { + return &ListSlackWorkspacesParams{ + timeout: timeout, + } +} + +// NewListSlackWorkspacesParamsWithContext creates a new ListSlackWorkspacesParams object +// with the ability to set a context for a request. +func NewListSlackWorkspacesParamsWithContext(ctx context.Context) *ListSlackWorkspacesParams { + return &ListSlackWorkspacesParams{ + Context: ctx, + } +} + +// NewListSlackWorkspacesParamsWithHTTPClient creates a new ListSlackWorkspacesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSlackWorkspacesParamsWithHTTPClient(client *http.Client) *ListSlackWorkspacesParams { + return &ListSlackWorkspacesParams{ + HTTPClient: client, + } +} + +/* +ListSlackWorkspacesParams contains all the parameters to send to the API endpoint + + for the list slack workspaces operation. + + Typically these are written to a http.Request. +*/ +type ListSlackWorkspacesParams struct { + + /* ConnectionID. + + Connection UUID + */ + ConnectionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list slack workspaces params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSlackWorkspacesParams) WithDefaults() *ListSlackWorkspacesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list slack workspaces params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSlackWorkspacesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list slack workspaces params +func (o *ListSlackWorkspacesParams) WithTimeout(timeout time.Duration) *ListSlackWorkspacesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list slack workspaces params +func (o *ListSlackWorkspacesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list slack workspaces params +func (o *ListSlackWorkspacesParams) WithContext(ctx context.Context) *ListSlackWorkspacesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list slack workspaces params +func (o *ListSlackWorkspacesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list slack workspaces params +func (o *ListSlackWorkspacesParams) WithHTTPClient(client *http.Client) *ListSlackWorkspacesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list slack workspaces params +func (o *ListSlackWorkspacesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the list slack workspaces params +func (o *ListSlackWorkspacesParams) WithConnectionID(connectionID string) *ListSlackWorkspacesParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the list slack workspaces params +func (o *ListSlackWorkspacesParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSlackWorkspacesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/list_slack_workspaces_responses.go b/client/integrations/list_slack_workspaces_responses.go new file mode 100644 index 0000000..b149638 --- /dev/null +++ b/client/integrations/list_slack_workspaces_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListSlackWorkspacesReader is a Reader for the ListSlackWorkspaces structure. +type ListSlackWorkspacesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSlackWorkspacesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSlackWorkspacesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListSlackWorkspacesOK creates a ListSlackWorkspacesOK with default headers values +func NewListSlackWorkspacesOK() *ListSlackWorkspacesOK { + return &ListSlackWorkspacesOK{} +} + +/* +ListSlackWorkspacesOK describes a response with status code 200, with default header values. + +Lists all Slack workspaces +*/ +type ListSlackWorkspacesOK struct { + Payload *models.IntegrationsSlackWorkspaceEntity +} + +// IsSuccess returns true when this list slack workspaces o k response has a 2xx status code +func (o *ListSlackWorkspacesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list slack workspaces o k response has a 3xx status code +func (o *ListSlackWorkspacesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list slack workspaces o k response has a 4xx status code +func (o *ListSlackWorkspacesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list slack workspaces o k response has a 5xx status code +func (o *ListSlackWorkspacesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list slack workspaces o k response a status code equal to that given +func (o *ListSlackWorkspacesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListSlackWorkspacesOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/slack/connections/{connection_id}/workspaces][%d] listSlackWorkspacesOK %+v", 200, o.Payload) +} + +func (o *ListSlackWorkspacesOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/slack/connections/{connection_id}/workspaces][%d] listSlackWorkspacesOK %+v", 200, o.Payload) +} + +func (o *ListSlackWorkspacesOK) GetPayload() *models.IntegrationsSlackWorkspaceEntity { + return o.Payload +} + +func (o *ListSlackWorkspacesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsSlackWorkspaceEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/list_statuspage_connection_pages_parameters.go b/client/integrations/list_statuspage_connection_pages_parameters.go new file mode 100644 index 0000000..b1a77dd --- /dev/null +++ b/client/integrations/list_statuspage_connection_pages_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListStatuspageConnectionPagesParams creates a new ListStatuspageConnectionPagesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListStatuspageConnectionPagesParams() *ListStatuspageConnectionPagesParams { + return &ListStatuspageConnectionPagesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListStatuspageConnectionPagesParamsWithTimeout creates a new ListStatuspageConnectionPagesParams object +// with the ability to set a timeout on a request. +func NewListStatuspageConnectionPagesParamsWithTimeout(timeout time.Duration) *ListStatuspageConnectionPagesParams { + return &ListStatuspageConnectionPagesParams{ + timeout: timeout, + } +} + +// NewListStatuspageConnectionPagesParamsWithContext creates a new ListStatuspageConnectionPagesParams object +// with the ability to set a context for a request. +func NewListStatuspageConnectionPagesParamsWithContext(ctx context.Context) *ListStatuspageConnectionPagesParams { + return &ListStatuspageConnectionPagesParams{ + Context: ctx, + } +} + +// NewListStatuspageConnectionPagesParamsWithHTTPClient creates a new ListStatuspageConnectionPagesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListStatuspageConnectionPagesParamsWithHTTPClient(client *http.Client) *ListStatuspageConnectionPagesParams { + return &ListStatuspageConnectionPagesParams{ + HTTPClient: client, + } +} + +/* +ListStatuspageConnectionPagesParams contains all the parameters to send to the API endpoint + + for the list statuspage connection pages operation. + + Typically these are written to a http.Request. +*/ +type ListStatuspageConnectionPagesParams struct { + + /* ConnectionID. + + Connection UUID + */ + ConnectionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list statuspage connection pages params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListStatuspageConnectionPagesParams) WithDefaults() *ListStatuspageConnectionPagesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list statuspage connection pages params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListStatuspageConnectionPagesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list statuspage connection pages params +func (o *ListStatuspageConnectionPagesParams) WithTimeout(timeout time.Duration) *ListStatuspageConnectionPagesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list statuspage connection pages params +func (o *ListStatuspageConnectionPagesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list statuspage connection pages params +func (o *ListStatuspageConnectionPagesParams) WithContext(ctx context.Context) *ListStatuspageConnectionPagesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list statuspage connection pages params +func (o *ListStatuspageConnectionPagesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list statuspage connection pages params +func (o *ListStatuspageConnectionPagesParams) WithHTTPClient(client *http.Client) *ListStatuspageConnectionPagesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list statuspage connection pages params +func (o *ListStatuspageConnectionPagesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the list statuspage connection pages params +func (o *ListStatuspageConnectionPagesParams) WithConnectionID(connectionID string) *ListStatuspageConnectionPagesParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the list statuspage connection pages params +func (o *ListStatuspageConnectionPagesParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListStatuspageConnectionPagesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/list_statuspage_connection_pages_responses.go b/client/integrations/list_statuspage_connection_pages_responses.go new file mode 100644 index 0000000..7751307 --- /dev/null +++ b/client/integrations/list_statuspage_connection_pages_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListStatuspageConnectionPagesReader is a Reader for the ListStatuspageConnectionPages structure. +type ListStatuspageConnectionPagesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListStatuspageConnectionPagesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListStatuspageConnectionPagesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListStatuspageConnectionPagesOK creates a ListStatuspageConnectionPagesOK with default headers values +func NewListStatuspageConnectionPagesOK() *ListStatuspageConnectionPagesOK { + return &ListStatuspageConnectionPagesOK{} +} + +/* +ListStatuspageConnectionPagesOK describes a response with status code 200, with default header values. + +Lists available page IDs for the Statuspage integration connection. +*/ +type ListStatuspageConnectionPagesOK struct { + Payload *models.IntegrationsStatuspagePageEntity +} + +// IsSuccess returns true when this list statuspage connection pages o k response has a 2xx status code +func (o *ListStatuspageConnectionPagesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list statuspage connection pages o k response has a 3xx status code +func (o *ListStatuspageConnectionPagesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list statuspage connection pages o k response has a 4xx status code +func (o *ListStatuspageConnectionPagesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list statuspage connection pages o k response has a 5xx status code +func (o *ListStatuspageConnectionPagesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list statuspage connection pages o k response a status code equal to that given +func (o *ListStatuspageConnectionPagesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListStatuspageConnectionPagesOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/statuspage/connections/{connection_id}/pages][%d] listStatuspageConnectionPagesOK %+v", 200, o.Payload) +} + +func (o *ListStatuspageConnectionPagesOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/statuspage/connections/{connection_id}/pages][%d] listStatuspageConnectionPagesOK %+v", 200, o.Payload) +} + +func (o *ListStatuspageConnectionPagesOK) GetPayload() *models.IntegrationsStatuspagePageEntity { + return o.Payload +} + +func (o *ListStatuspageConnectionPagesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsStatuspagePageEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/list_statuspage_connections_parameters.go b/client/integrations/list_statuspage_connections_parameters.go new file mode 100644 index 0000000..efc67ba --- /dev/null +++ b/client/integrations/list_statuspage_connections_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListStatuspageConnectionsParams creates a new ListStatuspageConnectionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListStatuspageConnectionsParams() *ListStatuspageConnectionsParams { + return &ListStatuspageConnectionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListStatuspageConnectionsParamsWithTimeout creates a new ListStatuspageConnectionsParams object +// with the ability to set a timeout on a request. +func NewListStatuspageConnectionsParamsWithTimeout(timeout time.Duration) *ListStatuspageConnectionsParams { + return &ListStatuspageConnectionsParams{ + timeout: timeout, + } +} + +// NewListStatuspageConnectionsParamsWithContext creates a new ListStatuspageConnectionsParams object +// with the ability to set a context for a request. +func NewListStatuspageConnectionsParamsWithContext(ctx context.Context) *ListStatuspageConnectionsParams { + return &ListStatuspageConnectionsParams{ + Context: ctx, + } +} + +// NewListStatuspageConnectionsParamsWithHTTPClient creates a new ListStatuspageConnectionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListStatuspageConnectionsParamsWithHTTPClient(client *http.Client) *ListStatuspageConnectionsParams { + return &ListStatuspageConnectionsParams{ + HTTPClient: client, + } +} + +/* +ListStatuspageConnectionsParams contains all the parameters to send to the API endpoint + + for the list statuspage connections operation. + + Typically these are written to a http.Request. +*/ +type ListStatuspageConnectionsParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list statuspage connections params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListStatuspageConnectionsParams) WithDefaults() *ListStatuspageConnectionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list statuspage connections params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListStatuspageConnectionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list statuspage connections params +func (o *ListStatuspageConnectionsParams) WithTimeout(timeout time.Duration) *ListStatuspageConnectionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list statuspage connections params +func (o *ListStatuspageConnectionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list statuspage connections params +func (o *ListStatuspageConnectionsParams) WithContext(ctx context.Context) *ListStatuspageConnectionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list statuspage connections params +func (o *ListStatuspageConnectionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list statuspage connections params +func (o *ListStatuspageConnectionsParams) WithHTTPClient(client *http.Client) *ListStatuspageConnectionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list statuspage connections params +func (o *ListStatuspageConnectionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list statuspage connections params +func (o *ListStatuspageConnectionsParams) WithPage(page *int32) *ListStatuspageConnectionsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list statuspage connections params +func (o *ListStatuspageConnectionsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list statuspage connections params +func (o *ListStatuspageConnectionsParams) WithPerPage(perPage *int32) *ListStatuspageConnectionsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list statuspage connections params +func (o *ListStatuspageConnectionsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListStatuspageConnectionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/list_statuspage_connections_responses.go b/client/integrations/list_statuspage_connections_responses.go new file mode 100644 index 0000000..4cde830 --- /dev/null +++ b/client/integrations/list_statuspage_connections_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListStatuspageConnectionsReader is a Reader for the ListStatuspageConnections structure. +type ListStatuspageConnectionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListStatuspageConnectionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListStatuspageConnectionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListStatuspageConnectionsOK creates a ListStatuspageConnectionsOK with default headers values +func NewListStatuspageConnectionsOK() *ListStatuspageConnectionsOK { + return &ListStatuspageConnectionsOK{} +} + +/* +ListStatuspageConnectionsOK describes a response with status code 200, with default header values. + +Lists the available and configured Statuspage integrations connections for the authenticated organization. +*/ +type ListStatuspageConnectionsOK struct { + Payload *models.IntegrationsStatuspageConnectionEntityPaginated +} + +// IsSuccess returns true when this list statuspage connections o k response has a 2xx status code +func (o *ListStatuspageConnectionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list statuspage connections o k response has a 3xx status code +func (o *ListStatuspageConnectionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list statuspage connections o k response has a 4xx status code +func (o *ListStatuspageConnectionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list statuspage connections o k response has a 5xx status code +func (o *ListStatuspageConnectionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list statuspage connections o k response a status code equal to that given +func (o *ListStatuspageConnectionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListStatuspageConnectionsOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/statuspage/connections][%d] listStatuspageConnectionsOK %+v", 200, o.Payload) +} + +func (o *ListStatuspageConnectionsOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/statuspage/connections][%d] listStatuspageConnectionsOK %+v", 200, o.Payload) +} + +func (o *ListStatuspageConnectionsOK) GetPayload() *models.IntegrationsStatuspageConnectionEntityPaginated { + return o.Payload +} + +func (o *ListStatuspageConnectionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsStatuspageConnectionEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/refresh_connection_parameters.go b/client/integrations/refresh_connection_parameters.go new file mode 100644 index 0000000..84e8483 --- /dev/null +++ b/client/integrations/refresh_connection_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewRefreshConnectionParams creates a new RefreshConnectionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRefreshConnectionParams() *RefreshConnectionParams { + return &RefreshConnectionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRefreshConnectionParamsWithTimeout creates a new RefreshConnectionParams object +// with the ability to set a timeout on a request. +func NewRefreshConnectionParamsWithTimeout(timeout time.Duration) *RefreshConnectionParams { + return &RefreshConnectionParams{ + timeout: timeout, + } +} + +// NewRefreshConnectionParamsWithContext creates a new RefreshConnectionParams object +// with the ability to set a context for a request. +func NewRefreshConnectionParamsWithContext(ctx context.Context) *RefreshConnectionParams { + return &RefreshConnectionParams{ + Context: ctx, + } +} + +// NewRefreshConnectionParamsWithHTTPClient creates a new RefreshConnectionParams object +// with the ability to set a custom HTTPClient for a request. +func NewRefreshConnectionParamsWithHTTPClient(client *http.Client) *RefreshConnectionParams { + return &RefreshConnectionParams{ + HTTPClient: client, + } +} + +/* +RefreshConnectionParams contains all the parameters to send to the API endpoint + + for the refresh connection operation. + + Typically these are written to a http.Request. +*/ +type RefreshConnectionParams struct { + + // ConnectionID. + ConnectionID string + + // Slug. + Slug string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the refresh connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RefreshConnectionParams) WithDefaults() *RefreshConnectionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the refresh connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RefreshConnectionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the refresh connection params +func (o *RefreshConnectionParams) WithTimeout(timeout time.Duration) *RefreshConnectionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the refresh connection params +func (o *RefreshConnectionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the refresh connection params +func (o *RefreshConnectionParams) WithContext(ctx context.Context) *RefreshConnectionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the refresh connection params +func (o *RefreshConnectionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the refresh connection params +func (o *RefreshConnectionParams) WithHTTPClient(client *http.Client) *RefreshConnectionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the refresh connection params +func (o *RefreshConnectionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the refresh connection params +func (o *RefreshConnectionParams) WithConnectionID(connectionID string) *RefreshConnectionParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the refresh connection params +func (o *RefreshConnectionParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WithSlug adds the slug to the refresh connection params +func (o *RefreshConnectionParams) WithSlug(slug string) *RefreshConnectionParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the refresh connection params +func (o *RefreshConnectionParams) SetSlug(slug string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *RefreshConnectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + + // path param slug + if err := r.SetPathParam("slug", o.Slug); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/refresh_connection_responses.go b/client/integrations/refresh_connection_responses.go new file mode 100644 index 0000000..a6e5039 --- /dev/null +++ b/client/integrations/refresh_connection_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// RefreshConnectionReader is a Reader for the RefreshConnection structure. +type RefreshConnectionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RefreshConnectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRefreshConnectionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewRefreshConnectionOK creates a RefreshConnectionOK with default headers values +func NewRefreshConnectionOK() *RefreshConnectionOK { + return &RefreshConnectionOK{} +} + +/* +RefreshConnectionOK describes a response with status code 200, with default header values. + +Refresh the integration connection with the provided data +*/ +type RefreshConnectionOK struct { + Payload *models.IntegrationsConnectionEntity +} + +// IsSuccess returns true when this refresh connection o k response has a 2xx status code +func (o *RefreshConnectionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this refresh connection o k response has a 3xx status code +func (o *RefreshConnectionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this refresh connection o k response has a 4xx status code +func (o *RefreshConnectionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this refresh connection o k response has a 5xx status code +func (o *RefreshConnectionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this refresh connection o k response a status code equal to that given +func (o *RefreshConnectionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *RefreshConnectionOK) Error() string { + return fmt.Sprintf("[PATCH /v1/integrations/connections/{slug}/{connection_id}/refresh][%d] refreshConnectionOK %+v", 200, o.Payload) +} + +func (o *RefreshConnectionOK) String() string { + return fmt.Sprintf("[PATCH /v1/integrations/connections/{slug}/{connection_id}/refresh][%d] refreshConnectionOK %+v", 200, o.Payload) +} + +func (o *RefreshConnectionOK) GetPayload() *models.IntegrationsConnectionEntity { + return o.Payload +} + +func (o *RefreshConnectionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/search_confluence_spaces_parameters.go b/client/integrations/search_confluence_spaces_parameters.go new file mode 100644 index 0000000..930f020 --- /dev/null +++ b/client/integrations/search_confluence_spaces_parameters.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSearchConfluenceSpacesParams creates a new SearchConfluenceSpacesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewSearchConfluenceSpacesParams() *SearchConfluenceSpacesParams { + return &SearchConfluenceSpacesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSearchConfluenceSpacesParamsWithTimeout creates a new SearchConfluenceSpacesParams object +// with the ability to set a timeout on a request. +func NewSearchConfluenceSpacesParamsWithTimeout(timeout time.Duration) *SearchConfluenceSpacesParams { + return &SearchConfluenceSpacesParams{ + timeout: timeout, + } +} + +// NewSearchConfluenceSpacesParamsWithContext creates a new SearchConfluenceSpacesParams object +// with the ability to set a context for a request. +func NewSearchConfluenceSpacesParamsWithContext(ctx context.Context) *SearchConfluenceSpacesParams { + return &SearchConfluenceSpacesParams{ + Context: ctx, + } +} + +// NewSearchConfluenceSpacesParamsWithHTTPClient creates a new SearchConfluenceSpacesParams object +// with the ability to set a custom HTTPClient for a request. +func NewSearchConfluenceSpacesParamsWithHTTPClient(client *http.Client) *SearchConfluenceSpacesParams { + return &SearchConfluenceSpacesParams{ + HTTPClient: client, + } +} + +/* +SearchConfluenceSpacesParams contains all the parameters to send to the API endpoint + + for the search confluence spaces operation. + + Typically these are written to a http.Request. +*/ +type SearchConfluenceSpacesParams struct { + + // ID. + ID string + + /* Keyword. + + Space Key + */ + Keyword *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the search confluence spaces params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchConfluenceSpacesParams) WithDefaults() *SearchConfluenceSpacesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the search confluence spaces params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchConfluenceSpacesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the search confluence spaces params +func (o *SearchConfluenceSpacesParams) WithTimeout(timeout time.Duration) *SearchConfluenceSpacesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the search confluence spaces params +func (o *SearchConfluenceSpacesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the search confluence spaces params +func (o *SearchConfluenceSpacesParams) WithContext(ctx context.Context) *SearchConfluenceSpacesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the search confluence spaces params +func (o *SearchConfluenceSpacesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the search confluence spaces params +func (o *SearchConfluenceSpacesParams) WithHTTPClient(client *http.Client) *SearchConfluenceSpacesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the search confluence spaces params +func (o *SearchConfluenceSpacesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the search confluence spaces params +func (o *SearchConfluenceSpacesParams) WithID(id string) *SearchConfluenceSpacesParams { + o.SetID(id) + return o +} + +// SetID adds the id to the search confluence spaces params +func (o *SearchConfluenceSpacesParams) SetID(id string) { + o.ID = id +} + +// WithKeyword adds the keyword to the search confluence spaces params +func (o *SearchConfluenceSpacesParams) WithKeyword(keyword *string) *SearchConfluenceSpacesParams { + o.SetKeyword(keyword) + return o +} + +// SetKeyword adds the keyword to the search confluence spaces params +func (o *SearchConfluenceSpacesParams) SetKeyword(keyword *string) { + o.Keyword = keyword +} + +// WriteToRequest writes these params to a swagger request +func (o *SearchConfluenceSpacesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if o.Keyword != nil { + + // query param keyword + var qrKeyword string + + if o.Keyword != nil { + qrKeyword = *o.Keyword + } + qKeyword := qrKeyword + if qKeyword != "" { + + if err := r.SetQueryParam("keyword", qKeyword); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/search_confluence_spaces_responses.go b/client/integrations/search_confluence_spaces_responses.go new file mode 100644 index 0000000..c8ac781 --- /dev/null +++ b/client/integrations/search_confluence_spaces_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// SearchConfluenceSpacesReader is a Reader for the SearchConfluenceSpaces structure. +type SearchConfluenceSpacesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SearchConfluenceSpacesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSearchConfluenceSpacesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewSearchConfluenceSpacesOK creates a SearchConfluenceSpacesOK with default headers values +func NewSearchConfluenceSpacesOK() *SearchConfluenceSpacesOK { + return &SearchConfluenceSpacesOK{} +} + +/* +SearchConfluenceSpacesOK describes a response with status code 200, with default header values. + +Lists available space keys for the Confluence integration connection. +*/ +type SearchConfluenceSpacesOK struct { + Payload *models.IntegrationsConfluenceCloudSpaceKeyEntity +} + +// IsSuccess returns true when this search confluence spaces o k response has a 2xx status code +func (o *SearchConfluenceSpacesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this search confluence spaces o k response has a 3xx status code +func (o *SearchConfluenceSpacesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search confluence spaces o k response has a 4xx status code +func (o *SearchConfluenceSpacesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this search confluence spaces o k response has a 5xx status code +func (o *SearchConfluenceSpacesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this search confluence spaces o k response a status code equal to that given +func (o *SearchConfluenceSpacesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *SearchConfluenceSpacesOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/confluence_cloud/connections/{id}/space/search][%d] searchConfluenceSpacesOK %+v", 200, o.Payload) +} + +func (o *SearchConfluenceSpacesOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/confluence_cloud/connections/{id}/space/search][%d] searchConfluenceSpacesOK %+v", 200, o.Payload) +} + +func (o *SearchConfluenceSpacesOK) GetPayload() *models.IntegrationsConfluenceCloudSpaceKeyEntity { + return o.Payload +} + +func (o *SearchConfluenceSpacesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsConfluenceCloudSpaceKeyEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/search_zendesk_tickets_parameters.go b/client/integrations/search_zendesk_tickets_parameters.go new file mode 100644 index 0000000..cd8a189 --- /dev/null +++ b/client/integrations/search_zendesk_tickets_parameters.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewSearchZendeskTicketsParams creates a new SearchZendeskTicketsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewSearchZendeskTicketsParams() *SearchZendeskTicketsParams { + return &SearchZendeskTicketsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSearchZendeskTicketsParamsWithTimeout creates a new SearchZendeskTicketsParams object +// with the ability to set a timeout on a request. +func NewSearchZendeskTicketsParamsWithTimeout(timeout time.Duration) *SearchZendeskTicketsParams { + return &SearchZendeskTicketsParams{ + timeout: timeout, + } +} + +// NewSearchZendeskTicketsParamsWithContext creates a new SearchZendeskTicketsParams object +// with the ability to set a context for a request. +func NewSearchZendeskTicketsParamsWithContext(ctx context.Context) *SearchZendeskTicketsParams { + return &SearchZendeskTicketsParams{ + Context: ctx, + } +} + +// NewSearchZendeskTicketsParamsWithHTTPClient creates a new SearchZendeskTicketsParams object +// with the ability to set a custom HTTPClient for a request. +func NewSearchZendeskTicketsParamsWithHTTPClient(client *http.Client) *SearchZendeskTicketsParams { + return &SearchZendeskTicketsParams{ + HTTPClient: client, + } +} + +/* +SearchZendeskTicketsParams contains all the parameters to send to the API endpoint + + for the search zendesk tickets operation. + + Typically these are written to a http.Request. +*/ +type SearchZendeskTicketsParams struct { + + // ConnectionID. + ConnectionID string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + // Query. + Query string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the search zendesk tickets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchZendeskTicketsParams) WithDefaults() *SearchZendeskTicketsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the search zendesk tickets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SearchZendeskTicketsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the search zendesk tickets params +func (o *SearchZendeskTicketsParams) WithTimeout(timeout time.Duration) *SearchZendeskTicketsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the search zendesk tickets params +func (o *SearchZendeskTicketsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the search zendesk tickets params +func (o *SearchZendeskTicketsParams) WithContext(ctx context.Context) *SearchZendeskTicketsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the search zendesk tickets params +func (o *SearchZendeskTicketsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the search zendesk tickets params +func (o *SearchZendeskTicketsParams) WithHTTPClient(client *http.Client) *SearchZendeskTicketsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the search zendesk tickets params +func (o *SearchZendeskTicketsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the search zendesk tickets params +func (o *SearchZendeskTicketsParams) WithConnectionID(connectionID string) *SearchZendeskTicketsParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the search zendesk tickets params +func (o *SearchZendeskTicketsParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WithPage adds the page to the search zendesk tickets params +func (o *SearchZendeskTicketsParams) WithPage(page *int32) *SearchZendeskTicketsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the search zendesk tickets params +func (o *SearchZendeskTicketsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the search zendesk tickets params +func (o *SearchZendeskTicketsParams) WithPerPage(perPage *int32) *SearchZendeskTicketsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the search zendesk tickets params +func (o *SearchZendeskTicketsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the search zendesk tickets params +func (o *SearchZendeskTicketsParams) WithQuery(query string) *SearchZendeskTicketsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the search zendesk tickets params +func (o *SearchZendeskTicketsParams) SetQuery(query string) { + o.Query = query +} + +// WriteToRequest writes these params to a swagger request +func (o *SearchZendeskTicketsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + // query param query + qrQuery := o.Query + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/search_zendesk_tickets_responses.go b/client/integrations/search_zendesk_tickets_responses.go new file mode 100644 index 0000000..e6f6a3a --- /dev/null +++ b/client/integrations/search_zendesk_tickets_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// SearchZendeskTicketsReader is a Reader for the SearchZendeskTickets structure. +type SearchZendeskTicketsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SearchZendeskTicketsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSearchZendeskTicketsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewSearchZendeskTicketsOK creates a SearchZendeskTicketsOK with default headers values +func NewSearchZendeskTicketsOK() *SearchZendeskTicketsOK { + return &SearchZendeskTicketsOK{} +} + +/* +SearchZendeskTicketsOK describes a response with status code 200, with default header values. + +Search for Zendesk tickets +*/ +type SearchZendeskTicketsOK struct { + Payload *models.IntegrationsZendeskSearchTicketsPaginatedEntity +} + +// IsSuccess returns true when this search zendesk tickets o k response has a 2xx status code +func (o *SearchZendeskTicketsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this search zendesk tickets o k response has a 3xx status code +func (o *SearchZendeskTicketsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this search zendesk tickets o k response has a 4xx status code +func (o *SearchZendeskTicketsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this search zendesk tickets o k response has a 5xx status code +func (o *SearchZendeskTicketsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this search zendesk tickets o k response a status code equal to that given +func (o *SearchZendeskTicketsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *SearchZendeskTicketsOK) Error() string { + return fmt.Sprintf("[GET /v1/integrations/zendesk/{connection_id}/tickets/search][%d] searchZendeskTicketsOK %+v", 200, o.Payload) +} + +func (o *SearchZendeskTicketsOK) String() string { + return fmt.Sprintf("[GET /v1/integrations/zendesk/{connection_id}/tickets/search][%d] searchZendeskTicketsOK %+v", 200, o.Payload) +} + +func (o *SearchZendeskTicketsOK) GetPayload() *models.IntegrationsZendeskSearchTicketsPaginatedEntity { + return o.Payload +} + +func (o *SearchZendeskTicketsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsZendeskSearchTicketsPaginatedEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/update_authed_provider_parameters.go b/client/integrations/update_authed_provider_parameters.go new file mode 100644 index 0000000..661c54a --- /dev/null +++ b/client/integrations/update_authed_provider_parameters.go @@ -0,0 +1,228 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewUpdateAuthedProviderParams creates a new UpdateAuthedProviderParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateAuthedProviderParams() *UpdateAuthedProviderParams { + return &UpdateAuthedProviderParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateAuthedProviderParamsWithTimeout creates a new UpdateAuthedProviderParams object +// with the ability to set a timeout on a request. +func NewUpdateAuthedProviderParamsWithTimeout(timeout time.Duration) *UpdateAuthedProviderParams { + return &UpdateAuthedProviderParams{ + timeout: timeout, + } +} + +// NewUpdateAuthedProviderParamsWithContext creates a new UpdateAuthedProviderParams object +// with the ability to set a context for a request. +func NewUpdateAuthedProviderParamsWithContext(ctx context.Context) *UpdateAuthedProviderParams { + return &UpdateAuthedProviderParams{ + Context: ctx, + } +} + +// NewUpdateAuthedProviderParamsWithHTTPClient creates a new UpdateAuthedProviderParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateAuthedProviderParamsWithHTTPClient(client *http.Client) *UpdateAuthedProviderParams { + return &UpdateAuthedProviderParams{ + HTTPClient: client, + } +} + +/* +UpdateAuthedProviderParams contains all the parameters to send to the API endpoint + + for the update authed provider operation. + + Typically these are written to a http.Request. +*/ +type UpdateAuthedProviderParams struct { + + /* AuthedProviderID. + + Authed provider ID + */ + AuthedProviderID string + + /* ConnectionID. + + Connection ID + */ + ConnectionID string + + /* IntegrationDefault. + + Set as the default integration for the account + */ + IntegrationDefault *bool + + /* IntegrationSlug. + + Integration slug + */ + IntegrationSlug string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update authed provider params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAuthedProviderParams) WithDefaults() *UpdateAuthedProviderParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update authed provider params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAuthedProviderParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update authed provider params +func (o *UpdateAuthedProviderParams) WithTimeout(timeout time.Duration) *UpdateAuthedProviderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update authed provider params +func (o *UpdateAuthedProviderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update authed provider params +func (o *UpdateAuthedProviderParams) WithContext(ctx context.Context) *UpdateAuthedProviderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update authed provider params +func (o *UpdateAuthedProviderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update authed provider params +func (o *UpdateAuthedProviderParams) WithHTTPClient(client *http.Client) *UpdateAuthedProviderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update authed provider params +func (o *UpdateAuthedProviderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuthedProviderID adds the authedProviderID to the update authed provider params +func (o *UpdateAuthedProviderParams) WithAuthedProviderID(authedProviderID string) *UpdateAuthedProviderParams { + o.SetAuthedProviderID(authedProviderID) + return o +} + +// SetAuthedProviderID adds the authedProviderId to the update authed provider params +func (o *UpdateAuthedProviderParams) SetAuthedProviderID(authedProviderID string) { + o.AuthedProviderID = authedProviderID +} + +// WithConnectionID adds the connectionID to the update authed provider params +func (o *UpdateAuthedProviderParams) WithConnectionID(connectionID string) *UpdateAuthedProviderParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the update authed provider params +func (o *UpdateAuthedProviderParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WithIntegrationDefault adds the integrationDefault to the update authed provider params +func (o *UpdateAuthedProviderParams) WithIntegrationDefault(integrationDefault *bool) *UpdateAuthedProviderParams { + o.SetIntegrationDefault(integrationDefault) + return o +} + +// SetIntegrationDefault adds the integrationDefault to the update authed provider params +func (o *UpdateAuthedProviderParams) SetIntegrationDefault(integrationDefault *bool) { + o.IntegrationDefault = integrationDefault +} + +// WithIntegrationSlug adds the integrationSlug to the update authed provider params +func (o *UpdateAuthedProviderParams) WithIntegrationSlug(integrationSlug string) *UpdateAuthedProviderParams { + o.SetIntegrationSlug(integrationSlug) + return o +} + +// SetIntegrationSlug adds the integrationSlug to the update authed provider params +func (o *UpdateAuthedProviderParams) SetIntegrationSlug(integrationSlug string) { + o.IntegrationSlug = integrationSlug +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateAuthedProviderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param authed_provider_id + if err := r.SetPathParam("authed_provider_id", o.AuthedProviderID); err != nil { + return err + } + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + + if o.IntegrationDefault != nil { + + // form param integration_default + var frIntegrationDefault bool + if o.IntegrationDefault != nil { + frIntegrationDefault = *o.IntegrationDefault + } + fIntegrationDefault := swag.FormatBool(frIntegrationDefault) + if fIntegrationDefault != "" { + if err := r.SetFormParam("integration_default", fIntegrationDefault); err != nil { + return err + } + } + } + + // path param integration_slug + if err := r.SetPathParam("integration_slug", o.IntegrationSlug); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/update_authed_provider_responses.go b/client/integrations/update_authed_provider_responses.go new file mode 100644 index 0000000..81f32b4 --- /dev/null +++ b/client/integrations/update_authed_provider_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateAuthedProviderReader is a Reader for the UpdateAuthedProvider structure. +type UpdateAuthedProviderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateAuthedProviderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateAuthedProviderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateAuthedProviderOK creates a UpdateAuthedProviderOK with default headers values +func NewUpdateAuthedProviderOK() *UpdateAuthedProviderOK { + return &UpdateAuthedProviderOK{} +} + +/* +UpdateAuthedProviderOK describes a response with status code 200, with default header values. + +Retrieve a single authed provider +*/ +type UpdateAuthedProviderOK struct { + Payload *models.PublicAPIV1IntegrationsAuthedProviderEntity +} + +// IsSuccess returns true when this update authed provider o k response has a 2xx status code +func (o *UpdateAuthedProviderOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update authed provider o k response has a 3xx status code +func (o *UpdateAuthedProviderOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update authed provider o k response has a 4xx status code +func (o *UpdateAuthedProviderOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update authed provider o k response has a 5xx status code +func (o *UpdateAuthedProviderOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update authed provider o k response a status code equal to that given +func (o *UpdateAuthedProviderOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateAuthedProviderOK) Error() string { + return fmt.Sprintf("[PATCH /v1/integrations/authed_providers/{integration_slug}/{connection_id}/{authed_provider_id}][%d] updateAuthedProviderOK %+v", 200, o.Payload) +} + +func (o *UpdateAuthedProviderOK) String() string { + return fmt.Sprintf("[PATCH /v1/integrations/authed_providers/{integration_slug}/{connection_id}/{authed_provider_id}][%d] updateAuthedProviderOK %+v", 200, o.Payload) +} + +func (o *UpdateAuthedProviderOK) GetPayload() *models.PublicAPIV1IntegrationsAuthedProviderEntity { + return o.Payload +} + +func (o *UpdateAuthedProviderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PublicAPIV1IntegrationsAuthedProviderEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/update_aws_cloudtrail_batch_parameters.go b/client/integrations/update_aws_cloudtrail_batch_parameters.go new file mode 100644 index 0000000..bd0fd23 --- /dev/null +++ b/client/integrations/update_aws_cloudtrail_batch_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateAwsCloudtrailBatchParams creates a new UpdateAwsCloudtrailBatchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateAwsCloudtrailBatchParams() *UpdateAwsCloudtrailBatchParams { + return &UpdateAwsCloudtrailBatchParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateAwsCloudtrailBatchParamsWithTimeout creates a new UpdateAwsCloudtrailBatchParams object +// with the ability to set a timeout on a request. +func NewUpdateAwsCloudtrailBatchParamsWithTimeout(timeout time.Duration) *UpdateAwsCloudtrailBatchParams { + return &UpdateAwsCloudtrailBatchParams{ + timeout: timeout, + } +} + +// NewUpdateAwsCloudtrailBatchParamsWithContext creates a new UpdateAwsCloudtrailBatchParams object +// with the ability to set a context for a request. +func NewUpdateAwsCloudtrailBatchParamsWithContext(ctx context.Context) *UpdateAwsCloudtrailBatchParams { + return &UpdateAwsCloudtrailBatchParams{ + Context: ctx, + } +} + +// NewUpdateAwsCloudtrailBatchParamsWithHTTPClient creates a new UpdateAwsCloudtrailBatchParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateAwsCloudtrailBatchParamsWithHTTPClient(client *http.Client) *UpdateAwsCloudtrailBatchParams { + return &UpdateAwsCloudtrailBatchParams{ + HTTPClient: client, + } +} + +/* +UpdateAwsCloudtrailBatchParams contains all the parameters to send to the API endpoint + + for the update aws cloudtrail batch operation. + + Typically these are written to a http.Request. +*/ +type UpdateAwsCloudtrailBatchParams struct { + + // ID. + ID string + + // UpdateAwsCloudtrailBatch. + UpdateAwsCloudtrailBatch *models.UpdateAwsCloudtrailBatch + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update aws cloudtrail batch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAwsCloudtrailBatchParams) WithDefaults() *UpdateAwsCloudtrailBatchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update aws cloudtrail batch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAwsCloudtrailBatchParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update aws cloudtrail batch params +func (o *UpdateAwsCloudtrailBatchParams) WithTimeout(timeout time.Duration) *UpdateAwsCloudtrailBatchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update aws cloudtrail batch params +func (o *UpdateAwsCloudtrailBatchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update aws cloudtrail batch params +func (o *UpdateAwsCloudtrailBatchParams) WithContext(ctx context.Context) *UpdateAwsCloudtrailBatchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update aws cloudtrail batch params +func (o *UpdateAwsCloudtrailBatchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update aws cloudtrail batch params +func (o *UpdateAwsCloudtrailBatchParams) WithHTTPClient(client *http.Client) *UpdateAwsCloudtrailBatchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update aws cloudtrail batch params +func (o *UpdateAwsCloudtrailBatchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the update aws cloudtrail batch params +func (o *UpdateAwsCloudtrailBatchParams) WithID(id string) *UpdateAwsCloudtrailBatchParams { + o.SetID(id) + return o +} + +// SetID adds the id to the update aws cloudtrail batch params +func (o *UpdateAwsCloudtrailBatchParams) SetID(id string) { + o.ID = id +} + +// WithUpdateAwsCloudtrailBatch adds the updateAwsCloudtrailBatch to the update aws cloudtrail batch params +func (o *UpdateAwsCloudtrailBatchParams) WithUpdateAwsCloudtrailBatch(updateAwsCloudtrailBatch *models.UpdateAwsCloudtrailBatch) *UpdateAwsCloudtrailBatchParams { + o.SetUpdateAwsCloudtrailBatch(updateAwsCloudtrailBatch) + return o +} + +// SetUpdateAwsCloudtrailBatch adds the updateAwsCloudtrailBatch to the update aws cloudtrail batch params +func (o *UpdateAwsCloudtrailBatchParams) SetUpdateAwsCloudtrailBatch(updateAwsCloudtrailBatch *models.UpdateAwsCloudtrailBatch) { + o.UpdateAwsCloudtrailBatch = updateAwsCloudtrailBatch +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateAwsCloudtrailBatchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + if o.UpdateAwsCloudtrailBatch != nil { + if err := r.SetBodyParam(o.UpdateAwsCloudtrailBatch); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/update_aws_cloudtrail_batch_responses.go b/client/integrations/update_aws_cloudtrail_batch_responses.go new file mode 100644 index 0000000..e6b5711 --- /dev/null +++ b/client/integrations/update_aws_cloudtrail_batch_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateAwsCloudtrailBatchReader is a Reader for the UpdateAwsCloudtrailBatch structure. +type UpdateAwsCloudtrailBatchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateAwsCloudtrailBatchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateAwsCloudtrailBatchOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateAwsCloudtrailBatchOK creates a UpdateAwsCloudtrailBatchOK with default headers values +func NewUpdateAwsCloudtrailBatchOK() *UpdateAwsCloudtrailBatchOK { + return &UpdateAwsCloudtrailBatchOK{} +} + +/* +UpdateAwsCloudtrailBatchOK describes a response with status code 200, with default header values. + +Update a CloudTrail batch with new information. +*/ +type UpdateAwsCloudtrailBatchOK struct { + Payload *models.IntegrationsAwsCloudtrailBatchEntity +} + +// IsSuccess returns true when this update aws cloudtrail batch o k response has a 2xx status code +func (o *UpdateAwsCloudtrailBatchOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update aws cloudtrail batch o k response has a 3xx status code +func (o *UpdateAwsCloudtrailBatchOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update aws cloudtrail batch o k response has a 4xx status code +func (o *UpdateAwsCloudtrailBatchOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update aws cloudtrail batch o k response has a 5xx status code +func (o *UpdateAwsCloudtrailBatchOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update aws cloudtrail batch o k response a status code equal to that given +func (o *UpdateAwsCloudtrailBatchOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateAwsCloudtrailBatchOK) Error() string { + return fmt.Sprintf("[PATCH /v1/integrations/aws/cloudtrail_batches/{id}][%d] updateAwsCloudtrailBatchOK %+v", 200, o.Payload) +} + +func (o *UpdateAwsCloudtrailBatchOK) String() string { + return fmt.Sprintf("[PATCH /v1/integrations/aws/cloudtrail_batches/{id}][%d] updateAwsCloudtrailBatchOK %+v", 200, o.Payload) +} + +func (o *UpdateAwsCloudtrailBatchOK) GetPayload() *models.IntegrationsAwsCloudtrailBatchEntity { + return o.Payload +} + +func (o *UpdateAwsCloudtrailBatchOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsAwsCloudtrailBatchEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/update_aws_connection_parameters.go b/client/integrations/update_aws_connection_parameters.go new file mode 100644 index 0000000..644cd2f --- /dev/null +++ b/client/integrations/update_aws_connection_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateAwsConnectionParams creates a new UpdateAwsConnectionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateAwsConnectionParams() *UpdateAwsConnectionParams { + return &UpdateAwsConnectionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateAwsConnectionParamsWithTimeout creates a new UpdateAwsConnectionParams object +// with the ability to set a timeout on a request. +func NewUpdateAwsConnectionParamsWithTimeout(timeout time.Duration) *UpdateAwsConnectionParams { + return &UpdateAwsConnectionParams{ + timeout: timeout, + } +} + +// NewUpdateAwsConnectionParamsWithContext creates a new UpdateAwsConnectionParams object +// with the ability to set a context for a request. +func NewUpdateAwsConnectionParamsWithContext(ctx context.Context) *UpdateAwsConnectionParams { + return &UpdateAwsConnectionParams{ + Context: ctx, + } +} + +// NewUpdateAwsConnectionParamsWithHTTPClient creates a new UpdateAwsConnectionParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateAwsConnectionParamsWithHTTPClient(client *http.Client) *UpdateAwsConnectionParams { + return &UpdateAwsConnectionParams{ + HTTPClient: client, + } +} + +/* +UpdateAwsConnectionParams contains all the parameters to send to the API endpoint + + for the update aws connection operation. + + Typically these are written to a http.Request. +*/ +type UpdateAwsConnectionParams struct { + + // ID. + ID string + + // UpdateAwsConnection. + UpdateAwsConnection *models.UpdateAwsConnection + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update aws connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAwsConnectionParams) WithDefaults() *UpdateAwsConnectionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update aws connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAwsConnectionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update aws connection params +func (o *UpdateAwsConnectionParams) WithTimeout(timeout time.Duration) *UpdateAwsConnectionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update aws connection params +func (o *UpdateAwsConnectionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update aws connection params +func (o *UpdateAwsConnectionParams) WithContext(ctx context.Context) *UpdateAwsConnectionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update aws connection params +func (o *UpdateAwsConnectionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update aws connection params +func (o *UpdateAwsConnectionParams) WithHTTPClient(client *http.Client) *UpdateAwsConnectionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update aws connection params +func (o *UpdateAwsConnectionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the update aws connection params +func (o *UpdateAwsConnectionParams) WithID(id string) *UpdateAwsConnectionParams { + o.SetID(id) + return o +} + +// SetID adds the id to the update aws connection params +func (o *UpdateAwsConnectionParams) SetID(id string) { + o.ID = id +} + +// WithUpdateAwsConnection adds the updateAwsConnection to the update aws connection params +func (o *UpdateAwsConnectionParams) WithUpdateAwsConnection(updateAwsConnection *models.UpdateAwsConnection) *UpdateAwsConnectionParams { + o.SetUpdateAwsConnection(updateAwsConnection) + return o +} + +// SetUpdateAwsConnection adds the updateAwsConnection to the update aws connection params +func (o *UpdateAwsConnectionParams) SetUpdateAwsConnection(updateAwsConnection *models.UpdateAwsConnection) { + o.UpdateAwsConnection = updateAwsConnection +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateAwsConnectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + if o.UpdateAwsConnection != nil { + if err := r.SetBodyParam(o.UpdateAwsConnection); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/update_aws_connection_responses.go b/client/integrations/update_aws_connection_responses.go new file mode 100644 index 0000000..f9ddb84 --- /dev/null +++ b/client/integrations/update_aws_connection_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateAwsConnectionReader is a Reader for the UpdateAwsConnection structure. +type UpdateAwsConnectionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateAwsConnectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateAwsConnectionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateAwsConnectionOK creates a UpdateAwsConnectionOK with default headers values +func NewUpdateAwsConnectionOK() *UpdateAwsConnectionOK { + return &UpdateAwsConnectionOK{} +} + +/* +UpdateAwsConnectionOK describes a response with status code 200, with default header values. + +Update the AWS connection with the provided data. +*/ +type UpdateAwsConnectionOK struct { + Payload *models.IntegrationsAwsConnectionEntity +} + +// IsSuccess returns true when this update aws connection o k response has a 2xx status code +func (o *UpdateAwsConnectionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update aws connection o k response has a 3xx status code +func (o *UpdateAwsConnectionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update aws connection o k response has a 4xx status code +func (o *UpdateAwsConnectionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update aws connection o k response has a 5xx status code +func (o *UpdateAwsConnectionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update aws connection o k response a status code equal to that given +func (o *UpdateAwsConnectionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateAwsConnectionOK) Error() string { + return fmt.Sprintf("[PATCH /v1/integrations/aws/connections/{id}][%d] updateAwsConnectionOK %+v", 200, o.Payload) +} + +func (o *UpdateAwsConnectionOK) String() string { + return fmt.Sprintf("[PATCH /v1/integrations/aws/connections/{id}][%d] updateAwsConnectionOK %+v", 200, o.Payload) +} + +func (o *UpdateAwsConnectionOK) GetPayload() *models.IntegrationsAwsConnectionEntity { + return o.Payload +} + +func (o *UpdateAwsConnectionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsAwsConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/update_connection_parameters.go b/client/integrations/update_connection_parameters.go new file mode 100644 index 0000000..47b6090 --- /dev/null +++ b/client/integrations/update_connection_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateConnectionParams creates a new UpdateConnectionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateConnectionParams() *UpdateConnectionParams { + return &UpdateConnectionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateConnectionParamsWithTimeout creates a new UpdateConnectionParams object +// with the ability to set a timeout on a request. +func NewUpdateConnectionParamsWithTimeout(timeout time.Duration) *UpdateConnectionParams { + return &UpdateConnectionParams{ + timeout: timeout, + } +} + +// NewUpdateConnectionParamsWithContext creates a new UpdateConnectionParams object +// with the ability to set a context for a request. +func NewUpdateConnectionParamsWithContext(ctx context.Context) *UpdateConnectionParams { + return &UpdateConnectionParams{ + Context: ctx, + } +} + +// NewUpdateConnectionParamsWithHTTPClient creates a new UpdateConnectionParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateConnectionParamsWithHTTPClient(client *http.Client) *UpdateConnectionParams { + return &UpdateConnectionParams{ + HTTPClient: client, + } +} + +/* +UpdateConnectionParams contains all the parameters to send to the API endpoint + + for the update connection operation. + + Typically these are written to a http.Request. +*/ +type UpdateConnectionParams struct { + + // ConnectionID. + ConnectionID string + + // Slug. + Slug string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateConnectionParams) WithDefaults() *UpdateConnectionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateConnectionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update connection params +func (o *UpdateConnectionParams) WithTimeout(timeout time.Duration) *UpdateConnectionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update connection params +func (o *UpdateConnectionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update connection params +func (o *UpdateConnectionParams) WithContext(ctx context.Context) *UpdateConnectionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update connection params +func (o *UpdateConnectionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update connection params +func (o *UpdateConnectionParams) WithHTTPClient(client *http.Client) *UpdateConnectionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update connection params +func (o *UpdateConnectionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the update connection params +func (o *UpdateConnectionParams) WithConnectionID(connectionID string) *UpdateConnectionParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the update connection params +func (o *UpdateConnectionParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WithSlug adds the slug to the update connection params +func (o *UpdateConnectionParams) WithSlug(slug string) *UpdateConnectionParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the update connection params +func (o *UpdateConnectionParams) SetSlug(slug string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateConnectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + + // path param slug + if err := r.SetPathParam("slug", o.Slug); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/update_connection_responses.go b/client/integrations/update_connection_responses.go new file mode 100644 index 0000000..bf2b4dc --- /dev/null +++ b/client/integrations/update_connection_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateConnectionReader is a Reader for the UpdateConnection structure. +type UpdateConnectionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateConnectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateConnectionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateConnectionOK creates a UpdateConnectionOK with default headers values +func NewUpdateConnectionOK() *UpdateConnectionOK { + return &UpdateConnectionOK{} +} + +/* +UpdateConnectionOK describes a response with status code 200, with default header values. + +Update the integration connection with the provided data +*/ +type UpdateConnectionOK struct { + Payload *models.IntegrationsConnectionEntity +} + +// IsSuccess returns true when this update connection o k response has a 2xx status code +func (o *UpdateConnectionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update connection o k response has a 3xx status code +func (o *UpdateConnectionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update connection o k response has a 4xx status code +func (o *UpdateConnectionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update connection o k response has a 5xx status code +func (o *UpdateConnectionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update connection o k response a status code equal to that given +func (o *UpdateConnectionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateConnectionOK) Error() string { + return fmt.Sprintf("[PATCH /v1/integrations/connections/{slug}/{connection_id}][%d] updateConnectionOK %+v", 200, o.Payload) +} + +func (o *UpdateConnectionOK) String() string { + return fmt.Sprintf("[PATCH /v1/integrations/connections/{slug}/{connection_id}][%d] updateConnectionOK %+v", 200, o.Payload) +} + +func (o *UpdateConnectionOK) GetPayload() *models.IntegrationsConnectionEntity { + return o.Payload +} + +func (o *UpdateConnectionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/update_field_map_parameters.go b/client/integrations/update_field_map_parameters.go new file mode 100644 index 0000000..4be023f --- /dev/null +++ b/client/integrations/update_field_map_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateFieldMapParams creates a new UpdateFieldMapParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateFieldMapParams() *UpdateFieldMapParams { + return &UpdateFieldMapParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateFieldMapParamsWithTimeout creates a new UpdateFieldMapParams object +// with the ability to set a timeout on a request. +func NewUpdateFieldMapParamsWithTimeout(timeout time.Duration) *UpdateFieldMapParams { + return &UpdateFieldMapParams{ + timeout: timeout, + } +} + +// NewUpdateFieldMapParamsWithContext creates a new UpdateFieldMapParams object +// with the ability to set a context for a request. +func NewUpdateFieldMapParamsWithContext(ctx context.Context) *UpdateFieldMapParams { + return &UpdateFieldMapParams{ + Context: ctx, + } +} + +// NewUpdateFieldMapParamsWithHTTPClient creates a new UpdateFieldMapParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateFieldMapParamsWithHTTPClient(client *http.Client) *UpdateFieldMapParams { + return &UpdateFieldMapParams{ + HTTPClient: client, + } +} + +/* +UpdateFieldMapParams contains all the parameters to send to the API endpoint + + for the update field map operation. + + Typically these are written to a http.Request. +*/ +type UpdateFieldMapParams struct { + + // FieldMapID. + FieldMapID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateFieldMapParams) WithDefaults() *UpdateFieldMapParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateFieldMapParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update field map params +func (o *UpdateFieldMapParams) WithTimeout(timeout time.Duration) *UpdateFieldMapParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update field map params +func (o *UpdateFieldMapParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update field map params +func (o *UpdateFieldMapParams) WithContext(ctx context.Context) *UpdateFieldMapParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update field map params +func (o *UpdateFieldMapParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update field map params +func (o *UpdateFieldMapParams) WithHTTPClient(client *http.Client) *UpdateFieldMapParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update field map params +func (o *UpdateFieldMapParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFieldMapID adds the fieldMapID to the update field map params +func (o *UpdateFieldMapParams) WithFieldMapID(fieldMapID string) *UpdateFieldMapParams { + o.SetFieldMapID(fieldMapID) + return o +} + +// SetFieldMapID adds the fieldMapId to the update field map params +func (o *UpdateFieldMapParams) SetFieldMapID(fieldMapID string) { + o.FieldMapID = fieldMapID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateFieldMapParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param field_map_id + if err := r.SetPathParam("field_map_id", o.FieldMapID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/update_field_map_responses.go b/client/integrations/update_field_map_responses.go new file mode 100644 index 0000000..5f2b2fb --- /dev/null +++ b/client/integrations/update_field_map_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateFieldMapReader is a Reader for the UpdateFieldMap structure. +type UpdateFieldMapReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateFieldMapReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateFieldMapOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateFieldMapOK creates a UpdateFieldMapOK with default headers values +func NewUpdateFieldMapOK() *UpdateFieldMapOK { + return &UpdateFieldMapOK{} +} + +/* +UpdateFieldMapOK describes a response with status code 200, with default header values. + +Update field mapping +*/ +type UpdateFieldMapOK struct { + Payload *models.FieldMappingFieldMapEntity +} + +// IsSuccess returns true when this update field map o k response has a 2xx status code +func (o *UpdateFieldMapOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update field map o k response has a 3xx status code +func (o *UpdateFieldMapOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update field map o k response has a 4xx status code +func (o *UpdateFieldMapOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update field map o k response has a 5xx status code +func (o *UpdateFieldMapOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update field map o k response a status code equal to that given +func (o *UpdateFieldMapOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateFieldMapOK) Error() string { + return fmt.Sprintf("[PATCH /v1/integrations/field_maps/{field_map_id}][%d] updateFieldMapOK %+v", 200, o.Payload) +} + +func (o *UpdateFieldMapOK) String() string { + return fmt.Sprintf("[PATCH /v1/integrations/field_maps/{field_map_id}][%d] updateFieldMapOK %+v", 200, o.Payload) +} + +func (o *UpdateFieldMapOK) GetPayload() *models.FieldMappingFieldMapEntity { + return o.Payload +} + +func (o *UpdateFieldMapOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FieldMappingFieldMapEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/integrations/update_slack_emoji_action_parameters.go b/client/integrations/update_slack_emoji_action_parameters.go new file mode 100644 index 0000000..2908abc --- /dev/null +++ b/client/integrations/update_slack_emoji_action_parameters.go @@ -0,0 +1,234 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateSlackEmojiActionParams creates a new UpdateSlackEmojiActionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateSlackEmojiActionParams() *UpdateSlackEmojiActionParams { + return &UpdateSlackEmojiActionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateSlackEmojiActionParamsWithTimeout creates a new UpdateSlackEmojiActionParams object +// with the ability to set a timeout on a request. +func NewUpdateSlackEmojiActionParamsWithTimeout(timeout time.Duration) *UpdateSlackEmojiActionParams { + return &UpdateSlackEmojiActionParams{ + timeout: timeout, + } +} + +// NewUpdateSlackEmojiActionParamsWithContext creates a new UpdateSlackEmojiActionParams object +// with the ability to set a context for a request. +func NewUpdateSlackEmojiActionParamsWithContext(ctx context.Context) *UpdateSlackEmojiActionParams { + return &UpdateSlackEmojiActionParams{ + Context: ctx, + } +} + +// NewUpdateSlackEmojiActionParamsWithHTTPClient creates a new UpdateSlackEmojiActionParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateSlackEmojiActionParamsWithHTTPClient(client *http.Client) *UpdateSlackEmojiActionParams { + return &UpdateSlackEmojiActionParams{ + HTTPClient: client, + } +} + +/* +UpdateSlackEmojiActionParams contains all the parameters to send to the API endpoint + + for the update slack emoji action operation. + + Typically these are written to a http.Request. +*/ +type UpdateSlackEmojiActionParams struct { + + /* ConnectionID. + + Slack Connection UUID + */ + ConnectionID string + + // EmojiActionID. + EmojiActionID string + + /* EmojiName. + + The name of the emoji to associate with this action + */ + EmojiName *string + + /* IncidentTypeID. + + The ID of the incident type to associate with this emoji action + */ + IncidentTypeID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update slack emoji action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSlackEmojiActionParams) WithDefaults() *UpdateSlackEmojiActionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update slack emoji action params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSlackEmojiActionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update slack emoji action params +func (o *UpdateSlackEmojiActionParams) WithTimeout(timeout time.Duration) *UpdateSlackEmojiActionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update slack emoji action params +func (o *UpdateSlackEmojiActionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update slack emoji action params +func (o *UpdateSlackEmojiActionParams) WithContext(ctx context.Context) *UpdateSlackEmojiActionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update slack emoji action params +func (o *UpdateSlackEmojiActionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update slack emoji action params +func (o *UpdateSlackEmojiActionParams) WithHTTPClient(client *http.Client) *UpdateSlackEmojiActionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update slack emoji action params +func (o *UpdateSlackEmojiActionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the update slack emoji action params +func (o *UpdateSlackEmojiActionParams) WithConnectionID(connectionID string) *UpdateSlackEmojiActionParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the update slack emoji action params +func (o *UpdateSlackEmojiActionParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WithEmojiActionID adds the emojiActionID to the update slack emoji action params +func (o *UpdateSlackEmojiActionParams) WithEmojiActionID(emojiActionID string) *UpdateSlackEmojiActionParams { + o.SetEmojiActionID(emojiActionID) + return o +} + +// SetEmojiActionID adds the emojiActionId to the update slack emoji action params +func (o *UpdateSlackEmojiActionParams) SetEmojiActionID(emojiActionID string) { + o.EmojiActionID = emojiActionID +} + +// WithEmojiName adds the emojiName to the update slack emoji action params +func (o *UpdateSlackEmojiActionParams) WithEmojiName(emojiName *string) *UpdateSlackEmojiActionParams { + o.SetEmojiName(emojiName) + return o +} + +// SetEmojiName adds the emojiName to the update slack emoji action params +func (o *UpdateSlackEmojiActionParams) SetEmojiName(emojiName *string) { + o.EmojiName = emojiName +} + +// WithIncidentTypeID adds the incidentTypeID to the update slack emoji action params +func (o *UpdateSlackEmojiActionParams) WithIncidentTypeID(incidentTypeID *string) *UpdateSlackEmojiActionParams { + o.SetIncidentTypeID(incidentTypeID) + return o +} + +// SetIncidentTypeID adds the incidentTypeId to the update slack emoji action params +func (o *UpdateSlackEmojiActionParams) SetIncidentTypeID(incidentTypeID *string) { + o.IncidentTypeID = incidentTypeID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateSlackEmojiActionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + + // path param emoji_action_id + if err := r.SetPathParam("emoji_action_id", o.EmojiActionID); err != nil { + return err + } + + if o.EmojiName != nil { + + // form param emoji_name + var frEmojiName string + if o.EmojiName != nil { + frEmojiName = *o.EmojiName + } + fEmojiName := frEmojiName + if fEmojiName != "" { + if err := r.SetFormParam("emoji_name", fEmojiName); err != nil { + return err + } + } + } + + if o.IncidentTypeID != nil { + + // form param incident_type_id + var frIncidentTypeID string + if o.IncidentTypeID != nil { + frIncidentTypeID = *o.IncidentTypeID + } + fIncidentTypeID := frIncidentTypeID + if fIncidentTypeID != "" { + if err := r.SetFormParam("incident_type_id", fIncidentTypeID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/update_slack_emoji_action_responses.go b/client/integrations/update_slack_emoji_action_responses.go new file mode 100644 index 0000000..7e74486 --- /dev/null +++ b/client/integrations/update_slack_emoji_action_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateSlackEmojiActionReader is a Reader for the UpdateSlackEmojiAction structure. +type UpdateSlackEmojiActionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateSlackEmojiActionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateSlackEmojiActionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateSlackEmojiActionOK creates a UpdateSlackEmojiActionOK with default headers values +func NewUpdateSlackEmojiActionOK() *UpdateSlackEmojiActionOK { + return &UpdateSlackEmojiActionOK{} +} + +/* +UpdateSlackEmojiActionOK describes a response with status code 200, with default header values. + +Updates a Slack emoji action +*/ +type UpdateSlackEmojiActionOK struct { +} + +// IsSuccess returns true when this update slack emoji action o k response has a 2xx status code +func (o *UpdateSlackEmojiActionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update slack emoji action o k response has a 3xx status code +func (o *UpdateSlackEmojiActionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update slack emoji action o k response has a 4xx status code +func (o *UpdateSlackEmojiActionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update slack emoji action o k response has a 5xx status code +func (o *UpdateSlackEmojiActionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update slack emoji action o k response a status code equal to that given +func (o *UpdateSlackEmojiActionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateSlackEmojiActionOK) Error() string { + return fmt.Sprintf("[PATCH /v1/integrations/slack/connections/{connection_id}/emoji_actions/{emoji_action_id}][%d] updateSlackEmojiActionOK ", 200) +} + +func (o *UpdateSlackEmojiActionOK) String() string { + return fmt.Sprintf("[PATCH /v1/integrations/slack/connections/{connection_id}/emoji_actions/{emoji_action_id}][%d] updateSlackEmojiActionOK ", 200) +} + +func (o *UpdateSlackEmojiActionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/integrations/update_statuspage_connection_parameters.go b/client/integrations/update_statuspage_connection_parameters.go new file mode 100644 index 0000000..5ebc4cd --- /dev/null +++ b/client/integrations/update_statuspage_connection_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateStatuspageConnectionParams creates a new UpdateStatuspageConnectionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateStatuspageConnectionParams() *UpdateStatuspageConnectionParams { + return &UpdateStatuspageConnectionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateStatuspageConnectionParamsWithTimeout creates a new UpdateStatuspageConnectionParams object +// with the ability to set a timeout on a request. +func NewUpdateStatuspageConnectionParamsWithTimeout(timeout time.Duration) *UpdateStatuspageConnectionParams { + return &UpdateStatuspageConnectionParams{ + timeout: timeout, + } +} + +// NewUpdateStatuspageConnectionParamsWithContext creates a new UpdateStatuspageConnectionParams object +// with the ability to set a context for a request. +func NewUpdateStatuspageConnectionParamsWithContext(ctx context.Context) *UpdateStatuspageConnectionParams { + return &UpdateStatuspageConnectionParams{ + Context: ctx, + } +} + +// NewUpdateStatuspageConnectionParamsWithHTTPClient creates a new UpdateStatuspageConnectionParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateStatuspageConnectionParamsWithHTTPClient(client *http.Client) *UpdateStatuspageConnectionParams { + return &UpdateStatuspageConnectionParams{ + HTTPClient: client, + } +} + +/* +UpdateStatuspageConnectionParams contains all the parameters to send to the API endpoint + + for the update statuspage connection operation. + + Typically these are written to a http.Request. +*/ +type UpdateStatuspageConnectionParams struct { + + /* ConnectionID. + + Connection UUID + */ + ConnectionID string + + // UpdateStatuspageConnection. + UpdateStatuspageConnection *models.UpdateStatuspageConnection + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update statuspage connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateStatuspageConnectionParams) WithDefaults() *UpdateStatuspageConnectionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update statuspage connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateStatuspageConnectionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update statuspage connection params +func (o *UpdateStatuspageConnectionParams) WithTimeout(timeout time.Duration) *UpdateStatuspageConnectionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update statuspage connection params +func (o *UpdateStatuspageConnectionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update statuspage connection params +func (o *UpdateStatuspageConnectionParams) WithContext(ctx context.Context) *UpdateStatuspageConnectionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update statuspage connection params +func (o *UpdateStatuspageConnectionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update statuspage connection params +func (o *UpdateStatuspageConnectionParams) WithHTTPClient(client *http.Client) *UpdateStatuspageConnectionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update statuspage connection params +func (o *UpdateStatuspageConnectionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionID adds the connectionID to the update statuspage connection params +func (o *UpdateStatuspageConnectionParams) WithConnectionID(connectionID string) *UpdateStatuspageConnectionParams { + o.SetConnectionID(connectionID) + return o +} + +// SetConnectionID adds the connectionId to the update statuspage connection params +func (o *UpdateStatuspageConnectionParams) SetConnectionID(connectionID string) { + o.ConnectionID = connectionID +} + +// WithUpdateStatuspageConnection adds the updateStatuspageConnection to the update statuspage connection params +func (o *UpdateStatuspageConnectionParams) WithUpdateStatuspageConnection(updateStatuspageConnection *models.UpdateStatuspageConnection) *UpdateStatuspageConnectionParams { + o.SetUpdateStatuspageConnection(updateStatuspageConnection) + return o +} + +// SetUpdateStatuspageConnection adds the updateStatuspageConnection to the update statuspage connection params +func (o *UpdateStatuspageConnectionParams) SetUpdateStatuspageConnection(updateStatuspageConnection *models.UpdateStatuspageConnection) { + o.UpdateStatuspageConnection = updateStatuspageConnection +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateStatuspageConnectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param connection_id + if err := r.SetPathParam("connection_id", o.ConnectionID); err != nil { + return err + } + if o.UpdateStatuspageConnection != nil { + if err := r.SetBodyParam(o.UpdateStatuspageConnection); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/integrations/update_statuspage_connection_responses.go b/client/integrations/update_statuspage_connection_responses.go new file mode 100644 index 0000000..4253cc4 --- /dev/null +++ b/client/integrations/update_statuspage_connection_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package integrations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateStatuspageConnectionReader is a Reader for the UpdateStatuspageConnection structure. +type UpdateStatuspageConnectionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateStatuspageConnectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateStatuspageConnectionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateStatuspageConnectionOK creates a UpdateStatuspageConnectionOK with default headers values +func NewUpdateStatuspageConnectionOK() *UpdateStatuspageConnectionOK { + return &UpdateStatuspageConnectionOK{} +} + +/* +UpdateStatuspageConnectionOK describes a response with status code 200, with default header values. + +Update the given Statuspage integration connection. +*/ +type UpdateStatuspageConnectionOK struct { + Payload *models.IntegrationsStatuspageConnectionEntity +} + +// IsSuccess returns true when this update statuspage connection o k response has a 2xx status code +func (o *UpdateStatuspageConnectionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update statuspage connection o k response has a 3xx status code +func (o *UpdateStatuspageConnectionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update statuspage connection o k response has a 4xx status code +func (o *UpdateStatuspageConnectionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update statuspage connection o k response has a 5xx status code +func (o *UpdateStatuspageConnectionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update statuspage connection o k response a status code equal to that given +func (o *UpdateStatuspageConnectionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateStatuspageConnectionOK) Error() string { + return fmt.Sprintf("[PATCH /v1/integrations/statuspage/connections/{connection_id}][%d] updateStatuspageConnectionOK %+v", 200, o.Payload) +} + +func (o *UpdateStatuspageConnectionOK) String() string { + return fmt.Sprintf("[PATCH /v1/integrations/statuspage/connections/{connection_id}][%d] updateStatuspageConnectionOK %+v", 200, o.Payload) +} + +func (o *UpdateStatuspageConnectionOK) GetPayload() *models.IntegrationsStatuspageConnectionEntity { + return o.Payload +} + +func (o *UpdateStatuspageConnectionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IntegrationsStatuspageConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/reporting/create_saved_search_parameters.go b/client/reporting/create_saved_search_parameters.go new file mode 100644 index 0000000..ea9dc5f --- /dev/null +++ b/client/reporting/create_saved_search_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateSavedSearchParams creates a new CreateSavedSearchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateSavedSearchParams() *CreateSavedSearchParams { + return &CreateSavedSearchParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateSavedSearchParamsWithTimeout creates a new CreateSavedSearchParams object +// with the ability to set a timeout on a request. +func NewCreateSavedSearchParamsWithTimeout(timeout time.Duration) *CreateSavedSearchParams { + return &CreateSavedSearchParams{ + timeout: timeout, + } +} + +// NewCreateSavedSearchParamsWithContext creates a new CreateSavedSearchParams object +// with the ability to set a context for a request. +func NewCreateSavedSearchParamsWithContext(ctx context.Context) *CreateSavedSearchParams { + return &CreateSavedSearchParams{ + Context: ctx, + } +} + +// NewCreateSavedSearchParamsWithHTTPClient creates a new CreateSavedSearchParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateSavedSearchParamsWithHTTPClient(client *http.Client) *CreateSavedSearchParams { + return &CreateSavedSearchParams{ + HTTPClient: client, + } +} + +/* +CreateSavedSearchParams contains all the parameters to send to the API endpoint + + for the create saved search operation. + + Typically these are written to a http.Request. +*/ +type CreateSavedSearchParams struct { + + // CreateSavedSearch. + CreateSavedSearch *models.CreateSavedSearch + + // ResourceType. + ResourceType string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create saved search params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSavedSearchParams) WithDefaults() *CreateSavedSearchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create saved search params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSavedSearchParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create saved search params +func (o *CreateSavedSearchParams) WithTimeout(timeout time.Duration) *CreateSavedSearchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create saved search params +func (o *CreateSavedSearchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create saved search params +func (o *CreateSavedSearchParams) WithContext(ctx context.Context) *CreateSavedSearchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create saved search params +func (o *CreateSavedSearchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create saved search params +func (o *CreateSavedSearchParams) WithHTTPClient(client *http.Client) *CreateSavedSearchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create saved search params +func (o *CreateSavedSearchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateSavedSearch adds the createSavedSearch to the create saved search params +func (o *CreateSavedSearchParams) WithCreateSavedSearch(createSavedSearch *models.CreateSavedSearch) *CreateSavedSearchParams { + o.SetCreateSavedSearch(createSavedSearch) + return o +} + +// SetCreateSavedSearch adds the createSavedSearch to the create saved search params +func (o *CreateSavedSearchParams) SetCreateSavedSearch(createSavedSearch *models.CreateSavedSearch) { + o.CreateSavedSearch = createSavedSearch +} + +// WithResourceType adds the resourceType to the create saved search params +func (o *CreateSavedSearchParams) WithResourceType(resourceType string) *CreateSavedSearchParams { + o.SetResourceType(resourceType) + return o +} + +// SetResourceType adds the resourceType to the create saved search params +func (o *CreateSavedSearchParams) SetResourceType(resourceType string) { + o.ResourceType = resourceType +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateSavedSearchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateSavedSearch != nil { + if err := r.SetBodyParam(o.CreateSavedSearch); err != nil { + return err + } + } + + // path param resource_type + if err := r.SetPathParam("resource_type", o.ResourceType); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/reporting/create_saved_search_responses.go b/client/reporting/create_saved_search_responses.go new file mode 100644 index 0000000..5554c5a --- /dev/null +++ b/client/reporting/create_saved_search_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateSavedSearchReader is a Reader for the CreateSavedSearch structure. +type CreateSavedSearchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateSavedSearchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateSavedSearchCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateSavedSearchCreated creates a CreateSavedSearchCreated with default headers values +func NewCreateSavedSearchCreated() *CreateSavedSearchCreated { + return &CreateSavedSearchCreated{} +} + +/* +CreateSavedSearchCreated describes a response with status code 201, with default header values. + +Create a new saved search for a particular resource type +*/ +type CreateSavedSearchCreated struct { + Payload *models.SavedSearchEntity +} + +// IsSuccess returns true when this create saved search created response has a 2xx status code +func (o *CreateSavedSearchCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create saved search created response has a 3xx status code +func (o *CreateSavedSearchCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create saved search created response has a 4xx status code +func (o *CreateSavedSearchCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create saved search created response has a 5xx status code +func (o *CreateSavedSearchCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create saved search created response a status code equal to that given +func (o *CreateSavedSearchCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateSavedSearchCreated) Error() string { + return fmt.Sprintf("[POST /v1/saved_searches/{resource_type}][%d] createSavedSearchCreated %+v", 201, o.Payload) +} + +func (o *CreateSavedSearchCreated) String() string { + return fmt.Sprintf("[POST /v1/saved_searches/{resource_type}][%d] createSavedSearchCreated %+v", 201, o.Payload) +} + +func (o *CreateSavedSearchCreated) GetPayload() *models.SavedSearchEntity { + return o.Payload +} + +func (o *CreateSavedSearchCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SavedSearchEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/reporting/delete_saved_search_parameters.go b/client/reporting/delete_saved_search_parameters.go new file mode 100644 index 0000000..687d052 --- /dev/null +++ b/client/reporting/delete_saved_search_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteSavedSearchParams creates a new DeleteSavedSearchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteSavedSearchParams() *DeleteSavedSearchParams { + return &DeleteSavedSearchParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSavedSearchParamsWithTimeout creates a new DeleteSavedSearchParams object +// with the ability to set a timeout on a request. +func NewDeleteSavedSearchParamsWithTimeout(timeout time.Duration) *DeleteSavedSearchParams { + return &DeleteSavedSearchParams{ + timeout: timeout, + } +} + +// NewDeleteSavedSearchParamsWithContext creates a new DeleteSavedSearchParams object +// with the ability to set a context for a request. +func NewDeleteSavedSearchParamsWithContext(ctx context.Context) *DeleteSavedSearchParams { + return &DeleteSavedSearchParams{ + Context: ctx, + } +} + +// NewDeleteSavedSearchParamsWithHTTPClient creates a new DeleteSavedSearchParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteSavedSearchParamsWithHTTPClient(client *http.Client) *DeleteSavedSearchParams { + return &DeleteSavedSearchParams{ + HTTPClient: client, + } +} + +/* +DeleteSavedSearchParams contains all the parameters to send to the API endpoint + + for the delete saved search operation. + + Typically these are written to a http.Request. +*/ +type DeleteSavedSearchParams struct { + + // ResourceType. + ResourceType string + + // SavedSearchID. + SavedSearchID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete saved search params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSavedSearchParams) WithDefaults() *DeleteSavedSearchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete saved search params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSavedSearchParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete saved search params +func (o *DeleteSavedSearchParams) WithTimeout(timeout time.Duration) *DeleteSavedSearchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete saved search params +func (o *DeleteSavedSearchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete saved search params +func (o *DeleteSavedSearchParams) WithContext(ctx context.Context) *DeleteSavedSearchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete saved search params +func (o *DeleteSavedSearchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete saved search params +func (o *DeleteSavedSearchParams) WithHTTPClient(client *http.Client) *DeleteSavedSearchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete saved search params +func (o *DeleteSavedSearchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithResourceType adds the resourceType to the delete saved search params +func (o *DeleteSavedSearchParams) WithResourceType(resourceType string) *DeleteSavedSearchParams { + o.SetResourceType(resourceType) + return o +} + +// SetResourceType adds the resourceType to the delete saved search params +func (o *DeleteSavedSearchParams) SetResourceType(resourceType string) { + o.ResourceType = resourceType +} + +// WithSavedSearchID adds the savedSearchID to the delete saved search params +func (o *DeleteSavedSearchParams) WithSavedSearchID(savedSearchID string) *DeleteSavedSearchParams { + o.SetSavedSearchID(savedSearchID) + return o +} + +// SetSavedSearchID adds the savedSearchId to the delete saved search params +func (o *DeleteSavedSearchParams) SetSavedSearchID(savedSearchID string) { + o.SavedSearchID = savedSearchID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSavedSearchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param resource_type + if err := r.SetPathParam("resource_type", o.ResourceType); err != nil { + return err + } + + // path param saved_search_id + if err := r.SetPathParam("saved_search_id", o.SavedSearchID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/reporting/delete_saved_search_responses.go b/client/reporting/delete_saved_search_responses.go new file mode 100644 index 0000000..1cfa2c1 --- /dev/null +++ b/client/reporting/delete_saved_search_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteSavedSearchReader is a Reader for the DeleteSavedSearch structure. +type DeleteSavedSearchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSavedSearchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteSavedSearchOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteSavedSearchOK creates a DeleteSavedSearchOK with default headers values +func NewDeleteSavedSearchOK() *DeleteSavedSearchOK { + return &DeleteSavedSearchOK{} +} + +/* +DeleteSavedSearchOK describes a response with status code 200, with default header values. + +Delete a specific saved search +*/ +type DeleteSavedSearchOK struct { + Payload *models.SavedSearchEntity +} + +// IsSuccess returns true when this delete saved search o k response has a 2xx status code +func (o *DeleteSavedSearchOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete saved search o k response has a 3xx status code +func (o *DeleteSavedSearchOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete saved search o k response has a 4xx status code +func (o *DeleteSavedSearchOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete saved search o k response has a 5xx status code +func (o *DeleteSavedSearchOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete saved search o k response a status code equal to that given +func (o *DeleteSavedSearchOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteSavedSearchOK) Error() string { + return fmt.Sprintf("[DELETE /v1/saved_searches/{resource_type}/{saved_search_id}][%d] deleteSavedSearchOK %+v", 200, o.Payload) +} + +func (o *DeleteSavedSearchOK) String() string { + return fmt.Sprintf("[DELETE /v1/saved_searches/{resource_type}/{saved_search_id}][%d] deleteSavedSearchOK %+v", 200, o.Payload) +} + +func (o *DeleteSavedSearchOK) GetPayload() *models.SavedSearchEntity { + return o.Payload +} + +func (o *DeleteSavedSearchOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SavedSearchEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/reporting/export_signals_shift_analytics_parameters.go b/client/reporting/export_signals_shift_analytics_parameters.go new file mode 100644 index 0000000..1571e69 --- /dev/null +++ b/client/reporting/export_signals_shift_analytics_parameters.go @@ -0,0 +1,278 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewExportSignalsShiftAnalyticsParams creates a new ExportSignalsShiftAnalyticsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewExportSignalsShiftAnalyticsParams() *ExportSignalsShiftAnalyticsParams { + return &ExportSignalsShiftAnalyticsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewExportSignalsShiftAnalyticsParamsWithTimeout creates a new ExportSignalsShiftAnalyticsParams object +// with the ability to set a timeout on a request. +func NewExportSignalsShiftAnalyticsParamsWithTimeout(timeout time.Duration) *ExportSignalsShiftAnalyticsParams { + return &ExportSignalsShiftAnalyticsParams{ + timeout: timeout, + } +} + +// NewExportSignalsShiftAnalyticsParamsWithContext creates a new ExportSignalsShiftAnalyticsParams object +// with the ability to set a context for a request. +func NewExportSignalsShiftAnalyticsParamsWithContext(ctx context.Context) *ExportSignalsShiftAnalyticsParams { + return &ExportSignalsShiftAnalyticsParams{ + Context: ctx, + } +} + +// NewExportSignalsShiftAnalyticsParamsWithHTTPClient creates a new ExportSignalsShiftAnalyticsParams object +// with the ability to set a custom HTTPClient for a request. +func NewExportSignalsShiftAnalyticsParamsWithHTTPClient(client *http.Client) *ExportSignalsShiftAnalyticsParams { + return &ExportSignalsShiftAnalyticsParams{ + HTTPClient: client, + } +} + +/* +ExportSignalsShiftAnalyticsParams contains all the parameters to send to the API endpoint + + for the export signals shift analytics operation. + + Typically these are written to a http.Request. +*/ +type ExportSignalsShiftAnalyticsParams struct { + + /* PeriodEnd. + + End of the period to fetch hours for (UTC) + + Format: date-time + */ + PeriodEnd strfmt.DateTime + + /* PeriodStart. + + Start of the period to fetch hours for (UTC) + + Format: date-time + */ + PeriodStart strfmt.DateTime + + /* TeamIds. + + Array of team IDs to fetch oncall hours for + */ + TeamIds []string + + /* UserIds. + + Array of user IDs to fetch oncall hours for + */ + UserIds []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the export signals shift analytics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ExportSignalsShiftAnalyticsParams) WithDefaults() *ExportSignalsShiftAnalyticsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the export signals shift analytics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ExportSignalsShiftAnalyticsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the export signals shift analytics params +func (o *ExportSignalsShiftAnalyticsParams) WithTimeout(timeout time.Duration) *ExportSignalsShiftAnalyticsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the export signals shift analytics params +func (o *ExportSignalsShiftAnalyticsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the export signals shift analytics params +func (o *ExportSignalsShiftAnalyticsParams) WithContext(ctx context.Context) *ExportSignalsShiftAnalyticsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the export signals shift analytics params +func (o *ExportSignalsShiftAnalyticsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the export signals shift analytics params +func (o *ExportSignalsShiftAnalyticsParams) WithHTTPClient(client *http.Client) *ExportSignalsShiftAnalyticsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the export signals shift analytics params +func (o *ExportSignalsShiftAnalyticsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPeriodEnd adds the periodEnd to the export signals shift analytics params +func (o *ExportSignalsShiftAnalyticsParams) WithPeriodEnd(periodEnd strfmt.DateTime) *ExportSignalsShiftAnalyticsParams { + o.SetPeriodEnd(periodEnd) + return o +} + +// SetPeriodEnd adds the periodEnd to the export signals shift analytics params +func (o *ExportSignalsShiftAnalyticsParams) SetPeriodEnd(periodEnd strfmt.DateTime) { + o.PeriodEnd = periodEnd +} + +// WithPeriodStart adds the periodStart to the export signals shift analytics params +func (o *ExportSignalsShiftAnalyticsParams) WithPeriodStart(periodStart strfmt.DateTime) *ExportSignalsShiftAnalyticsParams { + o.SetPeriodStart(periodStart) + return o +} + +// SetPeriodStart adds the periodStart to the export signals shift analytics params +func (o *ExportSignalsShiftAnalyticsParams) SetPeriodStart(periodStart strfmt.DateTime) { + o.PeriodStart = periodStart +} + +// WithTeamIds adds the teamIds to the export signals shift analytics params +func (o *ExportSignalsShiftAnalyticsParams) WithTeamIds(teamIds []string) *ExportSignalsShiftAnalyticsParams { + o.SetTeamIds(teamIds) + return o +} + +// SetTeamIds adds the teamIds to the export signals shift analytics params +func (o *ExportSignalsShiftAnalyticsParams) SetTeamIds(teamIds []string) { + o.TeamIds = teamIds +} + +// WithUserIds adds the userIds to the export signals shift analytics params +func (o *ExportSignalsShiftAnalyticsParams) WithUserIds(userIds []string) *ExportSignalsShiftAnalyticsParams { + o.SetUserIds(userIds) + return o +} + +// SetUserIds adds the userIds to the export signals shift analytics params +func (o *ExportSignalsShiftAnalyticsParams) SetUserIds(userIds []string) { + o.UserIds = userIds +} + +// WriteToRequest writes these params to a swagger request +func (o *ExportSignalsShiftAnalyticsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param period_end + qrPeriodEnd := o.PeriodEnd + qPeriodEnd := qrPeriodEnd.String() + if qPeriodEnd != "" { + + if err := r.SetQueryParam("period_end", qPeriodEnd); err != nil { + return err + } + } + + // query param period_start + qrPeriodStart := o.PeriodStart + qPeriodStart := qrPeriodStart.String() + if qPeriodStart != "" { + + if err := r.SetQueryParam("period_start", qPeriodStart); err != nil { + return err + } + } + + if o.TeamIds != nil { + + // binding items for team_ids + joinedTeamIds := o.bindParamTeamIds(reg) + + // form array param team_ids + if err := r.SetFormParam("team_ids", joinedTeamIds...); err != nil { + return err + } + } + + if o.UserIds != nil { + + // binding items for user_ids + joinedUserIds := o.bindParamUserIds(reg) + + // form array param user_ids + if err := r.SetFormParam("user_ids", joinedUserIds...); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamExportSignalsShiftAnalytics binds the parameter team_ids +func (o *ExportSignalsShiftAnalyticsParams) bindParamTeamIds(formats strfmt.Registry) []string { + teamIdsIR := o.TeamIds + + var teamIdsIC []string + for _, teamIdsIIR := range teamIdsIR { // explode []string + + teamIdsIIV := teamIdsIIR // string as string + teamIdsIC = append(teamIdsIC, teamIdsIIV) + } + + // items.CollectionFormat: "" + teamIdsIS := swag.JoinByFormat(teamIdsIC, "") + + return teamIdsIS +} + +// bindParamExportSignalsShiftAnalytics binds the parameter user_ids +func (o *ExportSignalsShiftAnalyticsParams) bindParamUserIds(formats strfmt.Registry) []string { + userIdsIR := o.UserIds + + var userIdsIC []string + for _, userIdsIIR := range userIdsIR { // explode []string + + userIdsIIV := userIdsIIR // string as string + userIdsIC = append(userIdsIC, userIdsIIV) + } + + // items.CollectionFormat: "" + userIdsIS := swag.JoinByFormat(userIdsIC, "") + + return userIdsIS +} diff --git a/client/reporting/export_signals_shift_analytics_responses.go b/client/reporting/export_signals_shift_analytics_responses.go new file mode 100644 index 0000000..bd58bc2 --- /dev/null +++ b/client/reporting/export_signals_shift_analytics_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ExportSignalsShiftAnalyticsReader is a Reader for the ExportSignalsShiftAnalytics structure. +type ExportSignalsShiftAnalyticsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExportSignalsShiftAnalyticsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewExportSignalsShiftAnalyticsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewExportSignalsShiftAnalyticsOK creates a ExportSignalsShiftAnalyticsOK with default headers values +func NewExportSignalsShiftAnalyticsOK() *ExportSignalsShiftAnalyticsOK { + return &ExportSignalsShiftAnalyticsOK{} +} + +/* +ExportSignalsShiftAnalyticsOK describes a response with status code 200, with default header values. + +Export on-call hours report for users/teams during a time period +*/ +type ExportSignalsShiftAnalyticsOK struct { +} + +// IsSuccess returns true when this export signals shift analytics o k response has a 2xx status code +func (o *ExportSignalsShiftAnalyticsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this export signals shift analytics o k response has a 3xx status code +func (o *ExportSignalsShiftAnalyticsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this export signals shift analytics o k response has a 4xx status code +func (o *ExportSignalsShiftAnalyticsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this export signals shift analytics o k response has a 5xx status code +func (o *ExportSignalsShiftAnalyticsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this export signals shift analytics o k response a status code equal to that given +func (o *ExportSignalsShiftAnalyticsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ExportSignalsShiftAnalyticsOK) Error() string { + return fmt.Sprintf("[GET /v1/signals/analytics/shifts/export][%d] exportSignalsShiftAnalyticsOK ", 200) +} + +func (o *ExportSignalsShiftAnalyticsOK) String() string { + return fmt.Sprintf("[GET /v1/signals/analytics/shifts/export][%d] exportSignalsShiftAnalyticsOK ", 200) +} + +func (o *ExportSignalsShiftAnalyticsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/reporting/get_mean_time_report_parameters.go b/client/reporting/get_mean_time_report_parameters.go new file mode 100644 index 0000000..449f3fd --- /dev/null +++ b/client/reporting/get_mean_time_report_parameters.go @@ -0,0 +1,576 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetMeanTimeReportParams creates a new GetMeanTimeReportParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetMeanTimeReportParams() *GetMeanTimeReportParams { + return &GetMeanTimeReportParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetMeanTimeReportParamsWithTimeout creates a new GetMeanTimeReportParams object +// with the ability to set a timeout on a request. +func NewGetMeanTimeReportParamsWithTimeout(timeout time.Duration) *GetMeanTimeReportParams { + return &GetMeanTimeReportParams{ + timeout: timeout, + } +} + +// NewGetMeanTimeReportParamsWithContext creates a new GetMeanTimeReportParams object +// with the ability to set a context for a request. +func NewGetMeanTimeReportParamsWithContext(ctx context.Context) *GetMeanTimeReportParams { + return &GetMeanTimeReportParams{ + Context: ctx, + } +} + +// NewGetMeanTimeReportParamsWithHTTPClient creates a new GetMeanTimeReportParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetMeanTimeReportParamsWithHTTPClient(client *http.Client) *GetMeanTimeReportParams { + return &GetMeanTimeReportParams{ + HTTPClient: client, + } +} + +/* +GetMeanTimeReportParams contains all the parameters to send to the API endpoint + + for the get mean time report operation. + + Typically these are written to a http.Request. +*/ +type GetMeanTimeReportParams struct { + + /* CurrentMilestones. + + A comma separated list of current milestones + */ + CurrentMilestones *string + + /* EndDate. + + The end date to return incidents from + + Format: date + */ + EndDate *strfmt.Date + + /* Environments. + + A comma separated list of environment IDs + */ + Environments *string + + /* Priorities. + + A comma separated list of priorities + */ + Priorities *string + + /* PriorityNotSet. + + Flag for including incidents where priority has not been set + */ + PriorityNotSet *bool + + /* Query. + + A text query for an incident that searches on name, summary, and desciption + */ + Query *string + + /* SavedSearchID. + + The id of a previously saved search. + */ + SavedSearchID *string + + /* Services. + + A comma separated list of service IDs + */ + Services *string + + /* Severities. + + A comma separated list of severities + */ + Severities *string + + /* SeverityNotSet. + + Flag for including incidents where severity has not been set + */ + SeverityNotSet *bool + + /* StartDate. + + The start date to return incidents from + + Format: date + */ + StartDate *strfmt.Date + + /* Status. + + Incident status + */ + Status *string + + /* Teams. + + A comma separated list of team IDs + */ + Teams *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get mean time report params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMeanTimeReportParams) WithDefaults() *GetMeanTimeReportParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get mean time report params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMeanTimeReportParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get mean time report params +func (o *GetMeanTimeReportParams) WithTimeout(timeout time.Duration) *GetMeanTimeReportParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get mean time report params +func (o *GetMeanTimeReportParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get mean time report params +func (o *GetMeanTimeReportParams) WithContext(ctx context.Context) *GetMeanTimeReportParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get mean time report params +func (o *GetMeanTimeReportParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get mean time report params +func (o *GetMeanTimeReportParams) WithHTTPClient(client *http.Client) *GetMeanTimeReportParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get mean time report params +func (o *GetMeanTimeReportParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCurrentMilestones adds the currentMilestones to the get mean time report params +func (o *GetMeanTimeReportParams) WithCurrentMilestones(currentMilestones *string) *GetMeanTimeReportParams { + o.SetCurrentMilestones(currentMilestones) + return o +} + +// SetCurrentMilestones adds the currentMilestones to the get mean time report params +func (o *GetMeanTimeReportParams) SetCurrentMilestones(currentMilestones *string) { + o.CurrentMilestones = currentMilestones +} + +// WithEndDate adds the endDate to the get mean time report params +func (o *GetMeanTimeReportParams) WithEndDate(endDate *strfmt.Date) *GetMeanTimeReportParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the get mean time report params +func (o *GetMeanTimeReportParams) SetEndDate(endDate *strfmt.Date) { + o.EndDate = endDate +} + +// WithEnvironments adds the environments to the get mean time report params +func (o *GetMeanTimeReportParams) WithEnvironments(environments *string) *GetMeanTimeReportParams { + o.SetEnvironments(environments) + return o +} + +// SetEnvironments adds the environments to the get mean time report params +func (o *GetMeanTimeReportParams) SetEnvironments(environments *string) { + o.Environments = environments +} + +// WithPriorities adds the priorities to the get mean time report params +func (o *GetMeanTimeReportParams) WithPriorities(priorities *string) *GetMeanTimeReportParams { + o.SetPriorities(priorities) + return o +} + +// SetPriorities adds the priorities to the get mean time report params +func (o *GetMeanTimeReportParams) SetPriorities(priorities *string) { + o.Priorities = priorities +} + +// WithPriorityNotSet adds the priorityNotSet to the get mean time report params +func (o *GetMeanTimeReportParams) WithPriorityNotSet(priorityNotSet *bool) *GetMeanTimeReportParams { + o.SetPriorityNotSet(priorityNotSet) + return o +} + +// SetPriorityNotSet adds the priorityNotSet to the get mean time report params +func (o *GetMeanTimeReportParams) SetPriorityNotSet(priorityNotSet *bool) { + o.PriorityNotSet = priorityNotSet +} + +// WithQuery adds the query to the get mean time report params +func (o *GetMeanTimeReportParams) WithQuery(query *string) *GetMeanTimeReportParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the get mean time report params +func (o *GetMeanTimeReportParams) SetQuery(query *string) { + o.Query = query +} + +// WithSavedSearchID adds the savedSearchID to the get mean time report params +func (o *GetMeanTimeReportParams) WithSavedSearchID(savedSearchID *string) *GetMeanTimeReportParams { + o.SetSavedSearchID(savedSearchID) + return o +} + +// SetSavedSearchID adds the savedSearchId to the get mean time report params +func (o *GetMeanTimeReportParams) SetSavedSearchID(savedSearchID *string) { + o.SavedSearchID = savedSearchID +} + +// WithServices adds the services to the get mean time report params +func (o *GetMeanTimeReportParams) WithServices(services *string) *GetMeanTimeReportParams { + o.SetServices(services) + return o +} + +// SetServices adds the services to the get mean time report params +func (o *GetMeanTimeReportParams) SetServices(services *string) { + o.Services = services +} + +// WithSeverities adds the severities to the get mean time report params +func (o *GetMeanTimeReportParams) WithSeverities(severities *string) *GetMeanTimeReportParams { + o.SetSeverities(severities) + return o +} + +// SetSeverities adds the severities to the get mean time report params +func (o *GetMeanTimeReportParams) SetSeverities(severities *string) { + o.Severities = severities +} + +// WithSeverityNotSet adds the severityNotSet to the get mean time report params +func (o *GetMeanTimeReportParams) WithSeverityNotSet(severityNotSet *bool) *GetMeanTimeReportParams { + o.SetSeverityNotSet(severityNotSet) + return o +} + +// SetSeverityNotSet adds the severityNotSet to the get mean time report params +func (o *GetMeanTimeReportParams) SetSeverityNotSet(severityNotSet *bool) { + o.SeverityNotSet = severityNotSet +} + +// WithStartDate adds the startDate to the get mean time report params +func (o *GetMeanTimeReportParams) WithStartDate(startDate *strfmt.Date) *GetMeanTimeReportParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the get mean time report params +func (o *GetMeanTimeReportParams) SetStartDate(startDate *strfmt.Date) { + o.StartDate = startDate +} + +// WithStatus adds the status to the get mean time report params +func (o *GetMeanTimeReportParams) WithStatus(status *string) *GetMeanTimeReportParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the get mean time report params +func (o *GetMeanTimeReportParams) SetStatus(status *string) { + o.Status = status +} + +// WithTeams adds the teams to the get mean time report params +func (o *GetMeanTimeReportParams) WithTeams(teams *string) *GetMeanTimeReportParams { + o.SetTeams(teams) + return o +} + +// SetTeams adds the teams to the get mean time report params +func (o *GetMeanTimeReportParams) SetTeams(teams *string) { + o.Teams = teams +} + +// WriteToRequest writes these params to a swagger request +func (o *GetMeanTimeReportParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CurrentMilestones != nil { + + // query param current_milestones + var qrCurrentMilestones string + + if o.CurrentMilestones != nil { + qrCurrentMilestones = *o.CurrentMilestones + } + qCurrentMilestones := qrCurrentMilestones + if qCurrentMilestones != "" { + + if err := r.SetQueryParam("current_milestones", qCurrentMilestones); err != nil { + return err + } + } + } + + if o.EndDate != nil { + + // query param end_date + var qrEndDate strfmt.Date + + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate.String() + if qEndDate != "" { + + if err := r.SetQueryParam("end_date", qEndDate); err != nil { + return err + } + } + } + + if o.Environments != nil { + + // query param environments + var qrEnvironments string + + if o.Environments != nil { + qrEnvironments = *o.Environments + } + qEnvironments := qrEnvironments + if qEnvironments != "" { + + if err := r.SetQueryParam("environments", qEnvironments); err != nil { + return err + } + } + } + + if o.Priorities != nil { + + // query param priorities + var qrPriorities string + + if o.Priorities != nil { + qrPriorities = *o.Priorities + } + qPriorities := qrPriorities + if qPriorities != "" { + + if err := r.SetQueryParam("priorities", qPriorities); err != nil { + return err + } + } + } + + if o.PriorityNotSet != nil { + + // query param priority_not_set + var qrPriorityNotSet bool + + if o.PriorityNotSet != nil { + qrPriorityNotSet = *o.PriorityNotSet + } + qPriorityNotSet := swag.FormatBool(qrPriorityNotSet) + if qPriorityNotSet != "" { + + if err := r.SetQueryParam("priority_not_set", qPriorityNotSet); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if o.SavedSearchID != nil { + + // query param saved_search_id + var qrSavedSearchID string + + if o.SavedSearchID != nil { + qrSavedSearchID = *o.SavedSearchID + } + qSavedSearchID := qrSavedSearchID + if qSavedSearchID != "" { + + if err := r.SetQueryParam("saved_search_id", qSavedSearchID); err != nil { + return err + } + } + } + + if o.Services != nil { + + // query param services + var qrServices string + + if o.Services != nil { + qrServices = *o.Services + } + qServices := qrServices + if qServices != "" { + + if err := r.SetQueryParam("services", qServices); err != nil { + return err + } + } + } + + if o.Severities != nil { + + // query param severities + var qrSeverities string + + if o.Severities != nil { + qrSeverities = *o.Severities + } + qSeverities := qrSeverities + if qSeverities != "" { + + if err := r.SetQueryParam("severities", qSeverities); err != nil { + return err + } + } + } + + if o.SeverityNotSet != nil { + + // query param severity_not_set + var qrSeverityNotSet bool + + if o.SeverityNotSet != nil { + qrSeverityNotSet = *o.SeverityNotSet + } + qSeverityNotSet := swag.FormatBool(qrSeverityNotSet) + if qSeverityNotSet != "" { + + if err := r.SetQueryParam("severity_not_set", qSeverityNotSet); err != nil { + return err + } + } + } + + if o.StartDate != nil { + + // query param start_date + var qrStartDate strfmt.Date + + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate.String() + if qStartDate != "" { + + if err := r.SetQueryParam("start_date", qStartDate); err != nil { + return err + } + } + } + + if o.Status != nil { + + // query param status + var qrStatus string + + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + + if err := r.SetQueryParam("status", qStatus); err != nil { + return err + } + } + } + + if o.Teams != nil { + + // query param teams + var qrTeams string + + if o.Teams != nil { + qrTeams = *o.Teams + } + qTeams := qrTeams + if qTeams != "" { + + if err := r.SetQueryParam("teams", qTeams); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/reporting/get_mean_time_report_responses.go b/client/reporting/get_mean_time_report_responses.go new file mode 100644 index 0000000..b0f524f --- /dev/null +++ b/client/reporting/get_mean_time_report_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetMeanTimeReportReader is a Reader for the GetMeanTimeReport structure. +type GetMeanTimeReportReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetMeanTimeReportReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetMeanTimeReportOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetMeanTimeReportOK creates a GetMeanTimeReportOK with default headers values +func NewGetMeanTimeReportOK() *GetMeanTimeReportOK { + return &GetMeanTimeReportOK{} +} + +/* +GetMeanTimeReportOK describes a response with status code 200, with default header values. + +Returns a report with time bucketed analytics data +*/ +type GetMeanTimeReportOK struct { + Payload *models.ReportEntity +} + +// IsSuccess returns true when this get mean time report o k response has a 2xx status code +func (o *GetMeanTimeReportOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get mean time report o k response has a 3xx status code +func (o *GetMeanTimeReportOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get mean time report o k response has a 4xx status code +func (o *GetMeanTimeReportOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get mean time report o k response has a 5xx status code +func (o *GetMeanTimeReportOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get mean time report o k response a status code equal to that given +func (o *GetMeanTimeReportOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetMeanTimeReportOK) Error() string { + return fmt.Sprintf("[GET /v1/reports/mean_time][%d] getMeanTimeReportOK %+v", 200, o.Payload) +} + +func (o *GetMeanTimeReportOK) String() string { + return fmt.Sprintf("[GET /v1/reports/mean_time][%d] getMeanTimeReportOK %+v", 200, o.Payload) +} + +func (o *GetMeanTimeReportOK) GetPayload() *models.ReportEntity { + return o.Payload +} + +func (o *GetMeanTimeReportOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ReportEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/reporting/get_saved_search_parameters.go b/client/reporting/get_saved_search_parameters.go new file mode 100644 index 0000000..b12ee04 --- /dev/null +++ b/client/reporting/get_saved_search_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSavedSearchParams creates a new GetSavedSearchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSavedSearchParams() *GetSavedSearchParams { + return &GetSavedSearchParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSavedSearchParamsWithTimeout creates a new GetSavedSearchParams object +// with the ability to set a timeout on a request. +func NewGetSavedSearchParamsWithTimeout(timeout time.Duration) *GetSavedSearchParams { + return &GetSavedSearchParams{ + timeout: timeout, + } +} + +// NewGetSavedSearchParamsWithContext creates a new GetSavedSearchParams object +// with the ability to set a context for a request. +func NewGetSavedSearchParamsWithContext(ctx context.Context) *GetSavedSearchParams { + return &GetSavedSearchParams{ + Context: ctx, + } +} + +// NewGetSavedSearchParamsWithHTTPClient creates a new GetSavedSearchParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSavedSearchParamsWithHTTPClient(client *http.Client) *GetSavedSearchParams { + return &GetSavedSearchParams{ + HTTPClient: client, + } +} + +/* +GetSavedSearchParams contains all the parameters to send to the API endpoint + + for the get saved search operation. + + Typically these are written to a http.Request. +*/ +type GetSavedSearchParams struct { + + // ResourceType. + ResourceType string + + // SavedSearchID. + SavedSearchID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get saved search params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSavedSearchParams) WithDefaults() *GetSavedSearchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get saved search params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSavedSearchParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get saved search params +func (o *GetSavedSearchParams) WithTimeout(timeout time.Duration) *GetSavedSearchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get saved search params +func (o *GetSavedSearchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get saved search params +func (o *GetSavedSearchParams) WithContext(ctx context.Context) *GetSavedSearchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get saved search params +func (o *GetSavedSearchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get saved search params +func (o *GetSavedSearchParams) WithHTTPClient(client *http.Client) *GetSavedSearchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get saved search params +func (o *GetSavedSearchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithResourceType adds the resourceType to the get saved search params +func (o *GetSavedSearchParams) WithResourceType(resourceType string) *GetSavedSearchParams { + o.SetResourceType(resourceType) + return o +} + +// SetResourceType adds the resourceType to the get saved search params +func (o *GetSavedSearchParams) SetResourceType(resourceType string) { + o.ResourceType = resourceType +} + +// WithSavedSearchID adds the savedSearchID to the get saved search params +func (o *GetSavedSearchParams) WithSavedSearchID(savedSearchID string) *GetSavedSearchParams { + o.SetSavedSearchID(savedSearchID) + return o +} + +// SetSavedSearchID adds the savedSearchId to the get saved search params +func (o *GetSavedSearchParams) SetSavedSearchID(savedSearchID string) { + o.SavedSearchID = savedSearchID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSavedSearchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param resource_type + if err := r.SetPathParam("resource_type", o.ResourceType); err != nil { + return err + } + + // path param saved_search_id + if err := r.SetPathParam("saved_search_id", o.SavedSearchID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/reporting/get_saved_search_responses.go b/client/reporting/get_saved_search_responses.go new file mode 100644 index 0000000..8c61aed --- /dev/null +++ b/client/reporting/get_saved_search_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetSavedSearchReader is a Reader for the GetSavedSearch structure. +type GetSavedSearchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSavedSearchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSavedSearchOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSavedSearchOK creates a GetSavedSearchOK with default headers values +func NewGetSavedSearchOK() *GetSavedSearchOK { + return &GetSavedSearchOK{} +} + +/* +GetSavedSearchOK describes a response with status code 200, with default header values. + +Retrieve a specific save search +*/ +type GetSavedSearchOK struct { + Payload *models.SavedSearchEntity +} + +// IsSuccess returns true when this get saved search o k response has a 2xx status code +func (o *GetSavedSearchOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get saved search o k response has a 3xx status code +func (o *GetSavedSearchOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get saved search o k response has a 4xx status code +func (o *GetSavedSearchOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get saved search o k response has a 5xx status code +func (o *GetSavedSearchOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get saved search o k response a status code equal to that given +func (o *GetSavedSearchOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetSavedSearchOK) Error() string { + return fmt.Sprintf("[GET /v1/saved_searches/{resource_type}/{saved_search_id}][%d] getSavedSearchOK %+v", 200, o.Payload) +} + +func (o *GetSavedSearchOK) String() string { + return fmt.Sprintf("[GET /v1/saved_searches/{resource_type}/{saved_search_id}][%d] getSavedSearchOK %+v", 200, o.Payload) +} + +func (o *GetSavedSearchOK) GetPayload() *models.SavedSearchEntity { + return o.Payload +} + +func (o *GetSavedSearchOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SavedSearchEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/reporting/get_signals_grouped_metrics_parameters.go b/client/reporting/get_signals_grouped_metrics_parameters.go new file mode 100644 index 0000000..7758c4d --- /dev/null +++ b/client/reporting/get_signals_grouped_metrics_parameters.go @@ -0,0 +1,507 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSignalsGroupedMetricsParams creates a new GetSignalsGroupedMetricsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSignalsGroupedMetricsParams() *GetSignalsGroupedMetricsParams { + return &GetSignalsGroupedMetricsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSignalsGroupedMetricsParamsWithTimeout creates a new GetSignalsGroupedMetricsParams object +// with the ability to set a timeout on a request. +func NewGetSignalsGroupedMetricsParamsWithTimeout(timeout time.Duration) *GetSignalsGroupedMetricsParams { + return &GetSignalsGroupedMetricsParams{ + timeout: timeout, + } +} + +// NewGetSignalsGroupedMetricsParamsWithContext creates a new GetSignalsGroupedMetricsParams object +// with the ability to set a context for a request. +func NewGetSignalsGroupedMetricsParamsWithContext(ctx context.Context) *GetSignalsGroupedMetricsParams { + return &GetSignalsGroupedMetricsParams{ + Context: ctx, + } +} + +// NewGetSignalsGroupedMetricsParamsWithHTTPClient creates a new GetSignalsGroupedMetricsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSignalsGroupedMetricsParamsWithHTTPClient(client *http.Client) *GetSignalsGroupedMetricsParams { + return &GetSignalsGroupedMetricsParams{ + HTTPClient: client, + } +} + +/* +GetSignalsGroupedMetricsParams contains all the parameters to send to the API endpoint + + for the get signals grouped metrics operation. + + Typically these are written to a http.Request. +*/ +type GetSignalsGroupedMetricsParams struct { + + /* EndDate. + + The end date to return metrics from + + Format: date-time + */ + EndDate *strfmt.DateTime + + /* Environments. + + A comma separated list of environment IDs + */ + Environments *string + + /* GroupBy. + + String that determines how records are grouped + */ + GroupBy *string + + /* Services. + + A comma separated list of service IDs + */ + Services *string + + /* SignalRules. + + A comma separated list of signal rule IDs + */ + SignalRules *string + + /* SortBy. + + String that determines how records are sorted + */ + SortBy *string + + /* SortDirection. + + String that determines how records are sorted + */ + SortDirection *string + + /* StartDate. + + The start date to return metrics from + + Format: date-time + */ + StartDate *strfmt.DateTime + + /* Tags. + + A comma separated list of tags + */ + Tags *string + + /* Teams. + + A comma separated list of team IDs + */ + Teams *string + + /* Users. + + A comma separated list of user IDs + */ + Users *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get signals grouped metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSignalsGroupedMetricsParams) WithDefaults() *GetSignalsGroupedMetricsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get signals grouped metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSignalsGroupedMetricsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) WithTimeout(timeout time.Duration) *GetSignalsGroupedMetricsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) WithContext(ctx context.Context) *GetSignalsGroupedMetricsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) WithHTTPClient(client *http.Client) *GetSignalsGroupedMetricsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndDate adds the endDate to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) WithEndDate(endDate *strfmt.DateTime) *GetSignalsGroupedMetricsParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) SetEndDate(endDate *strfmt.DateTime) { + o.EndDate = endDate +} + +// WithEnvironments adds the environments to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) WithEnvironments(environments *string) *GetSignalsGroupedMetricsParams { + o.SetEnvironments(environments) + return o +} + +// SetEnvironments adds the environments to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) SetEnvironments(environments *string) { + o.Environments = environments +} + +// WithGroupBy adds the groupBy to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) WithGroupBy(groupBy *string) *GetSignalsGroupedMetricsParams { + o.SetGroupBy(groupBy) + return o +} + +// SetGroupBy adds the groupBy to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) SetGroupBy(groupBy *string) { + o.GroupBy = groupBy +} + +// WithServices adds the services to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) WithServices(services *string) *GetSignalsGroupedMetricsParams { + o.SetServices(services) + return o +} + +// SetServices adds the services to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) SetServices(services *string) { + o.Services = services +} + +// WithSignalRules adds the signalRules to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) WithSignalRules(signalRules *string) *GetSignalsGroupedMetricsParams { + o.SetSignalRules(signalRules) + return o +} + +// SetSignalRules adds the signalRules to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) SetSignalRules(signalRules *string) { + o.SignalRules = signalRules +} + +// WithSortBy adds the sortBy to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) WithSortBy(sortBy *string) *GetSignalsGroupedMetricsParams { + o.SetSortBy(sortBy) + return o +} + +// SetSortBy adds the sortBy to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) SetSortBy(sortBy *string) { + o.SortBy = sortBy +} + +// WithSortDirection adds the sortDirection to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) WithSortDirection(sortDirection *string) *GetSignalsGroupedMetricsParams { + o.SetSortDirection(sortDirection) + return o +} + +// SetSortDirection adds the sortDirection to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) SetSortDirection(sortDirection *string) { + o.SortDirection = sortDirection +} + +// WithStartDate adds the startDate to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) WithStartDate(startDate *strfmt.DateTime) *GetSignalsGroupedMetricsParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) SetStartDate(startDate *strfmt.DateTime) { + o.StartDate = startDate +} + +// WithTags adds the tags to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) WithTags(tags *string) *GetSignalsGroupedMetricsParams { + o.SetTags(tags) + return o +} + +// SetTags adds the tags to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) SetTags(tags *string) { + o.Tags = tags +} + +// WithTeams adds the teams to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) WithTeams(teams *string) *GetSignalsGroupedMetricsParams { + o.SetTeams(teams) + return o +} + +// SetTeams adds the teams to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) SetTeams(teams *string) { + o.Teams = teams +} + +// WithUsers adds the users to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) WithUsers(users *string) *GetSignalsGroupedMetricsParams { + o.SetUsers(users) + return o +} + +// SetUsers adds the users to the get signals grouped metrics params +func (o *GetSignalsGroupedMetricsParams) SetUsers(users *string) { + o.Users = users +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSignalsGroupedMetricsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EndDate != nil { + + // query param end_date + var qrEndDate strfmt.DateTime + + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate.String() + if qEndDate != "" { + + if err := r.SetQueryParam("end_date", qEndDate); err != nil { + return err + } + } + } + + if o.Environments != nil { + + // query param environments + var qrEnvironments string + + if o.Environments != nil { + qrEnvironments = *o.Environments + } + qEnvironments := qrEnvironments + if qEnvironments != "" { + + if err := r.SetQueryParam("environments", qEnvironments); err != nil { + return err + } + } + } + + if o.GroupBy != nil { + + // query param group_by + var qrGroupBy string + + if o.GroupBy != nil { + qrGroupBy = *o.GroupBy + } + qGroupBy := qrGroupBy + if qGroupBy != "" { + + if err := r.SetQueryParam("group_by", qGroupBy); err != nil { + return err + } + } + } + + if o.Services != nil { + + // query param services + var qrServices string + + if o.Services != nil { + qrServices = *o.Services + } + qServices := qrServices + if qServices != "" { + + if err := r.SetQueryParam("services", qServices); err != nil { + return err + } + } + } + + if o.SignalRules != nil { + + // query param signal_rules + var qrSignalRules string + + if o.SignalRules != nil { + qrSignalRules = *o.SignalRules + } + qSignalRules := qrSignalRules + if qSignalRules != "" { + + if err := r.SetQueryParam("signal_rules", qSignalRules); err != nil { + return err + } + } + } + + if o.SortBy != nil { + + // query param sort_by + var qrSortBy string + + if o.SortBy != nil { + qrSortBy = *o.SortBy + } + qSortBy := qrSortBy + if qSortBy != "" { + + if err := r.SetQueryParam("sort_by", qSortBy); err != nil { + return err + } + } + } + + if o.SortDirection != nil { + + // query param sort_direction + var qrSortDirection string + + if o.SortDirection != nil { + qrSortDirection = *o.SortDirection + } + qSortDirection := qrSortDirection + if qSortDirection != "" { + + if err := r.SetQueryParam("sort_direction", qSortDirection); err != nil { + return err + } + } + } + + if o.StartDate != nil { + + // query param start_date + var qrStartDate strfmt.DateTime + + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate.String() + if qStartDate != "" { + + if err := r.SetQueryParam("start_date", qStartDate); err != nil { + return err + } + } + } + + if o.Tags != nil { + + // query param tags + var qrTags string + + if o.Tags != nil { + qrTags = *o.Tags + } + qTags := qrTags + if qTags != "" { + + if err := r.SetQueryParam("tags", qTags); err != nil { + return err + } + } + } + + if o.Teams != nil { + + // query param teams + var qrTeams string + + if o.Teams != nil { + qrTeams = *o.Teams + } + qTeams := qrTeams + if qTeams != "" { + + if err := r.SetQueryParam("teams", qTeams); err != nil { + return err + } + } + } + + if o.Users != nil { + + // query param users + var qrUsers string + + if o.Users != nil { + qrUsers = *o.Users + } + qUsers := qrUsers + if qUsers != "" { + + if err := r.SetQueryParam("users", qUsers); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/reporting/get_signals_grouped_metrics_responses.go b/client/reporting/get_signals_grouped_metrics_responses.go new file mode 100644 index 0000000..b4ae5e3 --- /dev/null +++ b/client/reporting/get_signals_grouped_metrics_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSignalsGroupedMetricsReader is a Reader for the GetSignalsGroupedMetrics structure. +type GetSignalsGroupedMetricsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSignalsGroupedMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSignalsGroupedMetricsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSignalsGroupedMetricsOK creates a GetSignalsGroupedMetricsOK with default headers values +func NewGetSignalsGroupedMetricsOK() *GetSignalsGroupedMetricsOK { + return &GetSignalsGroupedMetricsOK{} +} + +/* +GetSignalsGroupedMetricsOK describes a response with status code 200, with default header values. + +Generate a report of grouped metrics for Signals alerts +*/ +type GetSignalsGroupedMetricsOK struct { +} + +// IsSuccess returns true when this get signals grouped metrics o k response has a 2xx status code +func (o *GetSignalsGroupedMetricsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get signals grouped metrics o k response has a 3xx status code +func (o *GetSignalsGroupedMetricsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get signals grouped metrics o k response has a 4xx status code +func (o *GetSignalsGroupedMetricsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get signals grouped metrics o k response has a 5xx status code +func (o *GetSignalsGroupedMetricsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get signals grouped metrics o k response a status code equal to that given +func (o *GetSignalsGroupedMetricsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetSignalsGroupedMetricsOK) Error() string { + return fmt.Sprintf("[GET /v1/signals/analytics/grouped_metrics][%d] getSignalsGroupedMetricsOK ", 200) +} + +func (o *GetSignalsGroupedMetricsOK) String() string { + return fmt.Sprintf("[GET /v1/signals/analytics/grouped_metrics][%d] getSignalsGroupedMetricsOK ", 200) +} + +func (o *GetSignalsGroupedMetricsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/reporting/get_signals_mttx_analytics_parameters.go b/client/reporting/get_signals_mttx_analytics_parameters.go new file mode 100644 index 0000000..a0429ba --- /dev/null +++ b/client/reporting/get_signals_mttx_analytics_parameters.go @@ -0,0 +1,507 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSignalsMttxAnalyticsParams creates a new GetSignalsMttxAnalyticsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSignalsMttxAnalyticsParams() *GetSignalsMttxAnalyticsParams { + return &GetSignalsMttxAnalyticsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSignalsMttxAnalyticsParamsWithTimeout creates a new GetSignalsMttxAnalyticsParams object +// with the ability to set a timeout on a request. +func NewGetSignalsMttxAnalyticsParamsWithTimeout(timeout time.Duration) *GetSignalsMttxAnalyticsParams { + return &GetSignalsMttxAnalyticsParams{ + timeout: timeout, + } +} + +// NewGetSignalsMttxAnalyticsParamsWithContext creates a new GetSignalsMttxAnalyticsParams object +// with the ability to set a context for a request. +func NewGetSignalsMttxAnalyticsParamsWithContext(ctx context.Context) *GetSignalsMttxAnalyticsParams { + return &GetSignalsMttxAnalyticsParams{ + Context: ctx, + } +} + +// NewGetSignalsMttxAnalyticsParamsWithHTTPClient creates a new GetSignalsMttxAnalyticsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSignalsMttxAnalyticsParamsWithHTTPClient(client *http.Client) *GetSignalsMttxAnalyticsParams { + return &GetSignalsMttxAnalyticsParams{ + HTTPClient: client, + } +} + +/* +GetSignalsMttxAnalyticsParams contains all the parameters to send to the API endpoint + + for the get signals mttx analytics operation. + + Typically these are written to a http.Request. +*/ +type GetSignalsMttxAnalyticsParams struct { + + /* EndDate. + + The end date to return metrics from + + Format: date-time + */ + EndDate *strfmt.DateTime + + /* Environments. + + A comma separated list of environment IDs + */ + Environments *string + + /* GroupBy. + + String that determines how records are grouped + */ + GroupBy *string + + /* Services. + + A comma separated list of service IDs + */ + Services *string + + /* SignalRules. + + A comma separated list of signal rule IDs + */ + SignalRules *string + + /* SortBy. + + String that determines how records are sorted + */ + SortBy *string + + /* SortDirection. + + String that determines how records are sorted + */ + SortDirection *string + + /* StartDate. + + The start date to return metrics from + + Format: date-time + */ + StartDate *strfmt.DateTime + + /* Tags. + + A comma separated list of tags + */ + Tags *string + + /* Teams. + + A comma separated list of team IDs + */ + Teams *string + + /* Users. + + A comma separated list of user IDs + */ + Users *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get signals mttx analytics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSignalsMttxAnalyticsParams) WithDefaults() *GetSignalsMttxAnalyticsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get signals mttx analytics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSignalsMttxAnalyticsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) WithTimeout(timeout time.Duration) *GetSignalsMttxAnalyticsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) WithContext(ctx context.Context) *GetSignalsMttxAnalyticsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) WithHTTPClient(client *http.Client) *GetSignalsMttxAnalyticsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndDate adds the endDate to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) WithEndDate(endDate *strfmt.DateTime) *GetSignalsMttxAnalyticsParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) SetEndDate(endDate *strfmt.DateTime) { + o.EndDate = endDate +} + +// WithEnvironments adds the environments to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) WithEnvironments(environments *string) *GetSignalsMttxAnalyticsParams { + o.SetEnvironments(environments) + return o +} + +// SetEnvironments adds the environments to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) SetEnvironments(environments *string) { + o.Environments = environments +} + +// WithGroupBy adds the groupBy to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) WithGroupBy(groupBy *string) *GetSignalsMttxAnalyticsParams { + o.SetGroupBy(groupBy) + return o +} + +// SetGroupBy adds the groupBy to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) SetGroupBy(groupBy *string) { + o.GroupBy = groupBy +} + +// WithServices adds the services to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) WithServices(services *string) *GetSignalsMttxAnalyticsParams { + o.SetServices(services) + return o +} + +// SetServices adds the services to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) SetServices(services *string) { + o.Services = services +} + +// WithSignalRules adds the signalRules to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) WithSignalRules(signalRules *string) *GetSignalsMttxAnalyticsParams { + o.SetSignalRules(signalRules) + return o +} + +// SetSignalRules adds the signalRules to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) SetSignalRules(signalRules *string) { + o.SignalRules = signalRules +} + +// WithSortBy adds the sortBy to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) WithSortBy(sortBy *string) *GetSignalsMttxAnalyticsParams { + o.SetSortBy(sortBy) + return o +} + +// SetSortBy adds the sortBy to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) SetSortBy(sortBy *string) { + o.SortBy = sortBy +} + +// WithSortDirection adds the sortDirection to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) WithSortDirection(sortDirection *string) *GetSignalsMttxAnalyticsParams { + o.SetSortDirection(sortDirection) + return o +} + +// SetSortDirection adds the sortDirection to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) SetSortDirection(sortDirection *string) { + o.SortDirection = sortDirection +} + +// WithStartDate adds the startDate to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) WithStartDate(startDate *strfmt.DateTime) *GetSignalsMttxAnalyticsParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) SetStartDate(startDate *strfmt.DateTime) { + o.StartDate = startDate +} + +// WithTags adds the tags to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) WithTags(tags *string) *GetSignalsMttxAnalyticsParams { + o.SetTags(tags) + return o +} + +// SetTags adds the tags to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) SetTags(tags *string) { + o.Tags = tags +} + +// WithTeams adds the teams to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) WithTeams(teams *string) *GetSignalsMttxAnalyticsParams { + o.SetTeams(teams) + return o +} + +// SetTeams adds the teams to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) SetTeams(teams *string) { + o.Teams = teams +} + +// WithUsers adds the users to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) WithUsers(users *string) *GetSignalsMttxAnalyticsParams { + o.SetUsers(users) + return o +} + +// SetUsers adds the users to the get signals mttx analytics params +func (o *GetSignalsMttxAnalyticsParams) SetUsers(users *string) { + o.Users = users +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSignalsMttxAnalyticsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EndDate != nil { + + // query param end_date + var qrEndDate strfmt.DateTime + + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate.String() + if qEndDate != "" { + + if err := r.SetQueryParam("end_date", qEndDate); err != nil { + return err + } + } + } + + if o.Environments != nil { + + // query param environments + var qrEnvironments string + + if o.Environments != nil { + qrEnvironments = *o.Environments + } + qEnvironments := qrEnvironments + if qEnvironments != "" { + + if err := r.SetQueryParam("environments", qEnvironments); err != nil { + return err + } + } + } + + if o.GroupBy != nil { + + // query param group_by + var qrGroupBy string + + if o.GroupBy != nil { + qrGroupBy = *o.GroupBy + } + qGroupBy := qrGroupBy + if qGroupBy != "" { + + if err := r.SetQueryParam("group_by", qGroupBy); err != nil { + return err + } + } + } + + if o.Services != nil { + + // query param services + var qrServices string + + if o.Services != nil { + qrServices = *o.Services + } + qServices := qrServices + if qServices != "" { + + if err := r.SetQueryParam("services", qServices); err != nil { + return err + } + } + } + + if o.SignalRules != nil { + + // query param signal_rules + var qrSignalRules string + + if o.SignalRules != nil { + qrSignalRules = *o.SignalRules + } + qSignalRules := qrSignalRules + if qSignalRules != "" { + + if err := r.SetQueryParam("signal_rules", qSignalRules); err != nil { + return err + } + } + } + + if o.SortBy != nil { + + // query param sort_by + var qrSortBy string + + if o.SortBy != nil { + qrSortBy = *o.SortBy + } + qSortBy := qrSortBy + if qSortBy != "" { + + if err := r.SetQueryParam("sort_by", qSortBy); err != nil { + return err + } + } + } + + if o.SortDirection != nil { + + // query param sort_direction + var qrSortDirection string + + if o.SortDirection != nil { + qrSortDirection = *o.SortDirection + } + qSortDirection := qrSortDirection + if qSortDirection != "" { + + if err := r.SetQueryParam("sort_direction", qSortDirection); err != nil { + return err + } + } + } + + if o.StartDate != nil { + + // query param start_date + var qrStartDate strfmt.DateTime + + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate.String() + if qStartDate != "" { + + if err := r.SetQueryParam("start_date", qStartDate); err != nil { + return err + } + } + } + + if o.Tags != nil { + + // query param tags + var qrTags string + + if o.Tags != nil { + qrTags = *o.Tags + } + qTags := qrTags + if qTags != "" { + + if err := r.SetQueryParam("tags", qTags); err != nil { + return err + } + } + } + + if o.Teams != nil { + + // query param teams + var qrTeams string + + if o.Teams != nil { + qrTeams = *o.Teams + } + qTeams := qrTeams + if qTeams != "" { + + if err := r.SetQueryParam("teams", qTeams); err != nil { + return err + } + } + } + + if o.Users != nil { + + // query param users + var qrUsers string + + if o.Users != nil { + qrUsers = *o.Users + } + qUsers := qrUsers + if qUsers != "" { + + if err := r.SetQueryParam("users", qUsers); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/reporting/get_signals_mttx_analytics_responses.go b/client/reporting/get_signals_mttx_analytics_responses.go new file mode 100644 index 0000000..acdae3a --- /dev/null +++ b/client/reporting/get_signals_mttx_analytics_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSignalsMttxAnalyticsReader is a Reader for the GetSignalsMttxAnalytics structure. +type GetSignalsMttxAnalyticsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSignalsMttxAnalyticsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSignalsMttxAnalyticsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSignalsMttxAnalyticsOK creates a GetSignalsMttxAnalyticsOK with default headers values +func NewGetSignalsMttxAnalyticsOK() *GetSignalsMttxAnalyticsOK { + return &GetSignalsMttxAnalyticsOK{} +} + +/* +GetSignalsMttxAnalyticsOK describes a response with status code 200, with default header values. + +Get mean-time-to-acknowledged (MTTA) and mean-time-to-resolved (MTTR) metrics for Signals alerts +*/ +type GetSignalsMttxAnalyticsOK struct { +} + +// IsSuccess returns true when this get signals mttx analytics o k response has a 2xx status code +func (o *GetSignalsMttxAnalyticsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get signals mttx analytics o k response has a 3xx status code +func (o *GetSignalsMttxAnalyticsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get signals mttx analytics o k response has a 4xx status code +func (o *GetSignalsMttxAnalyticsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get signals mttx analytics o k response has a 5xx status code +func (o *GetSignalsMttxAnalyticsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get signals mttx analytics o k response a status code equal to that given +func (o *GetSignalsMttxAnalyticsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetSignalsMttxAnalyticsOK) Error() string { + return fmt.Sprintf("[GET /v1/signals/analytics/mttx][%d] getSignalsMttxAnalyticsOK ", 200) +} + +func (o *GetSignalsMttxAnalyticsOK) String() string { + return fmt.Sprintf("[GET /v1/signals/analytics/mttx][%d] getSignalsMttxAnalyticsOK ", 200) +} + +func (o *GetSignalsMttxAnalyticsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/reporting/get_signals_timeseries_analytics_parameters.go b/client/reporting/get_signals_timeseries_analytics_parameters.go new file mode 100644 index 0000000..08ea9fc --- /dev/null +++ b/client/reporting/get_signals_timeseries_analytics_parameters.go @@ -0,0 +1,541 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSignalsTimeseriesAnalyticsParams creates a new GetSignalsTimeseriesAnalyticsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSignalsTimeseriesAnalyticsParams() *GetSignalsTimeseriesAnalyticsParams { + return &GetSignalsTimeseriesAnalyticsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSignalsTimeseriesAnalyticsParamsWithTimeout creates a new GetSignalsTimeseriesAnalyticsParams object +// with the ability to set a timeout on a request. +func NewGetSignalsTimeseriesAnalyticsParamsWithTimeout(timeout time.Duration) *GetSignalsTimeseriesAnalyticsParams { + return &GetSignalsTimeseriesAnalyticsParams{ + timeout: timeout, + } +} + +// NewGetSignalsTimeseriesAnalyticsParamsWithContext creates a new GetSignalsTimeseriesAnalyticsParams object +// with the ability to set a context for a request. +func NewGetSignalsTimeseriesAnalyticsParamsWithContext(ctx context.Context) *GetSignalsTimeseriesAnalyticsParams { + return &GetSignalsTimeseriesAnalyticsParams{ + Context: ctx, + } +} + +// NewGetSignalsTimeseriesAnalyticsParamsWithHTTPClient creates a new GetSignalsTimeseriesAnalyticsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSignalsTimeseriesAnalyticsParamsWithHTTPClient(client *http.Client) *GetSignalsTimeseriesAnalyticsParams { + return &GetSignalsTimeseriesAnalyticsParams{ + HTTPClient: client, + } +} + +/* +GetSignalsTimeseriesAnalyticsParams contains all the parameters to send to the API endpoint + + for the get signals timeseries analytics operation. + + Typically these are written to a http.Request. +*/ +type GetSignalsTimeseriesAnalyticsParams struct { + + /* Bucket. + + String that determines how records are grouped + */ + Bucket *string + + /* EndDate. + + The end date to return metrics from + + Format: date-time + */ + EndDate *strfmt.DateTime + + /* Environments. + + A comma separated list of environment IDs + */ + Environments *string + + /* GroupBy. + + String that determines how records are grouped + */ + GroupBy *string + + /* Services. + + A comma separated list of service IDs + */ + Services *string + + /* SignalRules. + + A comma separated list of signal rule IDs + */ + SignalRules *string + + /* SortBy. + + String that determines how records are sorted + */ + SortBy *string + + /* SortDirection. + + String that determines how records are sorted + */ + SortDirection *string + + /* StartDate. + + The start date to return metrics from + + Format: date-time + */ + StartDate *strfmt.DateTime + + /* Tags. + + A comma separated list of tags + */ + Tags *string + + /* Teams. + + A comma separated list of team IDs + */ + Teams *string + + /* Users. + + A comma separated list of user IDs + */ + Users *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get signals timeseries analytics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSignalsTimeseriesAnalyticsParams) WithDefaults() *GetSignalsTimeseriesAnalyticsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get signals timeseries analytics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSignalsTimeseriesAnalyticsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithTimeout(timeout time.Duration) *GetSignalsTimeseriesAnalyticsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithContext(ctx context.Context) *GetSignalsTimeseriesAnalyticsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithHTTPClient(client *http.Client) *GetSignalsTimeseriesAnalyticsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucket adds the bucket to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithBucket(bucket *string) *GetSignalsTimeseriesAnalyticsParams { + o.SetBucket(bucket) + return o +} + +// SetBucket adds the bucket to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetBucket(bucket *string) { + o.Bucket = bucket +} + +// WithEndDate adds the endDate to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithEndDate(endDate *strfmt.DateTime) *GetSignalsTimeseriesAnalyticsParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetEndDate(endDate *strfmt.DateTime) { + o.EndDate = endDate +} + +// WithEnvironments adds the environments to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithEnvironments(environments *string) *GetSignalsTimeseriesAnalyticsParams { + o.SetEnvironments(environments) + return o +} + +// SetEnvironments adds the environments to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetEnvironments(environments *string) { + o.Environments = environments +} + +// WithGroupBy adds the groupBy to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithGroupBy(groupBy *string) *GetSignalsTimeseriesAnalyticsParams { + o.SetGroupBy(groupBy) + return o +} + +// SetGroupBy adds the groupBy to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetGroupBy(groupBy *string) { + o.GroupBy = groupBy +} + +// WithServices adds the services to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithServices(services *string) *GetSignalsTimeseriesAnalyticsParams { + o.SetServices(services) + return o +} + +// SetServices adds the services to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetServices(services *string) { + o.Services = services +} + +// WithSignalRules adds the signalRules to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithSignalRules(signalRules *string) *GetSignalsTimeseriesAnalyticsParams { + o.SetSignalRules(signalRules) + return o +} + +// SetSignalRules adds the signalRules to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetSignalRules(signalRules *string) { + o.SignalRules = signalRules +} + +// WithSortBy adds the sortBy to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithSortBy(sortBy *string) *GetSignalsTimeseriesAnalyticsParams { + o.SetSortBy(sortBy) + return o +} + +// SetSortBy adds the sortBy to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetSortBy(sortBy *string) { + o.SortBy = sortBy +} + +// WithSortDirection adds the sortDirection to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithSortDirection(sortDirection *string) *GetSignalsTimeseriesAnalyticsParams { + o.SetSortDirection(sortDirection) + return o +} + +// SetSortDirection adds the sortDirection to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetSortDirection(sortDirection *string) { + o.SortDirection = sortDirection +} + +// WithStartDate adds the startDate to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithStartDate(startDate *strfmt.DateTime) *GetSignalsTimeseriesAnalyticsParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetStartDate(startDate *strfmt.DateTime) { + o.StartDate = startDate +} + +// WithTags adds the tags to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithTags(tags *string) *GetSignalsTimeseriesAnalyticsParams { + o.SetTags(tags) + return o +} + +// SetTags adds the tags to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetTags(tags *string) { + o.Tags = tags +} + +// WithTeams adds the teams to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithTeams(teams *string) *GetSignalsTimeseriesAnalyticsParams { + o.SetTeams(teams) + return o +} + +// SetTeams adds the teams to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetTeams(teams *string) { + o.Teams = teams +} + +// WithUsers adds the users to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) WithUsers(users *string) *GetSignalsTimeseriesAnalyticsParams { + o.SetUsers(users) + return o +} + +// SetUsers adds the users to the get signals timeseries analytics params +func (o *GetSignalsTimeseriesAnalyticsParams) SetUsers(users *string) { + o.Users = users +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSignalsTimeseriesAnalyticsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Bucket != nil { + + // query param bucket + var qrBucket string + + if o.Bucket != nil { + qrBucket = *o.Bucket + } + qBucket := qrBucket + if qBucket != "" { + + if err := r.SetQueryParam("bucket", qBucket); err != nil { + return err + } + } + } + + if o.EndDate != nil { + + // query param end_date + var qrEndDate strfmt.DateTime + + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate.String() + if qEndDate != "" { + + if err := r.SetQueryParam("end_date", qEndDate); err != nil { + return err + } + } + } + + if o.Environments != nil { + + // query param environments + var qrEnvironments string + + if o.Environments != nil { + qrEnvironments = *o.Environments + } + qEnvironments := qrEnvironments + if qEnvironments != "" { + + if err := r.SetQueryParam("environments", qEnvironments); err != nil { + return err + } + } + } + + if o.GroupBy != nil { + + // query param group_by + var qrGroupBy string + + if o.GroupBy != nil { + qrGroupBy = *o.GroupBy + } + qGroupBy := qrGroupBy + if qGroupBy != "" { + + if err := r.SetQueryParam("group_by", qGroupBy); err != nil { + return err + } + } + } + + if o.Services != nil { + + // query param services + var qrServices string + + if o.Services != nil { + qrServices = *o.Services + } + qServices := qrServices + if qServices != "" { + + if err := r.SetQueryParam("services", qServices); err != nil { + return err + } + } + } + + if o.SignalRules != nil { + + // query param signal_rules + var qrSignalRules string + + if o.SignalRules != nil { + qrSignalRules = *o.SignalRules + } + qSignalRules := qrSignalRules + if qSignalRules != "" { + + if err := r.SetQueryParam("signal_rules", qSignalRules); err != nil { + return err + } + } + } + + if o.SortBy != nil { + + // query param sort_by + var qrSortBy string + + if o.SortBy != nil { + qrSortBy = *o.SortBy + } + qSortBy := qrSortBy + if qSortBy != "" { + + if err := r.SetQueryParam("sort_by", qSortBy); err != nil { + return err + } + } + } + + if o.SortDirection != nil { + + // query param sort_direction + var qrSortDirection string + + if o.SortDirection != nil { + qrSortDirection = *o.SortDirection + } + qSortDirection := qrSortDirection + if qSortDirection != "" { + + if err := r.SetQueryParam("sort_direction", qSortDirection); err != nil { + return err + } + } + } + + if o.StartDate != nil { + + // query param start_date + var qrStartDate strfmt.DateTime + + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate.String() + if qStartDate != "" { + + if err := r.SetQueryParam("start_date", qStartDate); err != nil { + return err + } + } + } + + if o.Tags != nil { + + // query param tags + var qrTags string + + if o.Tags != nil { + qrTags = *o.Tags + } + qTags := qrTags + if qTags != "" { + + if err := r.SetQueryParam("tags", qTags); err != nil { + return err + } + } + } + + if o.Teams != nil { + + // query param teams + var qrTeams string + + if o.Teams != nil { + qrTeams = *o.Teams + } + qTeams := qrTeams + if qTeams != "" { + + if err := r.SetQueryParam("teams", qTeams); err != nil { + return err + } + } + } + + if o.Users != nil { + + // query param users + var qrUsers string + + if o.Users != nil { + qrUsers = *o.Users + } + qUsers := qrUsers + if qUsers != "" { + + if err := r.SetQueryParam("users", qUsers); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/reporting/get_signals_timeseries_analytics_responses.go b/client/reporting/get_signals_timeseries_analytics_responses.go new file mode 100644 index 0000000..4f82a73 --- /dev/null +++ b/client/reporting/get_signals_timeseries_analytics_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSignalsTimeseriesAnalyticsReader is a Reader for the GetSignalsTimeseriesAnalytics structure. +type GetSignalsTimeseriesAnalyticsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSignalsTimeseriesAnalyticsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSignalsTimeseriesAnalyticsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSignalsTimeseriesAnalyticsOK creates a GetSignalsTimeseriesAnalyticsOK with default headers values +func NewGetSignalsTimeseriesAnalyticsOK() *GetSignalsTimeseriesAnalyticsOK { + return &GetSignalsTimeseriesAnalyticsOK{} +} + +/* +GetSignalsTimeseriesAnalyticsOK describes a response with status code 200, with default header values. + +Generate a timeseries-based report of metrics for Signals alerts +*/ +type GetSignalsTimeseriesAnalyticsOK struct { +} + +// IsSuccess returns true when this get signals timeseries analytics o k response has a 2xx status code +func (o *GetSignalsTimeseriesAnalyticsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get signals timeseries analytics o k response has a 3xx status code +func (o *GetSignalsTimeseriesAnalyticsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get signals timeseries analytics o k response has a 4xx status code +func (o *GetSignalsTimeseriesAnalyticsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get signals timeseries analytics o k response has a 5xx status code +func (o *GetSignalsTimeseriesAnalyticsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get signals timeseries analytics o k response a status code equal to that given +func (o *GetSignalsTimeseriesAnalyticsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetSignalsTimeseriesAnalyticsOK) Error() string { + return fmt.Sprintf("[GET /v1/signals/analytics/timeseries][%d] getSignalsTimeseriesAnalyticsOK ", 200) +} + +func (o *GetSignalsTimeseriesAnalyticsOK) String() string { + return fmt.Sprintf("[GET /v1/signals/analytics/timeseries][%d] getSignalsTimeseriesAnalyticsOK ", 200) +} + +func (o *GetSignalsTimeseriesAnalyticsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/reporting/list_incident_metrics_parameters.go b/client/reporting/list_incident_metrics_parameters.go new file mode 100644 index 0000000..d239321 --- /dev/null +++ b/client/reporting/list_incident_metrics_parameters.go @@ -0,0 +1,390 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListIncidentMetricsParams creates a new ListIncidentMetricsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentMetricsParams() *ListIncidentMetricsParams { + return &ListIncidentMetricsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentMetricsParamsWithTimeout creates a new ListIncidentMetricsParams object +// with the ability to set a timeout on a request. +func NewListIncidentMetricsParamsWithTimeout(timeout time.Duration) *ListIncidentMetricsParams { + return &ListIncidentMetricsParams{ + timeout: timeout, + } +} + +// NewListIncidentMetricsParamsWithContext creates a new ListIncidentMetricsParams object +// with the ability to set a context for a request. +func NewListIncidentMetricsParamsWithContext(ctx context.Context) *ListIncidentMetricsParams { + return &ListIncidentMetricsParams{ + Context: ctx, + } +} + +// NewListIncidentMetricsParamsWithHTTPClient creates a new ListIncidentMetricsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentMetricsParamsWithHTTPClient(client *http.Client) *ListIncidentMetricsParams { + return &ListIncidentMetricsParams{ + HTTPClient: client, + } +} + +/* +ListIncidentMetricsParams contains all the parameters to send to the API endpoint + + for the list incident metrics operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentMetricsParams struct { + + // BucketSize. + BucketSize *string + + // By. + By *string + + // Conditions. + Conditions *string + + /* EndDate. + + The end date to return metrics from + + Format: date + */ + EndDate *strfmt.Date + + // SortDirection. + SortDirection *string + + // SortField. + SortField *string + + // SortLimit. + // + // Format: int32 + SortLimit *int32 + + /* StartDate. + + The start date to return metrics from + + Format: date + */ + StartDate *strfmt.Date + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentMetricsParams) WithDefaults() *ListIncidentMetricsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentMetricsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident metrics params +func (o *ListIncidentMetricsParams) WithTimeout(timeout time.Duration) *ListIncidentMetricsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident metrics params +func (o *ListIncidentMetricsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident metrics params +func (o *ListIncidentMetricsParams) WithContext(ctx context.Context) *ListIncidentMetricsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident metrics params +func (o *ListIncidentMetricsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident metrics params +func (o *ListIncidentMetricsParams) WithHTTPClient(client *http.Client) *ListIncidentMetricsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident metrics params +func (o *ListIncidentMetricsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucketSize adds the bucketSize to the list incident metrics params +func (o *ListIncidentMetricsParams) WithBucketSize(bucketSize *string) *ListIncidentMetricsParams { + o.SetBucketSize(bucketSize) + return o +} + +// SetBucketSize adds the bucketSize to the list incident metrics params +func (o *ListIncidentMetricsParams) SetBucketSize(bucketSize *string) { + o.BucketSize = bucketSize +} + +// WithBy adds the by to the list incident metrics params +func (o *ListIncidentMetricsParams) WithBy(by *string) *ListIncidentMetricsParams { + o.SetBy(by) + return o +} + +// SetBy adds the by to the list incident metrics params +func (o *ListIncidentMetricsParams) SetBy(by *string) { + o.By = by +} + +// WithConditions adds the conditions to the list incident metrics params +func (o *ListIncidentMetricsParams) WithConditions(conditions *string) *ListIncidentMetricsParams { + o.SetConditions(conditions) + return o +} + +// SetConditions adds the conditions to the list incident metrics params +func (o *ListIncidentMetricsParams) SetConditions(conditions *string) { + o.Conditions = conditions +} + +// WithEndDate adds the endDate to the list incident metrics params +func (o *ListIncidentMetricsParams) WithEndDate(endDate *strfmt.Date) *ListIncidentMetricsParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the list incident metrics params +func (o *ListIncidentMetricsParams) SetEndDate(endDate *strfmt.Date) { + o.EndDate = endDate +} + +// WithSortDirection adds the sortDirection to the list incident metrics params +func (o *ListIncidentMetricsParams) WithSortDirection(sortDirection *string) *ListIncidentMetricsParams { + o.SetSortDirection(sortDirection) + return o +} + +// SetSortDirection adds the sortDirection to the list incident metrics params +func (o *ListIncidentMetricsParams) SetSortDirection(sortDirection *string) { + o.SortDirection = sortDirection +} + +// WithSortField adds the sortField to the list incident metrics params +func (o *ListIncidentMetricsParams) WithSortField(sortField *string) *ListIncidentMetricsParams { + o.SetSortField(sortField) + return o +} + +// SetSortField adds the sortField to the list incident metrics params +func (o *ListIncidentMetricsParams) SetSortField(sortField *string) { + o.SortField = sortField +} + +// WithSortLimit adds the sortLimit to the list incident metrics params +func (o *ListIncidentMetricsParams) WithSortLimit(sortLimit *int32) *ListIncidentMetricsParams { + o.SetSortLimit(sortLimit) + return o +} + +// SetSortLimit adds the sortLimit to the list incident metrics params +func (o *ListIncidentMetricsParams) SetSortLimit(sortLimit *int32) { + o.SortLimit = sortLimit +} + +// WithStartDate adds the startDate to the list incident metrics params +func (o *ListIncidentMetricsParams) WithStartDate(startDate *strfmt.Date) *ListIncidentMetricsParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the list incident metrics params +func (o *ListIncidentMetricsParams) SetStartDate(startDate *strfmt.Date) { + o.StartDate = startDate +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentMetricsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.BucketSize != nil { + + // query param bucket_size + var qrBucketSize string + + if o.BucketSize != nil { + qrBucketSize = *o.BucketSize + } + qBucketSize := qrBucketSize + if qBucketSize != "" { + + if err := r.SetQueryParam("bucket_size", qBucketSize); err != nil { + return err + } + } + } + + if o.By != nil { + + // query param by + var qrBy string + + if o.By != nil { + qrBy = *o.By + } + qBy := qrBy + if qBy != "" { + + if err := r.SetQueryParam("by", qBy); err != nil { + return err + } + } + } + + if o.Conditions != nil { + + // query param conditions + var qrConditions string + + if o.Conditions != nil { + qrConditions = *o.Conditions + } + qConditions := qrConditions + if qConditions != "" { + + if err := r.SetQueryParam("conditions", qConditions); err != nil { + return err + } + } + } + + if o.EndDate != nil { + + // query param end_date + var qrEndDate strfmt.Date + + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate.String() + if qEndDate != "" { + + if err := r.SetQueryParam("end_date", qEndDate); err != nil { + return err + } + } + } + + if o.SortDirection != nil { + + // query param sort_direction + var qrSortDirection string + + if o.SortDirection != nil { + qrSortDirection = *o.SortDirection + } + qSortDirection := qrSortDirection + if qSortDirection != "" { + + if err := r.SetQueryParam("sort_direction", qSortDirection); err != nil { + return err + } + } + } + + if o.SortField != nil { + + // query param sort_field + var qrSortField string + + if o.SortField != nil { + qrSortField = *o.SortField + } + qSortField := qrSortField + if qSortField != "" { + + if err := r.SetQueryParam("sort_field", qSortField); err != nil { + return err + } + } + } + + if o.SortLimit != nil { + + // query param sort_limit + var qrSortLimit int32 + + if o.SortLimit != nil { + qrSortLimit = *o.SortLimit + } + qSortLimit := swag.FormatInt32(qrSortLimit) + if qSortLimit != "" { + + if err := r.SetQueryParam("sort_limit", qSortLimit); err != nil { + return err + } + } + } + + if o.StartDate != nil { + + // query param start_date + var qrStartDate strfmt.Date + + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate.String() + if qStartDate != "" { + + if err := r.SetQueryParam("start_date", qStartDate); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/reporting/list_incident_metrics_responses.go b/client/reporting/list_incident_metrics_responses.go new file mode 100644 index 0000000..d395f49 --- /dev/null +++ b/client/reporting/list_incident_metrics_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentMetricsReader is a Reader for the ListIncidentMetrics structure. +type ListIncidentMetricsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentMetricsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentMetricsOK creates a ListIncidentMetricsOK with default headers values +func NewListIncidentMetricsOK() *ListIncidentMetricsOK { + return &ListIncidentMetricsOK{} +} + +/* +ListIncidentMetricsOK describes a response with status code 200, with default header values. + +Returns a report with time bucketed analytics data +*/ +type ListIncidentMetricsOK struct { + Payload *models.MetricsMetricsEntity +} + +// IsSuccess returns true when this list incident metrics o k response has a 2xx status code +func (o *ListIncidentMetricsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident metrics o k response has a 3xx status code +func (o *ListIncidentMetricsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident metrics o k response has a 4xx status code +func (o *ListIncidentMetricsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident metrics o k response has a 5xx status code +func (o *ListIncidentMetricsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident metrics o k response a status code equal to that given +func (o *ListIncidentMetricsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentMetricsOK) Error() string { + return fmt.Sprintf("[GET /v1/metrics/incidents][%d] listIncidentMetricsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentMetricsOK) String() string { + return fmt.Sprintf("[GET /v1/metrics/incidents][%d] listIncidentMetricsOK %+v", 200, o.Payload) +} + +func (o *ListIncidentMetricsOK) GetPayload() *models.MetricsMetricsEntity { + return o.Payload +} + +func (o *ListIncidentMetricsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.MetricsMetricsEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/reporting/list_infrastructure_metrics_parameters.go b/client/reporting/list_infrastructure_metrics_parameters.go new file mode 100644 index 0000000..75a7b6f --- /dev/null +++ b/client/reporting/list_infrastructure_metrics_parameters.go @@ -0,0 +1,242 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListInfrastructureMetricsParams creates a new ListInfrastructureMetricsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListInfrastructureMetricsParams() *ListInfrastructureMetricsParams { + return &ListInfrastructureMetricsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListInfrastructureMetricsParamsWithTimeout creates a new ListInfrastructureMetricsParams object +// with the ability to set a timeout on a request. +func NewListInfrastructureMetricsParamsWithTimeout(timeout time.Duration) *ListInfrastructureMetricsParams { + return &ListInfrastructureMetricsParams{ + timeout: timeout, + } +} + +// NewListInfrastructureMetricsParamsWithContext creates a new ListInfrastructureMetricsParams object +// with the ability to set a context for a request. +func NewListInfrastructureMetricsParamsWithContext(ctx context.Context) *ListInfrastructureMetricsParams { + return &ListInfrastructureMetricsParams{ + Context: ctx, + } +} + +// NewListInfrastructureMetricsParamsWithHTTPClient creates a new ListInfrastructureMetricsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListInfrastructureMetricsParamsWithHTTPClient(client *http.Client) *ListInfrastructureMetricsParams { + return &ListInfrastructureMetricsParams{ + HTTPClient: client, + } +} + +/* +ListInfrastructureMetricsParams contains all the parameters to send to the API endpoint + + for the list infrastructure metrics operation. + + Typically these are written to a http.Request. +*/ +type ListInfrastructureMetricsParams struct { + + /* EndDate. + + The end date to return metrics from, defaults to today + + Format: date + */ + EndDate *strfmt.Date + + /* InfraID. + + Component UUID + */ + InfraID string + + // InfraType. + InfraType string + + /* StartDate. + + The start date to return metrics from; defaults to 30 days ago + + Format: date + */ + StartDate *strfmt.Date + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list infrastructure metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListInfrastructureMetricsParams) WithDefaults() *ListInfrastructureMetricsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list infrastructure metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListInfrastructureMetricsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list infrastructure metrics params +func (o *ListInfrastructureMetricsParams) WithTimeout(timeout time.Duration) *ListInfrastructureMetricsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list infrastructure metrics params +func (o *ListInfrastructureMetricsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list infrastructure metrics params +func (o *ListInfrastructureMetricsParams) WithContext(ctx context.Context) *ListInfrastructureMetricsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list infrastructure metrics params +func (o *ListInfrastructureMetricsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list infrastructure metrics params +func (o *ListInfrastructureMetricsParams) WithHTTPClient(client *http.Client) *ListInfrastructureMetricsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list infrastructure metrics params +func (o *ListInfrastructureMetricsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndDate adds the endDate to the list infrastructure metrics params +func (o *ListInfrastructureMetricsParams) WithEndDate(endDate *strfmt.Date) *ListInfrastructureMetricsParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the list infrastructure metrics params +func (o *ListInfrastructureMetricsParams) SetEndDate(endDate *strfmt.Date) { + o.EndDate = endDate +} + +// WithInfraID adds the infraID to the list infrastructure metrics params +func (o *ListInfrastructureMetricsParams) WithInfraID(infraID string) *ListInfrastructureMetricsParams { + o.SetInfraID(infraID) + return o +} + +// SetInfraID adds the infraId to the list infrastructure metrics params +func (o *ListInfrastructureMetricsParams) SetInfraID(infraID string) { + o.InfraID = infraID +} + +// WithInfraType adds the infraType to the list infrastructure metrics params +func (o *ListInfrastructureMetricsParams) WithInfraType(infraType string) *ListInfrastructureMetricsParams { + o.SetInfraType(infraType) + return o +} + +// SetInfraType adds the infraType to the list infrastructure metrics params +func (o *ListInfrastructureMetricsParams) SetInfraType(infraType string) { + o.InfraType = infraType +} + +// WithStartDate adds the startDate to the list infrastructure metrics params +func (o *ListInfrastructureMetricsParams) WithStartDate(startDate *strfmt.Date) *ListInfrastructureMetricsParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the list infrastructure metrics params +func (o *ListInfrastructureMetricsParams) SetStartDate(startDate *strfmt.Date) { + o.StartDate = startDate +} + +// WriteToRequest writes these params to a swagger request +func (o *ListInfrastructureMetricsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EndDate != nil { + + // query param end_date + var qrEndDate strfmt.Date + + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate.String() + if qEndDate != "" { + + if err := r.SetQueryParam("end_date", qEndDate); err != nil { + return err + } + } + } + + // path param infra_id + if err := r.SetPathParam("infra_id", o.InfraID); err != nil { + return err + } + + // path param infra_type + if err := r.SetPathParam("infra_type", o.InfraType); err != nil { + return err + } + + if o.StartDate != nil { + + // query param start_date + var qrStartDate strfmt.Date + + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate.String() + if qStartDate != "" { + + if err := r.SetQueryParam("start_date", qStartDate); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/reporting/list_infrastructure_metrics_responses.go b/client/reporting/list_infrastructure_metrics_responses.go new file mode 100644 index 0000000..7ce15d3 --- /dev/null +++ b/client/reporting/list_infrastructure_metrics_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListInfrastructureMetricsReader is a Reader for the ListInfrastructureMetrics structure. +type ListInfrastructureMetricsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListInfrastructureMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListInfrastructureMetricsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListInfrastructureMetricsOK creates a ListInfrastructureMetricsOK with default headers values +func NewListInfrastructureMetricsOK() *ListInfrastructureMetricsOK { + return &ListInfrastructureMetricsOK{} +} + +/* +ListInfrastructureMetricsOK describes a response with status code 200, with default header values. + +Return metrics for a specific component +*/ +type ListInfrastructureMetricsOK struct { + Payload *models.MetricsInfrastructureMetricsEntity +} + +// IsSuccess returns true when this list infrastructure metrics o k response has a 2xx status code +func (o *ListInfrastructureMetricsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list infrastructure metrics o k response has a 3xx status code +func (o *ListInfrastructureMetricsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list infrastructure metrics o k response has a 4xx status code +func (o *ListInfrastructureMetricsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list infrastructure metrics o k response has a 5xx status code +func (o *ListInfrastructureMetricsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list infrastructure metrics o k response a status code equal to that given +func (o *ListInfrastructureMetricsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListInfrastructureMetricsOK) Error() string { + return fmt.Sprintf("[GET /v1/metrics/{infra_type}/{infra_id}][%d] listInfrastructureMetricsOK %+v", 200, o.Payload) +} + +func (o *ListInfrastructureMetricsOK) String() string { + return fmt.Sprintf("[GET /v1/metrics/{infra_type}/{infra_id}][%d] listInfrastructureMetricsOK %+v", 200, o.Payload) +} + +func (o *ListInfrastructureMetricsOK) GetPayload() *models.MetricsInfrastructureMetricsEntity { + return o.Payload +} + +func (o *ListInfrastructureMetricsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.MetricsInfrastructureMetricsEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/reporting/list_infrastructure_type_metrics_parameters.go b/client/reporting/list_infrastructure_type_metrics_parameters.go new file mode 100644 index 0000000..d3cf9dd --- /dev/null +++ b/client/reporting/list_infrastructure_type_metrics_parameters.go @@ -0,0 +1,220 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListInfrastructureTypeMetricsParams creates a new ListInfrastructureTypeMetricsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListInfrastructureTypeMetricsParams() *ListInfrastructureTypeMetricsParams { + return &ListInfrastructureTypeMetricsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListInfrastructureTypeMetricsParamsWithTimeout creates a new ListInfrastructureTypeMetricsParams object +// with the ability to set a timeout on a request. +func NewListInfrastructureTypeMetricsParamsWithTimeout(timeout time.Duration) *ListInfrastructureTypeMetricsParams { + return &ListInfrastructureTypeMetricsParams{ + timeout: timeout, + } +} + +// NewListInfrastructureTypeMetricsParamsWithContext creates a new ListInfrastructureTypeMetricsParams object +// with the ability to set a context for a request. +func NewListInfrastructureTypeMetricsParamsWithContext(ctx context.Context) *ListInfrastructureTypeMetricsParams { + return &ListInfrastructureTypeMetricsParams{ + Context: ctx, + } +} + +// NewListInfrastructureTypeMetricsParamsWithHTTPClient creates a new ListInfrastructureTypeMetricsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListInfrastructureTypeMetricsParamsWithHTTPClient(client *http.Client) *ListInfrastructureTypeMetricsParams { + return &ListInfrastructureTypeMetricsParams{ + HTTPClient: client, + } +} + +/* +ListInfrastructureTypeMetricsParams contains all the parameters to send to the API endpoint + + for the list infrastructure type metrics operation. + + Typically these are written to a http.Request. +*/ +type ListInfrastructureTypeMetricsParams struct { + + /* EndDate. + + The end date to return metrics from, defaults to today + + Format: date + */ + EndDate *strfmt.Date + + // InfraType. + InfraType string + + /* StartDate. + + The start date to return metrics from; defaults to 30 days ago + + Format: date + */ + StartDate *strfmt.Date + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list infrastructure type metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListInfrastructureTypeMetricsParams) WithDefaults() *ListInfrastructureTypeMetricsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list infrastructure type metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListInfrastructureTypeMetricsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list infrastructure type metrics params +func (o *ListInfrastructureTypeMetricsParams) WithTimeout(timeout time.Duration) *ListInfrastructureTypeMetricsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list infrastructure type metrics params +func (o *ListInfrastructureTypeMetricsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list infrastructure type metrics params +func (o *ListInfrastructureTypeMetricsParams) WithContext(ctx context.Context) *ListInfrastructureTypeMetricsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list infrastructure type metrics params +func (o *ListInfrastructureTypeMetricsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list infrastructure type metrics params +func (o *ListInfrastructureTypeMetricsParams) WithHTTPClient(client *http.Client) *ListInfrastructureTypeMetricsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list infrastructure type metrics params +func (o *ListInfrastructureTypeMetricsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndDate adds the endDate to the list infrastructure type metrics params +func (o *ListInfrastructureTypeMetricsParams) WithEndDate(endDate *strfmt.Date) *ListInfrastructureTypeMetricsParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the list infrastructure type metrics params +func (o *ListInfrastructureTypeMetricsParams) SetEndDate(endDate *strfmt.Date) { + o.EndDate = endDate +} + +// WithInfraType adds the infraType to the list infrastructure type metrics params +func (o *ListInfrastructureTypeMetricsParams) WithInfraType(infraType string) *ListInfrastructureTypeMetricsParams { + o.SetInfraType(infraType) + return o +} + +// SetInfraType adds the infraType to the list infrastructure type metrics params +func (o *ListInfrastructureTypeMetricsParams) SetInfraType(infraType string) { + o.InfraType = infraType +} + +// WithStartDate adds the startDate to the list infrastructure type metrics params +func (o *ListInfrastructureTypeMetricsParams) WithStartDate(startDate *strfmt.Date) *ListInfrastructureTypeMetricsParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the list infrastructure type metrics params +func (o *ListInfrastructureTypeMetricsParams) SetStartDate(startDate *strfmt.Date) { + o.StartDate = startDate +} + +// WriteToRequest writes these params to a swagger request +func (o *ListInfrastructureTypeMetricsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EndDate != nil { + + // query param end_date + var qrEndDate strfmt.Date + + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate.String() + if qEndDate != "" { + + if err := r.SetQueryParam("end_date", qEndDate); err != nil { + return err + } + } + } + + // path param infra_type + if err := r.SetPathParam("infra_type", o.InfraType); err != nil { + return err + } + + if o.StartDate != nil { + + // query param start_date + var qrStartDate strfmt.Date + + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate.String() + if qStartDate != "" { + + if err := r.SetQueryParam("start_date", qStartDate); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/reporting/list_infrastructure_type_metrics_responses.go b/client/reporting/list_infrastructure_type_metrics_responses.go new file mode 100644 index 0000000..b047c1e --- /dev/null +++ b/client/reporting/list_infrastructure_type_metrics_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListInfrastructureTypeMetricsReader is a Reader for the ListInfrastructureTypeMetrics structure. +type ListInfrastructureTypeMetricsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListInfrastructureTypeMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListInfrastructureTypeMetricsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListInfrastructureTypeMetricsOK creates a ListInfrastructureTypeMetricsOK with default headers values +func NewListInfrastructureTypeMetricsOK() *ListInfrastructureTypeMetricsOK { + return &ListInfrastructureTypeMetricsOK{} +} + +/* +ListInfrastructureTypeMetricsOK describes a response with status code 200, with default header values. + +Returns metrics for all components of a given type +*/ +type ListInfrastructureTypeMetricsOK struct { + Payload *models.MetricsInfrastructureListEntity +} + +// IsSuccess returns true when this list infrastructure type metrics o k response has a 2xx status code +func (o *ListInfrastructureTypeMetricsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list infrastructure type metrics o k response has a 3xx status code +func (o *ListInfrastructureTypeMetricsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list infrastructure type metrics o k response has a 4xx status code +func (o *ListInfrastructureTypeMetricsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list infrastructure type metrics o k response has a 5xx status code +func (o *ListInfrastructureTypeMetricsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list infrastructure type metrics o k response a status code equal to that given +func (o *ListInfrastructureTypeMetricsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListInfrastructureTypeMetricsOK) Error() string { + return fmt.Sprintf("[GET /v1/metrics/{infra_type}][%d] listInfrastructureTypeMetricsOK %+v", 200, o.Payload) +} + +func (o *ListInfrastructureTypeMetricsOK) String() string { + return fmt.Sprintf("[GET /v1/metrics/{infra_type}][%d] listInfrastructureTypeMetricsOK %+v", 200, o.Payload) +} + +func (o *ListInfrastructureTypeMetricsOK) GetPayload() *models.MetricsInfrastructureListEntity { + return o.Payload +} + +func (o *ListInfrastructureTypeMetricsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.MetricsInfrastructureListEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/reporting/list_milestone_funnel_metrics_parameters.go b/client/reporting/list_milestone_funnel_metrics_parameters.go new file mode 100644 index 0000000..1a5a8c6 --- /dev/null +++ b/client/reporting/list_milestone_funnel_metrics_parameters.go @@ -0,0 +1,1212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListMilestoneFunnelMetricsParams creates a new ListMilestoneFunnelMetricsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListMilestoneFunnelMetricsParams() *ListMilestoneFunnelMetricsParams { + return &ListMilestoneFunnelMetricsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListMilestoneFunnelMetricsParamsWithTimeout creates a new ListMilestoneFunnelMetricsParams object +// with the ability to set a timeout on a request. +func NewListMilestoneFunnelMetricsParamsWithTimeout(timeout time.Duration) *ListMilestoneFunnelMetricsParams { + return &ListMilestoneFunnelMetricsParams{ + timeout: timeout, + } +} + +// NewListMilestoneFunnelMetricsParamsWithContext creates a new ListMilestoneFunnelMetricsParams object +// with the ability to set a context for a request. +func NewListMilestoneFunnelMetricsParamsWithContext(ctx context.Context) *ListMilestoneFunnelMetricsParams { + return &ListMilestoneFunnelMetricsParams{ + Context: ctx, + } +} + +// NewListMilestoneFunnelMetricsParamsWithHTTPClient creates a new ListMilestoneFunnelMetricsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListMilestoneFunnelMetricsParamsWithHTTPClient(client *http.Client) *ListMilestoneFunnelMetricsParams { + return &ListMilestoneFunnelMetricsParams{ + HTTPClient: client, + } +} + +/* +ListMilestoneFunnelMetricsParams contains all the parameters to send to the API endpoint + + for the list milestone funnel metrics operation. + + Typically these are written to a http.Request. +*/ +type ListMilestoneFunnelMetricsParams struct { + + /* Archived. + + Return archived incidents + */ + Archived *bool + + /* AssignedTeams. + + A comma separated list of IDs for assigned teams or 'is_empty' to filter for incidents with no active team assignments + */ + AssignedTeams *string + + /* ClosedAtOrAfter. + + Filters for incidents that were closed at or after this time + + Format: date-time + */ + ClosedAtOrAfter *strfmt.DateTime + + /* ClosedAtOrBefore. + + Filters for incidents that were closed at or before this time + + Format: date-time + */ + ClosedAtOrBefore *strfmt.DateTime + + /* Conditions. + + A JSON string that defines 'logic' and 'user_data' + */ + Conditions *string + + /* CreatedAtOrAfter. + + Filters for incidents that were created at or after this time + + Format: date-time + */ + CreatedAtOrAfter *strfmt.DateTime + + /* CreatedAtOrBefore. + + Filters for incidents that were created at or before this time + + Format: date-time + */ + CreatedAtOrBefore *strfmt.DateTime + + /* CurrentMilestones. + + A comma separated list of current milestones + */ + CurrentMilestones *string + + /* EndDate. + + Filters for incidents that started on or before this date + + Format: date + */ + EndDate *strfmt.Date + + /* Environments. + + A comma separated list of environment IDs or 'is_empty' to filter for incidents with no impacted environments + */ + Environments *string + + /* ExcludedInfrastructureIds. + + A comma separated list of infrastructure IDs. Returns incidents that do not have the following infrastructure ids associated with them. + */ + ExcludedInfrastructureIds *string + + /* Functionalities. + + A comma separated list of functionality IDs or 'is_empty' to filter for incidents with no impacted functionalities + */ + Functionalities *string + + // GroupBy. + GroupBy []string + + /* IncidentTypeID. + + A comma separated list of incident type IDs + */ + IncidentTypeID *string + + /* Name. + + A query to search incidents by their name + */ + Name *string + + /* Priorities. + + A text value of priority + */ + Priorities *string + + /* PriorityNotSet. + + Flag for including incidents where priority has not been set + */ + PriorityNotSet *bool + + /* Query. + + A text query for an incident that searches on name, summary, and desciption + */ + Query *string + + /* ResolvedAtOrAfter. + + Filters for incidents that were resolved at or after this time. Combine this with the `current_milestones` parameter if you wish to omit incidents that were re-opened and are still active. + + Format: date-time + */ + ResolvedAtOrAfter *strfmt.DateTime + + /* ResolvedAtOrBefore. + + Filters for incidents that were resolved at or before this time. Combine this with the `current_milestones` parameter if you wish to omit incidents that were re-opened and are still active. + + Format: date-time + */ + ResolvedAtOrBefore *strfmt.DateTime + + /* SavedSearchID. + + The id of a previously saved search. + */ + SavedSearchID *string + + /* Services. + + A comma separated list of service IDs or 'is_empty' to filter for incidents with no impacted services + */ + Services *string + + /* Severities. + + A text value of severity + */ + Severities *string + + /* SeverityNotSet. + + Flag for including incidents where severity has not been set + */ + SeverityNotSet *bool + + /* StartDate. + + Filters for incidents that started on or after this date + + Format: date + */ + StartDate *strfmt.Date + + /* Status. + + Incident status + */ + Status *string + + /* TagMatchStrategy. + + A matching strategy for the tags provided + */ + TagMatchStrategy *string + + /* Tags. + + A comma separated list of tags + */ + Tags *string + + /* Teams. + + A comma separated list of team IDs + */ + Teams *string + + /* UpdatedAfter. + + Filters for incidents that were updated after this date + + Format: date-time + */ + UpdatedAfter *strfmt.DateTime + + /* UpdatedBefore. + + Filters for incidents that were updated before this date + + Format: date-time + */ + UpdatedBefore *strfmt.DateTime + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list milestone funnel metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListMilestoneFunnelMetricsParams) WithDefaults() *ListMilestoneFunnelMetricsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list milestone funnel metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListMilestoneFunnelMetricsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithTimeout(timeout time.Duration) *ListMilestoneFunnelMetricsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithContext(ctx context.Context) *ListMilestoneFunnelMetricsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithHTTPClient(client *http.Client) *ListMilestoneFunnelMetricsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithArchived adds the archived to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithArchived(archived *bool) *ListMilestoneFunnelMetricsParams { + o.SetArchived(archived) + return o +} + +// SetArchived adds the archived to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetArchived(archived *bool) { + o.Archived = archived +} + +// WithAssignedTeams adds the assignedTeams to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithAssignedTeams(assignedTeams *string) *ListMilestoneFunnelMetricsParams { + o.SetAssignedTeams(assignedTeams) + return o +} + +// SetAssignedTeams adds the assignedTeams to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetAssignedTeams(assignedTeams *string) { + o.AssignedTeams = assignedTeams +} + +// WithClosedAtOrAfter adds the closedAtOrAfter to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithClosedAtOrAfter(closedAtOrAfter *strfmt.DateTime) *ListMilestoneFunnelMetricsParams { + o.SetClosedAtOrAfter(closedAtOrAfter) + return o +} + +// SetClosedAtOrAfter adds the closedAtOrAfter to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetClosedAtOrAfter(closedAtOrAfter *strfmt.DateTime) { + o.ClosedAtOrAfter = closedAtOrAfter +} + +// WithClosedAtOrBefore adds the closedAtOrBefore to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithClosedAtOrBefore(closedAtOrBefore *strfmt.DateTime) *ListMilestoneFunnelMetricsParams { + o.SetClosedAtOrBefore(closedAtOrBefore) + return o +} + +// SetClosedAtOrBefore adds the closedAtOrBefore to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetClosedAtOrBefore(closedAtOrBefore *strfmt.DateTime) { + o.ClosedAtOrBefore = closedAtOrBefore +} + +// WithConditions adds the conditions to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithConditions(conditions *string) *ListMilestoneFunnelMetricsParams { + o.SetConditions(conditions) + return o +} + +// SetConditions adds the conditions to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetConditions(conditions *string) { + o.Conditions = conditions +} + +// WithCreatedAtOrAfter adds the createdAtOrAfter to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithCreatedAtOrAfter(createdAtOrAfter *strfmt.DateTime) *ListMilestoneFunnelMetricsParams { + o.SetCreatedAtOrAfter(createdAtOrAfter) + return o +} + +// SetCreatedAtOrAfter adds the createdAtOrAfter to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetCreatedAtOrAfter(createdAtOrAfter *strfmt.DateTime) { + o.CreatedAtOrAfter = createdAtOrAfter +} + +// WithCreatedAtOrBefore adds the createdAtOrBefore to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithCreatedAtOrBefore(createdAtOrBefore *strfmt.DateTime) *ListMilestoneFunnelMetricsParams { + o.SetCreatedAtOrBefore(createdAtOrBefore) + return o +} + +// SetCreatedAtOrBefore adds the createdAtOrBefore to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetCreatedAtOrBefore(createdAtOrBefore *strfmt.DateTime) { + o.CreatedAtOrBefore = createdAtOrBefore +} + +// WithCurrentMilestones adds the currentMilestones to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithCurrentMilestones(currentMilestones *string) *ListMilestoneFunnelMetricsParams { + o.SetCurrentMilestones(currentMilestones) + return o +} + +// SetCurrentMilestones adds the currentMilestones to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetCurrentMilestones(currentMilestones *string) { + o.CurrentMilestones = currentMilestones +} + +// WithEndDate adds the endDate to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithEndDate(endDate *strfmt.Date) *ListMilestoneFunnelMetricsParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetEndDate(endDate *strfmt.Date) { + o.EndDate = endDate +} + +// WithEnvironments adds the environments to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithEnvironments(environments *string) *ListMilestoneFunnelMetricsParams { + o.SetEnvironments(environments) + return o +} + +// SetEnvironments adds the environments to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetEnvironments(environments *string) { + o.Environments = environments +} + +// WithExcludedInfrastructureIds adds the excludedInfrastructureIds to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithExcludedInfrastructureIds(excludedInfrastructureIds *string) *ListMilestoneFunnelMetricsParams { + o.SetExcludedInfrastructureIds(excludedInfrastructureIds) + return o +} + +// SetExcludedInfrastructureIds adds the excludedInfrastructureIds to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetExcludedInfrastructureIds(excludedInfrastructureIds *string) { + o.ExcludedInfrastructureIds = excludedInfrastructureIds +} + +// WithFunctionalities adds the functionalities to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithFunctionalities(functionalities *string) *ListMilestoneFunnelMetricsParams { + o.SetFunctionalities(functionalities) + return o +} + +// SetFunctionalities adds the functionalities to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetFunctionalities(functionalities *string) { + o.Functionalities = functionalities +} + +// WithGroupBy adds the groupBy to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithGroupBy(groupBy []string) *ListMilestoneFunnelMetricsParams { + o.SetGroupBy(groupBy) + return o +} + +// SetGroupBy adds the groupBy to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetGroupBy(groupBy []string) { + o.GroupBy = groupBy +} + +// WithIncidentTypeID adds the incidentTypeID to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithIncidentTypeID(incidentTypeID *string) *ListMilestoneFunnelMetricsParams { + o.SetIncidentTypeID(incidentTypeID) + return o +} + +// SetIncidentTypeID adds the incidentTypeId to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetIncidentTypeID(incidentTypeID *string) { + o.IncidentTypeID = incidentTypeID +} + +// WithName adds the name to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithName(name *string) *ListMilestoneFunnelMetricsParams { + o.SetName(name) + return o +} + +// SetName adds the name to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetName(name *string) { + o.Name = name +} + +// WithPriorities adds the priorities to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithPriorities(priorities *string) *ListMilestoneFunnelMetricsParams { + o.SetPriorities(priorities) + return o +} + +// SetPriorities adds the priorities to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetPriorities(priorities *string) { + o.Priorities = priorities +} + +// WithPriorityNotSet adds the priorityNotSet to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithPriorityNotSet(priorityNotSet *bool) *ListMilestoneFunnelMetricsParams { + o.SetPriorityNotSet(priorityNotSet) + return o +} + +// SetPriorityNotSet adds the priorityNotSet to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetPriorityNotSet(priorityNotSet *bool) { + o.PriorityNotSet = priorityNotSet +} + +// WithQuery adds the query to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithQuery(query *string) *ListMilestoneFunnelMetricsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetQuery(query *string) { + o.Query = query +} + +// WithResolvedAtOrAfter adds the resolvedAtOrAfter to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithResolvedAtOrAfter(resolvedAtOrAfter *strfmt.DateTime) *ListMilestoneFunnelMetricsParams { + o.SetResolvedAtOrAfter(resolvedAtOrAfter) + return o +} + +// SetResolvedAtOrAfter adds the resolvedAtOrAfter to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetResolvedAtOrAfter(resolvedAtOrAfter *strfmt.DateTime) { + o.ResolvedAtOrAfter = resolvedAtOrAfter +} + +// WithResolvedAtOrBefore adds the resolvedAtOrBefore to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithResolvedAtOrBefore(resolvedAtOrBefore *strfmt.DateTime) *ListMilestoneFunnelMetricsParams { + o.SetResolvedAtOrBefore(resolvedAtOrBefore) + return o +} + +// SetResolvedAtOrBefore adds the resolvedAtOrBefore to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetResolvedAtOrBefore(resolvedAtOrBefore *strfmt.DateTime) { + o.ResolvedAtOrBefore = resolvedAtOrBefore +} + +// WithSavedSearchID adds the savedSearchID to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithSavedSearchID(savedSearchID *string) *ListMilestoneFunnelMetricsParams { + o.SetSavedSearchID(savedSearchID) + return o +} + +// SetSavedSearchID adds the savedSearchId to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetSavedSearchID(savedSearchID *string) { + o.SavedSearchID = savedSearchID +} + +// WithServices adds the services to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithServices(services *string) *ListMilestoneFunnelMetricsParams { + o.SetServices(services) + return o +} + +// SetServices adds the services to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetServices(services *string) { + o.Services = services +} + +// WithSeverities adds the severities to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithSeverities(severities *string) *ListMilestoneFunnelMetricsParams { + o.SetSeverities(severities) + return o +} + +// SetSeverities adds the severities to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetSeverities(severities *string) { + o.Severities = severities +} + +// WithSeverityNotSet adds the severityNotSet to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithSeverityNotSet(severityNotSet *bool) *ListMilestoneFunnelMetricsParams { + o.SetSeverityNotSet(severityNotSet) + return o +} + +// SetSeverityNotSet adds the severityNotSet to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetSeverityNotSet(severityNotSet *bool) { + o.SeverityNotSet = severityNotSet +} + +// WithStartDate adds the startDate to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithStartDate(startDate *strfmt.Date) *ListMilestoneFunnelMetricsParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetStartDate(startDate *strfmt.Date) { + o.StartDate = startDate +} + +// WithStatus adds the status to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithStatus(status *string) *ListMilestoneFunnelMetricsParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetStatus(status *string) { + o.Status = status +} + +// WithTagMatchStrategy adds the tagMatchStrategy to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithTagMatchStrategy(tagMatchStrategy *string) *ListMilestoneFunnelMetricsParams { + o.SetTagMatchStrategy(tagMatchStrategy) + return o +} + +// SetTagMatchStrategy adds the tagMatchStrategy to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetTagMatchStrategy(tagMatchStrategy *string) { + o.TagMatchStrategy = tagMatchStrategy +} + +// WithTags adds the tags to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithTags(tags *string) *ListMilestoneFunnelMetricsParams { + o.SetTags(tags) + return o +} + +// SetTags adds the tags to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetTags(tags *string) { + o.Tags = tags +} + +// WithTeams adds the teams to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithTeams(teams *string) *ListMilestoneFunnelMetricsParams { + o.SetTeams(teams) + return o +} + +// SetTeams adds the teams to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetTeams(teams *string) { + o.Teams = teams +} + +// WithUpdatedAfter adds the updatedAfter to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithUpdatedAfter(updatedAfter *strfmt.DateTime) *ListMilestoneFunnelMetricsParams { + o.SetUpdatedAfter(updatedAfter) + return o +} + +// SetUpdatedAfter adds the updatedAfter to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetUpdatedAfter(updatedAfter *strfmt.DateTime) { + o.UpdatedAfter = updatedAfter +} + +// WithUpdatedBefore adds the updatedBefore to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) WithUpdatedBefore(updatedBefore *strfmt.DateTime) *ListMilestoneFunnelMetricsParams { + o.SetUpdatedBefore(updatedBefore) + return o +} + +// SetUpdatedBefore adds the updatedBefore to the list milestone funnel metrics params +func (o *ListMilestoneFunnelMetricsParams) SetUpdatedBefore(updatedBefore *strfmt.DateTime) { + o.UpdatedBefore = updatedBefore +} + +// WriteToRequest writes these params to a swagger request +func (o *ListMilestoneFunnelMetricsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Archived != nil { + + // query param archived + var qrArchived bool + + if o.Archived != nil { + qrArchived = *o.Archived + } + qArchived := swag.FormatBool(qrArchived) + if qArchived != "" { + + if err := r.SetQueryParam("archived", qArchived); err != nil { + return err + } + } + } + + if o.AssignedTeams != nil { + + // query param assigned_teams + var qrAssignedTeams string + + if o.AssignedTeams != nil { + qrAssignedTeams = *o.AssignedTeams + } + qAssignedTeams := qrAssignedTeams + if qAssignedTeams != "" { + + if err := r.SetQueryParam("assigned_teams", qAssignedTeams); err != nil { + return err + } + } + } + + if o.ClosedAtOrAfter != nil { + + // query param closed_at_or_after + var qrClosedAtOrAfter strfmt.DateTime + + if o.ClosedAtOrAfter != nil { + qrClosedAtOrAfter = *o.ClosedAtOrAfter + } + qClosedAtOrAfter := qrClosedAtOrAfter.String() + if qClosedAtOrAfter != "" { + + if err := r.SetQueryParam("closed_at_or_after", qClosedAtOrAfter); err != nil { + return err + } + } + } + + if o.ClosedAtOrBefore != nil { + + // query param closed_at_or_before + var qrClosedAtOrBefore strfmt.DateTime + + if o.ClosedAtOrBefore != nil { + qrClosedAtOrBefore = *o.ClosedAtOrBefore + } + qClosedAtOrBefore := qrClosedAtOrBefore.String() + if qClosedAtOrBefore != "" { + + if err := r.SetQueryParam("closed_at_or_before", qClosedAtOrBefore); err != nil { + return err + } + } + } + + if o.Conditions != nil { + + // query param conditions + var qrConditions string + + if o.Conditions != nil { + qrConditions = *o.Conditions + } + qConditions := qrConditions + if qConditions != "" { + + if err := r.SetQueryParam("conditions", qConditions); err != nil { + return err + } + } + } + + if o.CreatedAtOrAfter != nil { + + // query param created_at_or_after + var qrCreatedAtOrAfter strfmt.DateTime + + if o.CreatedAtOrAfter != nil { + qrCreatedAtOrAfter = *o.CreatedAtOrAfter + } + qCreatedAtOrAfter := qrCreatedAtOrAfter.String() + if qCreatedAtOrAfter != "" { + + if err := r.SetQueryParam("created_at_or_after", qCreatedAtOrAfter); err != nil { + return err + } + } + } + + if o.CreatedAtOrBefore != nil { + + // query param created_at_or_before + var qrCreatedAtOrBefore strfmt.DateTime + + if o.CreatedAtOrBefore != nil { + qrCreatedAtOrBefore = *o.CreatedAtOrBefore + } + qCreatedAtOrBefore := qrCreatedAtOrBefore.String() + if qCreatedAtOrBefore != "" { + + if err := r.SetQueryParam("created_at_or_before", qCreatedAtOrBefore); err != nil { + return err + } + } + } + + if o.CurrentMilestones != nil { + + // query param current_milestones + var qrCurrentMilestones string + + if o.CurrentMilestones != nil { + qrCurrentMilestones = *o.CurrentMilestones + } + qCurrentMilestones := qrCurrentMilestones + if qCurrentMilestones != "" { + + if err := r.SetQueryParam("current_milestones", qCurrentMilestones); err != nil { + return err + } + } + } + + if o.EndDate != nil { + + // query param end_date + var qrEndDate strfmt.Date + + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate.String() + if qEndDate != "" { + + if err := r.SetQueryParam("end_date", qEndDate); err != nil { + return err + } + } + } + + if o.Environments != nil { + + // query param environments + var qrEnvironments string + + if o.Environments != nil { + qrEnvironments = *o.Environments + } + qEnvironments := qrEnvironments + if qEnvironments != "" { + + if err := r.SetQueryParam("environments", qEnvironments); err != nil { + return err + } + } + } + + if o.ExcludedInfrastructureIds != nil { + + // query param excluded_infrastructure_ids + var qrExcludedInfrastructureIds string + + if o.ExcludedInfrastructureIds != nil { + qrExcludedInfrastructureIds = *o.ExcludedInfrastructureIds + } + qExcludedInfrastructureIds := qrExcludedInfrastructureIds + if qExcludedInfrastructureIds != "" { + + if err := r.SetQueryParam("excluded_infrastructure_ids", qExcludedInfrastructureIds); err != nil { + return err + } + } + } + + if o.Functionalities != nil { + + // query param functionalities + var qrFunctionalities string + + if o.Functionalities != nil { + qrFunctionalities = *o.Functionalities + } + qFunctionalities := qrFunctionalities + if qFunctionalities != "" { + + if err := r.SetQueryParam("functionalities", qFunctionalities); err != nil { + return err + } + } + } + + if o.GroupBy != nil { + + // binding items for group_by + joinedGroupBy := o.bindParamGroupBy(reg) + + // form array param group_by + if err := r.SetFormParam("group_by", joinedGroupBy...); err != nil { + return err + } + } + + if o.IncidentTypeID != nil { + + // query param incident_type_id + var qrIncidentTypeID string + + if o.IncidentTypeID != nil { + qrIncidentTypeID = *o.IncidentTypeID + } + qIncidentTypeID := qrIncidentTypeID + if qIncidentTypeID != "" { + + if err := r.SetQueryParam("incident_type_id", qIncidentTypeID); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.Priorities != nil { + + // query param priorities + var qrPriorities string + + if o.Priorities != nil { + qrPriorities = *o.Priorities + } + qPriorities := qrPriorities + if qPriorities != "" { + + if err := r.SetQueryParam("priorities", qPriorities); err != nil { + return err + } + } + } + + if o.PriorityNotSet != nil { + + // query param priority_not_set + var qrPriorityNotSet bool + + if o.PriorityNotSet != nil { + qrPriorityNotSet = *o.PriorityNotSet + } + qPriorityNotSet := swag.FormatBool(qrPriorityNotSet) + if qPriorityNotSet != "" { + + if err := r.SetQueryParam("priority_not_set", qPriorityNotSet); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if o.ResolvedAtOrAfter != nil { + + // query param resolved_at_or_after + var qrResolvedAtOrAfter strfmt.DateTime + + if o.ResolvedAtOrAfter != nil { + qrResolvedAtOrAfter = *o.ResolvedAtOrAfter + } + qResolvedAtOrAfter := qrResolvedAtOrAfter.String() + if qResolvedAtOrAfter != "" { + + if err := r.SetQueryParam("resolved_at_or_after", qResolvedAtOrAfter); err != nil { + return err + } + } + } + + if o.ResolvedAtOrBefore != nil { + + // query param resolved_at_or_before + var qrResolvedAtOrBefore strfmt.DateTime + + if o.ResolvedAtOrBefore != nil { + qrResolvedAtOrBefore = *o.ResolvedAtOrBefore + } + qResolvedAtOrBefore := qrResolvedAtOrBefore.String() + if qResolvedAtOrBefore != "" { + + if err := r.SetQueryParam("resolved_at_or_before", qResolvedAtOrBefore); err != nil { + return err + } + } + } + + if o.SavedSearchID != nil { + + // query param saved_search_id + var qrSavedSearchID string + + if o.SavedSearchID != nil { + qrSavedSearchID = *o.SavedSearchID + } + qSavedSearchID := qrSavedSearchID + if qSavedSearchID != "" { + + if err := r.SetQueryParam("saved_search_id", qSavedSearchID); err != nil { + return err + } + } + } + + if o.Services != nil { + + // query param services + var qrServices string + + if o.Services != nil { + qrServices = *o.Services + } + qServices := qrServices + if qServices != "" { + + if err := r.SetQueryParam("services", qServices); err != nil { + return err + } + } + } + + if o.Severities != nil { + + // query param severities + var qrSeverities string + + if o.Severities != nil { + qrSeverities = *o.Severities + } + qSeverities := qrSeverities + if qSeverities != "" { + + if err := r.SetQueryParam("severities", qSeverities); err != nil { + return err + } + } + } + + if o.SeverityNotSet != nil { + + // query param severity_not_set + var qrSeverityNotSet bool + + if o.SeverityNotSet != nil { + qrSeverityNotSet = *o.SeverityNotSet + } + qSeverityNotSet := swag.FormatBool(qrSeverityNotSet) + if qSeverityNotSet != "" { + + if err := r.SetQueryParam("severity_not_set", qSeverityNotSet); err != nil { + return err + } + } + } + + if o.StartDate != nil { + + // query param start_date + var qrStartDate strfmt.Date + + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate.String() + if qStartDate != "" { + + if err := r.SetQueryParam("start_date", qStartDate); err != nil { + return err + } + } + } + + if o.Status != nil { + + // query param status + var qrStatus string + + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + + if err := r.SetQueryParam("status", qStatus); err != nil { + return err + } + } + } + + if o.TagMatchStrategy != nil { + + // query param tag_match_strategy + var qrTagMatchStrategy string + + if o.TagMatchStrategy != nil { + qrTagMatchStrategy = *o.TagMatchStrategy + } + qTagMatchStrategy := qrTagMatchStrategy + if qTagMatchStrategy != "" { + + if err := r.SetQueryParam("tag_match_strategy", qTagMatchStrategy); err != nil { + return err + } + } + } + + if o.Tags != nil { + + // query param tags + var qrTags string + + if o.Tags != nil { + qrTags = *o.Tags + } + qTags := qrTags + if qTags != "" { + + if err := r.SetQueryParam("tags", qTags); err != nil { + return err + } + } + } + + if o.Teams != nil { + + // query param teams + var qrTeams string + + if o.Teams != nil { + qrTeams = *o.Teams + } + qTeams := qrTeams + if qTeams != "" { + + if err := r.SetQueryParam("teams", qTeams); err != nil { + return err + } + } + } + + if o.UpdatedAfter != nil { + + // query param updated_after + var qrUpdatedAfter strfmt.DateTime + + if o.UpdatedAfter != nil { + qrUpdatedAfter = *o.UpdatedAfter + } + qUpdatedAfter := qrUpdatedAfter.String() + if qUpdatedAfter != "" { + + if err := r.SetQueryParam("updated_after", qUpdatedAfter); err != nil { + return err + } + } + } + + if o.UpdatedBefore != nil { + + // query param updated_before + var qrUpdatedBefore strfmt.DateTime + + if o.UpdatedBefore != nil { + qrUpdatedBefore = *o.UpdatedBefore + } + qUpdatedBefore := qrUpdatedBefore.String() + if qUpdatedBefore != "" { + + if err := r.SetQueryParam("updated_before", qUpdatedBefore); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamListMilestoneFunnelMetrics binds the parameter group_by +func (o *ListMilestoneFunnelMetricsParams) bindParamGroupBy(formats strfmt.Registry) []string { + groupByIR := o.GroupBy + + var groupByIC []string + for _, groupByIIR := range groupByIR { // explode []string + + groupByIIV := groupByIIR // string as string + groupByIC = append(groupByIC, groupByIIV) + } + + // items.CollectionFormat: "" + groupByIS := swag.JoinByFormat(groupByIC, "") + + return groupByIS +} diff --git a/client/reporting/list_milestone_funnel_metrics_responses.go b/client/reporting/list_milestone_funnel_metrics_responses.go new file mode 100644 index 0000000..41c3309 --- /dev/null +++ b/client/reporting/list_milestone_funnel_metrics_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListMilestoneFunnelMetricsReader is a Reader for the ListMilestoneFunnelMetrics structure. +type ListMilestoneFunnelMetricsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListMilestoneFunnelMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListMilestoneFunnelMetricsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListMilestoneFunnelMetricsOK creates a ListMilestoneFunnelMetricsOK with default headers values +func NewListMilestoneFunnelMetricsOK() *ListMilestoneFunnelMetricsOK { + return &ListMilestoneFunnelMetricsOK{} +} + +/* +ListMilestoneFunnelMetricsOK describes a response with status code 200, with default header values. + +Returns a report with time bucketed milestone data +*/ +type ListMilestoneFunnelMetricsOK struct { + Payload *models.MetricsMilestonesFunnelEntity +} + +// IsSuccess returns true when this list milestone funnel metrics o k response has a 2xx status code +func (o *ListMilestoneFunnelMetricsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list milestone funnel metrics o k response has a 3xx status code +func (o *ListMilestoneFunnelMetricsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list milestone funnel metrics o k response has a 4xx status code +func (o *ListMilestoneFunnelMetricsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list milestone funnel metrics o k response has a 5xx status code +func (o *ListMilestoneFunnelMetricsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list milestone funnel metrics o k response a status code equal to that given +func (o *ListMilestoneFunnelMetricsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListMilestoneFunnelMetricsOK) Error() string { + return fmt.Sprintf("[GET /v1/metrics/milestone_funnel][%d] listMilestoneFunnelMetricsOK %+v", 200, o.Payload) +} + +func (o *ListMilestoneFunnelMetricsOK) String() string { + return fmt.Sprintf("[GET /v1/metrics/milestone_funnel][%d] listMilestoneFunnelMetricsOK %+v", 200, o.Payload) +} + +func (o *ListMilestoneFunnelMetricsOK) GetPayload() *models.MetricsMilestonesFunnelEntity { + return o.Payload +} + +func (o *ListMilestoneFunnelMetricsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.MetricsMilestonesFunnelEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/reporting/list_mttx_metrics_parameters.go b/client/reporting/list_mttx_metrics_parameters.go new file mode 100644 index 0000000..0caab5a --- /dev/null +++ b/client/reporting/list_mttx_metrics_parameters.go @@ -0,0 +1,1360 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListMttxMetricsParams creates a new ListMttxMetricsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListMttxMetricsParams() *ListMttxMetricsParams { + return &ListMttxMetricsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListMttxMetricsParamsWithTimeout creates a new ListMttxMetricsParams object +// with the ability to set a timeout on a request. +func NewListMttxMetricsParamsWithTimeout(timeout time.Duration) *ListMttxMetricsParams { + return &ListMttxMetricsParams{ + timeout: timeout, + } +} + +// NewListMttxMetricsParamsWithContext creates a new ListMttxMetricsParams object +// with the ability to set a context for a request. +func NewListMttxMetricsParamsWithContext(ctx context.Context) *ListMttxMetricsParams { + return &ListMttxMetricsParams{ + Context: ctx, + } +} + +// NewListMttxMetricsParamsWithHTTPClient creates a new ListMttxMetricsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListMttxMetricsParamsWithHTTPClient(client *http.Client) *ListMttxMetricsParams { + return &ListMttxMetricsParams{ + HTTPClient: client, + } +} + +/* +ListMttxMetricsParams contains all the parameters to send to the API endpoint + + for the list mttx metrics operation. + + Typically these are written to a http.Request. +*/ +type ListMttxMetricsParams struct { + + /* Archived. + + Return archived incidents + */ + Archived *bool + + /* AssignedTeams. + + A comma separated list of IDs for assigned teams or 'is_empty' to filter for incidents with no active team assignments + */ + AssignedTeams *string + + /* ClosedAtOrAfter. + + Filters for incidents that were closed at or after this time + + Format: date-time + */ + ClosedAtOrAfter *strfmt.DateTime + + /* ClosedAtOrBefore. + + Filters for incidents that were closed at or before this time + + Format: date-time + */ + ClosedAtOrBefore *strfmt.DateTime + + /* Conditions. + + A JSON string that defines 'logic' and 'user_data' + */ + Conditions *string + + /* CreatedAtOrAfter. + + Filters for incidents that were created at or after this time + + Format: date-time + */ + CreatedAtOrAfter *strfmt.DateTime + + /* CreatedAtOrBefore. + + Filters for incidents that were created at or before this time + + Format: date-time + */ + CreatedAtOrBefore *strfmt.DateTime + + /* CurrentMilestones. + + A comma separated list of current milestones + */ + CurrentMilestones *string + + // CustomFieldID. + CustomFieldID *string + + /* EndDate. + + Filters for incidents that started on or before this date + + Format: date + */ + EndDate strfmt.Date + + /* Environments. + + A comma separated list of environment IDs or 'is_empty' to filter for incidents with no impacted environments + */ + Environments *string + + /* ExcludedInfrastructureIds. + + A comma separated list of infrastructure IDs. Returns incidents that do not have the following infrastructure ids associated with them. + */ + ExcludedInfrastructureIds *string + + /* Functionalities. + + A comma separated list of functionality IDs or 'is_empty' to filter for incidents with no impacted functionalities + */ + Functionalities *string + + // GroupBy. + GroupBy []string + + /* IncidentTypeID. + + A comma separated list of incident type IDs + */ + IncidentTypeID *string + + /* Measurements. + + Comma-separated list of measurements to include in the response + */ + Measurements *string + + /* Name. + + A query to search incidents by their name + */ + Name *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Priorities. + + A text value of priority + */ + Priorities *string + + /* PriorityNotSet. + + Flag for including incidents where priority has not been set + */ + PriorityNotSet *bool + + /* Query. + + A text query for an incident that searches on name, summary, and desciption + */ + Query *string + + /* ResolvedAtOrAfter. + + Filters for incidents that were resolved at or after this time. Combine this with the `current_milestones` parameter if you wish to omit incidents that were re-opened and are still active. + + Format: date-time + */ + ResolvedAtOrAfter *strfmt.DateTime + + /* ResolvedAtOrBefore. + + Filters for incidents that were resolved at or before this time. Combine this with the `current_milestones` parameter if you wish to omit incidents that were re-opened and are still active. + + Format: date-time + */ + ResolvedAtOrBefore *strfmt.DateTime + + /* SavedSearchID. + + The id of a previously saved search. + */ + SavedSearchID *string + + /* Services. + + A comma separated list of service IDs or 'is_empty' to filter for incidents with no impacted services + */ + Services *string + + /* Severities. + + A text value of severity + */ + Severities *string + + /* SeverityNotSet. + + Flag for including incidents where severity has not been set + */ + SeverityNotSet *bool + + // SortBy. + SortBy *string + + /* StartDate. + + Filters for incidents that started on or after this date + + Format: date + */ + StartDate strfmt.Date + + /* Status. + + Incident status + */ + Status *string + + /* TagMatchStrategy. + + A matching strategy for the tags provided + */ + TagMatchStrategy *string + + /* Tags. + + A comma separated list of tags + */ + Tags *string + + /* Teams. + + A comma separated list of team IDs + */ + Teams *string + + /* UpdatedAfter. + + Filters for incidents that were updated after this date + + Format: date-time + */ + UpdatedAfter *strfmt.DateTime + + /* UpdatedBefore. + + Filters for incidents that were updated before this date + + Format: date-time + */ + UpdatedBefore *strfmt.DateTime + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list mttx metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListMttxMetricsParams) WithDefaults() *ListMttxMetricsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list mttx metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListMttxMetricsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list mttx metrics params +func (o *ListMttxMetricsParams) WithTimeout(timeout time.Duration) *ListMttxMetricsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list mttx metrics params +func (o *ListMttxMetricsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list mttx metrics params +func (o *ListMttxMetricsParams) WithContext(ctx context.Context) *ListMttxMetricsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list mttx metrics params +func (o *ListMttxMetricsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list mttx metrics params +func (o *ListMttxMetricsParams) WithHTTPClient(client *http.Client) *ListMttxMetricsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list mttx metrics params +func (o *ListMttxMetricsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithArchived adds the archived to the list mttx metrics params +func (o *ListMttxMetricsParams) WithArchived(archived *bool) *ListMttxMetricsParams { + o.SetArchived(archived) + return o +} + +// SetArchived adds the archived to the list mttx metrics params +func (o *ListMttxMetricsParams) SetArchived(archived *bool) { + o.Archived = archived +} + +// WithAssignedTeams adds the assignedTeams to the list mttx metrics params +func (o *ListMttxMetricsParams) WithAssignedTeams(assignedTeams *string) *ListMttxMetricsParams { + o.SetAssignedTeams(assignedTeams) + return o +} + +// SetAssignedTeams adds the assignedTeams to the list mttx metrics params +func (o *ListMttxMetricsParams) SetAssignedTeams(assignedTeams *string) { + o.AssignedTeams = assignedTeams +} + +// WithClosedAtOrAfter adds the closedAtOrAfter to the list mttx metrics params +func (o *ListMttxMetricsParams) WithClosedAtOrAfter(closedAtOrAfter *strfmt.DateTime) *ListMttxMetricsParams { + o.SetClosedAtOrAfter(closedAtOrAfter) + return o +} + +// SetClosedAtOrAfter adds the closedAtOrAfter to the list mttx metrics params +func (o *ListMttxMetricsParams) SetClosedAtOrAfter(closedAtOrAfter *strfmt.DateTime) { + o.ClosedAtOrAfter = closedAtOrAfter +} + +// WithClosedAtOrBefore adds the closedAtOrBefore to the list mttx metrics params +func (o *ListMttxMetricsParams) WithClosedAtOrBefore(closedAtOrBefore *strfmt.DateTime) *ListMttxMetricsParams { + o.SetClosedAtOrBefore(closedAtOrBefore) + return o +} + +// SetClosedAtOrBefore adds the closedAtOrBefore to the list mttx metrics params +func (o *ListMttxMetricsParams) SetClosedAtOrBefore(closedAtOrBefore *strfmt.DateTime) { + o.ClosedAtOrBefore = closedAtOrBefore +} + +// WithConditions adds the conditions to the list mttx metrics params +func (o *ListMttxMetricsParams) WithConditions(conditions *string) *ListMttxMetricsParams { + o.SetConditions(conditions) + return o +} + +// SetConditions adds the conditions to the list mttx metrics params +func (o *ListMttxMetricsParams) SetConditions(conditions *string) { + o.Conditions = conditions +} + +// WithCreatedAtOrAfter adds the createdAtOrAfter to the list mttx metrics params +func (o *ListMttxMetricsParams) WithCreatedAtOrAfter(createdAtOrAfter *strfmt.DateTime) *ListMttxMetricsParams { + o.SetCreatedAtOrAfter(createdAtOrAfter) + return o +} + +// SetCreatedAtOrAfter adds the createdAtOrAfter to the list mttx metrics params +func (o *ListMttxMetricsParams) SetCreatedAtOrAfter(createdAtOrAfter *strfmt.DateTime) { + o.CreatedAtOrAfter = createdAtOrAfter +} + +// WithCreatedAtOrBefore adds the createdAtOrBefore to the list mttx metrics params +func (o *ListMttxMetricsParams) WithCreatedAtOrBefore(createdAtOrBefore *strfmt.DateTime) *ListMttxMetricsParams { + o.SetCreatedAtOrBefore(createdAtOrBefore) + return o +} + +// SetCreatedAtOrBefore adds the createdAtOrBefore to the list mttx metrics params +func (o *ListMttxMetricsParams) SetCreatedAtOrBefore(createdAtOrBefore *strfmt.DateTime) { + o.CreatedAtOrBefore = createdAtOrBefore +} + +// WithCurrentMilestones adds the currentMilestones to the list mttx metrics params +func (o *ListMttxMetricsParams) WithCurrentMilestones(currentMilestones *string) *ListMttxMetricsParams { + o.SetCurrentMilestones(currentMilestones) + return o +} + +// SetCurrentMilestones adds the currentMilestones to the list mttx metrics params +func (o *ListMttxMetricsParams) SetCurrentMilestones(currentMilestones *string) { + o.CurrentMilestones = currentMilestones +} + +// WithCustomFieldID adds the customFieldID to the list mttx metrics params +func (o *ListMttxMetricsParams) WithCustomFieldID(customFieldID *string) *ListMttxMetricsParams { + o.SetCustomFieldID(customFieldID) + return o +} + +// SetCustomFieldID adds the customFieldId to the list mttx metrics params +func (o *ListMttxMetricsParams) SetCustomFieldID(customFieldID *string) { + o.CustomFieldID = customFieldID +} + +// WithEndDate adds the endDate to the list mttx metrics params +func (o *ListMttxMetricsParams) WithEndDate(endDate strfmt.Date) *ListMttxMetricsParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the list mttx metrics params +func (o *ListMttxMetricsParams) SetEndDate(endDate strfmt.Date) { + o.EndDate = endDate +} + +// WithEnvironments adds the environments to the list mttx metrics params +func (o *ListMttxMetricsParams) WithEnvironments(environments *string) *ListMttxMetricsParams { + o.SetEnvironments(environments) + return o +} + +// SetEnvironments adds the environments to the list mttx metrics params +func (o *ListMttxMetricsParams) SetEnvironments(environments *string) { + o.Environments = environments +} + +// WithExcludedInfrastructureIds adds the excludedInfrastructureIds to the list mttx metrics params +func (o *ListMttxMetricsParams) WithExcludedInfrastructureIds(excludedInfrastructureIds *string) *ListMttxMetricsParams { + o.SetExcludedInfrastructureIds(excludedInfrastructureIds) + return o +} + +// SetExcludedInfrastructureIds adds the excludedInfrastructureIds to the list mttx metrics params +func (o *ListMttxMetricsParams) SetExcludedInfrastructureIds(excludedInfrastructureIds *string) { + o.ExcludedInfrastructureIds = excludedInfrastructureIds +} + +// WithFunctionalities adds the functionalities to the list mttx metrics params +func (o *ListMttxMetricsParams) WithFunctionalities(functionalities *string) *ListMttxMetricsParams { + o.SetFunctionalities(functionalities) + return o +} + +// SetFunctionalities adds the functionalities to the list mttx metrics params +func (o *ListMttxMetricsParams) SetFunctionalities(functionalities *string) { + o.Functionalities = functionalities +} + +// WithGroupBy adds the groupBy to the list mttx metrics params +func (o *ListMttxMetricsParams) WithGroupBy(groupBy []string) *ListMttxMetricsParams { + o.SetGroupBy(groupBy) + return o +} + +// SetGroupBy adds the groupBy to the list mttx metrics params +func (o *ListMttxMetricsParams) SetGroupBy(groupBy []string) { + o.GroupBy = groupBy +} + +// WithIncidentTypeID adds the incidentTypeID to the list mttx metrics params +func (o *ListMttxMetricsParams) WithIncidentTypeID(incidentTypeID *string) *ListMttxMetricsParams { + o.SetIncidentTypeID(incidentTypeID) + return o +} + +// SetIncidentTypeID adds the incidentTypeId to the list mttx metrics params +func (o *ListMttxMetricsParams) SetIncidentTypeID(incidentTypeID *string) { + o.IncidentTypeID = incidentTypeID +} + +// WithMeasurements adds the measurements to the list mttx metrics params +func (o *ListMttxMetricsParams) WithMeasurements(measurements *string) *ListMttxMetricsParams { + o.SetMeasurements(measurements) + return o +} + +// SetMeasurements adds the measurements to the list mttx metrics params +func (o *ListMttxMetricsParams) SetMeasurements(measurements *string) { + o.Measurements = measurements +} + +// WithName adds the name to the list mttx metrics params +func (o *ListMttxMetricsParams) WithName(name *string) *ListMttxMetricsParams { + o.SetName(name) + return o +} + +// SetName adds the name to the list mttx metrics params +func (o *ListMttxMetricsParams) SetName(name *string) { + o.Name = name +} + +// WithPage adds the page to the list mttx metrics params +func (o *ListMttxMetricsParams) WithPage(page *int32) *ListMttxMetricsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list mttx metrics params +func (o *ListMttxMetricsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list mttx metrics params +func (o *ListMttxMetricsParams) WithPerPage(perPage *int32) *ListMttxMetricsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list mttx metrics params +func (o *ListMttxMetricsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithPriorities adds the priorities to the list mttx metrics params +func (o *ListMttxMetricsParams) WithPriorities(priorities *string) *ListMttxMetricsParams { + o.SetPriorities(priorities) + return o +} + +// SetPriorities adds the priorities to the list mttx metrics params +func (o *ListMttxMetricsParams) SetPriorities(priorities *string) { + o.Priorities = priorities +} + +// WithPriorityNotSet adds the priorityNotSet to the list mttx metrics params +func (o *ListMttxMetricsParams) WithPriorityNotSet(priorityNotSet *bool) *ListMttxMetricsParams { + o.SetPriorityNotSet(priorityNotSet) + return o +} + +// SetPriorityNotSet adds the priorityNotSet to the list mttx metrics params +func (o *ListMttxMetricsParams) SetPriorityNotSet(priorityNotSet *bool) { + o.PriorityNotSet = priorityNotSet +} + +// WithQuery adds the query to the list mttx metrics params +func (o *ListMttxMetricsParams) WithQuery(query *string) *ListMttxMetricsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list mttx metrics params +func (o *ListMttxMetricsParams) SetQuery(query *string) { + o.Query = query +} + +// WithResolvedAtOrAfter adds the resolvedAtOrAfter to the list mttx metrics params +func (o *ListMttxMetricsParams) WithResolvedAtOrAfter(resolvedAtOrAfter *strfmt.DateTime) *ListMttxMetricsParams { + o.SetResolvedAtOrAfter(resolvedAtOrAfter) + return o +} + +// SetResolvedAtOrAfter adds the resolvedAtOrAfter to the list mttx metrics params +func (o *ListMttxMetricsParams) SetResolvedAtOrAfter(resolvedAtOrAfter *strfmt.DateTime) { + o.ResolvedAtOrAfter = resolvedAtOrAfter +} + +// WithResolvedAtOrBefore adds the resolvedAtOrBefore to the list mttx metrics params +func (o *ListMttxMetricsParams) WithResolvedAtOrBefore(resolvedAtOrBefore *strfmt.DateTime) *ListMttxMetricsParams { + o.SetResolvedAtOrBefore(resolvedAtOrBefore) + return o +} + +// SetResolvedAtOrBefore adds the resolvedAtOrBefore to the list mttx metrics params +func (o *ListMttxMetricsParams) SetResolvedAtOrBefore(resolvedAtOrBefore *strfmt.DateTime) { + o.ResolvedAtOrBefore = resolvedAtOrBefore +} + +// WithSavedSearchID adds the savedSearchID to the list mttx metrics params +func (o *ListMttxMetricsParams) WithSavedSearchID(savedSearchID *string) *ListMttxMetricsParams { + o.SetSavedSearchID(savedSearchID) + return o +} + +// SetSavedSearchID adds the savedSearchId to the list mttx metrics params +func (o *ListMttxMetricsParams) SetSavedSearchID(savedSearchID *string) { + o.SavedSearchID = savedSearchID +} + +// WithServices adds the services to the list mttx metrics params +func (o *ListMttxMetricsParams) WithServices(services *string) *ListMttxMetricsParams { + o.SetServices(services) + return o +} + +// SetServices adds the services to the list mttx metrics params +func (o *ListMttxMetricsParams) SetServices(services *string) { + o.Services = services +} + +// WithSeverities adds the severities to the list mttx metrics params +func (o *ListMttxMetricsParams) WithSeverities(severities *string) *ListMttxMetricsParams { + o.SetSeverities(severities) + return o +} + +// SetSeverities adds the severities to the list mttx metrics params +func (o *ListMttxMetricsParams) SetSeverities(severities *string) { + o.Severities = severities +} + +// WithSeverityNotSet adds the severityNotSet to the list mttx metrics params +func (o *ListMttxMetricsParams) WithSeverityNotSet(severityNotSet *bool) *ListMttxMetricsParams { + o.SetSeverityNotSet(severityNotSet) + return o +} + +// SetSeverityNotSet adds the severityNotSet to the list mttx metrics params +func (o *ListMttxMetricsParams) SetSeverityNotSet(severityNotSet *bool) { + o.SeverityNotSet = severityNotSet +} + +// WithSortBy adds the sortBy to the list mttx metrics params +func (o *ListMttxMetricsParams) WithSortBy(sortBy *string) *ListMttxMetricsParams { + o.SetSortBy(sortBy) + return o +} + +// SetSortBy adds the sortBy to the list mttx metrics params +func (o *ListMttxMetricsParams) SetSortBy(sortBy *string) { + o.SortBy = sortBy +} + +// WithStartDate adds the startDate to the list mttx metrics params +func (o *ListMttxMetricsParams) WithStartDate(startDate strfmt.Date) *ListMttxMetricsParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the list mttx metrics params +func (o *ListMttxMetricsParams) SetStartDate(startDate strfmt.Date) { + o.StartDate = startDate +} + +// WithStatus adds the status to the list mttx metrics params +func (o *ListMttxMetricsParams) WithStatus(status *string) *ListMttxMetricsParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the list mttx metrics params +func (o *ListMttxMetricsParams) SetStatus(status *string) { + o.Status = status +} + +// WithTagMatchStrategy adds the tagMatchStrategy to the list mttx metrics params +func (o *ListMttxMetricsParams) WithTagMatchStrategy(tagMatchStrategy *string) *ListMttxMetricsParams { + o.SetTagMatchStrategy(tagMatchStrategy) + return o +} + +// SetTagMatchStrategy adds the tagMatchStrategy to the list mttx metrics params +func (o *ListMttxMetricsParams) SetTagMatchStrategy(tagMatchStrategy *string) { + o.TagMatchStrategy = tagMatchStrategy +} + +// WithTags adds the tags to the list mttx metrics params +func (o *ListMttxMetricsParams) WithTags(tags *string) *ListMttxMetricsParams { + o.SetTags(tags) + return o +} + +// SetTags adds the tags to the list mttx metrics params +func (o *ListMttxMetricsParams) SetTags(tags *string) { + o.Tags = tags +} + +// WithTeams adds the teams to the list mttx metrics params +func (o *ListMttxMetricsParams) WithTeams(teams *string) *ListMttxMetricsParams { + o.SetTeams(teams) + return o +} + +// SetTeams adds the teams to the list mttx metrics params +func (o *ListMttxMetricsParams) SetTeams(teams *string) { + o.Teams = teams +} + +// WithUpdatedAfter adds the updatedAfter to the list mttx metrics params +func (o *ListMttxMetricsParams) WithUpdatedAfter(updatedAfter *strfmt.DateTime) *ListMttxMetricsParams { + o.SetUpdatedAfter(updatedAfter) + return o +} + +// SetUpdatedAfter adds the updatedAfter to the list mttx metrics params +func (o *ListMttxMetricsParams) SetUpdatedAfter(updatedAfter *strfmt.DateTime) { + o.UpdatedAfter = updatedAfter +} + +// WithUpdatedBefore adds the updatedBefore to the list mttx metrics params +func (o *ListMttxMetricsParams) WithUpdatedBefore(updatedBefore *strfmt.DateTime) *ListMttxMetricsParams { + o.SetUpdatedBefore(updatedBefore) + return o +} + +// SetUpdatedBefore adds the updatedBefore to the list mttx metrics params +func (o *ListMttxMetricsParams) SetUpdatedBefore(updatedBefore *strfmt.DateTime) { + o.UpdatedBefore = updatedBefore +} + +// WriteToRequest writes these params to a swagger request +func (o *ListMttxMetricsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Archived != nil { + + // query param archived + var qrArchived bool + + if o.Archived != nil { + qrArchived = *o.Archived + } + qArchived := swag.FormatBool(qrArchived) + if qArchived != "" { + + if err := r.SetQueryParam("archived", qArchived); err != nil { + return err + } + } + } + + if o.AssignedTeams != nil { + + // query param assigned_teams + var qrAssignedTeams string + + if o.AssignedTeams != nil { + qrAssignedTeams = *o.AssignedTeams + } + qAssignedTeams := qrAssignedTeams + if qAssignedTeams != "" { + + if err := r.SetQueryParam("assigned_teams", qAssignedTeams); err != nil { + return err + } + } + } + + if o.ClosedAtOrAfter != nil { + + // query param closed_at_or_after + var qrClosedAtOrAfter strfmt.DateTime + + if o.ClosedAtOrAfter != nil { + qrClosedAtOrAfter = *o.ClosedAtOrAfter + } + qClosedAtOrAfter := qrClosedAtOrAfter.String() + if qClosedAtOrAfter != "" { + + if err := r.SetQueryParam("closed_at_or_after", qClosedAtOrAfter); err != nil { + return err + } + } + } + + if o.ClosedAtOrBefore != nil { + + // query param closed_at_or_before + var qrClosedAtOrBefore strfmt.DateTime + + if o.ClosedAtOrBefore != nil { + qrClosedAtOrBefore = *o.ClosedAtOrBefore + } + qClosedAtOrBefore := qrClosedAtOrBefore.String() + if qClosedAtOrBefore != "" { + + if err := r.SetQueryParam("closed_at_or_before", qClosedAtOrBefore); err != nil { + return err + } + } + } + + if o.Conditions != nil { + + // query param conditions + var qrConditions string + + if o.Conditions != nil { + qrConditions = *o.Conditions + } + qConditions := qrConditions + if qConditions != "" { + + if err := r.SetQueryParam("conditions", qConditions); err != nil { + return err + } + } + } + + if o.CreatedAtOrAfter != nil { + + // query param created_at_or_after + var qrCreatedAtOrAfter strfmt.DateTime + + if o.CreatedAtOrAfter != nil { + qrCreatedAtOrAfter = *o.CreatedAtOrAfter + } + qCreatedAtOrAfter := qrCreatedAtOrAfter.String() + if qCreatedAtOrAfter != "" { + + if err := r.SetQueryParam("created_at_or_after", qCreatedAtOrAfter); err != nil { + return err + } + } + } + + if o.CreatedAtOrBefore != nil { + + // query param created_at_or_before + var qrCreatedAtOrBefore strfmt.DateTime + + if o.CreatedAtOrBefore != nil { + qrCreatedAtOrBefore = *o.CreatedAtOrBefore + } + qCreatedAtOrBefore := qrCreatedAtOrBefore.String() + if qCreatedAtOrBefore != "" { + + if err := r.SetQueryParam("created_at_or_before", qCreatedAtOrBefore); err != nil { + return err + } + } + } + + if o.CurrentMilestones != nil { + + // query param current_milestones + var qrCurrentMilestones string + + if o.CurrentMilestones != nil { + qrCurrentMilestones = *o.CurrentMilestones + } + qCurrentMilestones := qrCurrentMilestones + if qCurrentMilestones != "" { + + if err := r.SetQueryParam("current_milestones", qCurrentMilestones); err != nil { + return err + } + } + } + + if o.CustomFieldID != nil { + + // query param custom_field_id + var qrCustomFieldID string + + if o.CustomFieldID != nil { + qrCustomFieldID = *o.CustomFieldID + } + qCustomFieldID := qrCustomFieldID + if qCustomFieldID != "" { + + if err := r.SetQueryParam("custom_field_id", qCustomFieldID); err != nil { + return err + } + } + } + + // query param end_date + qrEndDate := o.EndDate + qEndDate := qrEndDate.String() + if qEndDate != "" { + + if err := r.SetQueryParam("end_date", qEndDate); err != nil { + return err + } + } + + if o.Environments != nil { + + // query param environments + var qrEnvironments string + + if o.Environments != nil { + qrEnvironments = *o.Environments + } + qEnvironments := qrEnvironments + if qEnvironments != "" { + + if err := r.SetQueryParam("environments", qEnvironments); err != nil { + return err + } + } + } + + if o.ExcludedInfrastructureIds != nil { + + // query param excluded_infrastructure_ids + var qrExcludedInfrastructureIds string + + if o.ExcludedInfrastructureIds != nil { + qrExcludedInfrastructureIds = *o.ExcludedInfrastructureIds + } + qExcludedInfrastructureIds := qrExcludedInfrastructureIds + if qExcludedInfrastructureIds != "" { + + if err := r.SetQueryParam("excluded_infrastructure_ids", qExcludedInfrastructureIds); err != nil { + return err + } + } + } + + if o.Functionalities != nil { + + // query param functionalities + var qrFunctionalities string + + if o.Functionalities != nil { + qrFunctionalities = *o.Functionalities + } + qFunctionalities := qrFunctionalities + if qFunctionalities != "" { + + if err := r.SetQueryParam("functionalities", qFunctionalities); err != nil { + return err + } + } + } + + if o.GroupBy != nil { + + // binding items for group_by + joinedGroupBy := o.bindParamGroupBy(reg) + + // form array param group_by + if err := r.SetFormParam("group_by", joinedGroupBy...); err != nil { + return err + } + } + + if o.IncidentTypeID != nil { + + // query param incident_type_id + var qrIncidentTypeID string + + if o.IncidentTypeID != nil { + qrIncidentTypeID = *o.IncidentTypeID + } + qIncidentTypeID := qrIncidentTypeID + if qIncidentTypeID != "" { + + if err := r.SetQueryParam("incident_type_id", qIncidentTypeID); err != nil { + return err + } + } + } + + if o.Measurements != nil { + + // query param measurements + var qrMeasurements string + + if o.Measurements != nil { + qrMeasurements = *o.Measurements + } + qMeasurements := qrMeasurements + if qMeasurements != "" { + + if err := r.SetQueryParam("measurements", qMeasurements); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Priorities != nil { + + // query param priorities + var qrPriorities string + + if o.Priorities != nil { + qrPriorities = *o.Priorities + } + qPriorities := qrPriorities + if qPriorities != "" { + + if err := r.SetQueryParam("priorities", qPriorities); err != nil { + return err + } + } + } + + if o.PriorityNotSet != nil { + + // query param priority_not_set + var qrPriorityNotSet bool + + if o.PriorityNotSet != nil { + qrPriorityNotSet = *o.PriorityNotSet + } + qPriorityNotSet := swag.FormatBool(qrPriorityNotSet) + if qPriorityNotSet != "" { + + if err := r.SetQueryParam("priority_not_set", qPriorityNotSet); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if o.ResolvedAtOrAfter != nil { + + // query param resolved_at_or_after + var qrResolvedAtOrAfter strfmt.DateTime + + if o.ResolvedAtOrAfter != nil { + qrResolvedAtOrAfter = *o.ResolvedAtOrAfter + } + qResolvedAtOrAfter := qrResolvedAtOrAfter.String() + if qResolvedAtOrAfter != "" { + + if err := r.SetQueryParam("resolved_at_or_after", qResolvedAtOrAfter); err != nil { + return err + } + } + } + + if o.ResolvedAtOrBefore != nil { + + // query param resolved_at_or_before + var qrResolvedAtOrBefore strfmt.DateTime + + if o.ResolvedAtOrBefore != nil { + qrResolvedAtOrBefore = *o.ResolvedAtOrBefore + } + qResolvedAtOrBefore := qrResolvedAtOrBefore.String() + if qResolvedAtOrBefore != "" { + + if err := r.SetQueryParam("resolved_at_or_before", qResolvedAtOrBefore); err != nil { + return err + } + } + } + + if o.SavedSearchID != nil { + + // query param saved_search_id + var qrSavedSearchID string + + if o.SavedSearchID != nil { + qrSavedSearchID = *o.SavedSearchID + } + qSavedSearchID := qrSavedSearchID + if qSavedSearchID != "" { + + if err := r.SetQueryParam("saved_search_id", qSavedSearchID); err != nil { + return err + } + } + } + + if o.Services != nil { + + // query param services + var qrServices string + + if o.Services != nil { + qrServices = *o.Services + } + qServices := qrServices + if qServices != "" { + + if err := r.SetQueryParam("services", qServices); err != nil { + return err + } + } + } + + if o.Severities != nil { + + // query param severities + var qrSeverities string + + if o.Severities != nil { + qrSeverities = *o.Severities + } + qSeverities := qrSeverities + if qSeverities != "" { + + if err := r.SetQueryParam("severities", qSeverities); err != nil { + return err + } + } + } + + if o.SeverityNotSet != nil { + + // query param severity_not_set + var qrSeverityNotSet bool + + if o.SeverityNotSet != nil { + qrSeverityNotSet = *o.SeverityNotSet + } + qSeverityNotSet := swag.FormatBool(qrSeverityNotSet) + if qSeverityNotSet != "" { + + if err := r.SetQueryParam("severity_not_set", qSeverityNotSet); err != nil { + return err + } + } + } + + if o.SortBy != nil { + + // query param sort_by + var qrSortBy string + + if o.SortBy != nil { + qrSortBy = *o.SortBy + } + qSortBy := qrSortBy + if qSortBy != "" { + + if err := r.SetQueryParam("sort_by", qSortBy); err != nil { + return err + } + } + } + + // query param start_date + qrStartDate := o.StartDate + qStartDate := qrStartDate.String() + if qStartDate != "" { + + if err := r.SetQueryParam("start_date", qStartDate); err != nil { + return err + } + } + + if o.Status != nil { + + // query param status + var qrStatus string + + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + + if err := r.SetQueryParam("status", qStatus); err != nil { + return err + } + } + } + + if o.TagMatchStrategy != nil { + + // query param tag_match_strategy + var qrTagMatchStrategy string + + if o.TagMatchStrategy != nil { + qrTagMatchStrategy = *o.TagMatchStrategy + } + qTagMatchStrategy := qrTagMatchStrategy + if qTagMatchStrategy != "" { + + if err := r.SetQueryParam("tag_match_strategy", qTagMatchStrategy); err != nil { + return err + } + } + } + + if o.Tags != nil { + + // query param tags + var qrTags string + + if o.Tags != nil { + qrTags = *o.Tags + } + qTags := qrTags + if qTags != "" { + + if err := r.SetQueryParam("tags", qTags); err != nil { + return err + } + } + } + + if o.Teams != nil { + + // query param teams + var qrTeams string + + if o.Teams != nil { + qrTeams = *o.Teams + } + qTeams := qrTeams + if qTeams != "" { + + if err := r.SetQueryParam("teams", qTeams); err != nil { + return err + } + } + } + + if o.UpdatedAfter != nil { + + // query param updated_after + var qrUpdatedAfter strfmt.DateTime + + if o.UpdatedAfter != nil { + qrUpdatedAfter = *o.UpdatedAfter + } + qUpdatedAfter := qrUpdatedAfter.String() + if qUpdatedAfter != "" { + + if err := r.SetQueryParam("updated_after", qUpdatedAfter); err != nil { + return err + } + } + } + + if o.UpdatedBefore != nil { + + // query param updated_before + var qrUpdatedBefore strfmt.DateTime + + if o.UpdatedBefore != nil { + qrUpdatedBefore = *o.UpdatedBefore + } + qUpdatedBefore := qrUpdatedBefore.String() + if qUpdatedBefore != "" { + + if err := r.SetQueryParam("updated_before", qUpdatedBefore); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamListMttxMetrics binds the parameter group_by +func (o *ListMttxMetricsParams) bindParamGroupBy(formats strfmt.Registry) []string { + groupByIR := o.GroupBy + + var groupByIC []string + for _, groupByIIR := range groupByIR { // explode []string + + groupByIIV := groupByIIR // string as string + groupByIC = append(groupByIC, groupByIIV) + } + + // items.CollectionFormat: "" + groupByIS := swag.JoinByFormat(groupByIC, "") + + return groupByIS +} diff --git a/client/reporting/list_mttx_metrics_responses.go b/client/reporting/list_mttx_metrics_responses.go new file mode 100644 index 0000000..305d75c --- /dev/null +++ b/client/reporting/list_mttx_metrics_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListMttxMetricsReader is a Reader for the ListMttxMetrics structure. +type ListMttxMetricsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListMttxMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListMttxMetricsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListMttxMetricsOK creates a ListMttxMetricsOK with default headers values +func NewListMttxMetricsOK() *ListMttxMetricsOK { + return &ListMttxMetricsOK{} +} + +/* +ListMttxMetricsOK describes a response with status code 200, with default header values. + +Fetch infrastructure metrics based on custom query +*/ +type ListMttxMetricsOK struct { + Payload *models.MetricsMttxDataEntity +} + +// IsSuccess returns true when this list mttx metrics o k response has a 2xx status code +func (o *ListMttxMetricsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list mttx metrics o k response has a 3xx status code +func (o *ListMttxMetricsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list mttx metrics o k response has a 4xx status code +func (o *ListMttxMetricsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list mttx metrics o k response has a 5xx status code +func (o *ListMttxMetricsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list mttx metrics o k response a status code equal to that given +func (o *ListMttxMetricsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListMttxMetricsOK) Error() string { + return fmt.Sprintf("[GET /v1/metrics/mttx][%d] listMttxMetricsOK %+v", 200, o.Payload) +} + +func (o *ListMttxMetricsOK) String() string { + return fmt.Sprintf("[GET /v1/metrics/mttx][%d] listMttxMetricsOK %+v", 200, o.Payload) +} + +func (o *ListMttxMetricsOK) GetPayload() *models.MetricsMttxDataEntity { + return o.Payload +} + +func (o *ListMttxMetricsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.MetricsMttxDataEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/reporting/list_retrospective_metrics_parameters.go b/client/reporting/list_retrospective_metrics_parameters.go new file mode 100644 index 0000000..e813e88 --- /dev/null +++ b/client/reporting/list_retrospective_metrics_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListRetrospectiveMetricsParams creates a new ListRetrospectiveMetricsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListRetrospectiveMetricsParams() *ListRetrospectiveMetricsParams { + return &ListRetrospectiveMetricsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListRetrospectiveMetricsParamsWithTimeout creates a new ListRetrospectiveMetricsParams object +// with the ability to set a timeout on a request. +func NewListRetrospectiveMetricsParamsWithTimeout(timeout time.Duration) *ListRetrospectiveMetricsParams { + return &ListRetrospectiveMetricsParams{ + timeout: timeout, + } +} + +// NewListRetrospectiveMetricsParamsWithContext creates a new ListRetrospectiveMetricsParams object +// with the ability to set a context for a request. +func NewListRetrospectiveMetricsParamsWithContext(ctx context.Context) *ListRetrospectiveMetricsParams { + return &ListRetrospectiveMetricsParams{ + Context: ctx, + } +} + +// NewListRetrospectiveMetricsParamsWithHTTPClient creates a new ListRetrospectiveMetricsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListRetrospectiveMetricsParamsWithHTTPClient(client *http.Client) *ListRetrospectiveMetricsParams { + return &ListRetrospectiveMetricsParams{ + HTTPClient: client, + } +} + +/* +ListRetrospectiveMetricsParams contains all the parameters to send to the API endpoint + + for the list retrospective metrics operation. + + Typically these are written to a http.Request. +*/ +type ListRetrospectiveMetricsParams struct { + + /* EndDate. + + The end date to return metrics from + + Format: date + */ + EndDate *strfmt.Date + + /* StartDate. + + The start date to return metrics from + + Format: date + */ + StartDate *strfmt.Date + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list retrospective metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRetrospectiveMetricsParams) WithDefaults() *ListRetrospectiveMetricsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list retrospective metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRetrospectiveMetricsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list retrospective metrics params +func (o *ListRetrospectiveMetricsParams) WithTimeout(timeout time.Duration) *ListRetrospectiveMetricsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list retrospective metrics params +func (o *ListRetrospectiveMetricsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list retrospective metrics params +func (o *ListRetrospectiveMetricsParams) WithContext(ctx context.Context) *ListRetrospectiveMetricsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list retrospective metrics params +func (o *ListRetrospectiveMetricsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list retrospective metrics params +func (o *ListRetrospectiveMetricsParams) WithHTTPClient(client *http.Client) *ListRetrospectiveMetricsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list retrospective metrics params +func (o *ListRetrospectiveMetricsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEndDate adds the endDate to the list retrospective metrics params +func (o *ListRetrospectiveMetricsParams) WithEndDate(endDate *strfmt.Date) *ListRetrospectiveMetricsParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the list retrospective metrics params +func (o *ListRetrospectiveMetricsParams) SetEndDate(endDate *strfmt.Date) { + o.EndDate = endDate +} + +// WithStartDate adds the startDate to the list retrospective metrics params +func (o *ListRetrospectiveMetricsParams) WithStartDate(startDate *strfmt.Date) *ListRetrospectiveMetricsParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the list retrospective metrics params +func (o *ListRetrospectiveMetricsParams) SetStartDate(startDate *strfmt.Date) { + o.StartDate = startDate +} + +// WriteToRequest writes these params to a swagger request +func (o *ListRetrospectiveMetricsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EndDate != nil { + + // query param end_date + var qrEndDate strfmt.Date + + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate.String() + if qEndDate != "" { + + if err := r.SetQueryParam("end_date", qEndDate); err != nil { + return err + } + } + } + + if o.StartDate != nil { + + // query param start_date + var qrStartDate strfmt.Date + + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate.String() + if qStartDate != "" { + + if err := r.SetQueryParam("start_date", qStartDate); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/reporting/list_retrospective_metrics_responses.go b/client/reporting/list_retrospective_metrics_responses.go new file mode 100644 index 0000000..d961055 --- /dev/null +++ b/client/reporting/list_retrospective_metrics_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListRetrospectiveMetricsReader is a Reader for the ListRetrospectiveMetrics structure. +type ListRetrospectiveMetricsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListRetrospectiveMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListRetrospectiveMetricsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListRetrospectiveMetricsOK creates a ListRetrospectiveMetricsOK with default headers values +func NewListRetrospectiveMetricsOK() *ListRetrospectiveMetricsOK { + return &ListRetrospectiveMetricsOK{} +} + +/* +ListRetrospectiveMetricsOK describes a response with status code 200, with default header values. + +Returns a report with retrospective analytics data +*/ +type ListRetrospectiveMetricsOK struct { + Payload *models.MetricsRetrospectiveEntity +} + +// IsSuccess returns true when this list retrospective metrics o k response has a 2xx status code +func (o *ListRetrospectiveMetricsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list retrospective metrics o k response has a 3xx status code +func (o *ListRetrospectiveMetricsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list retrospective metrics o k response has a 4xx status code +func (o *ListRetrospectiveMetricsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list retrospective metrics o k response has a 5xx status code +func (o *ListRetrospectiveMetricsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list retrospective metrics o k response a status code equal to that given +func (o *ListRetrospectiveMetricsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListRetrospectiveMetricsOK) Error() string { + return fmt.Sprintf("[GET /v1/metrics/retrospectives][%d] listRetrospectiveMetricsOK %+v", 200, o.Payload) +} + +func (o *ListRetrospectiveMetricsOK) String() string { + return fmt.Sprintf("[GET /v1/metrics/retrospectives][%d] listRetrospectiveMetricsOK %+v", 200, o.Payload) +} + +func (o *ListRetrospectiveMetricsOK) GetPayload() *models.MetricsRetrospectiveEntity { + return o.Payload +} + +func (o *ListRetrospectiveMetricsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.MetricsRetrospectiveEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/reporting/list_saved_searches_parameters.go b/client/reporting/list_saved_searches_parameters.go new file mode 100644 index 0000000..0c7ee12 --- /dev/null +++ b/client/reporting/list_saved_searches_parameters.go @@ -0,0 +1,283 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListSavedSearchesParams creates a new ListSavedSearchesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSavedSearchesParams() *ListSavedSearchesParams { + return &ListSavedSearchesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSavedSearchesParamsWithTimeout creates a new ListSavedSearchesParams object +// with the ability to set a timeout on a request. +func NewListSavedSearchesParamsWithTimeout(timeout time.Duration) *ListSavedSearchesParams { + return &ListSavedSearchesParams{ + timeout: timeout, + } +} + +// NewListSavedSearchesParamsWithContext creates a new ListSavedSearchesParams object +// with the ability to set a context for a request. +func NewListSavedSearchesParamsWithContext(ctx context.Context) *ListSavedSearchesParams { + return &ListSavedSearchesParams{ + Context: ctx, + } +} + +// NewListSavedSearchesParamsWithHTTPClient creates a new ListSavedSearchesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSavedSearchesParamsWithHTTPClient(client *http.Client) *ListSavedSearchesParams { + return &ListSavedSearchesParams{ + HTTPClient: client, + } +} + +/* +ListSavedSearchesParams contains all the parameters to send to the API endpoint + + for the list saved searches operation. + + Typically these are written to a http.Request. +*/ +type ListSavedSearchesParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + Filter saved searches with a query on their name + */ + Query *string + + // ResourceType. + ResourceType string + + /* UserID. + + The user ID used to filter saved searches. + */ + UserID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list saved searches params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSavedSearchesParams) WithDefaults() *ListSavedSearchesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list saved searches params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSavedSearchesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list saved searches params +func (o *ListSavedSearchesParams) WithTimeout(timeout time.Duration) *ListSavedSearchesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list saved searches params +func (o *ListSavedSearchesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list saved searches params +func (o *ListSavedSearchesParams) WithContext(ctx context.Context) *ListSavedSearchesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list saved searches params +func (o *ListSavedSearchesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list saved searches params +func (o *ListSavedSearchesParams) WithHTTPClient(client *http.Client) *ListSavedSearchesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list saved searches params +func (o *ListSavedSearchesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list saved searches params +func (o *ListSavedSearchesParams) WithPage(page *int32) *ListSavedSearchesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list saved searches params +func (o *ListSavedSearchesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list saved searches params +func (o *ListSavedSearchesParams) WithPerPage(perPage *int32) *ListSavedSearchesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list saved searches params +func (o *ListSavedSearchesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list saved searches params +func (o *ListSavedSearchesParams) WithQuery(query *string) *ListSavedSearchesParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list saved searches params +func (o *ListSavedSearchesParams) SetQuery(query *string) { + o.Query = query +} + +// WithResourceType adds the resourceType to the list saved searches params +func (o *ListSavedSearchesParams) WithResourceType(resourceType string) *ListSavedSearchesParams { + o.SetResourceType(resourceType) + return o +} + +// SetResourceType adds the resourceType to the list saved searches params +func (o *ListSavedSearchesParams) SetResourceType(resourceType string) { + o.ResourceType = resourceType +} + +// WithUserID adds the userID to the list saved searches params +func (o *ListSavedSearchesParams) WithUserID(userID *string) *ListSavedSearchesParams { + o.SetUserID(userID) + return o +} + +// SetUserID adds the userId to the list saved searches params +func (o *ListSavedSearchesParams) SetUserID(userID *string) { + o.UserID = userID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSavedSearchesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + // path param resource_type + if err := r.SetPathParam("resource_type", o.ResourceType); err != nil { + return err + } + + if o.UserID != nil { + + // query param user_id + var qrUserID string + + if o.UserID != nil { + qrUserID = *o.UserID + } + qUserID := qrUserID + if qUserID != "" { + + if err := r.SetQueryParam("user_id", qUserID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/reporting/list_saved_searches_responses.go b/client/reporting/list_saved_searches_responses.go new file mode 100644 index 0000000..42e1425 --- /dev/null +++ b/client/reporting/list_saved_searches_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListSavedSearchesReader is a Reader for the ListSavedSearches structure. +type ListSavedSearchesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSavedSearchesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSavedSearchesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListSavedSearchesOK creates a ListSavedSearchesOK with default headers values +func NewListSavedSearchesOK() *ListSavedSearchesOK { + return &ListSavedSearchesOK{} +} + +/* +ListSavedSearchesOK describes a response with status code 200, with default header values. + +Lists saved searches +*/ +type ListSavedSearchesOK struct { + Payload *models.SavedSearchEntity +} + +// IsSuccess returns true when this list saved searches o k response has a 2xx status code +func (o *ListSavedSearchesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list saved searches o k response has a 3xx status code +func (o *ListSavedSearchesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list saved searches o k response has a 4xx status code +func (o *ListSavedSearchesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list saved searches o k response has a 5xx status code +func (o *ListSavedSearchesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list saved searches o k response a status code equal to that given +func (o *ListSavedSearchesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListSavedSearchesOK) Error() string { + return fmt.Sprintf("[GET /v1/saved_searches/{resource_type}][%d] listSavedSearchesOK %+v", 200, o.Payload) +} + +func (o *ListSavedSearchesOK) String() string { + return fmt.Sprintf("[GET /v1/saved_searches/{resource_type}][%d] listSavedSearchesOK %+v", 200, o.Payload) +} + +func (o *ListSavedSearchesOK) GetPayload() *models.SavedSearchEntity { + return o.Payload +} + +func (o *ListSavedSearchesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SavedSearchEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/reporting/list_ticket_funnel_metrics_parameters.go b/client/reporting/list_ticket_funnel_metrics_parameters.go new file mode 100644 index 0000000..845248c --- /dev/null +++ b/client/reporting/list_ticket_funnel_metrics_parameters.go @@ -0,0 +1,1212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListTicketFunnelMetricsParams creates a new ListTicketFunnelMetricsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListTicketFunnelMetricsParams() *ListTicketFunnelMetricsParams { + return &ListTicketFunnelMetricsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListTicketFunnelMetricsParamsWithTimeout creates a new ListTicketFunnelMetricsParams object +// with the ability to set a timeout on a request. +func NewListTicketFunnelMetricsParamsWithTimeout(timeout time.Duration) *ListTicketFunnelMetricsParams { + return &ListTicketFunnelMetricsParams{ + timeout: timeout, + } +} + +// NewListTicketFunnelMetricsParamsWithContext creates a new ListTicketFunnelMetricsParams object +// with the ability to set a context for a request. +func NewListTicketFunnelMetricsParamsWithContext(ctx context.Context) *ListTicketFunnelMetricsParams { + return &ListTicketFunnelMetricsParams{ + Context: ctx, + } +} + +// NewListTicketFunnelMetricsParamsWithHTTPClient creates a new ListTicketFunnelMetricsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListTicketFunnelMetricsParamsWithHTTPClient(client *http.Client) *ListTicketFunnelMetricsParams { + return &ListTicketFunnelMetricsParams{ + HTTPClient: client, + } +} + +/* +ListTicketFunnelMetricsParams contains all the parameters to send to the API endpoint + + for the list ticket funnel metrics operation. + + Typically these are written to a http.Request. +*/ +type ListTicketFunnelMetricsParams struct { + + /* Archived. + + Return archived incidents + */ + Archived *bool + + /* AssignedTeams. + + A comma separated list of IDs for assigned teams or 'is_empty' to filter for incidents with no active team assignments + */ + AssignedTeams *string + + /* ClosedAtOrAfter. + + Filters for incidents that were closed at or after this time + + Format: date-time + */ + ClosedAtOrAfter *strfmt.DateTime + + /* ClosedAtOrBefore. + + Filters for incidents that were closed at or before this time + + Format: date-time + */ + ClosedAtOrBefore *strfmt.DateTime + + /* Conditions. + + A JSON string that defines 'logic' and 'user_data' + */ + Conditions *string + + /* CreatedAtOrAfter. + + Filters for incidents that were created at or after this time + + Format: date-time + */ + CreatedAtOrAfter *strfmt.DateTime + + /* CreatedAtOrBefore. + + Filters for incidents that were created at or before this time + + Format: date-time + */ + CreatedAtOrBefore *strfmt.DateTime + + /* CurrentMilestones. + + A comma separated list of current milestones + */ + CurrentMilestones *string + + /* EndDate. + + Filters for incidents that started on or before this date + + Format: date + */ + EndDate *strfmt.Date + + /* Environments. + + A comma separated list of environment IDs or 'is_empty' to filter for incidents with no impacted environments + */ + Environments *string + + /* ExcludedInfrastructureIds. + + A comma separated list of infrastructure IDs. Returns incidents that do not have the following infrastructure ids associated with them. + */ + ExcludedInfrastructureIds *string + + /* Functionalities. + + A comma separated list of functionality IDs or 'is_empty' to filter for incidents with no impacted functionalities + */ + Functionalities *string + + // GroupBy. + GroupBy []string + + /* IncidentTypeID. + + A comma separated list of incident type IDs + */ + IncidentTypeID *string + + /* Name. + + A query to search incidents by their name + */ + Name *string + + /* Priorities. + + A text value of priority + */ + Priorities *string + + /* PriorityNotSet. + + Flag for including incidents where priority has not been set + */ + PriorityNotSet *bool + + /* Query. + + A text query for an incident that searches on name, summary, and desciption + */ + Query *string + + /* ResolvedAtOrAfter. + + Filters for incidents that were resolved at or after this time. Combine this with the `current_milestones` parameter if you wish to omit incidents that were re-opened and are still active. + + Format: date-time + */ + ResolvedAtOrAfter *strfmt.DateTime + + /* ResolvedAtOrBefore. + + Filters for incidents that were resolved at or before this time. Combine this with the `current_milestones` parameter if you wish to omit incidents that were re-opened and are still active. + + Format: date-time + */ + ResolvedAtOrBefore *strfmt.DateTime + + /* SavedSearchID. + + The id of a previously saved search. + */ + SavedSearchID *string + + /* Services. + + A comma separated list of service IDs or 'is_empty' to filter for incidents with no impacted services + */ + Services *string + + /* Severities. + + A text value of severity + */ + Severities *string + + /* SeverityNotSet. + + Flag for including incidents where severity has not been set + */ + SeverityNotSet *bool + + /* StartDate. + + Filters for incidents that started on or after this date + + Format: date + */ + StartDate *strfmt.Date + + /* Status. + + Incident status + */ + Status *string + + /* TagMatchStrategy. + + A matching strategy for the tags provided + */ + TagMatchStrategy *string + + /* Tags. + + A comma separated list of tags + */ + Tags *string + + /* Teams. + + A comma separated list of team IDs + */ + Teams *string + + /* UpdatedAfter. + + Filters for incidents that were updated after this date + + Format: date-time + */ + UpdatedAfter *strfmt.DateTime + + /* UpdatedBefore. + + Filters for incidents that were updated before this date + + Format: date-time + */ + UpdatedBefore *strfmt.DateTime + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list ticket funnel metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTicketFunnelMetricsParams) WithDefaults() *ListTicketFunnelMetricsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list ticket funnel metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTicketFunnelMetricsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithTimeout(timeout time.Duration) *ListTicketFunnelMetricsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithContext(ctx context.Context) *ListTicketFunnelMetricsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithHTTPClient(client *http.Client) *ListTicketFunnelMetricsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithArchived adds the archived to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithArchived(archived *bool) *ListTicketFunnelMetricsParams { + o.SetArchived(archived) + return o +} + +// SetArchived adds the archived to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetArchived(archived *bool) { + o.Archived = archived +} + +// WithAssignedTeams adds the assignedTeams to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithAssignedTeams(assignedTeams *string) *ListTicketFunnelMetricsParams { + o.SetAssignedTeams(assignedTeams) + return o +} + +// SetAssignedTeams adds the assignedTeams to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetAssignedTeams(assignedTeams *string) { + o.AssignedTeams = assignedTeams +} + +// WithClosedAtOrAfter adds the closedAtOrAfter to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithClosedAtOrAfter(closedAtOrAfter *strfmt.DateTime) *ListTicketFunnelMetricsParams { + o.SetClosedAtOrAfter(closedAtOrAfter) + return o +} + +// SetClosedAtOrAfter adds the closedAtOrAfter to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetClosedAtOrAfter(closedAtOrAfter *strfmt.DateTime) { + o.ClosedAtOrAfter = closedAtOrAfter +} + +// WithClosedAtOrBefore adds the closedAtOrBefore to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithClosedAtOrBefore(closedAtOrBefore *strfmt.DateTime) *ListTicketFunnelMetricsParams { + o.SetClosedAtOrBefore(closedAtOrBefore) + return o +} + +// SetClosedAtOrBefore adds the closedAtOrBefore to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetClosedAtOrBefore(closedAtOrBefore *strfmt.DateTime) { + o.ClosedAtOrBefore = closedAtOrBefore +} + +// WithConditions adds the conditions to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithConditions(conditions *string) *ListTicketFunnelMetricsParams { + o.SetConditions(conditions) + return o +} + +// SetConditions adds the conditions to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetConditions(conditions *string) { + o.Conditions = conditions +} + +// WithCreatedAtOrAfter adds the createdAtOrAfter to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithCreatedAtOrAfter(createdAtOrAfter *strfmt.DateTime) *ListTicketFunnelMetricsParams { + o.SetCreatedAtOrAfter(createdAtOrAfter) + return o +} + +// SetCreatedAtOrAfter adds the createdAtOrAfter to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetCreatedAtOrAfter(createdAtOrAfter *strfmt.DateTime) { + o.CreatedAtOrAfter = createdAtOrAfter +} + +// WithCreatedAtOrBefore adds the createdAtOrBefore to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithCreatedAtOrBefore(createdAtOrBefore *strfmt.DateTime) *ListTicketFunnelMetricsParams { + o.SetCreatedAtOrBefore(createdAtOrBefore) + return o +} + +// SetCreatedAtOrBefore adds the createdAtOrBefore to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetCreatedAtOrBefore(createdAtOrBefore *strfmt.DateTime) { + o.CreatedAtOrBefore = createdAtOrBefore +} + +// WithCurrentMilestones adds the currentMilestones to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithCurrentMilestones(currentMilestones *string) *ListTicketFunnelMetricsParams { + o.SetCurrentMilestones(currentMilestones) + return o +} + +// SetCurrentMilestones adds the currentMilestones to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetCurrentMilestones(currentMilestones *string) { + o.CurrentMilestones = currentMilestones +} + +// WithEndDate adds the endDate to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithEndDate(endDate *strfmt.Date) *ListTicketFunnelMetricsParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetEndDate(endDate *strfmt.Date) { + o.EndDate = endDate +} + +// WithEnvironments adds the environments to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithEnvironments(environments *string) *ListTicketFunnelMetricsParams { + o.SetEnvironments(environments) + return o +} + +// SetEnvironments adds the environments to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetEnvironments(environments *string) { + o.Environments = environments +} + +// WithExcludedInfrastructureIds adds the excludedInfrastructureIds to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithExcludedInfrastructureIds(excludedInfrastructureIds *string) *ListTicketFunnelMetricsParams { + o.SetExcludedInfrastructureIds(excludedInfrastructureIds) + return o +} + +// SetExcludedInfrastructureIds adds the excludedInfrastructureIds to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetExcludedInfrastructureIds(excludedInfrastructureIds *string) { + o.ExcludedInfrastructureIds = excludedInfrastructureIds +} + +// WithFunctionalities adds the functionalities to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithFunctionalities(functionalities *string) *ListTicketFunnelMetricsParams { + o.SetFunctionalities(functionalities) + return o +} + +// SetFunctionalities adds the functionalities to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetFunctionalities(functionalities *string) { + o.Functionalities = functionalities +} + +// WithGroupBy adds the groupBy to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithGroupBy(groupBy []string) *ListTicketFunnelMetricsParams { + o.SetGroupBy(groupBy) + return o +} + +// SetGroupBy adds the groupBy to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetGroupBy(groupBy []string) { + o.GroupBy = groupBy +} + +// WithIncidentTypeID adds the incidentTypeID to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithIncidentTypeID(incidentTypeID *string) *ListTicketFunnelMetricsParams { + o.SetIncidentTypeID(incidentTypeID) + return o +} + +// SetIncidentTypeID adds the incidentTypeId to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetIncidentTypeID(incidentTypeID *string) { + o.IncidentTypeID = incidentTypeID +} + +// WithName adds the name to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithName(name *string) *ListTicketFunnelMetricsParams { + o.SetName(name) + return o +} + +// SetName adds the name to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetName(name *string) { + o.Name = name +} + +// WithPriorities adds the priorities to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithPriorities(priorities *string) *ListTicketFunnelMetricsParams { + o.SetPriorities(priorities) + return o +} + +// SetPriorities adds the priorities to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetPriorities(priorities *string) { + o.Priorities = priorities +} + +// WithPriorityNotSet adds the priorityNotSet to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithPriorityNotSet(priorityNotSet *bool) *ListTicketFunnelMetricsParams { + o.SetPriorityNotSet(priorityNotSet) + return o +} + +// SetPriorityNotSet adds the priorityNotSet to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetPriorityNotSet(priorityNotSet *bool) { + o.PriorityNotSet = priorityNotSet +} + +// WithQuery adds the query to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithQuery(query *string) *ListTicketFunnelMetricsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetQuery(query *string) { + o.Query = query +} + +// WithResolvedAtOrAfter adds the resolvedAtOrAfter to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithResolvedAtOrAfter(resolvedAtOrAfter *strfmt.DateTime) *ListTicketFunnelMetricsParams { + o.SetResolvedAtOrAfter(resolvedAtOrAfter) + return o +} + +// SetResolvedAtOrAfter adds the resolvedAtOrAfter to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetResolvedAtOrAfter(resolvedAtOrAfter *strfmt.DateTime) { + o.ResolvedAtOrAfter = resolvedAtOrAfter +} + +// WithResolvedAtOrBefore adds the resolvedAtOrBefore to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithResolvedAtOrBefore(resolvedAtOrBefore *strfmt.DateTime) *ListTicketFunnelMetricsParams { + o.SetResolvedAtOrBefore(resolvedAtOrBefore) + return o +} + +// SetResolvedAtOrBefore adds the resolvedAtOrBefore to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetResolvedAtOrBefore(resolvedAtOrBefore *strfmt.DateTime) { + o.ResolvedAtOrBefore = resolvedAtOrBefore +} + +// WithSavedSearchID adds the savedSearchID to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithSavedSearchID(savedSearchID *string) *ListTicketFunnelMetricsParams { + o.SetSavedSearchID(savedSearchID) + return o +} + +// SetSavedSearchID adds the savedSearchId to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetSavedSearchID(savedSearchID *string) { + o.SavedSearchID = savedSearchID +} + +// WithServices adds the services to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithServices(services *string) *ListTicketFunnelMetricsParams { + o.SetServices(services) + return o +} + +// SetServices adds the services to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetServices(services *string) { + o.Services = services +} + +// WithSeverities adds the severities to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithSeverities(severities *string) *ListTicketFunnelMetricsParams { + o.SetSeverities(severities) + return o +} + +// SetSeverities adds the severities to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetSeverities(severities *string) { + o.Severities = severities +} + +// WithSeverityNotSet adds the severityNotSet to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithSeverityNotSet(severityNotSet *bool) *ListTicketFunnelMetricsParams { + o.SetSeverityNotSet(severityNotSet) + return o +} + +// SetSeverityNotSet adds the severityNotSet to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetSeverityNotSet(severityNotSet *bool) { + o.SeverityNotSet = severityNotSet +} + +// WithStartDate adds the startDate to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithStartDate(startDate *strfmt.Date) *ListTicketFunnelMetricsParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetStartDate(startDate *strfmt.Date) { + o.StartDate = startDate +} + +// WithStatus adds the status to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithStatus(status *string) *ListTicketFunnelMetricsParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetStatus(status *string) { + o.Status = status +} + +// WithTagMatchStrategy adds the tagMatchStrategy to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithTagMatchStrategy(tagMatchStrategy *string) *ListTicketFunnelMetricsParams { + o.SetTagMatchStrategy(tagMatchStrategy) + return o +} + +// SetTagMatchStrategy adds the tagMatchStrategy to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetTagMatchStrategy(tagMatchStrategy *string) { + o.TagMatchStrategy = tagMatchStrategy +} + +// WithTags adds the tags to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithTags(tags *string) *ListTicketFunnelMetricsParams { + o.SetTags(tags) + return o +} + +// SetTags adds the tags to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetTags(tags *string) { + o.Tags = tags +} + +// WithTeams adds the teams to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithTeams(teams *string) *ListTicketFunnelMetricsParams { + o.SetTeams(teams) + return o +} + +// SetTeams adds the teams to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetTeams(teams *string) { + o.Teams = teams +} + +// WithUpdatedAfter adds the updatedAfter to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithUpdatedAfter(updatedAfter *strfmt.DateTime) *ListTicketFunnelMetricsParams { + o.SetUpdatedAfter(updatedAfter) + return o +} + +// SetUpdatedAfter adds the updatedAfter to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetUpdatedAfter(updatedAfter *strfmt.DateTime) { + o.UpdatedAfter = updatedAfter +} + +// WithUpdatedBefore adds the updatedBefore to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) WithUpdatedBefore(updatedBefore *strfmt.DateTime) *ListTicketFunnelMetricsParams { + o.SetUpdatedBefore(updatedBefore) + return o +} + +// SetUpdatedBefore adds the updatedBefore to the list ticket funnel metrics params +func (o *ListTicketFunnelMetricsParams) SetUpdatedBefore(updatedBefore *strfmt.DateTime) { + o.UpdatedBefore = updatedBefore +} + +// WriteToRequest writes these params to a swagger request +func (o *ListTicketFunnelMetricsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Archived != nil { + + // query param archived + var qrArchived bool + + if o.Archived != nil { + qrArchived = *o.Archived + } + qArchived := swag.FormatBool(qrArchived) + if qArchived != "" { + + if err := r.SetQueryParam("archived", qArchived); err != nil { + return err + } + } + } + + if o.AssignedTeams != nil { + + // query param assigned_teams + var qrAssignedTeams string + + if o.AssignedTeams != nil { + qrAssignedTeams = *o.AssignedTeams + } + qAssignedTeams := qrAssignedTeams + if qAssignedTeams != "" { + + if err := r.SetQueryParam("assigned_teams", qAssignedTeams); err != nil { + return err + } + } + } + + if o.ClosedAtOrAfter != nil { + + // query param closed_at_or_after + var qrClosedAtOrAfter strfmt.DateTime + + if o.ClosedAtOrAfter != nil { + qrClosedAtOrAfter = *o.ClosedAtOrAfter + } + qClosedAtOrAfter := qrClosedAtOrAfter.String() + if qClosedAtOrAfter != "" { + + if err := r.SetQueryParam("closed_at_or_after", qClosedAtOrAfter); err != nil { + return err + } + } + } + + if o.ClosedAtOrBefore != nil { + + // query param closed_at_or_before + var qrClosedAtOrBefore strfmt.DateTime + + if o.ClosedAtOrBefore != nil { + qrClosedAtOrBefore = *o.ClosedAtOrBefore + } + qClosedAtOrBefore := qrClosedAtOrBefore.String() + if qClosedAtOrBefore != "" { + + if err := r.SetQueryParam("closed_at_or_before", qClosedAtOrBefore); err != nil { + return err + } + } + } + + if o.Conditions != nil { + + // query param conditions + var qrConditions string + + if o.Conditions != nil { + qrConditions = *o.Conditions + } + qConditions := qrConditions + if qConditions != "" { + + if err := r.SetQueryParam("conditions", qConditions); err != nil { + return err + } + } + } + + if o.CreatedAtOrAfter != nil { + + // query param created_at_or_after + var qrCreatedAtOrAfter strfmt.DateTime + + if o.CreatedAtOrAfter != nil { + qrCreatedAtOrAfter = *o.CreatedAtOrAfter + } + qCreatedAtOrAfter := qrCreatedAtOrAfter.String() + if qCreatedAtOrAfter != "" { + + if err := r.SetQueryParam("created_at_or_after", qCreatedAtOrAfter); err != nil { + return err + } + } + } + + if o.CreatedAtOrBefore != nil { + + // query param created_at_or_before + var qrCreatedAtOrBefore strfmt.DateTime + + if o.CreatedAtOrBefore != nil { + qrCreatedAtOrBefore = *o.CreatedAtOrBefore + } + qCreatedAtOrBefore := qrCreatedAtOrBefore.String() + if qCreatedAtOrBefore != "" { + + if err := r.SetQueryParam("created_at_or_before", qCreatedAtOrBefore); err != nil { + return err + } + } + } + + if o.CurrentMilestones != nil { + + // query param current_milestones + var qrCurrentMilestones string + + if o.CurrentMilestones != nil { + qrCurrentMilestones = *o.CurrentMilestones + } + qCurrentMilestones := qrCurrentMilestones + if qCurrentMilestones != "" { + + if err := r.SetQueryParam("current_milestones", qCurrentMilestones); err != nil { + return err + } + } + } + + if o.EndDate != nil { + + // query param end_date + var qrEndDate strfmt.Date + + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate.String() + if qEndDate != "" { + + if err := r.SetQueryParam("end_date", qEndDate); err != nil { + return err + } + } + } + + if o.Environments != nil { + + // query param environments + var qrEnvironments string + + if o.Environments != nil { + qrEnvironments = *o.Environments + } + qEnvironments := qrEnvironments + if qEnvironments != "" { + + if err := r.SetQueryParam("environments", qEnvironments); err != nil { + return err + } + } + } + + if o.ExcludedInfrastructureIds != nil { + + // query param excluded_infrastructure_ids + var qrExcludedInfrastructureIds string + + if o.ExcludedInfrastructureIds != nil { + qrExcludedInfrastructureIds = *o.ExcludedInfrastructureIds + } + qExcludedInfrastructureIds := qrExcludedInfrastructureIds + if qExcludedInfrastructureIds != "" { + + if err := r.SetQueryParam("excluded_infrastructure_ids", qExcludedInfrastructureIds); err != nil { + return err + } + } + } + + if o.Functionalities != nil { + + // query param functionalities + var qrFunctionalities string + + if o.Functionalities != nil { + qrFunctionalities = *o.Functionalities + } + qFunctionalities := qrFunctionalities + if qFunctionalities != "" { + + if err := r.SetQueryParam("functionalities", qFunctionalities); err != nil { + return err + } + } + } + + if o.GroupBy != nil { + + // binding items for group_by + joinedGroupBy := o.bindParamGroupBy(reg) + + // form array param group_by + if err := r.SetFormParam("group_by", joinedGroupBy...); err != nil { + return err + } + } + + if o.IncidentTypeID != nil { + + // query param incident_type_id + var qrIncidentTypeID string + + if o.IncidentTypeID != nil { + qrIncidentTypeID = *o.IncidentTypeID + } + qIncidentTypeID := qrIncidentTypeID + if qIncidentTypeID != "" { + + if err := r.SetQueryParam("incident_type_id", qIncidentTypeID); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.Priorities != nil { + + // query param priorities + var qrPriorities string + + if o.Priorities != nil { + qrPriorities = *o.Priorities + } + qPriorities := qrPriorities + if qPriorities != "" { + + if err := r.SetQueryParam("priorities", qPriorities); err != nil { + return err + } + } + } + + if o.PriorityNotSet != nil { + + // query param priority_not_set + var qrPriorityNotSet bool + + if o.PriorityNotSet != nil { + qrPriorityNotSet = *o.PriorityNotSet + } + qPriorityNotSet := swag.FormatBool(qrPriorityNotSet) + if qPriorityNotSet != "" { + + if err := r.SetQueryParam("priority_not_set", qPriorityNotSet); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if o.ResolvedAtOrAfter != nil { + + // query param resolved_at_or_after + var qrResolvedAtOrAfter strfmt.DateTime + + if o.ResolvedAtOrAfter != nil { + qrResolvedAtOrAfter = *o.ResolvedAtOrAfter + } + qResolvedAtOrAfter := qrResolvedAtOrAfter.String() + if qResolvedAtOrAfter != "" { + + if err := r.SetQueryParam("resolved_at_or_after", qResolvedAtOrAfter); err != nil { + return err + } + } + } + + if o.ResolvedAtOrBefore != nil { + + // query param resolved_at_or_before + var qrResolvedAtOrBefore strfmt.DateTime + + if o.ResolvedAtOrBefore != nil { + qrResolvedAtOrBefore = *o.ResolvedAtOrBefore + } + qResolvedAtOrBefore := qrResolvedAtOrBefore.String() + if qResolvedAtOrBefore != "" { + + if err := r.SetQueryParam("resolved_at_or_before", qResolvedAtOrBefore); err != nil { + return err + } + } + } + + if o.SavedSearchID != nil { + + // query param saved_search_id + var qrSavedSearchID string + + if o.SavedSearchID != nil { + qrSavedSearchID = *o.SavedSearchID + } + qSavedSearchID := qrSavedSearchID + if qSavedSearchID != "" { + + if err := r.SetQueryParam("saved_search_id", qSavedSearchID); err != nil { + return err + } + } + } + + if o.Services != nil { + + // query param services + var qrServices string + + if o.Services != nil { + qrServices = *o.Services + } + qServices := qrServices + if qServices != "" { + + if err := r.SetQueryParam("services", qServices); err != nil { + return err + } + } + } + + if o.Severities != nil { + + // query param severities + var qrSeverities string + + if o.Severities != nil { + qrSeverities = *o.Severities + } + qSeverities := qrSeverities + if qSeverities != "" { + + if err := r.SetQueryParam("severities", qSeverities); err != nil { + return err + } + } + } + + if o.SeverityNotSet != nil { + + // query param severity_not_set + var qrSeverityNotSet bool + + if o.SeverityNotSet != nil { + qrSeverityNotSet = *o.SeverityNotSet + } + qSeverityNotSet := swag.FormatBool(qrSeverityNotSet) + if qSeverityNotSet != "" { + + if err := r.SetQueryParam("severity_not_set", qSeverityNotSet); err != nil { + return err + } + } + } + + if o.StartDate != nil { + + // query param start_date + var qrStartDate strfmt.Date + + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate.String() + if qStartDate != "" { + + if err := r.SetQueryParam("start_date", qStartDate); err != nil { + return err + } + } + } + + if o.Status != nil { + + // query param status + var qrStatus string + + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + + if err := r.SetQueryParam("status", qStatus); err != nil { + return err + } + } + } + + if o.TagMatchStrategy != nil { + + // query param tag_match_strategy + var qrTagMatchStrategy string + + if o.TagMatchStrategy != nil { + qrTagMatchStrategy = *o.TagMatchStrategy + } + qTagMatchStrategy := qrTagMatchStrategy + if qTagMatchStrategy != "" { + + if err := r.SetQueryParam("tag_match_strategy", qTagMatchStrategy); err != nil { + return err + } + } + } + + if o.Tags != nil { + + // query param tags + var qrTags string + + if o.Tags != nil { + qrTags = *o.Tags + } + qTags := qrTags + if qTags != "" { + + if err := r.SetQueryParam("tags", qTags); err != nil { + return err + } + } + } + + if o.Teams != nil { + + // query param teams + var qrTeams string + + if o.Teams != nil { + qrTeams = *o.Teams + } + qTeams := qrTeams + if qTeams != "" { + + if err := r.SetQueryParam("teams", qTeams); err != nil { + return err + } + } + } + + if o.UpdatedAfter != nil { + + // query param updated_after + var qrUpdatedAfter strfmt.DateTime + + if o.UpdatedAfter != nil { + qrUpdatedAfter = *o.UpdatedAfter + } + qUpdatedAfter := qrUpdatedAfter.String() + if qUpdatedAfter != "" { + + if err := r.SetQueryParam("updated_after", qUpdatedAfter); err != nil { + return err + } + } + } + + if o.UpdatedBefore != nil { + + // query param updated_before + var qrUpdatedBefore strfmt.DateTime + + if o.UpdatedBefore != nil { + qrUpdatedBefore = *o.UpdatedBefore + } + qUpdatedBefore := qrUpdatedBefore.String() + if qUpdatedBefore != "" { + + if err := r.SetQueryParam("updated_before", qUpdatedBefore); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamListTicketFunnelMetrics binds the parameter group_by +func (o *ListTicketFunnelMetricsParams) bindParamGroupBy(formats strfmt.Registry) []string { + groupByIR := o.GroupBy + + var groupByIC []string + for _, groupByIIR := range groupByIR { // explode []string + + groupByIIV := groupByIIR // string as string + groupByIC = append(groupByIC, groupByIIV) + } + + // items.CollectionFormat: "" + groupByIS := swag.JoinByFormat(groupByIC, "") + + return groupByIS +} diff --git a/client/reporting/list_ticket_funnel_metrics_responses.go b/client/reporting/list_ticket_funnel_metrics_responses.go new file mode 100644 index 0000000..1e77b6c --- /dev/null +++ b/client/reporting/list_ticket_funnel_metrics_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListTicketFunnelMetricsReader is a Reader for the ListTicketFunnelMetrics structure. +type ListTicketFunnelMetricsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListTicketFunnelMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListTicketFunnelMetricsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListTicketFunnelMetricsOK creates a ListTicketFunnelMetricsOK with default headers values +func NewListTicketFunnelMetricsOK() *ListTicketFunnelMetricsOK { + return &ListTicketFunnelMetricsOK{} +} + +/* +ListTicketFunnelMetricsOK describes a response with status code 200, with default header values. + +Returns a report with task and follow up creation and completion data +*/ +type ListTicketFunnelMetricsOK struct { + Payload *models.MetricsTicketFunnelMetricsEntity +} + +// IsSuccess returns true when this list ticket funnel metrics o k response has a 2xx status code +func (o *ListTicketFunnelMetricsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list ticket funnel metrics o k response has a 3xx status code +func (o *ListTicketFunnelMetricsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list ticket funnel metrics o k response has a 4xx status code +func (o *ListTicketFunnelMetricsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list ticket funnel metrics o k response has a 5xx status code +func (o *ListTicketFunnelMetricsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list ticket funnel metrics o k response a status code equal to that given +func (o *ListTicketFunnelMetricsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListTicketFunnelMetricsOK) Error() string { + return fmt.Sprintf("[GET /v1/metrics/ticket_funnel][%d] listTicketFunnelMetricsOK %+v", 200, o.Payload) +} + +func (o *ListTicketFunnelMetricsOK) String() string { + return fmt.Sprintf("[GET /v1/metrics/ticket_funnel][%d] listTicketFunnelMetricsOK %+v", 200, o.Payload) +} + +func (o *ListTicketFunnelMetricsOK) GetPayload() *models.MetricsTicketFunnelMetricsEntity { + return o.Payload +} + +func (o *ListTicketFunnelMetricsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.MetricsTicketFunnelMetricsEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/reporting/list_user_involvement_metrics_parameters.go b/client/reporting/list_user_involvement_metrics_parameters.go new file mode 100644 index 0000000..3020459 --- /dev/null +++ b/client/reporting/list_user_involvement_metrics_parameters.go @@ -0,0 +1,359 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListUserInvolvementMetricsParams creates a new ListUserInvolvementMetricsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListUserInvolvementMetricsParams() *ListUserInvolvementMetricsParams { + return &ListUserInvolvementMetricsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListUserInvolvementMetricsParamsWithTimeout creates a new ListUserInvolvementMetricsParams object +// with the ability to set a timeout on a request. +func NewListUserInvolvementMetricsParamsWithTimeout(timeout time.Duration) *ListUserInvolvementMetricsParams { + return &ListUserInvolvementMetricsParams{ + timeout: timeout, + } +} + +// NewListUserInvolvementMetricsParamsWithContext creates a new ListUserInvolvementMetricsParams object +// with the ability to set a context for a request. +func NewListUserInvolvementMetricsParamsWithContext(ctx context.Context) *ListUserInvolvementMetricsParams { + return &ListUserInvolvementMetricsParams{ + Context: ctx, + } +} + +// NewListUserInvolvementMetricsParamsWithHTTPClient creates a new ListUserInvolvementMetricsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListUserInvolvementMetricsParamsWithHTTPClient(client *http.Client) *ListUserInvolvementMetricsParams { + return &ListUserInvolvementMetricsParams{ + HTTPClient: client, + } +} + +/* +ListUserInvolvementMetricsParams contains all the parameters to send to the API endpoint + + for the list user involvement metrics operation. + + Typically these are written to a http.Request. +*/ +type ListUserInvolvementMetricsParams struct { + + // BucketSize. + BucketSize *string + + // By. + By *string + + /* EndDate. + + The end date to return metrics from + + Format: date + */ + EndDate *strfmt.Date + + // SortDirection. + SortDirection *string + + // SortField. + SortField *string + + // SortLimit. + // + // Format: int32 + SortLimit *int32 + + /* StartDate. + + The start date to return metrics from + + Format: date + */ + StartDate *strfmt.Date + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list user involvement metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListUserInvolvementMetricsParams) WithDefaults() *ListUserInvolvementMetricsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list user involvement metrics params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListUserInvolvementMetricsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) WithTimeout(timeout time.Duration) *ListUserInvolvementMetricsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) WithContext(ctx context.Context) *ListUserInvolvementMetricsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) WithHTTPClient(client *http.Client) *ListUserInvolvementMetricsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucketSize adds the bucketSize to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) WithBucketSize(bucketSize *string) *ListUserInvolvementMetricsParams { + o.SetBucketSize(bucketSize) + return o +} + +// SetBucketSize adds the bucketSize to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) SetBucketSize(bucketSize *string) { + o.BucketSize = bucketSize +} + +// WithBy adds the by to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) WithBy(by *string) *ListUserInvolvementMetricsParams { + o.SetBy(by) + return o +} + +// SetBy adds the by to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) SetBy(by *string) { + o.By = by +} + +// WithEndDate adds the endDate to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) WithEndDate(endDate *strfmt.Date) *ListUserInvolvementMetricsParams { + o.SetEndDate(endDate) + return o +} + +// SetEndDate adds the endDate to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) SetEndDate(endDate *strfmt.Date) { + o.EndDate = endDate +} + +// WithSortDirection adds the sortDirection to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) WithSortDirection(sortDirection *string) *ListUserInvolvementMetricsParams { + o.SetSortDirection(sortDirection) + return o +} + +// SetSortDirection adds the sortDirection to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) SetSortDirection(sortDirection *string) { + o.SortDirection = sortDirection +} + +// WithSortField adds the sortField to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) WithSortField(sortField *string) *ListUserInvolvementMetricsParams { + o.SetSortField(sortField) + return o +} + +// SetSortField adds the sortField to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) SetSortField(sortField *string) { + o.SortField = sortField +} + +// WithSortLimit adds the sortLimit to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) WithSortLimit(sortLimit *int32) *ListUserInvolvementMetricsParams { + o.SetSortLimit(sortLimit) + return o +} + +// SetSortLimit adds the sortLimit to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) SetSortLimit(sortLimit *int32) { + o.SortLimit = sortLimit +} + +// WithStartDate adds the startDate to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) WithStartDate(startDate *strfmt.Date) *ListUserInvolvementMetricsParams { + o.SetStartDate(startDate) + return o +} + +// SetStartDate adds the startDate to the list user involvement metrics params +func (o *ListUserInvolvementMetricsParams) SetStartDate(startDate *strfmt.Date) { + o.StartDate = startDate +} + +// WriteToRequest writes these params to a swagger request +func (o *ListUserInvolvementMetricsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.BucketSize != nil { + + // query param bucket_size + var qrBucketSize string + + if o.BucketSize != nil { + qrBucketSize = *o.BucketSize + } + qBucketSize := qrBucketSize + if qBucketSize != "" { + + if err := r.SetQueryParam("bucket_size", qBucketSize); err != nil { + return err + } + } + } + + if o.By != nil { + + // query param by + var qrBy string + + if o.By != nil { + qrBy = *o.By + } + qBy := qrBy + if qBy != "" { + + if err := r.SetQueryParam("by", qBy); err != nil { + return err + } + } + } + + if o.EndDate != nil { + + // query param end_date + var qrEndDate strfmt.Date + + if o.EndDate != nil { + qrEndDate = *o.EndDate + } + qEndDate := qrEndDate.String() + if qEndDate != "" { + + if err := r.SetQueryParam("end_date", qEndDate); err != nil { + return err + } + } + } + + if o.SortDirection != nil { + + // query param sort_direction + var qrSortDirection string + + if o.SortDirection != nil { + qrSortDirection = *o.SortDirection + } + qSortDirection := qrSortDirection + if qSortDirection != "" { + + if err := r.SetQueryParam("sort_direction", qSortDirection); err != nil { + return err + } + } + } + + if o.SortField != nil { + + // query param sort_field + var qrSortField string + + if o.SortField != nil { + qrSortField = *o.SortField + } + qSortField := qrSortField + if qSortField != "" { + + if err := r.SetQueryParam("sort_field", qSortField); err != nil { + return err + } + } + } + + if o.SortLimit != nil { + + // query param sort_limit + var qrSortLimit int32 + + if o.SortLimit != nil { + qrSortLimit = *o.SortLimit + } + qSortLimit := swag.FormatInt32(qrSortLimit) + if qSortLimit != "" { + + if err := r.SetQueryParam("sort_limit", qSortLimit); err != nil { + return err + } + } + } + + if o.StartDate != nil { + + // query param start_date + var qrStartDate strfmt.Date + + if o.StartDate != nil { + qrStartDate = *o.StartDate + } + qStartDate := qrStartDate.String() + if qStartDate != "" { + + if err := r.SetQueryParam("start_date", qStartDate); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/reporting/list_user_involvement_metrics_responses.go b/client/reporting/list_user_involvement_metrics_responses.go new file mode 100644 index 0000000..d1e1ea6 --- /dev/null +++ b/client/reporting/list_user_involvement_metrics_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListUserInvolvementMetricsReader is a Reader for the ListUserInvolvementMetrics structure. +type ListUserInvolvementMetricsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListUserInvolvementMetricsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListUserInvolvementMetricsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListUserInvolvementMetricsOK creates a ListUserInvolvementMetricsOK with default headers values +func NewListUserInvolvementMetricsOK() *ListUserInvolvementMetricsOK { + return &ListUserInvolvementMetricsOK{} +} + +/* +ListUserInvolvementMetricsOK describes a response with status code 200, with default header values. + +Returns a report with time bucketed analytics data +*/ +type ListUserInvolvementMetricsOK struct { + Payload *models.MetricsMetricsEntity +} + +// IsSuccess returns true when this list user involvement metrics o k response has a 2xx status code +func (o *ListUserInvolvementMetricsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list user involvement metrics o k response has a 3xx status code +func (o *ListUserInvolvementMetricsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list user involvement metrics o k response has a 4xx status code +func (o *ListUserInvolvementMetricsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list user involvement metrics o k response has a 5xx status code +func (o *ListUserInvolvementMetricsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list user involvement metrics o k response a status code equal to that given +func (o *ListUserInvolvementMetricsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListUserInvolvementMetricsOK) Error() string { + return fmt.Sprintf("[GET /v1/metrics/user_involvements][%d] listUserInvolvementMetricsOK %+v", 200, o.Payload) +} + +func (o *ListUserInvolvementMetricsOK) String() string { + return fmt.Sprintf("[GET /v1/metrics/user_involvements][%d] listUserInvolvementMetricsOK %+v", 200, o.Payload) +} + +func (o *ListUserInvolvementMetricsOK) GetPayload() *models.MetricsMetricsEntity { + return o.Payload +} + +func (o *ListUserInvolvementMetricsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.MetricsMetricsEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/reporting/reporting_client.go b/client/reporting/reporting_client.go index 707e1ff..7d18d9c 100644 --- a/client/reporting/reporting_client.go +++ b/client/reporting/reporting_client.go @@ -30,64 +30,64 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1SavedSearchesResourceTypeSavedSearchID(params *DeleteV1SavedSearchesResourceTypeSavedSearchIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SavedSearchesResourceTypeSavedSearchIDOK, error) + CreateSavedSearch(params *CreateSavedSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSavedSearchCreated, error) - GetV1MetricsIncidents(params *GetV1MetricsIncidentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsIncidentsOK, error) + DeleteSavedSearch(params *DeleteSavedSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSavedSearchOK, error) - GetV1MetricsInfraType(params *GetV1MetricsInfraTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsInfraTypeOK, error) + ExportSignalsShiftAnalytics(params *ExportSignalsShiftAnalyticsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportSignalsShiftAnalyticsOK, error) - GetV1MetricsInfraTypeInfraID(params *GetV1MetricsInfraTypeInfraIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsInfraTypeInfraIDOK, error) + GetMeanTimeReport(params *GetMeanTimeReportParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetMeanTimeReportOK, error) - GetV1MetricsMilestoneFunnel(params *GetV1MetricsMilestoneFunnelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsMilestoneFunnelOK, error) + GetSavedSearch(params *GetSavedSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSavedSearchOK, error) - GetV1MetricsMttx(params *GetV1MetricsMttxParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsMttxOK, error) + GetSignalsGroupedMetrics(params *GetSignalsGroupedMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSignalsGroupedMetricsOK, error) - GetV1MetricsRetrospectives(params *GetV1MetricsRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsRetrospectivesOK, error) + GetSignalsMttxAnalytics(params *GetSignalsMttxAnalyticsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSignalsMttxAnalyticsOK, error) - GetV1MetricsTicketFunnel(params *GetV1MetricsTicketFunnelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsTicketFunnelOK, error) + GetSignalsTimeseriesAnalytics(params *GetSignalsTimeseriesAnalyticsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSignalsTimeseriesAnalyticsOK, error) - GetV1MetricsUserInvolvements(params *GetV1MetricsUserInvolvementsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsUserInvolvementsOK, error) + ListIncidentMetrics(params *ListIncidentMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentMetricsOK, error) - GetV1ReportsMeanTime(params *GetV1ReportsMeanTimeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ReportsMeanTimeOK, error) + ListInfrastructureMetrics(params *ListInfrastructureMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListInfrastructureMetricsOK, error) - GetV1SavedSearchesResourceType(params *GetV1SavedSearchesResourceTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SavedSearchesResourceTypeOK, error) + ListInfrastructureTypeMetrics(params *ListInfrastructureTypeMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListInfrastructureTypeMetricsOK, error) - GetV1SavedSearchesResourceTypeSavedSearchID(params *GetV1SavedSearchesResourceTypeSavedSearchIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SavedSearchesResourceTypeSavedSearchIDOK, error) + ListMilestoneFunnelMetrics(params *ListMilestoneFunnelMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListMilestoneFunnelMetricsOK, error) - GetV1SignalsAnalyticsGroupedMetrics(params *GetV1SignalsAnalyticsGroupedMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsAnalyticsGroupedMetricsOK, error) + ListMttxMetrics(params *ListMttxMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListMttxMetricsOK, error) - GetV1SignalsAnalyticsMttx(params *GetV1SignalsAnalyticsMttxParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsAnalyticsMttxOK, error) + ListRetrospectiveMetrics(params *ListRetrospectiveMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRetrospectiveMetricsOK, error) - GetV1SignalsAnalyticsShiftsExport(params *GetV1SignalsAnalyticsShiftsExportParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsAnalyticsShiftsExportOK, error) + ListSavedSearches(params *ListSavedSearchesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSavedSearchesOK, error) - GetV1SignalsAnalyticsTimeseries(params *GetV1SignalsAnalyticsTimeseriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsAnalyticsTimeseriesOK, error) + ListTicketFunnelMetrics(params *ListTicketFunnelMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTicketFunnelMetricsOK, error) - PatchV1SavedSearchesResourceTypeSavedSearchID(params *PatchV1SavedSearchesResourceTypeSavedSearchIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SavedSearchesResourceTypeSavedSearchIDOK, error) + ListUserInvolvementMetrics(params *ListUserInvolvementMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListUserInvolvementMetricsOK, error) - PostV1SavedSearchesResourceType(params *PostV1SavedSearchesResourceTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SavedSearchesResourceTypeCreated, error) + UpdateSavedSearch(params *UpdateSavedSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSavedSearchOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1SavedSearchesResourceTypeSavedSearchID deletes a saved search +CreateSavedSearch creates a saved search -Delete a specific saved search +Create a new saved search for a particular resource type */ -func (a *Client) DeleteV1SavedSearchesResourceTypeSavedSearchID(params *DeleteV1SavedSearchesResourceTypeSavedSearchIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SavedSearchesResourceTypeSavedSearchIDOK, error) { +func (a *Client) CreateSavedSearch(params *CreateSavedSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSavedSearchCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1SavedSearchesResourceTypeSavedSearchIDParams() + params = NewCreateSavedSearchParams() } op := &runtime.ClientOperation{ - ID: "deleteV1SavedSearchesResourceTypeSavedSearchId", - Method: "DELETE", - PathPattern: "/v1/saved_searches/{resource_type}/{saved_search_id}", + ID: "create_saved_search", + Method: "POST", + PathPattern: "/v1/saved_searches/{resource_type}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1SavedSearchesResourceTypeSavedSearchIDReader{formats: a.formats}, + Reader: &CreateSavedSearchReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -100,35 +100,35 @@ func (a *Client) DeleteV1SavedSearchesResourceTypeSavedSearchID(params *DeleteV1 if err != nil { return nil, err } - success, ok := result.(*DeleteV1SavedSearchesResourceTypeSavedSearchIDOK) + success, ok := result.(*CreateSavedSearchCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1SavedSearchesResourceTypeSavedSearchId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_saved_search: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1MetricsIncidents lists incident metrics and analytics +DeleteSavedSearch deletes a saved search -Returns a report with time bucketed analytics data +Delete a specific saved search */ -func (a *Client) GetV1MetricsIncidents(params *GetV1MetricsIncidentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsIncidentsOK, error) { +func (a *Client) DeleteSavedSearch(params *DeleteSavedSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSavedSearchOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1MetricsIncidentsParams() + params = NewDeleteSavedSearchParams() } op := &runtime.ClientOperation{ - ID: "getV1MetricsIncidents", - Method: "GET", - PathPattern: "/v1/metrics/incidents", + ID: "delete_saved_search", + Method: "DELETE", + PathPattern: "/v1/saved_searches/{resource_type}/{saved_search_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1MetricsIncidentsReader{formats: a.formats}, + Reader: &DeleteSavedSearchReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -141,35 +141,35 @@ func (a *Client) GetV1MetricsIncidents(params *GetV1MetricsIncidentsParams, auth if err != nil { return nil, err } - success, ok := result.(*GetV1MetricsIncidentsOK) + success, ok := result.(*DeleteSavedSearchOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1MetricsIncidents: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_saved_search: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1MetricsInfraType lists metrics for a component type +ExportSignalsShiftAnalytics exports on call hours report -Returns metrics for all components of a given type +Export on-call hours report for users/teams during a time period */ -func (a *Client) GetV1MetricsInfraType(params *GetV1MetricsInfraTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsInfraTypeOK, error) { +func (a *Client) ExportSignalsShiftAnalytics(params *ExportSignalsShiftAnalyticsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportSignalsShiftAnalyticsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1MetricsInfraTypeParams() + params = NewExportSignalsShiftAnalyticsParams() } op := &runtime.ClientOperation{ - ID: "getV1MetricsInfraType", + ID: "export_signals_shift_analytics", Method: "GET", - PathPattern: "/v1/metrics/{infra_type}", + PathPattern: "/v1/signals/analytics/shifts/export", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1MetricsInfraTypeReader{formats: a.formats}, + Reader: &ExportSignalsShiftAnalyticsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -182,35 +182,35 @@ func (a *Client) GetV1MetricsInfraType(params *GetV1MetricsInfraTypeParams, auth if err != nil { return nil, err } - success, ok := result.(*GetV1MetricsInfraTypeOK) + success, ok := result.(*ExportSignalsShiftAnalyticsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1MetricsInfraType: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for export_signals_shift_analytics: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1MetricsInfraTypeInfraID gets metrics for a component +GetMeanTimeReport gets mean time metrics for incidents -Return metrics for a specific component +Returns a report with time bucketed analytics data */ -func (a *Client) GetV1MetricsInfraTypeInfraID(params *GetV1MetricsInfraTypeInfraIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsInfraTypeInfraIDOK, error) { +func (a *Client) GetMeanTimeReport(params *GetMeanTimeReportParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetMeanTimeReportOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1MetricsInfraTypeInfraIDParams() + params = NewGetMeanTimeReportParams() } op := &runtime.ClientOperation{ - ID: "getV1MetricsInfraTypeInfraId", + ID: "get_mean_time_report", Method: "GET", - PathPattern: "/v1/metrics/{infra_type}/{infra_id}", + PathPattern: "/v1/reports/mean_time", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1MetricsInfraTypeInfraIDReader{formats: a.formats}, + Reader: &GetMeanTimeReportReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -223,35 +223,35 @@ func (a *Client) GetV1MetricsInfraTypeInfraID(params *GetV1MetricsInfraTypeInfra if err != nil { return nil, err } - success, ok := result.(*GetV1MetricsInfraTypeInfraIDOK) + success, ok := result.(*GetMeanTimeReportOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1MetricsInfraTypeInfraId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_mean_time_report: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1MetricsMilestoneFunnel lists milestone funnel metrics +GetSavedSearch gets a saved search -Returns a report with time bucketed milestone data +Retrieve a specific save search */ -func (a *Client) GetV1MetricsMilestoneFunnel(params *GetV1MetricsMilestoneFunnelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsMilestoneFunnelOK, error) { +func (a *Client) GetSavedSearch(params *GetSavedSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSavedSearchOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1MetricsMilestoneFunnelParams() + params = NewGetSavedSearchParams() } op := &runtime.ClientOperation{ - ID: "getV1MetricsMilestoneFunnel", + ID: "get_saved_search", Method: "GET", - PathPattern: "/v1/metrics/milestone_funnel", + PathPattern: "/v1/saved_searches/{resource_type}/{saved_search_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1MetricsMilestoneFunnelReader{formats: a.formats}, + Reader: &GetSavedSearchReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -264,35 +264,35 @@ func (a *Client) GetV1MetricsMilestoneFunnel(params *GetV1MetricsMilestoneFunnel if err != nil { return nil, err } - success, ok := result.(*GetV1MetricsMilestoneFunnelOK) + success, ok := result.(*GetSavedSearchOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1MetricsMilestoneFunnel: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_saved_search: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1MetricsMttx gets infrastructure metrics +GetSignalsGroupedMetrics generates grouped alert metrics -Fetch infrastructure metrics based on custom query +Generate a report of grouped metrics for Signals alerts */ -func (a *Client) GetV1MetricsMttx(params *GetV1MetricsMttxParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsMttxOK, error) { +func (a *Client) GetSignalsGroupedMetrics(params *GetSignalsGroupedMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSignalsGroupedMetricsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1MetricsMttxParams() + params = NewGetSignalsGroupedMetricsParams() } op := &runtime.ClientOperation{ - ID: "getV1MetricsMttx", + ID: "get_signals_grouped_metrics", Method: "GET", - PathPattern: "/v1/metrics/mttx", + PathPattern: "/v1/signals/analytics/grouped_metrics", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1MetricsMttxReader{formats: a.formats}, + Reader: &GetSignalsGroupedMetricsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -305,35 +305,35 @@ func (a *Client) GetV1MetricsMttx(params *GetV1MetricsMttxParams, authInfo runti if err != nil { return nil, err } - success, ok := result.(*GetV1MetricsMttxOK) + success, ok := result.(*GetSignalsGroupedMetricsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1MetricsMttx: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_signals_grouped_metrics: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1MetricsRetrospectives lists retrospective metrics +GetSignalsMttxAnalytics gets m t t x analytics for signals -Returns a report with retrospective analytics data +Get mean-time-to-acknowledged (MTTA) and mean-time-to-resolved (MTTR) metrics for Signals alerts */ -func (a *Client) GetV1MetricsRetrospectives(params *GetV1MetricsRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsRetrospectivesOK, error) { +func (a *Client) GetSignalsMttxAnalytics(params *GetSignalsMttxAnalyticsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSignalsMttxAnalyticsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1MetricsRetrospectivesParams() + params = NewGetSignalsMttxAnalyticsParams() } op := &runtime.ClientOperation{ - ID: "getV1MetricsRetrospectives", + ID: "get_signals_mttx_analytics", Method: "GET", - PathPattern: "/v1/metrics/retrospectives", + PathPattern: "/v1/signals/analytics/mttx", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1MetricsRetrospectivesReader{formats: a.formats}, + Reader: &GetSignalsMttxAnalyticsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -346,35 +346,35 @@ func (a *Client) GetV1MetricsRetrospectives(params *GetV1MetricsRetrospectivesPa if err != nil { return nil, err } - success, ok := result.(*GetV1MetricsRetrospectivesOK) + success, ok := result.(*GetSignalsMttxAnalyticsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1MetricsRetrospectives: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_signals_mttx_analytics: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1MetricsTicketFunnel lists ticket task and follow up creation and completion metrics +GetSignalsTimeseriesAnalytics generates timeseries alert metrics -Returns a report with task and follow up creation and completion data +Generate a timeseries-based report of metrics for Signals alerts */ -func (a *Client) GetV1MetricsTicketFunnel(params *GetV1MetricsTicketFunnelParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsTicketFunnelOK, error) { +func (a *Client) GetSignalsTimeseriesAnalytics(params *GetSignalsTimeseriesAnalyticsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSignalsTimeseriesAnalyticsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1MetricsTicketFunnelParams() + params = NewGetSignalsTimeseriesAnalyticsParams() } op := &runtime.ClientOperation{ - ID: "getV1MetricsTicketFunnel", + ID: "get_signals_timeseries_analytics", Method: "GET", - PathPattern: "/v1/metrics/ticket_funnel", + PathPattern: "/v1/signals/analytics/timeseries", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1MetricsTicketFunnelReader{formats: a.formats}, + Reader: &GetSignalsTimeseriesAnalyticsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -387,35 +387,35 @@ func (a *Client) GetV1MetricsTicketFunnel(params *GetV1MetricsTicketFunnelParams if err != nil { return nil, err } - success, ok := result.(*GetV1MetricsTicketFunnelOK) + success, ok := result.(*GetSignalsTimeseriesAnalyticsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1MetricsTicketFunnel: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_signals_timeseries_analytics: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1MetricsUserInvolvements lists user metrics +ListIncidentMetrics lists incident metrics and analytics Returns a report with time bucketed analytics data */ -func (a *Client) GetV1MetricsUserInvolvements(params *GetV1MetricsUserInvolvementsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1MetricsUserInvolvementsOK, error) { +func (a *Client) ListIncidentMetrics(params *ListIncidentMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentMetricsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1MetricsUserInvolvementsParams() + params = NewListIncidentMetricsParams() } op := &runtime.ClientOperation{ - ID: "getV1MetricsUserInvolvements", + ID: "list_incident_metrics", Method: "GET", - PathPattern: "/v1/metrics/user_involvements", + PathPattern: "/v1/metrics/incidents", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1MetricsUserInvolvementsReader{formats: a.formats}, + Reader: &ListIncidentMetricsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -428,35 +428,35 @@ func (a *Client) GetV1MetricsUserInvolvements(params *GetV1MetricsUserInvolvemen if err != nil { return nil, err } - success, ok := result.(*GetV1MetricsUserInvolvementsOK) + success, ok := result.(*ListIncidentMetricsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1MetricsUserInvolvements: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_metrics: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ReportsMeanTime gets mean time metrics for incidents +ListInfrastructureMetrics gets metrics for a component -Returns a report with time bucketed analytics data +Return metrics for a specific component */ -func (a *Client) GetV1ReportsMeanTime(params *GetV1ReportsMeanTimeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ReportsMeanTimeOK, error) { +func (a *Client) ListInfrastructureMetrics(params *ListInfrastructureMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListInfrastructureMetricsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ReportsMeanTimeParams() + params = NewListInfrastructureMetricsParams() } op := &runtime.ClientOperation{ - ID: "getV1ReportsMeanTime", + ID: "list_infrastructure_metrics", Method: "GET", - PathPattern: "/v1/reports/mean_time", + PathPattern: "/v1/metrics/{infra_type}/{infra_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ReportsMeanTimeReader{formats: a.formats}, + Reader: &ListInfrastructureMetricsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -469,35 +469,35 @@ func (a *Client) GetV1ReportsMeanTime(params *GetV1ReportsMeanTimeParams, authIn if err != nil { return nil, err } - success, ok := result.(*GetV1ReportsMeanTimeOK) + success, ok := result.(*ListInfrastructureMetricsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ReportsMeanTime: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_infrastructure_metrics: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SavedSearchesResourceType lists saved searches +ListInfrastructureTypeMetrics lists metrics for a component type -Lists saved searches +Returns metrics for all components of a given type */ -func (a *Client) GetV1SavedSearchesResourceType(params *GetV1SavedSearchesResourceTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SavedSearchesResourceTypeOK, error) { +func (a *Client) ListInfrastructureTypeMetrics(params *ListInfrastructureTypeMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListInfrastructureTypeMetricsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SavedSearchesResourceTypeParams() + params = NewListInfrastructureTypeMetricsParams() } op := &runtime.ClientOperation{ - ID: "getV1SavedSearchesResourceType", + ID: "list_infrastructure_type_metrics", Method: "GET", - PathPattern: "/v1/saved_searches/{resource_type}", + PathPattern: "/v1/metrics/{infra_type}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SavedSearchesResourceTypeReader{formats: a.formats}, + Reader: &ListInfrastructureTypeMetricsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -510,35 +510,35 @@ func (a *Client) GetV1SavedSearchesResourceType(params *GetV1SavedSearchesResour if err != nil { return nil, err } - success, ok := result.(*GetV1SavedSearchesResourceTypeOK) + success, ok := result.(*ListInfrastructureTypeMetricsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SavedSearchesResourceType: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_infrastructure_type_metrics: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SavedSearchesResourceTypeSavedSearchID gets a saved search +ListMilestoneFunnelMetrics lists milestone funnel metrics -Retrieve a specific save search +Returns a report with time bucketed milestone data */ -func (a *Client) GetV1SavedSearchesResourceTypeSavedSearchID(params *GetV1SavedSearchesResourceTypeSavedSearchIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SavedSearchesResourceTypeSavedSearchIDOK, error) { +func (a *Client) ListMilestoneFunnelMetrics(params *ListMilestoneFunnelMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListMilestoneFunnelMetricsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SavedSearchesResourceTypeSavedSearchIDParams() + params = NewListMilestoneFunnelMetricsParams() } op := &runtime.ClientOperation{ - ID: "getV1SavedSearchesResourceTypeSavedSearchId", + ID: "list_milestone_funnel_metrics", Method: "GET", - PathPattern: "/v1/saved_searches/{resource_type}/{saved_search_id}", + PathPattern: "/v1/metrics/milestone_funnel", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SavedSearchesResourceTypeSavedSearchIDReader{formats: a.formats}, + Reader: &ListMilestoneFunnelMetricsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -551,35 +551,35 @@ func (a *Client) GetV1SavedSearchesResourceTypeSavedSearchID(params *GetV1SavedS if err != nil { return nil, err } - success, ok := result.(*GetV1SavedSearchesResourceTypeSavedSearchIDOK) + success, ok := result.(*ListMilestoneFunnelMetricsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SavedSearchesResourceTypeSavedSearchId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_milestone_funnel_metrics: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SignalsAnalyticsGroupedMetrics generates grouped alert metrics +ListMttxMetrics gets infrastructure metrics -Generate a report of grouped metrics for Signals alerts +Fetch infrastructure metrics based on custom query */ -func (a *Client) GetV1SignalsAnalyticsGroupedMetrics(params *GetV1SignalsAnalyticsGroupedMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsAnalyticsGroupedMetricsOK, error) { +func (a *Client) ListMttxMetrics(params *ListMttxMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListMttxMetricsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SignalsAnalyticsGroupedMetricsParams() + params = NewListMttxMetricsParams() } op := &runtime.ClientOperation{ - ID: "getV1SignalsAnalyticsGroupedMetrics", + ID: "list_mttx_metrics", Method: "GET", - PathPattern: "/v1/signals/analytics/grouped_metrics", + PathPattern: "/v1/metrics/mttx", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SignalsAnalyticsGroupedMetricsReader{formats: a.formats}, + Reader: &ListMttxMetricsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -592,35 +592,35 @@ func (a *Client) GetV1SignalsAnalyticsGroupedMetrics(params *GetV1SignalsAnalyti if err != nil { return nil, err } - success, ok := result.(*GetV1SignalsAnalyticsGroupedMetricsOK) + success, ok := result.(*ListMttxMetricsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SignalsAnalyticsGroupedMetrics: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_mttx_metrics: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SignalsAnalyticsMttx gets m t t x analytics for signals +ListRetrospectiveMetrics lists retrospective metrics -Get mean-time-to-acknowledged (MTTA) and mean-time-to-resolved (MTTR) metrics for Signals alerts +Returns a report with retrospective analytics data */ -func (a *Client) GetV1SignalsAnalyticsMttx(params *GetV1SignalsAnalyticsMttxParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsAnalyticsMttxOK, error) { +func (a *Client) ListRetrospectiveMetrics(params *ListRetrospectiveMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRetrospectiveMetricsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SignalsAnalyticsMttxParams() + params = NewListRetrospectiveMetricsParams() } op := &runtime.ClientOperation{ - ID: "getV1SignalsAnalyticsMttx", + ID: "list_retrospective_metrics", Method: "GET", - PathPattern: "/v1/signals/analytics/mttx", + PathPattern: "/v1/metrics/retrospectives", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SignalsAnalyticsMttxReader{formats: a.formats}, + Reader: &ListRetrospectiveMetricsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -633,35 +633,35 @@ func (a *Client) GetV1SignalsAnalyticsMttx(params *GetV1SignalsAnalyticsMttxPara if err != nil { return nil, err } - success, ok := result.(*GetV1SignalsAnalyticsMttxOK) + success, ok := result.(*ListRetrospectiveMetricsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SignalsAnalyticsMttx: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_retrospective_metrics: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SignalsAnalyticsShiftsExport exports on call hours report +ListSavedSearches lists saved searches -Export on-call hours report for users/teams during a time period +Lists saved searches */ -func (a *Client) GetV1SignalsAnalyticsShiftsExport(params *GetV1SignalsAnalyticsShiftsExportParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsAnalyticsShiftsExportOK, error) { +func (a *Client) ListSavedSearches(params *ListSavedSearchesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSavedSearchesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SignalsAnalyticsShiftsExportParams() + params = NewListSavedSearchesParams() } op := &runtime.ClientOperation{ - ID: "getV1SignalsAnalyticsShiftsExport", + ID: "list_saved_searches", Method: "GET", - PathPattern: "/v1/signals/analytics/shifts/export", + PathPattern: "/v1/saved_searches/{resource_type}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SignalsAnalyticsShiftsExportReader{formats: a.formats}, + Reader: &ListSavedSearchesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -674,35 +674,35 @@ func (a *Client) GetV1SignalsAnalyticsShiftsExport(params *GetV1SignalsAnalytics if err != nil { return nil, err } - success, ok := result.(*GetV1SignalsAnalyticsShiftsExportOK) + success, ok := result.(*ListSavedSearchesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SignalsAnalyticsShiftsExport: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_saved_searches: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SignalsAnalyticsTimeseries generates timeseries alert metrics +ListTicketFunnelMetrics lists ticket task and follow up creation and completion metrics -Generate a timeseries-based report of metrics for Signals alerts +Returns a report with task and follow up creation and completion data */ -func (a *Client) GetV1SignalsAnalyticsTimeseries(params *GetV1SignalsAnalyticsTimeseriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsAnalyticsTimeseriesOK, error) { +func (a *Client) ListTicketFunnelMetrics(params *ListTicketFunnelMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTicketFunnelMetricsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SignalsAnalyticsTimeseriesParams() + params = NewListTicketFunnelMetricsParams() } op := &runtime.ClientOperation{ - ID: "getV1SignalsAnalyticsTimeseries", + ID: "list_ticket_funnel_metrics", Method: "GET", - PathPattern: "/v1/signals/analytics/timeseries", + PathPattern: "/v1/metrics/ticket_funnel", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SignalsAnalyticsTimeseriesReader{formats: a.formats}, + Reader: &ListTicketFunnelMetricsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -715,35 +715,35 @@ func (a *Client) GetV1SignalsAnalyticsTimeseries(params *GetV1SignalsAnalyticsTi if err != nil { return nil, err } - success, ok := result.(*GetV1SignalsAnalyticsTimeseriesOK) + success, ok := result.(*ListTicketFunnelMetricsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SignalsAnalyticsTimeseries: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_ticket_funnel_metrics: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1SavedSearchesResourceTypeSavedSearchID updates a saved search +ListUserInvolvementMetrics lists user metrics -Update a specific saved search +Returns a report with time bucketed analytics data */ -func (a *Client) PatchV1SavedSearchesResourceTypeSavedSearchID(params *PatchV1SavedSearchesResourceTypeSavedSearchIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SavedSearchesResourceTypeSavedSearchIDOK, error) { +func (a *Client) ListUserInvolvementMetrics(params *ListUserInvolvementMetricsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListUserInvolvementMetricsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1SavedSearchesResourceTypeSavedSearchIDParams() + params = NewListUserInvolvementMetricsParams() } op := &runtime.ClientOperation{ - ID: "patchV1SavedSearchesResourceTypeSavedSearchId", - Method: "PATCH", - PathPattern: "/v1/saved_searches/{resource_type}/{saved_search_id}", + ID: "list_user_involvement_metrics", + Method: "GET", + PathPattern: "/v1/metrics/user_involvements", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1SavedSearchesResourceTypeSavedSearchIDReader{formats: a.formats}, + Reader: &ListUserInvolvementMetricsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -756,35 +756,35 @@ func (a *Client) PatchV1SavedSearchesResourceTypeSavedSearchID(params *PatchV1Sa if err != nil { return nil, err } - success, ok := result.(*PatchV1SavedSearchesResourceTypeSavedSearchIDOK) + success, ok := result.(*ListUserInvolvementMetricsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1SavedSearchesResourceTypeSavedSearchId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_user_involvement_metrics: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1SavedSearchesResourceType creates a saved search +UpdateSavedSearch updates a saved search -Create a new saved search for a particular resource type +Update a specific saved search */ -func (a *Client) PostV1SavedSearchesResourceType(params *PostV1SavedSearchesResourceTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SavedSearchesResourceTypeCreated, error) { +func (a *Client) UpdateSavedSearch(params *UpdateSavedSearchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSavedSearchOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1SavedSearchesResourceTypeParams() + params = NewUpdateSavedSearchParams() } op := &runtime.ClientOperation{ - ID: "postV1SavedSearchesResourceType", - Method: "POST", - PathPattern: "/v1/saved_searches/{resource_type}", + ID: "update_saved_search", + Method: "PATCH", + PathPattern: "/v1/saved_searches/{resource_type}/{saved_search_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1SavedSearchesResourceTypeReader{formats: a.formats}, + Reader: &UpdateSavedSearchReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -797,13 +797,13 @@ func (a *Client) PostV1SavedSearchesResourceType(params *PostV1SavedSearchesReso if err != nil { return nil, err } - success, ok := result.(*PostV1SavedSearchesResourceTypeCreated) + success, ok := result.(*UpdateSavedSearchOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1SavedSearchesResourceType: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_saved_search: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/reporting/update_saved_search_parameters.go b/client/reporting/update_saved_search_parameters.go new file mode 100644 index 0000000..f4fe2f8 --- /dev/null +++ b/client/reporting/update_saved_search_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateSavedSearchParams creates a new UpdateSavedSearchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateSavedSearchParams() *UpdateSavedSearchParams { + return &UpdateSavedSearchParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateSavedSearchParamsWithTimeout creates a new UpdateSavedSearchParams object +// with the ability to set a timeout on a request. +func NewUpdateSavedSearchParamsWithTimeout(timeout time.Duration) *UpdateSavedSearchParams { + return &UpdateSavedSearchParams{ + timeout: timeout, + } +} + +// NewUpdateSavedSearchParamsWithContext creates a new UpdateSavedSearchParams object +// with the ability to set a context for a request. +func NewUpdateSavedSearchParamsWithContext(ctx context.Context) *UpdateSavedSearchParams { + return &UpdateSavedSearchParams{ + Context: ctx, + } +} + +// NewUpdateSavedSearchParamsWithHTTPClient creates a new UpdateSavedSearchParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateSavedSearchParamsWithHTTPClient(client *http.Client) *UpdateSavedSearchParams { + return &UpdateSavedSearchParams{ + HTTPClient: client, + } +} + +/* +UpdateSavedSearchParams contains all the parameters to send to the API endpoint + + for the update saved search operation. + + Typically these are written to a http.Request. +*/ +type UpdateSavedSearchParams struct { + + // ResourceType. + ResourceType string + + // SavedSearchID. + SavedSearchID string + + // UpdateSavedSearch. + UpdateSavedSearch *models.UpdateSavedSearch + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update saved search params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSavedSearchParams) WithDefaults() *UpdateSavedSearchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update saved search params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSavedSearchParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update saved search params +func (o *UpdateSavedSearchParams) WithTimeout(timeout time.Duration) *UpdateSavedSearchParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update saved search params +func (o *UpdateSavedSearchParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update saved search params +func (o *UpdateSavedSearchParams) WithContext(ctx context.Context) *UpdateSavedSearchParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update saved search params +func (o *UpdateSavedSearchParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update saved search params +func (o *UpdateSavedSearchParams) WithHTTPClient(client *http.Client) *UpdateSavedSearchParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update saved search params +func (o *UpdateSavedSearchParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithResourceType adds the resourceType to the update saved search params +func (o *UpdateSavedSearchParams) WithResourceType(resourceType string) *UpdateSavedSearchParams { + o.SetResourceType(resourceType) + return o +} + +// SetResourceType adds the resourceType to the update saved search params +func (o *UpdateSavedSearchParams) SetResourceType(resourceType string) { + o.ResourceType = resourceType +} + +// WithSavedSearchID adds the savedSearchID to the update saved search params +func (o *UpdateSavedSearchParams) WithSavedSearchID(savedSearchID string) *UpdateSavedSearchParams { + o.SetSavedSearchID(savedSearchID) + return o +} + +// SetSavedSearchID adds the savedSearchId to the update saved search params +func (o *UpdateSavedSearchParams) SetSavedSearchID(savedSearchID string) { + o.SavedSearchID = savedSearchID +} + +// WithUpdateSavedSearch adds the updateSavedSearch to the update saved search params +func (o *UpdateSavedSearchParams) WithUpdateSavedSearch(updateSavedSearch *models.UpdateSavedSearch) *UpdateSavedSearchParams { + o.SetUpdateSavedSearch(updateSavedSearch) + return o +} + +// SetUpdateSavedSearch adds the updateSavedSearch to the update saved search params +func (o *UpdateSavedSearchParams) SetUpdateSavedSearch(updateSavedSearch *models.UpdateSavedSearch) { + o.UpdateSavedSearch = updateSavedSearch +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateSavedSearchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param resource_type + if err := r.SetPathParam("resource_type", o.ResourceType); err != nil { + return err + } + + // path param saved_search_id + if err := r.SetPathParam("saved_search_id", o.SavedSearchID); err != nil { + return err + } + if o.UpdateSavedSearch != nil { + if err := r.SetBodyParam(o.UpdateSavedSearch); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/reporting/update_saved_search_responses.go b/client/reporting/update_saved_search_responses.go new file mode 100644 index 0000000..497a82b --- /dev/null +++ b/client/reporting/update_saved_search_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package reporting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateSavedSearchReader is a Reader for the UpdateSavedSearch structure. +type UpdateSavedSearchReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateSavedSearchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateSavedSearchOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateSavedSearchOK creates a UpdateSavedSearchOK with default headers values +func NewUpdateSavedSearchOK() *UpdateSavedSearchOK { + return &UpdateSavedSearchOK{} +} + +/* +UpdateSavedSearchOK describes a response with status code 200, with default header values. + +Update a specific saved search +*/ +type UpdateSavedSearchOK struct { + Payload *models.SavedSearchEntity +} + +// IsSuccess returns true when this update saved search o k response has a 2xx status code +func (o *UpdateSavedSearchOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update saved search o k response has a 3xx status code +func (o *UpdateSavedSearchOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update saved search o k response has a 4xx status code +func (o *UpdateSavedSearchOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update saved search o k response has a 5xx status code +func (o *UpdateSavedSearchOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update saved search o k response a status code equal to that given +func (o *UpdateSavedSearchOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateSavedSearchOK) Error() string { + return fmt.Sprintf("[PATCH /v1/saved_searches/{resource_type}/{saved_search_id}][%d] updateSavedSearchOK %+v", 200, o.Payload) +} + +func (o *UpdateSavedSearchOK) String() string { + return fmt.Sprintf("[PATCH /v1/saved_searches/{resource_type}/{saved_search_id}][%d] updateSavedSearchOK %+v", 200, o.Payload) +} + +func (o *UpdateSavedSearchOK) GetPayload() *models.SavedSearchEntity { + return o.Payload +} + +func (o *UpdateSavedSearchOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SavedSearchEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/create_incident_retrospective_dynamic_input_parameters.go b/client/retrospectives/create_incident_retrospective_dynamic_input_parameters.go new file mode 100644 index 0000000..d0be54c --- /dev/null +++ b/client/retrospectives/create_incident_retrospective_dynamic_input_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateIncidentRetrospectiveDynamicInputParams creates a new CreateIncidentRetrospectiveDynamicInputParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentRetrospectiveDynamicInputParams() *CreateIncidentRetrospectiveDynamicInputParams { + return &CreateIncidentRetrospectiveDynamicInputParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentRetrospectiveDynamicInputParamsWithTimeout creates a new CreateIncidentRetrospectiveDynamicInputParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentRetrospectiveDynamicInputParamsWithTimeout(timeout time.Duration) *CreateIncidentRetrospectiveDynamicInputParams { + return &CreateIncidentRetrospectiveDynamicInputParams{ + timeout: timeout, + } +} + +// NewCreateIncidentRetrospectiveDynamicInputParamsWithContext creates a new CreateIncidentRetrospectiveDynamicInputParams object +// with the ability to set a context for a request. +func NewCreateIncidentRetrospectiveDynamicInputParamsWithContext(ctx context.Context) *CreateIncidentRetrospectiveDynamicInputParams { + return &CreateIncidentRetrospectiveDynamicInputParams{ + Context: ctx, + } +} + +// NewCreateIncidentRetrospectiveDynamicInputParamsWithHTTPClient creates a new CreateIncidentRetrospectiveDynamicInputParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentRetrospectiveDynamicInputParamsWithHTTPClient(client *http.Client) *CreateIncidentRetrospectiveDynamicInputParams { + return &CreateIncidentRetrospectiveDynamicInputParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentRetrospectiveDynamicInputParams contains all the parameters to send to the API endpoint + + for the create incident retrospective dynamic input operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentRetrospectiveDynamicInputParams struct { + + // FieldID. + FieldID string + + // IncidentID. + IncidentID string + + // RetrospectiveID. + RetrospectiveID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident retrospective dynamic input params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentRetrospectiveDynamicInputParams) WithDefaults() *CreateIncidentRetrospectiveDynamicInputParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident retrospective dynamic input params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentRetrospectiveDynamicInputParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident retrospective dynamic input params +func (o *CreateIncidentRetrospectiveDynamicInputParams) WithTimeout(timeout time.Duration) *CreateIncidentRetrospectiveDynamicInputParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident retrospective dynamic input params +func (o *CreateIncidentRetrospectiveDynamicInputParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident retrospective dynamic input params +func (o *CreateIncidentRetrospectiveDynamicInputParams) WithContext(ctx context.Context) *CreateIncidentRetrospectiveDynamicInputParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident retrospective dynamic input params +func (o *CreateIncidentRetrospectiveDynamicInputParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident retrospective dynamic input params +func (o *CreateIncidentRetrospectiveDynamicInputParams) WithHTTPClient(client *http.Client) *CreateIncidentRetrospectiveDynamicInputParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident retrospective dynamic input params +func (o *CreateIncidentRetrospectiveDynamicInputParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFieldID adds the fieldID to the create incident retrospective dynamic input params +func (o *CreateIncidentRetrospectiveDynamicInputParams) WithFieldID(fieldID string) *CreateIncidentRetrospectiveDynamicInputParams { + o.SetFieldID(fieldID) + return o +} + +// SetFieldID adds the fieldId to the create incident retrospective dynamic input params +func (o *CreateIncidentRetrospectiveDynamicInputParams) SetFieldID(fieldID string) { + o.FieldID = fieldID +} + +// WithIncidentID adds the incidentID to the create incident retrospective dynamic input params +func (o *CreateIncidentRetrospectiveDynamicInputParams) WithIncidentID(incidentID string) *CreateIncidentRetrospectiveDynamicInputParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident retrospective dynamic input params +func (o *CreateIncidentRetrospectiveDynamicInputParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithRetrospectiveID adds the retrospectiveID to the create incident retrospective dynamic input params +func (o *CreateIncidentRetrospectiveDynamicInputParams) WithRetrospectiveID(retrospectiveID string) *CreateIncidentRetrospectiveDynamicInputParams { + o.SetRetrospectiveID(retrospectiveID) + return o +} + +// SetRetrospectiveID adds the retrospectiveId to the create incident retrospective dynamic input params +func (o *CreateIncidentRetrospectiveDynamicInputParams) SetRetrospectiveID(retrospectiveID string) { + o.RetrospectiveID = retrospectiveID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentRetrospectiveDynamicInputParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param field_id + if err := r.SetPathParam("field_id", o.FieldID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param retrospective_id + if err := r.SetPathParam("retrospective_id", o.RetrospectiveID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/create_incident_retrospective_dynamic_input_responses.go b/client/retrospectives/create_incident_retrospective_dynamic_input_responses.go new file mode 100644 index 0000000..5be5dd3 --- /dev/null +++ b/client/retrospectives/create_incident_retrospective_dynamic_input_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentRetrospectiveDynamicInputReader is a Reader for the CreateIncidentRetrospectiveDynamicInput structure. +type CreateIncidentRetrospectiveDynamicInputReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentRetrospectiveDynamicInputReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentRetrospectiveDynamicInputCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentRetrospectiveDynamicInputCreated creates a CreateIncidentRetrospectiveDynamicInputCreated with default headers values +func NewCreateIncidentRetrospectiveDynamicInputCreated() *CreateIncidentRetrospectiveDynamicInputCreated { + return &CreateIncidentRetrospectiveDynamicInputCreated{} +} + +/* +CreateIncidentRetrospectiveDynamicInputCreated describes a response with status code 201, with default header values. + +Add a new dynamic input field to a dynamic input group +*/ +type CreateIncidentRetrospectiveDynamicInputCreated struct { + Payload *models.IncidentsRetrospectiveFieldEntity +} + +// IsSuccess returns true when this create incident retrospective dynamic input created response has a 2xx status code +func (o *CreateIncidentRetrospectiveDynamicInputCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident retrospective dynamic input created response has a 3xx status code +func (o *CreateIncidentRetrospectiveDynamicInputCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident retrospective dynamic input created response has a 4xx status code +func (o *CreateIncidentRetrospectiveDynamicInputCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident retrospective dynamic input created response has a 5xx status code +func (o *CreateIncidentRetrospectiveDynamicInputCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident retrospective dynamic input created response a status code equal to that given +func (o *CreateIncidentRetrospectiveDynamicInputCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentRetrospectiveDynamicInputCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}/inputs][%d] createIncidentRetrospectiveDynamicInputCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentRetrospectiveDynamicInputCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}/inputs][%d] createIncidentRetrospectiveDynamicInputCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentRetrospectiveDynamicInputCreated) GetPayload() *models.IncidentsRetrospectiveFieldEntity { + return o.Payload +} + +func (o *CreateIncidentRetrospectiveDynamicInputCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRetrospectiveFieldEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/create_incident_retrospective_field_parameters.go b/client/retrospectives/create_incident_retrospective_field_parameters.go new file mode 100644 index 0000000..3456676 --- /dev/null +++ b/client/retrospectives/create_incident_retrospective_field_parameters.go @@ -0,0 +1,356 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCreateIncidentRetrospectiveFieldParams creates a new CreateIncidentRetrospectiveFieldParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentRetrospectiveFieldParams() *CreateIncidentRetrospectiveFieldParams { + return &CreateIncidentRetrospectiveFieldParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentRetrospectiveFieldParamsWithTimeout creates a new CreateIncidentRetrospectiveFieldParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentRetrospectiveFieldParamsWithTimeout(timeout time.Duration) *CreateIncidentRetrospectiveFieldParams { + return &CreateIncidentRetrospectiveFieldParams{ + timeout: timeout, + } +} + +// NewCreateIncidentRetrospectiveFieldParamsWithContext creates a new CreateIncidentRetrospectiveFieldParams object +// with the ability to set a context for a request. +func NewCreateIncidentRetrospectiveFieldParamsWithContext(ctx context.Context) *CreateIncidentRetrospectiveFieldParams { + return &CreateIncidentRetrospectiveFieldParams{ + Context: ctx, + } +} + +// NewCreateIncidentRetrospectiveFieldParamsWithHTTPClient creates a new CreateIncidentRetrospectiveFieldParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentRetrospectiveFieldParamsWithHTTPClient(client *http.Client) *CreateIncidentRetrospectiveFieldParams { + return &CreateIncidentRetrospectiveFieldParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentRetrospectiveFieldParams contains all the parameters to send to the API endpoint + + for the create incident retrospective field operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentRetrospectiveFieldParams struct { + + // HelpText. + HelpText *string + + // IncidentID. + IncidentID string + + // IsRequired. + IsRequired *bool + + // Label. + Label string + + // PermissibleValues. + PermissibleValues []string + + // RetrospectiveID. + RetrospectiveID string + + // Schema. + Schema []string + + // Type. + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident retrospective field params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentRetrospectiveFieldParams) WithDefaults() *CreateIncidentRetrospectiveFieldParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident retrospective field params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentRetrospectiveFieldParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) WithTimeout(timeout time.Duration) *CreateIncidentRetrospectiveFieldParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) WithContext(ctx context.Context) *CreateIncidentRetrospectiveFieldParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) WithHTTPClient(client *http.Client) *CreateIncidentRetrospectiveFieldParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithHelpText adds the helpText to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) WithHelpText(helpText *string) *CreateIncidentRetrospectiveFieldParams { + o.SetHelpText(helpText) + return o +} + +// SetHelpText adds the helpText to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) SetHelpText(helpText *string) { + o.HelpText = helpText +} + +// WithIncidentID adds the incidentID to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) WithIncidentID(incidentID string) *CreateIncidentRetrospectiveFieldParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithIsRequired adds the isRequired to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) WithIsRequired(isRequired *bool) *CreateIncidentRetrospectiveFieldParams { + o.SetIsRequired(isRequired) + return o +} + +// SetIsRequired adds the isRequired to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) SetIsRequired(isRequired *bool) { + o.IsRequired = isRequired +} + +// WithLabel adds the label to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) WithLabel(label string) *CreateIncidentRetrospectiveFieldParams { + o.SetLabel(label) + return o +} + +// SetLabel adds the label to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) SetLabel(label string) { + o.Label = label +} + +// WithPermissibleValues adds the permissibleValues to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) WithPermissibleValues(permissibleValues []string) *CreateIncidentRetrospectiveFieldParams { + o.SetPermissibleValues(permissibleValues) + return o +} + +// SetPermissibleValues adds the permissibleValues to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) SetPermissibleValues(permissibleValues []string) { + o.PermissibleValues = permissibleValues +} + +// WithRetrospectiveID adds the retrospectiveID to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) WithRetrospectiveID(retrospectiveID string) *CreateIncidentRetrospectiveFieldParams { + o.SetRetrospectiveID(retrospectiveID) + return o +} + +// SetRetrospectiveID adds the retrospectiveId to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) SetRetrospectiveID(retrospectiveID string) { + o.RetrospectiveID = retrospectiveID +} + +// WithSchema adds the schema to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) WithSchema(schema []string) *CreateIncidentRetrospectiveFieldParams { + o.SetSchema(schema) + return o +} + +// SetSchema adds the schema to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) SetSchema(schema []string) { + o.Schema = schema +} + +// WithType adds the typeVar to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) WithType(typeVar string) *CreateIncidentRetrospectiveFieldParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the create incident retrospective field params +func (o *CreateIncidentRetrospectiveFieldParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentRetrospectiveFieldParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.HelpText != nil { + + // form param help_text + var frHelpText string + if o.HelpText != nil { + frHelpText = *o.HelpText + } + fHelpText := frHelpText + if fHelpText != "" { + if err := r.SetFormParam("help_text", fHelpText); err != nil { + return err + } + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if o.IsRequired != nil { + + // form param is_required + var frIsRequired bool + if o.IsRequired != nil { + frIsRequired = *o.IsRequired + } + fIsRequired := swag.FormatBool(frIsRequired) + if fIsRequired != "" { + if err := r.SetFormParam("is_required", fIsRequired); err != nil { + return err + } + } + } + + // form param label + frLabel := o.Label + fLabel := frLabel + if fLabel != "" { + if err := r.SetFormParam("label", fLabel); err != nil { + return err + } + } + + if o.PermissibleValues != nil { + + // binding items for permissible_values + joinedPermissibleValues := o.bindParamPermissibleValues(reg) + + // form array param permissible_values + if err := r.SetFormParam("permissible_values", joinedPermissibleValues...); err != nil { + return err + } + } + + // path param retrospective_id + if err := r.SetPathParam("retrospective_id", o.RetrospectiveID); err != nil { + return err + } + + if o.Schema != nil { + + // binding items for schema + joinedSchema := o.bindParamSchema(reg) + + // form array param schema + if err := r.SetFormParam("schema", joinedSchema...); err != nil { + return err + } + } + + // form param type + frType := o.Type + fType := frType + if fType != "" { + if err := r.SetFormParam("type", fType); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamCreateIncidentRetrospectiveField binds the parameter permissible_values +func (o *CreateIncidentRetrospectiveFieldParams) bindParamPermissibleValues(formats strfmt.Registry) []string { + permissibleValuesIR := o.PermissibleValues + + var permissibleValuesIC []string + for _, permissibleValuesIIR := range permissibleValuesIR { // explode []string + + permissibleValuesIIV := permissibleValuesIIR // string as string + permissibleValuesIC = append(permissibleValuesIC, permissibleValuesIIV) + } + + // items.CollectionFormat: "" + permissibleValuesIS := swag.JoinByFormat(permissibleValuesIC, "") + + return permissibleValuesIS +} + +// bindParamCreateIncidentRetrospectiveField binds the parameter schema +func (o *CreateIncidentRetrospectiveFieldParams) bindParamSchema(formats strfmt.Registry) []string { + schemaIR := o.Schema + + var schemaIC []string + for _, schemaIIR := range schemaIR { // explode []string + + schemaIIV := schemaIIR // string as string + schemaIC = append(schemaIC, schemaIIV) + } + + // items.CollectionFormat: "" + schemaIS := swag.JoinByFormat(schemaIC, "") + + return schemaIS +} diff --git a/client/retrospectives/create_incident_retrospective_field_responses.go b/client/retrospectives/create_incident_retrospective_field_responses.go new file mode 100644 index 0000000..62f5153 --- /dev/null +++ b/client/retrospectives/create_incident_retrospective_field_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentRetrospectiveFieldReader is a Reader for the CreateIncidentRetrospectiveField structure. +type CreateIncidentRetrospectiveFieldReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentRetrospectiveFieldReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateIncidentRetrospectiveFieldOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentRetrospectiveFieldOK creates a CreateIncidentRetrospectiveFieldOK with default headers values +func NewCreateIncidentRetrospectiveFieldOK() *CreateIncidentRetrospectiveFieldOK { + return &CreateIncidentRetrospectiveFieldOK{} +} + +/* +CreateIncidentRetrospectiveFieldOK describes a response with status code 200, with default header values. + +Add a new field to an incident retrospective +*/ +type CreateIncidentRetrospectiveFieldOK struct { + Payload *models.IncidentsRetrospectiveFieldEntity +} + +// IsSuccess returns true when this create incident retrospective field o k response has a 2xx status code +func (o *CreateIncidentRetrospectiveFieldOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident retrospective field o k response has a 3xx status code +func (o *CreateIncidentRetrospectiveFieldOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident retrospective field o k response has a 4xx status code +func (o *CreateIncidentRetrospectiveFieldOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident retrospective field o k response has a 5xx status code +func (o *CreateIncidentRetrospectiveFieldOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident retrospective field o k response a status code equal to that given +func (o *CreateIncidentRetrospectiveFieldOK) IsCode(code int) bool { + return code == 200 +} + +func (o *CreateIncidentRetrospectiveFieldOK) Error() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields][%d] createIncidentRetrospectiveFieldOK %+v", 200, o.Payload) +} + +func (o *CreateIncidentRetrospectiveFieldOK) String() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields][%d] createIncidentRetrospectiveFieldOK %+v", 200, o.Payload) +} + +func (o *CreateIncidentRetrospectiveFieldOK) GetPayload() *models.IncidentsRetrospectiveFieldEntity { + return o.Payload +} + +func (o *CreateIncidentRetrospectiveFieldOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRetrospectiveFieldEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/create_incident_retrospective_parameters.go b/client/retrospectives/create_incident_retrospective_parameters.go new file mode 100644 index 0000000..d8e8d75 --- /dev/null +++ b/client/retrospectives/create_incident_retrospective_parameters.go @@ -0,0 +1,174 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateIncidentRetrospectiveParams creates a new CreateIncidentRetrospectiveParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentRetrospectiveParams() *CreateIncidentRetrospectiveParams { + return &CreateIncidentRetrospectiveParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentRetrospectiveParamsWithTimeout creates a new CreateIncidentRetrospectiveParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentRetrospectiveParamsWithTimeout(timeout time.Duration) *CreateIncidentRetrospectiveParams { + return &CreateIncidentRetrospectiveParams{ + timeout: timeout, + } +} + +// NewCreateIncidentRetrospectiveParamsWithContext creates a new CreateIncidentRetrospectiveParams object +// with the ability to set a context for a request. +func NewCreateIncidentRetrospectiveParamsWithContext(ctx context.Context) *CreateIncidentRetrospectiveParams { + return &CreateIncidentRetrospectiveParams{ + Context: ctx, + } +} + +// NewCreateIncidentRetrospectiveParamsWithHTTPClient creates a new CreateIncidentRetrospectiveParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentRetrospectiveParamsWithHTTPClient(client *http.Client) *CreateIncidentRetrospectiveParams { + return &CreateIncidentRetrospectiveParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentRetrospectiveParams contains all the parameters to send to the API endpoint + + for the create incident retrospective operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentRetrospectiveParams struct { + + // IncidentID. + IncidentID string + + /* RetrospectiveTemplateID. + + The id of the retrospective template to apply. + */ + RetrospectiveTemplateID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident retrospective params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentRetrospectiveParams) WithDefaults() *CreateIncidentRetrospectiveParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident retrospective params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentRetrospectiveParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident retrospective params +func (o *CreateIncidentRetrospectiveParams) WithTimeout(timeout time.Duration) *CreateIncidentRetrospectiveParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident retrospective params +func (o *CreateIncidentRetrospectiveParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident retrospective params +func (o *CreateIncidentRetrospectiveParams) WithContext(ctx context.Context) *CreateIncidentRetrospectiveParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident retrospective params +func (o *CreateIncidentRetrospectiveParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident retrospective params +func (o *CreateIncidentRetrospectiveParams) WithHTTPClient(client *http.Client) *CreateIncidentRetrospectiveParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident retrospective params +func (o *CreateIncidentRetrospectiveParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the create incident retrospective params +func (o *CreateIncidentRetrospectiveParams) WithIncidentID(incidentID string) *CreateIncidentRetrospectiveParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident retrospective params +func (o *CreateIncidentRetrospectiveParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithRetrospectiveTemplateID adds the retrospectiveTemplateID to the create incident retrospective params +func (o *CreateIncidentRetrospectiveParams) WithRetrospectiveTemplateID(retrospectiveTemplateID string) *CreateIncidentRetrospectiveParams { + o.SetRetrospectiveTemplateID(retrospectiveTemplateID) + return o +} + +// SetRetrospectiveTemplateID adds the retrospectiveTemplateId to the create incident retrospective params +func (o *CreateIncidentRetrospectiveParams) SetRetrospectiveTemplateID(retrospectiveTemplateID string) { + o.RetrospectiveTemplateID = retrospectiveTemplateID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentRetrospectiveParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // form param retrospective_template_id + frRetrospectiveTemplateID := o.RetrospectiveTemplateID + fRetrospectiveTemplateID := frRetrospectiveTemplateID + if fRetrospectiveTemplateID != "" { + if err := r.SetFormParam("retrospective_template_id", fRetrospectiveTemplateID); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/create_incident_retrospective_responses.go b/client/retrospectives/create_incident_retrospective_responses.go new file mode 100644 index 0000000..717e800 --- /dev/null +++ b/client/retrospectives/create_incident_retrospective_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentRetrospectiveReader is a Reader for the CreateIncidentRetrospective structure. +type CreateIncidentRetrospectiveReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentRetrospectiveReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentRetrospectiveCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentRetrospectiveCreated creates a CreateIncidentRetrospectiveCreated with default headers values +func NewCreateIncidentRetrospectiveCreated() *CreateIncidentRetrospectiveCreated { + return &CreateIncidentRetrospectiveCreated{} +} + +/* +CreateIncidentRetrospectiveCreated describes a response with status code 201, with default header values. + +Create a new retrospective for an incident +*/ +type CreateIncidentRetrospectiveCreated struct { + Payload *models.IncidentsRetrospectiveEntity +} + +// IsSuccess returns true when this create incident retrospective created response has a 2xx status code +func (o *CreateIncidentRetrospectiveCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident retrospective created response has a 3xx status code +func (o *CreateIncidentRetrospectiveCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident retrospective created response has a 4xx status code +func (o *CreateIncidentRetrospectiveCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident retrospective created response has a 5xx status code +func (o *CreateIncidentRetrospectiveCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident retrospective created response a status code equal to that given +func (o *CreateIncidentRetrospectiveCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentRetrospectiveCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/retrospectives][%d] createIncidentRetrospectiveCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentRetrospectiveCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/retrospectives][%d] createIncidentRetrospectiveCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentRetrospectiveCreated) GetPayload() *models.IncidentsRetrospectiveEntity { + return o.Payload +} + +func (o *CreateIncidentRetrospectiveCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRetrospectiveEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/create_post_mortem_reason_parameters.go b/client/retrospectives/create_post_mortem_reason_parameters.go new file mode 100644 index 0000000..b5292fe --- /dev/null +++ b/client/retrospectives/create_post_mortem_reason_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreatePostMortemReasonParams creates a new CreatePostMortemReasonParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreatePostMortemReasonParams() *CreatePostMortemReasonParams { + return &CreatePostMortemReasonParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreatePostMortemReasonParamsWithTimeout creates a new CreatePostMortemReasonParams object +// with the ability to set a timeout on a request. +func NewCreatePostMortemReasonParamsWithTimeout(timeout time.Duration) *CreatePostMortemReasonParams { + return &CreatePostMortemReasonParams{ + timeout: timeout, + } +} + +// NewCreatePostMortemReasonParamsWithContext creates a new CreatePostMortemReasonParams object +// with the ability to set a context for a request. +func NewCreatePostMortemReasonParamsWithContext(ctx context.Context) *CreatePostMortemReasonParams { + return &CreatePostMortemReasonParams{ + Context: ctx, + } +} + +// NewCreatePostMortemReasonParamsWithHTTPClient creates a new CreatePostMortemReasonParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreatePostMortemReasonParamsWithHTTPClient(client *http.Client) *CreatePostMortemReasonParams { + return &CreatePostMortemReasonParams{ + HTTPClient: client, + } +} + +/* +CreatePostMortemReasonParams contains all the parameters to send to the API endpoint + + for the create post mortem reason operation. + + Typically these are written to a http.Request. +*/ +type CreatePostMortemReasonParams struct { + + // CreatePostMortemReason. + CreatePostMortemReason *models.CreatePostMortemReason + + // ReportID. + ReportID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create post mortem reason params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePostMortemReasonParams) WithDefaults() *CreatePostMortemReasonParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create post mortem reason params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePostMortemReasonParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create post mortem reason params +func (o *CreatePostMortemReasonParams) WithTimeout(timeout time.Duration) *CreatePostMortemReasonParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create post mortem reason params +func (o *CreatePostMortemReasonParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create post mortem reason params +func (o *CreatePostMortemReasonParams) WithContext(ctx context.Context) *CreatePostMortemReasonParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create post mortem reason params +func (o *CreatePostMortemReasonParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create post mortem reason params +func (o *CreatePostMortemReasonParams) WithHTTPClient(client *http.Client) *CreatePostMortemReasonParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create post mortem reason params +func (o *CreatePostMortemReasonParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreatePostMortemReason adds the createPostMortemReason to the create post mortem reason params +func (o *CreatePostMortemReasonParams) WithCreatePostMortemReason(createPostMortemReason *models.CreatePostMortemReason) *CreatePostMortemReasonParams { + o.SetCreatePostMortemReason(createPostMortemReason) + return o +} + +// SetCreatePostMortemReason adds the createPostMortemReason to the create post mortem reason params +func (o *CreatePostMortemReasonParams) SetCreatePostMortemReason(createPostMortemReason *models.CreatePostMortemReason) { + o.CreatePostMortemReason = createPostMortemReason +} + +// WithReportID adds the reportID to the create post mortem reason params +func (o *CreatePostMortemReasonParams) WithReportID(reportID string) *CreatePostMortemReasonParams { + o.SetReportID(reportID) + return o +} + +// SetReportID adds the reportId to the create post mortem reason params +func (o *CreatePostMortemReasonParams) SetReportID(reportID string) { + o.ReportID = reportID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreatePostMortemReasonParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreatePostMortemReason != nil { + if err := r.SetBodyParam(o.CreatePostMortemReason); err != nil { + return err + } + } + + // path param report_id + if err := r.SetPathParam("report_id", o.ReportID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/create_post_mortem_reason_responses.go b/client/retrospectives/create_post_mortem_reason_responses.go new file mode 100644 index 0000000..1a07c4b --- /dev/null +++ b/client/retrospectives/create_post_mortem_reason_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreatePostMortemReasonReader is a Reader for the CreatePostMortemReason structure. +type CreatePostMortemReasonReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreatePostMortemReasonReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreatePostMortemReasonCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreatePostMortemReasonCreated creates a CreatePostMortemReasonCreated with default headers values +func NewCreatePostMortemReasonCreated() *CreatePostMortemReasonCreated { + return &CreatePostMortemReasonCreated{} +} + +/* +CreatePostMortemReasonCreated describes a response with status code 201, with default header values. + +Add a new contributing factor to an incident +*/ +type CreatePostMortemReasonCreated struct { + Payload *models.PostMortemsReasonEntity +} + +// IsSuccess returns true when this create post mortem reason created response has a 2xx status code +func (o *CreatePostMortemReasonCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create post mortem reason created response has a 3xx status code +func (o *CreatePostMortemReasonCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create post mortem reason created response has a 4xx status code +func (o *CreatePostMortemReasonCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create post mortem reason created response has a 5xx status code +func (o *CreatePostMortemReasonCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create post mortem reason created response a status code equal to that given +func (o *CreatePostMortemReasonCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreatePostMortemReasonCreated) Error() string { + return fmt.Sprintf("[POST /v1/post_mortems/reports/{report_id}/reasons][%d] createPostMortemReasonCreated %+v", 201, o.Payload) +} + +func (o *CreatePostMortemReasonCreated) String() string { + return fmt.Sprintf("[POST /v1/post_mortems/reports/{report_id}/reasons][%d] createPostMortemReasonCreated %+v", 201, o.Payload) +} + +func (o *CreatePostMortemReasonCreated) GetPayload() *models.PostMortemsReasonEntity { + return o.Payload +} + +func (o *CreatePostMortemReasonCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PostMortemsReasonEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/create_post_mortem_report_parameters.go b/client/retrospectives/create_post_mortem_report_parameters.go new file mode 100644 index 0000000..05519b4 --- /dev/null +++ b/client/retrospectives/create_post_mortem_report_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreatePostMortemReportParams creates a new CreatePostMortemReportParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreatePostMortemReportParams() *CreatePostMortemReportParams { + return &CreatePostMortemReportParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreatePostMortemReportParamsWithTimeout creates a new CreatePostMortemReportParams object +// with the ability to set a timeout on a request. +func NewCreatePostMortemReportParamsWithTimeout(timeout time.Duration) *CreatePostMortemReportParams { + return &CreatePostMortemReportParams{ + timeout: timeout, + } +} + +// NewCreatePostMortemReportParamsWithContext creates a new CreatePostMortemReportParams object +// with the ability to set a context for a request. +func NewCreatePostMortemReportParamsWithContext(ctx context.Context) *CreatePostMortemReportParams { + return &CreatePostMortemReportParams{ + Context: ctx, + } +} + +// NewCreatePostMortemReportParamsWithHTTPClient creates a new CreatePostMortemReportParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreatePostMortemReportParamsWithHTTPClient(client *http.Client) *CreatePostMortemReportParams { + return &CreatePostMortemReportParams{ + HTTPClient: client, + } +} + +/* +CreatePostMortemReportParams contains all the parameters to send to the API endpoint + + for the create post mortem report operation. + + Typically these are written to a http.Request. +*/ +type CreatePostMortemReportParams struct { + + // CreatePostMortemReport. + CreatePostMortemReport *models.CreatePostMortemReport + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create post mortem report params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePostMortemReportParams) WithDefaults() *CreatePostMortemReportParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create post mortem report params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePostMortemReportParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create post mortem report params +func (o *CreatePostMortemReportParams) WithTimeout(timeout time.Duration) *CreatePostMortemReportParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create post mortem report params +func (o *CreatePostMortemReportParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create post mortem report params +func (o *CreatePostMortemReportParams) WithContext(ctx context.Context) *CreatePostMortemReportParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create post mortem report params +func (o *CreatePostMortemReportParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create post mortem report params +func (o *CreatePostMortemReportParams) WithHTTPClient(client *http.Client) *CreatePostMortemReportParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create post mortem report params +func (o *CreatePostMortemReportParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreatePostMortemReport adds the createPostMortemReport to the create post mortem report params +func (o *CreatePostMortemReportParams) WithCreatePostMortemReport(createPostMortemReport *models.CreatePostMortemReport) *CreatePostMortemReportParams { + o.SetCreatePostMortemReport(createPostMortemReport) + return o +} + +// SetCreatePostMortemReport adds the createPostMortemReport to the create post mortem report params +func (o *CreatePostMortemReportParams) SetCreatePostMortemReport(createPostMortemReport *models.CreatePostMortemReport) { + o.CreatePostMortemReport = createPostMortemReport +} + +// WriteToRequest writes these params to a swagger request +func (o *CreatePostMortemReportParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreatePostMortemReport != nil { + if err := r.SetBodyParam(o.CreatePostMortemReport); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/create_post_mortem_report_responses.go b/client/retrospectives/create_post_mortem_report_responses.go new file mode 100644 index 0000000..0741b66 --- /dev/null +++ b/client/retrospectives/create_post_mortem_report_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreatePostMortemReportReader is a Reader for the CreatePostMortemReport structure. +type CreatePostMortemReportReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreatePostMortemReportReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreatePostMortemReportCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreatePostMortemReportCreated creates a CreatePostMortemReportCreated with default headers values +func NewCreatePostMortemReportCreated() *CreatePostMortemReportCreated { + return &CreatePostMortemReportCreated{} +} + +/* +CreatePostMortemReportCreated describes a response with status code 201, with default header values. + +Create a report +*/ +type CreatePostMortemReportCreated struct { + Payload *models.PostMortemsPostMortemReportEntity +} + +// IsSuccess returns true when this create post mortem report created response has a 2xx status code +func (o *CreatePostMortemReportCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create post mortem report created response has a 3xx status code +func (o *CreatePostMortemReportCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create post mortem report created response has a 4xx status code +func (o *CreatePostMortemReportCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create post mortem report created response has a 5xx status code +func (o *CreatePostMortemReportCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create post mortem report created response a status code equal to that given +func (o *CreatePostMortemReportCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreatePostMortemReportCreated) Error() string { + return fmt.Sprintf("[POST /v1/post_mortems/reports][%d] createPostMortemReportCreated %+v", 201, o.Payload) +} + +func (o *CreatePostMortemReportCreated) String() string { + return fmt.Sprintf("[POST /v1/post_mortems/reports][%d] createPostMortemReportCreated %+v", 201, o.Payload) +} + +func (o *CreatePostMortemReportCreated) GetPayload() *models.PostMortemsPostMortemReportEntity { + return o.Payload +} + +func (o *CreatePostMortemReportCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PostMortemsPostMortemReportEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/create_retrospective_template_parameters.go b/client/retrospectives/create_retrospective_template_parameters.go new file mode 100644 index 0000000..2276847 --- /dev/null +++ b/client/retrospectives/create_retrospective_template_parameters.go @@ -0,0 +1,541 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCreateRetrospectiveTemplateParams creates a new CreateRetrospectiveTemplateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateRetrospectiveTemplateParams() *CreateRetrospectiveTemplateParams { + return &CreateRetrospectiveTemplateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateRetrospectiveTemplateParamsWithTimeout creates a new CreateRetrospectiveTemplateParams object +// with the ability to set a timeout on a request. +func NewCreateRetrospectiveTemplateParamsWithTimeout(timeout time.Duration) *CreateRetrospectiveTemplateParams { + return &CreateRetrospectiveTemplateParams{ + timeout: timeout, + } +} + +// NewCreateRetrospectiveTemplateParamsWithContext creates a new CreateRetrospectiveTemplateParams object +// with the ability to set a context for a request. +func NewCreateRetrospectiveTemplateParamsWithContext(ctx context.Context) *CreateRetrospectiveTemplateParams { + return &CreateRetrospectiveTemplateParams{ + Context: ctx, + } +} + +// NewCreateRetrospectiveTemplateParamsWithHTTPClient creates a new CreateRetrospectiveTemplateParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateRetrospectiveTemplateParamsWithHTTPClient(client *http.Client) *CreateRetrospectiveTemplateParams { + return &CreateRetrospectiveTemplateParams{ + HTTPClient: client, + } +} + +/* +CreateRetrospectiveTemplateParams contains all the parameters to send to the API endpoint + + for the create retrospective template operation. + + Typically these are written to a http.Request. +*/ +type CreateRetrospectiveTemplateParams struct { + + // Description. + Description string + + // FieldsHelpText. + FieldsHelpText []string + + // FieldsIsRequired. + FieldsIsRequired []bool + + // FieldsLabel. + FieldsLabel []string + + // FieldsPermissibleValues. + FieldsPermissibleValues []string + + // FieldsSchema. + FieldsSchema []string + + // FieldsType. + FieldsType []string + + // IsDefault. + IsDefault *bool + + // Name. + Name string + + // SectionsElements. + SectionsElements []string + + // SectionsSlug. + SectionsSlug []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create retrospective template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateRetrospectiveTemplateParams) WithDefaults() *CreateRetrospectiveTemplateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create retrospective template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateRetrospectiveTemplateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) WithTimeout(timeout time.Duration) *CreateRetrospectiveTemplateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) WithContext(ctx context.Context) *CreateRetrospectiveTemplateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) WithHTTPClient(client *http.Client) *CreateRetrospectiveTemplateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDescription adds the description to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) WithDescription(description string) *CreateRetrospectiveTemplateParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) SetDescription(description string) { + o.Description = description +} + +// WithFieldsHelpText adds the fieldsHelpText to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) WithFieldsHelpText(fieldsHelpText []string) *CreateRetrospectiveTemplateParams { + o.SetFieldsHelpText(fieldsHelpText) + return o +} + +// SetFieldsHelpText adds the fieldsHelpText to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) SetFieldsHelpText(fieldsHelpText []string) { + o.FieldsHelpText = fieldsHelpText +} + +// WithFieldsIsRequired adds the fieldsIsRequired to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) WithFieldsIsRequired(fieldsIsRequired []bool) *CreateRetrospectiveTemplateParams { + o.SetFieldsIsRequired(fieldsIsRequired) + return o +} + +// SetFieldsIsRequired adds the fieldsIsRequired to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) SetFieldsIsRequired(fieldsIsRequired []bool) { + o.FieldsIsRequired = fieldsIsRequired +} + +// WithFieldsLabel adds the fieldsLabel to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) WithFieldsLabel(fieldsLabel []string) *CreateRetrospectiveTemplateParams { + o.SetFieldsLabel(fieldsLabel) + return o +} + +// SetFieldsLabel adds the fieldsLabel to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) SetFieldsLabel(fieldsLabel []string) { + o.FieldsLabel = fieldsLabel +} + +// WithFieldsPermissibleValues adds the fieldsPermissibleValues to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) WithFieldsPermissibleValues(fieldsPermissibleValues []string) *CreateRetrospectiveTemplateParams { + o.SetFieldsPermissibleValues(fieldsPermissibleValues) + return o +} + +// SetFieldsPermissibleValues adds the fieldsPermissibleValues to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) SetFieldsPermissibleValues(fieldsPermissibleValues []string) { + o.FieldsPermissibleValues = fieldsPermissibleValues +} + +// WithFieldsSchema adds the fieldsSchema to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) WithFieldsSchema(fieldsSchema []string) *CreateRetrospectiveTemplateParams { + o.SetFieldsSchema(fieldsSchema) + return o +} + +// SetFieldsSchema adds the fieldsSchema to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) SetFieldsSchema(fieldsSchema []string) { + o.FieldsSchema = fieldsSchema +} + +// WithFieldsType adds the fieldsType to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) WithFieldsType(fieldsType []string) *CreateRetrospectiveTemplateParams { + o.SetFieldsType(fieldsType) + return o +} + +// SetFieldsType adds the fieldsType to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) SetFieldsType(fieldsType []string) { + o.FieldsType = fieldsType +} + +// WithIsDefault adds the isDefault to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) WithIsDefault(isDefault *bool) *CreateRetrospectiveTemplateParams { + o.SetIsDefault(isDefault) + return o +} + +// SetIsDefault adds the isDefault to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) SetIsDefault(isDefault *bool) { + o.IsDefault = isDefault +} + +// WithName adds the name to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) WithName(name string) *CreateRetrospectiveTemplateParams { + o.SetName(name) + return o +} + +// SetName adds the name to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) SetName(name string) { + o.Name = name +} + +// WithSectionsElements adds the sectionsElements to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) WithSectionsElements(sectionsElements []string) *CreateRetrospectiveTemplateParams { + o.SetSectionsElements(sectionsElements) + return o +} + +// SetSectionsElements adds the sectionsElements to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) SetSectionsElements(sectionsElements []string) { + o.SectionsElements = sectionsElements +} + +// WithSectionsSlug adds the sectionsSlug to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) WithSectionsSlug(sectionsSlug []string) *CreateRetrospectiveTemplateParams { + o.SetSectionsSlug(sectionsSlug) + return o +} + +// SetSectionsSlug adds the sectionsSlug to the create retrospective template params +func (o *CreateRetrospectiveTemplateParams) SetSectionsSlug(sectionsSlug []string) { + o.SectionsSlug = sectionsSlug +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateRetrospectiveTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // form param description + frDescription := o.Description + fDescription := frDescription + if fDescription != "" { + if err := r.SetFormParam("description", fDescription); err != nil { + return err + } + } + + if o.FieldsHelpText != nil { + + // binding items for fields[help_text] + joinedFieldsHelpText := o.bindParamFieldsHelpText(reg) + + // form array param fields[help_text] + if err := r.SetFormParam("fields[help_text]", joinedFieldsHelpText...); err != nil { + return err + } + } + + if o.FieldsIsRequired != nil { + + // binding items for fields[is_required] + joinedFieldsIsRequired := o.bindParamFieldsIsRequired(reg) + + // form array param fields[is_required] + if err := r.SetFormParam("fields[is_required]", joinedFieldsIsRequired...); err != nil { + return err + } + } + + if o.FieldsLabel != nil { + + // binding items for fields[label] + joinedFieldsLabel := o.bindParamFieldsLabel(reg) + + // form array param fields[label] + if err := r.SetFormParam("fields[label]", joinedFieldsLabel...); err != nil { + return err + } + } + + if o.FieldsPermissibleValues != nil { + + // binding items for fields[permissible_values] + joinedFieldsPermissibleValues := o.bindParamFieldsPermissibleValues(reg) + + // form array param fields[permissible_values] + if err := r.SetFormParam("fields[permissible_values]", joinedFieldsPermissibleValues...); err != nil { + return err + } + } + + if o.FieldsSchema != nil { + + // binding items for fields[schema] + joinedFieldsSchema := o.bindParamFieldsSchema(reg) + + // form array param fields[schema] + if err := r.SetFormParam("fields[schema]", joinedFieldsSchema...); err != nil { + return err + } + } + + if o.FieldsType != nil { + + // binding items for fields[type] + joinedFieldsType := o.bindParamFieldsType(reg) + + // form array param fields[type] + if err := r.SetFormParam("fields[type]", joinedFieldsType...); err != nil { + return err + } + } + + if o.IsDefault != nil { + + // form param is_default + var frIsDefault bool + if o.IsDefault != nil { + frIsDefault = *o.IsDefault + } + fIsDefault := swag.FormatBool(frIsDefault) + if fIsDefault != "" { + if err := r.SetFormParam("is_default", fIsDefault); err != nil { + return err + } + } + } + + // form param name + frName := o.Name + fName := frName + if fName != "" { + if err := r.SetFormParam("name", fName); err != nil { + return err + } + } + + if o.SectionsElements != nil { + + // binding items for sections[elements] + joinedSectionsElements := o.bindParamSectionsElements(reg) + + // form array param sections[elements] + if err := r.SetFormParam("sections[elements]", joinedSectionsElements...); err != nil { + return err + } + } + + if o.SectionsSlug != nil { + + // binding items for sections[slug] + joinedSectionsSlug := o.bindParamSectionsSlug(reg) + + // form array param sections[slug] + if err := r.SetFormParam("sections[slug]", joinedSectionsSlug...); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamCreateRetrospectiveTemplate binds the parameter fields[help_text] +func (o *CreateRetrospectiveTemplateParams) bindParamFieldsHelpText(formats strfmt.Registry) []string { + fieldsHelpTextIR := o.FieldsHelpText + + var fieldsHelpTextIC []string + for _, fieldsHelpTextIIR := range fieldsHelpTextIR { // explode []string + + fieldsHelpTextIIV := fieldsHelpTextIIR // string as string + fieldsHelpTextIC = append(fieldsHelpTextIC, fieldsHelpTextIIV) + } + + // items.CollectionFormat: "" + fieldsHelpTextIS := swag.JoinByFormat(fieldsHelpTextIC, "") + + return fieldsHelpTextIS +} + +// bindParamCreateRetrospectiveTemplate binds the parameter fields[is_required] +func (o *CreateRetrospectiveTemplateParams) bindParamFieldsIsRequired(formats strfmt.Registry) []string { + fieldsIsRequiredIR := o.FieldsIsRequired + + var fieldsIsRequiredIC []string + for _, fieldsIsRequiredIIR := range fieldsIsRequiredIR { // explode []bool + + fieldsIsRequiredIIV := swag.FormatBool(fieldsIsRequiredIIR) // bool as string + fieldsIsRequiredIC = append(fieldsIsRequiredIC, fieldsIsRequiredIIV) + } + + // items.CollectionFormat: "" + fieldsIsRequiredIS := swag.JoinByFormat(fieldsIsRequiredIC, "") + + return fieldsIsRequiredIS +} + +// bindParamCreateRetrospectiveTemplate binds the parameter fields[label] +func (o *CreateRetrospectiveTemplateParams) bindParamFieldsLabel(formats strfmt.Registry) []string { + fieldsLabelIR := o.FieldsLabel + + var fieldsLabelIC []string + for _, fieldsLabelIIR := range fieldsLabelIR { // explode []string + + fieldsLabelIIV := fieldsLabelIIR // string as string + fieldsLabelIC = append(fieldsLabelIC, fieldsLabelIIV) + } + + // items.CollectionFormat: "" + fieldsLabelIS := swag.JoinByFormat(fieldsLabelIC, "") + + return fieldsLabelIS +} + +// bindParamCreateRetrospectiveTemplate binds the parameter fields[permissible_values] +func (o *CreateRetrospectiveTemplateParams) bindParamFieldsPermissibleValues(formats strfmt.Registry) []string { + fieldsPermissibleValuesIR := o.FieldsPermissibleValues + + var fieldsPermissibleValuesIC []string + for _, fieldsPermissibleValuesIIR := range fieldsPermissibleValuesIR { // explode []string + + fieldsPermissibleValuesIIV := fieldsPermissibleValuesIIR // string as string + fieldsPermissibleValuesIC = append(fieldsPermissibleValuesIC, fieldsPermissibleValuesIIV) + } + + // items.CollectionFormat: "" + fieldsPermissibleValuesIS := swag.JoinByFormat(fieldsPermissibleValuesIC, "") + + return fieldsPermissibleValuesIS +} + +// bindParamCreateRetrospectiveTemplate binds the parameter fields[schema] +func (o *CreateRetrospectiveTemplateParams) bindParamFieldsSchema(formats strfmt.Registry) []string { + fieldsSchemaIR := o.FieldsSchema + + var fieldsSchemaIC []string + for _, fieldsSchemaIIR := range fieldsSchemaIR { // explode []string + + fieldsSchemaIIV := fieldsSchemaIIR // string as string + fieldsSchemaIC = append(fieldsSchemaIC, fieldsSchemaIIV) + } + + // items.CollectionFormat: "" + fieldsSchemaIS := swag.JoinByFormat(fieldsSchemaIC, "") + + return fieldsSchemaIS +} + +// bindParamCreateRetrospectiveTemplate binds the parameter fields[type] +func (o *CreateRetrospectiveTemplateParams) bindParamFieldsType(formats strfmt.Registry) []string { + fieldsTypeIR := o.FieldsType + + var fieldsTypeIC []string + for _, fieldsTypeIIR := range fieldsTypeIR { // explode []string + + fieldsTypeIIV := fieldsTypeIIR // string as string + fieldsTypeIC = append(fieldsTypeIC, fieldsTypeIIV) + } + + // items.CollectionFormat: "" + fieldsTypeIS := swag.JoinByFormat(fieldsTypeIC, "") + + return fieldsTypeIS +} + +// bindParamCreateRetrospectiveTemplate binds the parameter sections[elements] +func (o *CreateRetrospectiveTemplateParams) bindParamSectionsElements(formats strfmt.Registry) []string { + sectionsElementsIR := o.SectionsElements + + var sectionsElementsIC []string + for _, sectionsElementsIIR := range sectionsElementsIR { // explode []string + + sectionsElementsIIV := sectionsElementsIIR // string as string + sectionsElementsIC = append(sectionsElementsIC, sectionsElementsIIV) + } + + // items.CollectionFormat: "" + sectionsElementsIS := swag.JoinByFormat(sectionsElementsIC, "") + + return sectionsElementsIS +} + +// bindParamCreateRetrospectiveTemplate binds the parameter sections[slug] +func (o *CreateRetrospectiveTemplateParams) bindParamSectionsSlug(formats strfmt.Registry) []string { + sectionsSlugIR := o.SectionsSlug + + var sectionsSlugIC []string + for _, sectionsSlugIIR := range sectionsSlugIR { // explode []string + + sectionsSlugIIV := sectionsSlugIIR // string as string + sectionsSlugIC = append(sectionsSlugIC, sectionsSlugIIV) + } + + // items.CollectionFormat: "" + sectionsSlugIS := swag.JoinByFormat(sectionsSlugIC, "") + + return sectionsSlugIS +} diff --git a/client/retrospectives/create_retrospective_template_responses.go b/client/retrospectives/create_retrospective_template_responses.go new file mode 100644 index 0000000..35d1d6f --- /dev/null +++ b/client/retrospectives/create_retrospective_template_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateRetrospectiveTemplateReader is a Reader for the CreateRetrospectiveTemplate structure. +type CreateRetrospectiveTemplateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateRetrospectiveTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateRetrospectiveTemplateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateRetrospectiveTemplateCreated creates a CreateRetrospectiveTemplateCreated with default headers values +func NewCreateRetrospectiveTemplateCreated() *CreateRetrospectiveTemplateCreated { + return &CreateRetrospectiveTemplateCreated{} +} + +/* +CreateRetrospectiveTemplateCreated describes a response with status code 201, with default header values. + +Create a new retrospective template +*/ +type CreateRetrospectiveTemplateCreated struct { + Payload *models.RetrospectivesTemplateEntity +} + +// IsSuccess returns true when this create retrospective template created response has a 2xx status code +func (o *CreateRetrospectiveTemplateCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create retrospective template created response has a 3xx status code +func (o *CreateRetrospectiveTemplateCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create retrospective template created response has a 4xx status code +func (o *CreateRetrospectiveTemplateCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create retrospective template created response has a 5xx status code +func (o *CreateRetrospectiveTemplateCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create retrospective template created response a status code equal to that given +func (o *CreateRetrospectiveTemplateCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateRetrospectiveTemplateCreated) Error() string { + return fmt.Sprintf("[POST /v1/retrospective_templates][%d] createRetrospectiveTemplateCreated %+v", 201, o.Payload) +} + +func (o *CreateRetrospectiveTemplateCreated) String() string { + return fmt.Sprintf("[POST /v1/retrospective_templates][%d] createRetrospectiveTemplateCreated %+v", 201, o.Payload) +} + +func (o *CreateRetrospectiveTemplateCreated) GetPayload() *models.RetrospectivesTemplateEntity { + return o.Payload +} + +func (o *CreateRetrospectiveTemplateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RetrospectivesTemplateEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/delete_incident_retrospective_dynamic_input_parameters.go b/client/retrospectives/delete_incident_retrospective_dynamic_input_parameters.go new file mode 100644 index 0000000..51fd956 --- /dev/null +++ b/client/retrospectives/delete_incident_retrospective_dynamic_input_parameters.go @@ -0,0 +1,213 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteIncidentRetrospectiveDynamicInputParams creates a new DeleteIncidentRetrospectiveDynamicInputParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteIncidentRetrospectiveDynamicInputParams() *DeleteIncidentRetrospectiveDynamicInputParams { + return &DeleteIncidentRetrospectiveDynamicInputParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteIncidentRetrospectiveDynamicInputParamsWithTimeout creates a new DeleteIncidentRetrospectiveDynamicInputParams object +// with the ability to set a timeout on a request. +func NewDeleteIncidentRetrospectiveDynamicInputParamsWithTimeout(timeout time.Duration) *DeleteIncidentRetrospectiveDynamicInputParams { + return &DeleteIncidentRetrospectiveDynamicInputParams{ + timeout: timeout, + } +} + +// NewDeleteIncidentRetrospectiveDynamicInputParamsWithContext creates a new DeleteIncidentRetrospectiveDynamicInputParams object +// with the ability to set a context for a request. +func NewDeleteIncidentRetrospectiveDynamicInputParamsWithContext(ctx context.Context) *DeleteIncidentRetrospectiveDynamicInputParams { + return &DeleteIncidentRetrospectiveDynamicInputParams{ + Context: ctx, + } +} + +// NewDeleteIncidentRetrospectiveDynamicInputParamsWithHTTPClient creates a new DeleteIncidentRetrospectiveDynamicInputParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteIncidentRetrospectiveDynamicInputParamsWithHTTPClient(client *http.Client) *DeleteIncidentRetrospectiveDynamicInputParams { + return &DeleteIncidentRetrospectiveDynamicInputParams{ + HTTPClient: client, + } +} + +/* +DeleteIncidentRetrospectiveDynamicInputParams contains all the parameters to send to the API endpoint + + for the delete incident retrospective dynamic input operation. + + Typically these are written to a http.Request. +*/ +type DeleteIncidentRetrospectiveDynamicInputParams struct { + + /* DynamicInputFieldID. + + The ID of the dynamic input field to delete. + */ + DynamicInputFieldID string + + // FieldID. + FieldID string + + // IncidentID. + IncidentID string + + // RetrospectiveID. + RetrospectiveID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete incident retrospective dynamic input params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentRetrospectiveDynamicInputParams) WithDefaults() *DeleteIncidentRetrospectiveDynamicInputParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete incident retrospective dynamic input params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentRetrospectiveDynamicInputParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete incident retrospective dynamic input params +func (o *DeleteIncidentRetrospectiveDynamicInputParams) WithTimeout(timeout time.Duration) *DeleteIncidentRetrospectiveDynamicInputParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete incident retrospective dynamic input params +func (o *DeleteIncidentRetrospectiveDynamicInputParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete incident retrospective dynamic input params +func (o *DeleteIncidentRetrospectiveDynamicInputParams) WithContext(ctx context.Context) *DeleteIncidentRetrospectiveDynamicInputParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete incident retrospective dynamic input params +func (o *DeleteIncidentRetrospectiveDynamicInputParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete incident retrospective dynamic input params +func (o *DeleteIncidentRetrospectiveDynamicInputParams) WithHTTPClient(client *http.Client) *DeleteIncidentRetrospectiveDynamicInputParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete incident retrospective dynamic input params +func (o *DeleteIncidentRetrospectiveDynamicInputParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDynamicInputFieldID adds the dynamicInputFieldID to the delete incident retrospective dynamic input params +func (o *DeleteIncidentRetrospectiveDynamicInputParams) WithDynamicInputFieldID(dynamicInputFieldID string) *DeleteIncidentRetrospectiveDynamicInputParams { + o.SetDynamicInputFieldID(dynamicInputFieldID) + return o +} + +// SetDynamicInputFieldID adds the dynamicInputFieldId to the delete incident retrospective dynamic input params +func (o *DeleteIncidentRetrospectiveDynamicInputParams) SetDynamicInputFieldID(dynamicInputFieldID string) { + o.DynamicInputFieldID = dynamicInputFieldID +} + +// WithFieldID adds the fieldID to the delete incident retrospective dynamic input params +func (o *DeleteIncidentRetrospectiveDynamicInputParams) WithFieldID(fieldID string) *DeleteIncidentRetrospectiveDynamicInputParams { + o.SetFieldID(fieldID) + return o +} + +// SetFieldID adds the fieldId to the delete incident retrospective dynamic input params +func (o *DeleteIncidentRetrospectiveDynamicInputParams) SetFieldID(fieldID string) { + o.FieldID = fieldID +} + +// WithIncidentID adds the incidentID to the delete incident retrospective dynamic input params +func (o *DeleteIncidentRetrospectiveDynamicInputParams) WithIncidentID(incidentID string) *DeleteIncidentRetrospectiveDynamicInputParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the delete incident retrospective dynamic input params +func (o *DeleteIncidentRetrospectiveDynamicInputParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithRetrospectiveID adds the retrospectiveID to the delete incident retrospective dynamic input params +func (o *DeleteIncidentRetrospectiveDynamicInputParams) WithRetrospectiveID(retrospectiveID string) *DeleteIncidentRetrospectiveDynamicInputParams { + o.SetRetrospectiveID(retrospectiveID) + return o +} + +// SetRetrospectiveID adds the retrospectiveId to the delete incident retrospective dynamic input params +func (o *DeleteIncidentRetrospectiveDynamicInputParams) SetRetrospectiveID(retrospectiveID string) { + o.RetrospectiveID = retrospectiveID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteIncidentRetrospectiveDynamicInputParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param dynamic_input_field_id + qrDynamicInputFieldID := o.DynamicInputFieldID + qDynamicInputFieldID := qrDynamicInputFieldID + if qDynamicInputFieldID != "" { + + if err := r.SetQueryParam("dynamic_input_field_id", qDynamicInputFieldID); err != nil { + return err + } + } + + // path param field_id + if err := r.SetPathParam("field_id", o.FieldID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param retrospective_id + if err := r.SetPathParam("retrospective_id", o.RetrospectiveID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/delete_incident_retrospective_dynamic_input_responses.go b/client/retrospectives/delete_incident_retrospective_dynamic_input_responses.go new file mode 100644 index 0000000..603f335 --- /dev/null +++ b/client/retrospectives/delete_incident_retrospective_dynamic_input_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteIncidentRetrospectiveDynamicInputReader is a Reader for the DeleteIncidentRetrospectiveDynamicInput structure. +type DeleteIncidentRetrospectiveDynamicInputReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteIncidentRetrospectiveDynamicInputReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteIncidentRetrospectiveDynamicInputOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteIncidentRetrospectiveDynamicInputOK creates a DeleteIncidentRetrospectiveDynamicInputOK with default headers values +func NewDeleteIncidentRetrospectiveDynamicInputOK() *DeleteIncidentRetrospectiveDynamicInputOK { + return &DeleteIncidentRetrospectiveDynamicInputOK{} +} + +/* +DeleteIncidentRetrospectiveDynamicInputOK describes a response with status code 200, with default header values. + +Delete a dynamic input on a dynamic input group +*/ +type DeleteIncidentRetrospectiveDynamicInputOK struct { + Payload *models.IncidentsRetrospectiveFieldEntity +} + +// IsSuccess returns true when this delete incident retrospective dynamic input o k response has a 2xx status code +func (o *DeleteIncidentRetrospectiveDynamicInputOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete incident retrospective dynamic input o k response has a 3xx status code +func (o *DeleteIncidentRetrospectiveDynamicInputOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete incident retrospective dynamic input o k response has a 4xx status code +func (o *DeleteIncidentRetrospectiveDynamicInputOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete incident retrospective dynamic input o k response has a 5xx status code +func (o *DeleteIncidentRetrospectiveDynamicInputOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete incident retrospective dynamic input o k response a status code equal to that given +func (o *DeleteIncidentRetrospectiveDynamicInputOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteIncidentRetrospectiveDynamicInputOK) Error() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}/inputs][%d] deleteIncidentRetrospectiveDynamicInputOK %+v", 200, o.Payload) +} + +func (o *DeleteIncidentRetrospectiveDynamicInputOK) String() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}/inputs][%d] deleteIncidentRetrospectiveDynamicInputOK %+v", 200, o.Payload) +} + +func (o *DeleteIncidentRetrospectiveDynamicInputOK) GetPayload() *models.IncidentsRetrospectiveFieldEntity { + return o.Payload +} + +func (o *DeleteIncidentRetrospectiveDynamicInputOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRetrospectiveFieldEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/delete_post_mortem_reason_parameters.go b/client/retrospectives/delete_post_mortem_reason_parameters.go new file mode 100644 index 0000000..f4e62cf --- /dev/null +++ b/client/retrospectives/delete_post_mortem_reason_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeletePostMortemReasonParams creates a new DeletePostMortemReasonParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeletePostMortemReasonParams() *DeletePostMortemReasonParams { + return &DeletePostMortemReasonParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeletePostMortemReasonParamsWithTimeout creates a new DeletePostMortemReasonParams object +// with the ability to set a timeout on a request. +func NewDeletePostMortemReasonParamsWithTimeout(timeout time.Duration) *DeletePostMortemReasonParams { + return &DeletePostMortemReasonParams{ + timeout: timeout, + } +} + +// NewDeletePostMortemReasonParamsWithContext creates a new DeletePostMortemReasonParams object +// with the ability to set a context for a request. +func NewDeletePostMortemReasonParamsWithContext(ctx context.Context) *DeletePostMortemReasonParams { + return &DeletePostMortemReasonParams{ + Context: ctx, + } +} + +// NewDeletePostMortemReasonParamsWithHTTPClient creates a new DeletePostMortemReasonParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeletePostMortemReasonParamsWithHTTPClient(client *http.Client) *DeletePostMortemReasonParams { + return &DeletePostMortemReasonParams{ + HTTPClient: client, + } +} + +/* +DeletePostMortemReasonParams contains all the parameters to send to the API endpoint + + for the delete post mortem reason operation. + + Typically these are written to a http.Request. +*/ +type DeletePostMortemReasonParams struct { + + // ReasonID. + ReasonID string + + // ReportID. + ReportID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete post mortem reason params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeletePostMortemReasonParams) WithDefaults() *DeletePostMortemReasonParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete post mortem reason params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeletePostMortemReasonParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete post mortem reason params +func (o *DeletePostMortemReasonParams) WithTimeout(timeout time.Duration) *DeletePostMortemReasonParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete post mortem reason params +func (o *DeletePostMortemReasonParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete post mortem reason params +func (o *DeletePostMortemReasonParams) WithContext(ctx context.Context) *DeletePostMortemReasonParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete post mortem reason params +func (o *DeletePostMortemReasonParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete post mortem reason params +func (o *DeletePostMortemReasonParams) WithHTTPClient(client *http.Client) *DeletePostMortemReasonParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete post mortem reason params +func (o *DeletePostMortemReasonParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithReasonID adds the reasonID to the delete post mortem reason params +func (o *DeletePostMortemReasonParams) WithReasonID(reasonID string) *DeletePostMortemReasonParams { + o.SetReasonID(reasonID) + return o +} + +// SetReasonID adds the reasonId to the delete post mortem reason params +func (o *DeletePostMortemReasonParams) SetReasonID(reasonID string) { + o.ReasonID = reasonID +} + +// WithReportID adds the reportID to the delete post mortem reason params +func (o *DeletePostMortemReasonParams) WithReportID(reportID string) *DeletePostMortemReasonParams { + o.SetReportID(reportID) + return o +} + +// SetReportID adds the reportId to the delete post mortem reason params +func (o *DeletePostMortemReasonParams) SetReportID(reportID string) { + o.ReportID = reportID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeletePostMortemReasonParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param reason_id + if err := r.SetPathParam("reason_id", o.ReasonID); err != nil { + return err + } + + // path param report_id + if err := r.SetPathParam("report_id", o.ReportID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/delete_post_mortem_reason_responses.go b/client/retrospectives/delete_post_mortem_reason_responses.go new file mode 100644 index 0000000..7c66a5d --- /dev/null +++ b/client/retrospectives/delete_post_mortem_reason_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeletePostMortemReasonReader is a Reader for the DeletePostMortemReason structure. +type DeletePostMortemReasonReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeletePostMortemReasonReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeletePostMortemReasonOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeletePostMortemReasonOK creates a DeletePostMortemReasonOK with default headers values +func NewDeletePostMortemReasonOK() *DeletePostMortemReasonOK { + return &DeletePostMortemReasonOK{} +} + +/* +DeletePostMortemReasonOK describes a response with status code 200, with default header values. + +Delete a contributing factor +*/ +type DeletePostMortemReasonOK struct { + Payload *models.PostMortemsReasonEntity +} + +// IsSuccess returns true when this delete post mortem reason o k response has a 2xx status code +func (o *DeletePostMortemReasonOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete post mortem reason o k response has a 3xx status code +func (o *DeletePostMortemReasonOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete post mortem reason o k response has a 4xx status code +func (o *DeletePostMortemReasonOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete post mortem reason o k response has a 5xx status code +func (o *DeletePostMortemReasonOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete post mortem reason o k response a status code equal to that given +func (o *DeletePostMortemReasonOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeletePostMortemReasonOK) Error() string { + return fmt.Sprintf("[DELETE /v1/post_mortems/reports/{report_id}/reasons/{reason_id}][%d] deletePostMortemReasonOK %+v", 200, o.Payload) +} + +func (o *DeletePostMortemReasonOK) String() string { + return fmt.Sprintf("[DELETE /v1/post_mortems/reports/{report_id}/reasons/{reason_id}][%d] deletePostMortemReasonOK %+v", 200, o.Payload) +} + +func (o *DeletePostMortemReasonOK) GetPayload() *models.PostMortemsReasonEntity { + return o.Payload +} + +func (o *DeletePostMortemReasonOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PostMortemsReasonEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/delete_retrospective_template_parameters.go b/client/retrospectives/delete_retrospective_template_parameters.go new file mode 100644 index 0000000..58f33c7 --- /dev/null +++ b/client/retrospectives/delete_retrospective_template_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteRetrospectiveTemplateParams creates a new DeleteRetrospectiveTemplateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteRetrospectiveTemplateParams() *DeleteRetrospectiveTemplateParams { + return &DeleteRetrospectiveTemplateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteRetrospectiveTemplateParamsWithTimeout creates a new DeleteRetrospectiveTemplateParams object +// with the ability to set a timeout on a request. +func NewDeleteRetrospectiveTemplateParamsWithTimeout(timeout time.Duration) *DeleteRetrospectiveTemplateParams { + return &DeleteRetrospectiveTemplateParams{ + timeout: timeout, + } +} + +// NewDeleteRetrospectiveTemplateParamsWithContext creates a new DeleteRetrospectiveTemplateParams object +// with the ability to set a context for a request. +func NewDeleteRetrospectiveTemplateParamsWithContext(ctx context.Context) *DeleteRetrospectiveTemplateParams { + return &DeleteRetrospectiveTemplateParams{ + Context: ctx, + } +} + +// NewDeleteRetrospectiveTemplateParamsWithHTTPClient creates a new DeleteRetrospectiveTemplateParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteRetrospectiveTemplateParamsWithHTTPClient(client *http.Client) *DeleteRetrospectiveTemplateParams { + return &DeleteRetrospectiveTemplateParams{ + HTTPClient: client, + } +} + +/* +DeleteRetrospectiveTemplateParams contains all the parameters to send to the API endpoint + + for the delete retrospective template operation. + + Typically these are written to a http.Request. +*/ +type DeleteRetrospectiveTemplateParams struct { + + // RetrospectiveTemplateID. + RetrospectiveTemplateID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete retrospective template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteRetrospectiveTemplateParams) WithDefaults() *DeleteRetrospectiveTemplateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete retrospective template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteRetrospectiveTemplateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete retrospective template params +func (o *DeleteRetrospectiveTemplateParams) WithTimeout(timeout time.Duration) *DeleteRetrospectiveTemplateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete retrospective template params +func (o *DeleteRetrospectiveTemplateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete retrospective template params +func (o *DeleteRetrospectiveTemplateParams) WithContext(ctx context.Context) *DeleteRetrospectiveTemplateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete retrospective template params +func (o *DeleteRetrospectiveTemplateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete retrospective template params +func (o *DeleteRetrospectiveTemplateParams) WithHTTPClient(client *http.Client) *DeleteRetrospectiveTemplateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete retrospective template params +func (o *DeleteRetrospectiveTemplateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRetrospectiveTemplateID adds the retrospectiveTemplateID to the delete retrospective template params +func (o *DeleteRetrospectiveTemplateParams) WithRetrospectiveTemplateID(retrospectiveTemplateID string) *DeleteRetrospectiveTemplateParams { + o.SetRetrospectiveTemplateID(retrospectiveTemplateID) + return o +} + +// SetRetrospectiveTemplateID adds the retrospectiveTemplateId to the delete retrospective template params +func (o *DeleteRetrospectiveTemplateParams) SetRetrospectiveTemplateID(retrospectiveTemplateID string) { + o.RetrospectiveTemplateID = retrospectiveTemplateID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteRetrospectiveTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param retrospective_template_id + if err := r.SetPathParam("retrospective_template_id", o.RetrospectiveTemplateID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/delete_retrospective_template_responses.go b/client/retrospectives/delete_retrospective_template_responses.go new file mode 100644 index 0000000..02cb053 --- /dev/null +++ b/client/retrospectives/delete_retrospective_template_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteRetrospectiveTemplateReader is a Reader for the DeleteRetrospectiveTemplate structure. +type DeleteRetrospectiveTemplateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteRetrospectiveTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteRetrospectiveTemplateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteRetrospectiveTemplateOK creates a DeleteRetrospectiveTemplateOK with default headers values +func NewDeleteRetrospectiveTemplateOK() *DeleteRetrospectiveTemplateOK { + return &DeleteRetrospectiveTemplateOK{} +} + +/* +DeleteRetrospectiveTemplateOK describes a response with status code 200, with default header values. + +Delete a single retrospective template +*/ +type DeleteRetrospectiveTemplateOK struct { + Payload *models.RetrospectivesTemplateEntity +} + +// IsSuccess returns true when this delete retrospective template o k response has a 2xx status code +func (o *DeleteRetrospectiveTemplateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete retrospective template o k response has a 3xx status code +func (o *DeleteRetrospectiveTemplateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete retrospective template o k response has a 4xx status code +func (o *DeleteRetrospectiveTemplateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete retrospective template o k response has a 5xx status code +func (o *DeleteRetrospectiveTemplateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete retrospective template o k response a status code equal to that given +func (o *DeleteRetrospectiveTemplateOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteRetrospectiveTemplateOK) Error() string { + return fmt.Sprintf("[DELETE /v1/retrospective_templates/{retrospective_template_id}][%d] deleteRetrospectiveTemplateOK %+v", 200, o.Payload) +} + +func (o *DeleteRetrospectiveTemplateOK) String() string { + return fmt.Sprintf("[DELETE /v1/retrospective_templates/{retrospective_template_id}][%d] deleteRetrospectiveTemplateOK %+v", 200, o.Payload) +} + +func (o *DeleteRetrospectiveTemplateOK) GetPayload() *models.RetrospectivesTemplateEntity { + return o.Payload +} + +func (o *DeleteRetrospectiveTemplateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RetrospectivesTemplateEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/export_incident_retrospectives_parameters.go b/client/retrospectives/export_incident_retrospectives_parameters.go new file mode 100644 index 0000000..2b52fec --- /dev/null +++ b/client/retrospectives/export_incident_retrospectives_parameters.go @@ -0,0 +1,206 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewExportIncidentRetrospectivesParams creates a new ExportIncidentRetrospectivesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewExportIncidentRetrospectivesParams() *ExportIncidentRetrospectivesParams { + return &ExportIncidentRetrospectivesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewExportIncidentRetrospectivesParamsWithTimeout creates a new ExportIncidentRetrospectivesParams object +// with the ability to set a timeout on a request. +func NewExportIncidentRetrospectivesParamsWithTimeout(timeout time.Duration) *ExportIncidentRetrospectivesParams { + return &ExportIncidentRetrospectivesParams{ + timeout: timeout, + } +} + +// NewExportIncidentRetrospectivesParamsWithContext creates a new ExportIncidentRetrospectivesParams object +// with the ability to set a context for a request. +func NewExportIncidentRetrospectivesParamsWithContext(ctx context.Context) *ExportIncidentRetrospectivesParams { + return &ExportIncidentRetrospectivesParams{ + Context: ctx, + } +} + +// NewExportIncidentRetrospectivesParamsWithHTTPClient creates a new ExportIncidentRetrospectivesParams object +// with the ability to set a custom HTTPClient for a request. +func NewExportIncidentRetrospectivesParamsWithHTTPClient(client *http.Client) *ExportIncidentRetrospectivesParams { + return &ExportIncidentRetrospectivesParams{ + HTTPClient: client, + } +} + +/* +ExportIncidentRetrospectivesParams contains all the parameters to send to the API endpoint + + for the export incident retrospectives operation. + + Typically these are written to a http.Request. +*/ +type ExportIncidentRetrospectivesParams struct { + + // IncidentID. + IncidentID string + + /* IntegrationSlug. + + The name of the integration to export the retrospective to. + */ + IntegrationSlug string + + /* ParentPageID. + + The ID of the parent page to export the retrospective to. + */ + ParentPageID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the export incident retrospectives params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ExportIncidentRetrospectivesParams) WithDefaults() *ExportIncidentRetrospectivesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the export incident retrospectives params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ExportIncidentRetrospectivesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the export incident retrospectives params +func (o *ExportIncidentRetrospectivesParams) WithTimeout(timeout time.Duration) *ExportIncidentRetrospectivesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the export incident retrospectives params +func (o *ExportIncidentRetrospectivesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the export incident retrospectives params +func (o *ExportIncidentRetrospectivesParams) WithContext(ctx context.Context) *ExportIncidentRetrospectivesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the export incident retrospectives params +func (o *ExportIncidentRetrospectivesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the export incident retrospectives params +func (o *ExportIncidentRetrospectivesParams) WithHTTPClient(client *http.Client) *ExportIncidentRetrospectivesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the export incident retrospectives params +func (o *ExportIncidentRetrospectivesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the export incident retrospectives params +func (o *ExportIncidentRetrospectivesParams) WithIncidentID(incidentID string) *ExportIncidentRetrospectivesParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the export incident retrospectives params +func (o *ExportIncidentRetrospectivesParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithIntegrationSlug adds the integrationSlug to the export incident retrospectives params +func (o *ExportIncidentRetrospectivesParams) WithIntegrationSlug(integrationSlug string) *ExportIncidentRetrospectivesParams { + o.SetIntegrationSlug(integrationSlug) + return o +} + +// SetIntegrationSlug adds the integrationSlug to the export incident retrospectives params +func (o *ExportIncidentRetrospectivesParams) SetIntegrationSlug(integrationSlug string) { + o.IntegrationSlug = integrationSlug +} + +// WithParentPageID adds the parentPageID to the export incident retrospectives params +func (o *ExportIncidentRetrospectivesParams) WithParentPageID(parentPageID *string) *ExportIncidentRetrospectivesParams { + o.SetParentPageID(parentPageID) + return o +} + +// SetParentPageID adds the parentPageId to the export incident retrospectives params +func (o *ExportIncidentRetrospectivesParams) SetParentPageID(parentPageID *string) { + o.ParentPageID = parentPageID +} + +// WriteToRequest writes these params to a swagger request +func (o *ExportIncidentRetrospectivesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // form param integration_slug + frIntegrationSlug := o.IntegrationSlug + fIntegrationSlug := frIntegrationSlug + if fIntegrationSlug != "" { + if err := r.SetFormParam("integration_slug", fIntegrationSlug); err != nil { + return err + } + } + + if o.ParentPageID != nil { + + // form param parent_page_id + var frParentPageID string + if o.ParentPageID != nil { + frParentPageID = *o.ParentPageID + } + fParentPageID := frParentPageID + if fParentPageID != "" { + if err := r.SetFormParam("parent_page_id", fParentPageID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/export_incident_retrospectives_responses.go b/client/retrospectives/export_incident_retrospectives_responses.go new file mode 100644 index 0000000..3ad66fb --- /dev/null +++ b/client/retrospectives/export_incident_retrospectives_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ExportIncidentRetrospectivesReader is a Reader for the ExportIncidentRetrospectives structure. +type ExportIncidentRetrospectivesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExportIncidentRetrospectivesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewExportIncidentRetrospectivesCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewExportIncidentRetrospectivesCreated creates a ExportIncidentRetrospectivesCreated with default headers values +func NewExportIncidentRetrospectivesCreated() *ExportIncidentRetrospectivesCreated { + return &ExportIncidentRetrospectivesCreated{} +} + +/* +ExportIncidentRetrospectivesCreated describes a response with status code 201, with default header values. + +Export incident's retrospective(s) using their templates +*/ +type ExportIncidentRetrospectivesCreated struct { + Payload *models.IncidentsExportRetrospectivesResultEntity +} + +// IsSuccess returns true when this export incident retrospectives created response has a 2xx status code +func (o *ExportIncidentRetrospectivesCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this export incident retrospectives created response has a 3xx status code +func (o *ExportIncidentRetrospectivesCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this export incident retrospectives created response has a 4xx status code +func (o *ExportIncidentRetrospectivesCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this export incident retrospectives created response has a 5xx status code +func (o *ExportIncidentRetrospectivesCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this export incident retrospectives created response a status code equal to that given +func (o *ExportIncidentRetrospectivesCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *ExportIncidentRetrospectivesCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/retrospectives/export][%d] exportIncidentRetrospectivesCreated %+v", 201, o.Payload) +} + +func (o *ExportIncidentRetrospectivesCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/retrospectives/export][%d] exportIncidentRetrospectivesCreated %+v", 201, o.Payload) +} + +func (o *ExportIncidentRetrospectivesCreated) GetPayload() *models.IncidentsExportRetrospectivesResultEntity { + return o.Payload +} + +func (o *ExportIncidentRetrospectivesCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsExportRetrospectivesResultEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/get_incident_retrospective_field_parameters.go b/client/retrospectives/get_incident_retrospective_field_parameters.go new file mode 100644 index 0000000..530821f --- /dev/null +++ b/client/retrospectives/get_incident_retrospective_field_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetIncidentRetrospectiveFieldParams creates a new GetIncidentRetrospectiveFieldParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetIncidentRetrospectiveFieldParams() *GetIncidentRetrospectiveFieldParams { + return &GetIncidentRetrospectiveFieldParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetIncidentRetrospectiveFieldParamsWithTimeout creates a new GetIncidentRetrospectiveFieldParams object +// with the ability to set a timeout on a request. +func NewGetIncidentRetrospectiveFieldParamsWithTimeout(timeout time.Duration) *GetIncidentRetrospectiveFieldParams { + return &GetIncidentRetrospectiveFieldParams{ + timeout: timeout, + } +} + +// NewGetIncidentRetrospectiveFieldParamsWithContext creates a new GetIncidentRetrospectiveFieldParams object +// with the ability to set a context for a request. +func NewGetIncidentRetrospectiveFieldParamsWithContext(ctx context.Context) *GetIncidentRetrospectiveFieldParams { + return &GetIncidentRetrospectiveFieldParams{ + Context: ctx, + } +} + +// NewGetIncidentRetrospectiveFieldParamsWithHTTPClient creates a new GetIncidentRetrospectiveFieldParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetIncidentRetrospectiveFieldParamsWithHTTPClient(client *http.Client) *GetIncidentRetrospectiveFieldParams { + return &GetIncidentRetrospectiveFieldParams{ + HTTPClient: client, + } +} + +/* +GetIncidentRetrospectiveFieldParams contains all the parameters to send to the API endpoint + + for the get incident retrospective field operation. + + Typically these are written to a http.Request. +*/ +type GetIncidentRetrospectiveFieldParams struct { + + // FieldID. + FieldID string + + // IncidentID. + IncidentID string + + // RetrospectiveID. + RetrospectiveID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get incident retrospective field params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentRetrospectiveFieldParams) WithDefaults() *GetIncidentRetrospectiveFieldParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get incident retrospective field params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentRetrospectiveFieldParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get incident retrospective field params +func (o *GetIncidentRetrospectiveFieldParams) WithTimeout(timeout time.Duration) *GetIncidentRetrospectiveFieldParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get incident retrospective field params +func (o *GetIncidentRetrospectiveFieldParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get incident retrospective field params +func (o *GetIncidentRetrospectiveFieldParams) WithContext(ctx context.Context) *GetIncidentRetrospectiveFieldParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get incident retrospective field params +func (o *GetIncidentRetrospectiveFieldParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get incident retrospective field params +func (o *GetIncidentRetrospectiveFieldParams) WithHTTPClient(client *http.Client) *GetIncidentRetrospectiveFieldParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get incident retrospective field params +func (o *GetIncidentRetrospectiveFieldParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFieldID adds the fieldID to the get incident retrospective field params +func (o *GetIncidentRetrospectiveFieldParams) WithFieldID(fieldID string) *GetIncidentRetrospectiveFieldParams { + o.SetFieldID(fieldID) + return o +} + +// SetFieldID adds the fieldId to the get incident retrospective field params +func (o *GetIncidentRetrospectiveFieldParams) SetFieldID(fieldID string) { + o.FieldID = fieldID +} + +// WithIncidentID adds the incidentID to the get incident retrospective field params +func (o *GetIncidentRetrospectiveFieldParams) WithIncidentID(incidentID string) *GetIncidentRetrospectiveFieldParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the get incident retrospective field params +func (o *GetIncidentRetrospectiveFieldParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithRetrospectiveID adds the retrospectiveID to the get incident retrospective field params +func (o *GetIncidentRetrospectiveFieldParams) WithRetrospectiveID(retrospectiveID string) *GetIncidentRetrospectiveFieldParams { + o.SetRetrospectiveID(retrospectiveID) + return o +} + +// SetRetrospectiveID adds the retrospectiveId to the get incident retrospective field params +func (o *GetIncidentRetrospectiveFieldParams) SetRetrospectiveID(retrospectiveID string) { + o.RetrospectiveID = retrospectiveID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetIncidentRetrospectiveFieldParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param field_id + if err := r.SetPathParam("field_id", o.FieldID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param retrospective_id + if err := r.SetPathParam("retrospective_id", o.RetrospectiveID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/get_incident_retrospective_field_responses.go b/client/retrospectives/get_incident_retrospective_field_responses.go new file mode 100644 index 0000000..c526938 --- /dev/null +++ b/client/retrospectives/get_incident_retrospective_field_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetIncidentRetrospectiveFieldReader is a Reader for the GetIncidentRetrospectiveField structure. +type GetIncidentRetrospectiveFieldReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetIncidentRetrospectiveFieldReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetIncidentRetrospectiveFieldOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetIncidentRetrospectiveFieldOK creates a GetIncidentRetrospectiveFieldOK with default headers values +func NewGetIncidentRetrospectiveFieldOK() *GetIncidentRetrospectiveFieldOK { + return &GetIncidentRetrospectiveFieldOK{} +} + +/* +GetIncidentRetrospectiveFieldOK describes a response with status code 200, with default header values. + +Retrieve a field on an incident retrospective +*/ +type GetIncidentRetrospectiveFieldOK struct { + Payload *models.IncidentsRetrospectiveFieldEntity +} + +// IsSuccess returns true when this get incident retrospective field o k response has a 2xx status code +func (o *GetIncidentRetrospectiveFieldOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get incident retrospective field o k response has a 3xx status code +func (o *GetIncidentRetrospectiveFieldOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get incident retrospective field o k response has a 4xx status code +func (o *GetIncidentRetrospectiveFieldOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get incident retrospective field o k response has a 5xx status code +func (o *GetIncidentRetrospectiveFieldOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get incident retrospective field o k response a status code equal to that given +func (o *GetIncidentRetrospectiveFieldOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetIncidentRetrospectiveFieldOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}][%d] getIncidentRetrospectiveFieldOK %+v", 200, o.Payload) +} + +func (o *GetIncidentRetrospectiveFieldOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}][%d] getIncidentRetrospectiveFieldOK %+v", 200, o.Payload) +} + +func (o *GetIncidentRetrospectiveFieldOK) GetPayload() *models.IncidentsRetrospectiveFieldEntity { + return o.Payload +} + +func (o *GetIncidentRetrospectiveFieldOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRetrospectiveFieldEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/get_post_mortem_question_parameters.go b/client/retrospectives/get_post_mortem_question_parameters.go new file mode 100644 index 0000000..484c0a8 --- /dev/null +++ b/client/retrospectives/get_post_mortem_question_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetPostMortemQuestionParams creates a new GetPostMortemQuestionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetPostMortemQuestionParams() *GetPostMortemQuestionParams { + return &GetPostMortemQuestionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetPostMortemQuestionParamsWithTimeout creates a new GetPostMortemQuestionParams object +// with the ability to set a timeout on a request. +func NewGetPostMortemQuestionParamsWithTimeout(timeout time.Duration) *GetPostMortemQuestionParams { + return &GetPostMortemQuestionParams{ + timeout: timeout, + } +} + +// NewGetPostMortemQuestionParamsWithContext creates a new GetPostMortemQuestionParams object +// with the ability to set a context for a request. +func NewGetPostMortemQuestionParamsWithContext(ctx context.Context) *GetPostMortemQuestionParams { + return &GetPostMortemQuestionParams{ + Context: ctx, + } +} + +// NewGetPostMortemQuestionParamsWithHTTPClient creates a new GetPostMortemQuestionParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetPostMortemQuestionParamsWithHTTPClient(client *http.Client) *GetPostMortemQuestionParams { + return &GetPostMortemQuestionParams{ + HTTPClient: client, + } +} + +/* +GetPostMortemQuestionParams contains all the parameters to send to the API endpoint + + for the get post mortem question operation. + + Typically these are written to a http.Request. +*/ +type GetPostMortemQuestionParams struct { + + // QuestionID. + QuestionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get post mortem question params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPostMortemQuestionParams) WithDefaults() *GetPostMortemQuestionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get post mortem question params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPostMortemQuestionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get post mortem question params +func (o *GetPostMortemQuestionParams) WithTimeout(timeout time.Duration) *GetPostMortemQuestionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get post mortem question params +func (o *GetPostMortemQuestionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get post mortem question params +func (o *GetPostMortemQuestionParams) WithContext(ctx context.Context) *GetPostMortemQuestionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get post mortem question params +func (o *GetPostMortemQuestionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get post mortem question params +func (o *GetPostMortemQuestionParams) WithHTTPClient(client *http.Client) *GetPostMortemQuestionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get post mortem question params +func (o *GetPostMortemQuestionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithQuestionID adds the questionID to the get post mortem question params +func (o *GetPostMortemQuestionParams) WithQuestionID(questionID string) *GetPostMortemQuestionParams { + o.SetQuestionID(questionID) + return o +} + +// SetQuestionID adds the questionId to the get post mortem question params +func (o *GetPostMortemQuestionParams) SetQuestionID(questionID string) { + o.QuestionID = questionID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPostMortemQuestionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param question_id + if err := r.SetPathParam("question_id", o.QuestionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/get_post_mortem_question_responses.go b/client/retrospectives/get_post_mortem_question_responses.go new file mode 100644 index 0000000..7f4a299 --- /dev/null +++ b/client/retrospectives/get_post_mortem_question_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetPostMortemQuestionReader is a Reader for the GetPostMortemQuestion structure. +type GetPostMortemQuestionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPostMortemQuestionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPostMortemQuestionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetPostMortemQuestionOK creates a GetPostMortemQuestionOK with default headers values +func NewGetPostMortemQuestionOK() *GetPostMortemQuestionOK { + return &GetPostMortemQuestionOK{} +} + +/* +GetPostMortemQuestionOK describes a response with status code 200, with default header values. + +Get an incident retrospective question configured to be provided and filled out on each retrospective report. +*/ +type GetPostMortemQuestionOK struct { +} + +// IsSuccess returns true when this get post mortem question o k response has a 2xx status code +func (o *GetPostMortemQuestionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get post mortem question o k response has a 3xx status code +func (o *GetPostMortemQuestionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get post mortem question o k response has a 4xx status code +func (o *GetPostMortemQuestionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get post mortem question o k response has a 5xx status code +func (o *GetPostMortemQuestionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get post mortem question o k response a status code equal to that given +func (o *GetPostMortemQuestionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetPostMortemQuestionOK) Error() string { + return fmt.Sprintf("[GET /v1/post_mortems/questions/{question_id}][%d] getPostMortemQuestionOK ", 200) +} + +func (o *GetPostMortemQuestionOK) String() string { + return fmt.Sprintf("[GET /v1/post_mortems/questions/{question_id}][%d] getPostMortemQuestionOK ", 200) +} + +func (o *GetPostMortemQuestionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/retrospectives/get_post_mortem_report_parameters.go b/client/retrospectives/get_post_mortem_report_parameters.go new file mode 100644 index 0000000..aa4fcd6 --- /dev/null +++ b/client/retrospectives/get_post_mortem_report_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetPostMortemReportParams creates a new GetPostMortemReportParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetPostMortemReportParams() *GetPostMortemReportParams { + return &GetPostMortemReportParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetPostMortemReportParamsWithTimeout creates a new GetPostMortemReportParams object +// with the ability to set a timeout on a request. +func NewGetPostMortemReportParamsWithTimeout(timeout time.Duration) *GetPostMortemReportParams { + return &GetPostMortemReportParams{ + timeout: timeout, + } +} + +// NewGetPostMortemReportParamsWithContext creates a new GetPostMortemReportParams object +// with the ability to set a context for a request. +func NewGetPostMortemReportParamsWithContext(ctx context.Context) *GetPostMortemReportParams { + return &GetPostMortemReportParams{ + Context: ctx, + } +} + +// NewGetPostMortemReportParamsWithHTTPClient creates a new GetPostMortemReportParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetPostMortemReportParamsWithHTTPClient(client *http.Client) *GetPostMortemReportParams { + return &GetPostMortemReportParams{ + HTTPClient: client, + } +} + +/* +GetPostMortemReportParams contains all the parameters to send to the API endpoint + + for the get post mortem report operation. + + Typically these are written to a http.Request. +*/ +type GetPostMortemReportParams struct { + + // ReportID. + ReportID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get post mortem report params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPostMortemReportParams) WithDefaults() *GetPostMortemReportParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get post mortem report params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPostMortemReportParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get post mortem report params +func (o *GetPostMortemReportParams) WithTimeout(timeout time.Duration) *GetPostMortemReportParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get post mortem report params +func (o *GetPostMortemReportParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get post mortem report params +func (o *GetPostMortemReportParams) WithContext(ctx context.Context) *GetPostMortemReportParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get post mortem report params +func (o *GetPostMortemReportParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get post mortem report params +func (o *GetPostMortemReportParams) WithHTTPClient(client *http.Client) *GetPostMortemReportParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get post mortem report params +func (o *GetPostMortemReportParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithReportID adds the reportID to the get post mortem report params +func (o *GetPostMortemReportParams) WithReportID(reportID string) *GetPostMortemReportParams { + o.SetReportID(reportID) + return o +} + +// SetReportID adds the reportId to the get post mortem report params +func (o *GetPostMortemReportParams) SetReportID(reportID string) { + o.ReportID = reportID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPostMortemReportParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param report_id + if err := r.SetPathParam("report_id", o.ReportID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/get_post_mortem_report_responses.go b/client/retrospectives/get_post_mortem_report_responses.go new file mode 100644 index 0000000..30e37b5 --- /dev/null +++ b/client/retrospectives/get_post_mortem_report_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetPostMortemReportReader is a Reader for the GetPostMortemReport structure. +type GetPostMortemReportReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPostMortemReportReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPostMortemReportOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetPostMortemReportOK creates a GetPostMortemReportOK with default headers values +func NewGetPostMortemReportOK() *GetPostMortemReportOK { + return &GetPostMortemReportOK{} +} + +/* +GetPostMortemReportOK describes a response with status code 200, with default header values. + +Get a report +*/ +type GetPostMortemReportOK struct { + Payload *models.PostMortemsPostMortemReportEntity +} + +// IsSuccess returns true when this get post mortem report o k response has a 2xx status code +func (o *GetPostMortemReportOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get post mortem report o k response has a 3xx status code +func (o *GetPostMortemReportOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get post mortem report o k response has a 4xx status code +func (o *GetPostMortemReportOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get post mortem report o k response has a 5xx status code +func (o *GetPostMortemReportOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get post mortem report o k response a status code equal to that given +func (o *GetPostMortemReportOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetPostMortemReportOK) Error() string { + return fmt.Sprintf("[GET /v1/post_mortems/reports/{report_id}][%d] getPostMortemReportOK %+v", 200, o.Payload) +} + +func (o *GetPostMortemReportOK) String() string { + return fmt.Sprintf("[GET /v1/post_mortems/reports/{report_id}][%d] getPostMortemReportOK %+v", 200, o.Payload) +} + +func (o *GetPostMortemReportOK) GetPayload() *models.PostMortemsPostMortemReportEntity { + return o.Payload +} + +func (o *GetPostMortemReportOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PostMortemsPostMortemReportEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/get_retrospective_template_parameters.go b/client/retrospectives/get_retrospective_template_parameters.go new file mode 100644 index 0000000..bbc582e --- /dev/null +++ b/client/retrospectives/get_retrospective_template_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetRetrospectiveTemplateParams creates a new GetRetrospectiveTemplateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetRetrospectiveTemplateParams() *GetRetrospectiveTemplateParams { + return &GetRetrospectiveTemplateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetRetrospectiveTemplateParamsWithTimeout creates a new GetRetrospectiveTemplateParams object +// with the ability to set a timeout on a request. +func NewGetRetrospectiveTemplateParamsWithTimeout(timeout time.Duration) *GetRetrospectiveTemplateParams { + return &GetRetrospectiveTemplateParams{ + timeout: timeout, + } +} + +// NewGetRetrospectiveTemplateParamsWithContext creates a new GetRetrospectiveTemplateParams object +// with the ability to set a context for a request. +func NewGetRetrospectiveTemplateParamsWithContext(ctx context.Context) *GetRetrospectiveTemplateParams { + return &GetRetrospectiveTemplateParams{ + Context: ctx, + } +} + +// NewGetRetrospectiveTemplateParamsWithHTTPClient creates a new GetRetrospectiveTemplateParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetRetrospectiveTemplateParamsWithHTTPClient(client *http.Client) *GetRetrospectiveTemplateParams { + return &GetRetrospectiveTemplateParams{ + HTTPClient: client, + } +} + +/* +GetRetrospectiveTemplateParams contains all the parameters to send to the API endpoint + + for the get retrospective template operation. + + Typically these are written to a http.Request. +*/ +type GetRetrospectiveTemplateParams struct { + + // RetrospectiveTemplateID. + RetrospectiveTemplateID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get retrospective template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRetrospectiveTemplateParams) WithDefaults() *GetRetrospectiveTemplateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get retrospective template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRetrospectiveTemplateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get retrospective template params +func (o *GetRetrospectiveTemplateParams) WithTimeout(timeout time.Duration) *GetRetrospectiveTemplateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get retrospective template params +func (o *GetRetrospectiveTemplateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get retrospective template params +func (o *GetRetrospectiveTemplateParams) WithContext(ctx context.Context) *GetRetrospectiveTemplateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get retrospective template params +func (o *GetRetrospectiveTemplateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get retrospective template params +func (o *GetRetrospectiveTemplateParams) WithHTTPClient(client *http.Client) *GetRetrospectiveTemplateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get retrospective template params +func (o *GetRetrospectiveTemplateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRetrospectiveTemplateID adds the retrospectiveTemplateID to the get retrospective template params +func (o *GetRetrospectiveTemplateParams) WithRetrospectiveTemplateID(retrospectiveTemplateID string) *GetRetrospectiveTemplateParams { + o.SetRetrospectiveTemplateID(retrospectiveTemplateID) + return o +} + +// SetRetrospectiveTemplateID adds the retrospectiveTemplateId to the get retrospective template params +func (o *GetRetrospectiveTemplateParams) SetRetrospectiveTemplateID(retrospectiveTemplateID string) { + o.RetrospectiveTemplateID = retrospectiveTemplateID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRetrospectiveTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param retrospective_template_id + if err := r.SetPathParam("retrospective_template_id", o.RetrospectiveTemplateID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/get_retrospective_template_responses.go b/client/retrospectives/get_retrospective_template_responses.go new file mode 100644 index 0000000..367dd4f --- /dev/null +++ b/client/retrospectives/get_retrospective_template_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetRetrospectiveTemplateReader is a Reader for the GetRetrospectiveTemplate structure. +type GetRetrospectiveTemplateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRetrospectiveTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRetrospectiveTemplateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetRetrospectiveTemplateOK creates a GetRetrospectiveTemplateOK with default headers values +func NewGetRetrospectiveTemplateOK() *GetRetrospectiveTemplateOK { + return &GetRetrospectiveTemplateOK{} +} + +/* +GetRetrospectiveTemplateOK describes a response with status code 200, with default header values. + +Retrieve a single retrospective template by ID +*/ +type GetRetrospectiveTemplateOK struct { + Payload *models.RetrospectivesTemplateEntity +} + +// IsSuccess returns true when this get retrospective template o k response has a 2xx status code +func (o *GetRetrospectiveTemplateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get retrospective template o k response has a 3xx status code +func (o *GetRetrospectiveTemplateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get retrospective template o k response has a 4xx status code +func (o *GetRetrospectiveTemplateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get retrospective template o k response has a 5xx status code +func (o *GetRetrospectiveTemplateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get retrospective template o k response a status code equal to that given +func (o *GetRetrospectiveTemplateOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetRetrospectiveTemplateOK) Error() string { + return fmt.Sprintf("[GET /v1/retrospective_templates/{retrospective_template_id}][%d] getRetrospectiveTemplateOK %+v", 200, o.Payload) +} + +func (o *GetRetrospectiveTemplateOK) String() string { + return fmt.Sprintf("[GET /v1/retrospective_templates/{retrospective_template_id}][%d] getRetrospectiveTemplateOK %+v", 200, o.Payload) +} + +func (o *GetRetrospectiveTemplateOK) GetPayload() *models.RetrospectivesTemplateEntity { + return o.Payload +} + +func (o *GetRetrospectiveTemplateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RetrospectivesTemplateEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/list_incident_retrospectives_parameters.go b/client/retrospectives/list_incident_retrospectives_parameters.go new file mode 100644 index 0000000..fc27df5 --- /dev/null +++ b/client/retrospectives/list_incident_retrospectives_parameters.go @@ -0,0 +1,249 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListIncidentRetrospectivesParams creates a new ListIncidentRetrospectivesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentRetrospectivesParams() *ListIncidentRetrospectivesParams { + return &ListIncidentRetrospectivesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentRetrospectivesParamsWithTimeout creates a new ListIncidentRetrospectivesParams object +// with the ability to set a timeout on a request. +func NewListIncidentRetrospectivesParamsWithTimeout(timeout time.Duration) *ListIncidentRetrospectivesParams { + return &ListIncidentRetrospectivesParams{ + timeout: timeout, + } +} + +// NewListIncidentRetrospectivesParamsWithContext creates a new ListIncidentRetrospectivesParams object +// with the ability to set a context for a request. +func NewListIncidentRetrospectivesParamsWithContext(ctx context.Context) *ListIncidentRetrospectivesParams { + return &ListIncidentRetrospectivesParams{ + Context: ctx, + } +} + +// NewListIncidentRetrospectivesParamsWithHTTPClient creates a new ListIncidentRetrospectivesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentRetrospectivesParamsWithHTTPClient(client *http.Client) *ListIncidentRetrospectivesParams { + return &ListIncidentRetrospectivesParams{ + HTTPClient: client, + } +} + +/* +ListIncidentRetrospectivesParams contains all the parameters to send to the API endpoint + + for the list incident retrospectives operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentRetrospectivesParams struct { + + // IncidentID. + IncidentID string + + /* IsHidden. + + Filter by hidden status. + */ + IsHidden *bool + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident retrospectives params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentRetrospectivesParams) WithDefaults() *ListIncidentRetrospectivesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident retrospectives params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentRetrospectivesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident retrospectives params +func (o *ListIncidentRetrospectivesParams) WithTimeout(timeout time.Duration) *ListIncidentRetrospectivesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident retrospectives params +func (o *ListIncidentRetrospectivesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident retrospectives params +func (o *ListIncidentRetrospectivesParams) WithContext(ctx context.Context) *ListIncidentRetrospectivesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident retrospectives params +func (o *ListIncidentRetrospectivesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident retrospectives params +func (o *ListIncidentRetrospectivesParams) WithHTTPClient(client *http.Client) *ListIncidentRetrospectivesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident retrospectives params +func (o *ListIncidentRetrospectivesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list incident retrospectives params +func (o *ListIncidentRetrospectivesParams) WithIncidentID(incidentID string) *ListIncidentRetrospectivesParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list incident retrospectives params +func (o *ListIncidentRetrospectivesParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithIsHidden adds the isHidden to the list incident retrospectives params +func (o *ListIncidentRetrospectivesParams) WithIsHidden(isHidden *bool) *ListIncidentRetrospectivesParams { + o.SetIsHidden(isHidden) + return o +} + +// SetIsHidden adds the isHidden to the list incident retrospectives params +func (o *ListIncidentRetrospectivesParams) SetIsHidden(isHidden *bool) { + o.IsHidden = isHidden +} + +// WithPage adds the page to the list incident retrospectives params +func (o *ListIncidentRetrospectivesParams) WithPage(page *int32) *ListIncidentRetrospectivesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list incident retrospectives params +func (o *ListIncidentRetrospectivesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list incident retrospectives params +func (o *ListIncidentRetrospectivesParams) WithPerPage(perPage *int32) *ListIncidentRetrospectivesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list incident retrospectives params +func (o *ListIncidentRetrospectivesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentRetrospectivesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if o.IsHidden != nil { + + // query param is_hidden + var qrIsHidden bool + + if o.IsHidden != nil { + qrIsHidden = *o.IsHidden + } + qIsHidden := swag.FormatBool(qrIsHidden) + if qIsHidden != "" { + + if err := r.SetQueryParam("is_hidden", qIsHidden); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/list_incident_retrospectives_responses.go b/client/retrospectives/list_incident_retrospectives_responses.go new file mode 100644 index 0000000..b4da5e7 --- /dev/null +++ b/client/retrospectives/list_incident_retrospectives_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentRetrospectivesReader is a Reader for the ListIncidentRetrospectives structure. +type ListIncidentRetrospectivesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentRetrospectivesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentRetrospectivesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentRetrospectivesOK creates a ListIncidentRetrospectivesOK with default headers values +func NewListIncidentRetrospectivesOK() *ListIncidentRetrospectivesOK { + return &ListIncidentRetrospectivesOK{} +} + +/* +ListIncidentRetrospectivesOK describes a response with status code 200, with default header values. + +Retrieve retrospectives attached to an incident +*/ +type ListIncidentRetrospectivesOK struct { + Payload *models.IncidentsRetrospectiveEntityPaginated +} + +// IsSuccess returns true when this list incident retrospectives o k response has a 2xx status code +func (o *ListIncidentRetrospectivesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident retrospectives o k response has a 3xx status code +func (o *ListIncidentRetrospectivesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident retrospectives o k response has a 4xx status code +func (o *ListIncidentRetrospectivesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident retrospectives o k response has a 5xx status code +func (o *ListIncidentRetrospectivesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident retrospectives o k response a status code equal to that given +func (o *ListIncidentRetrospectivesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentRetrospectivesOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/retrospectives][%d] listIncidentRetrospectivesOK %+v", 200, o.Payload) +} + +func (o *ListIncidentRetrospectivesOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/retrospectives][%d] listIncidentRetrospectivesOK %+v", 200, o.Payload) +} + +func (o *ListIncidentRetrospectivesOK) GetPayload() *models.IncidentsRetrospectiveEntityPaginated { + return o.Payload +} + +func (o *ListIncidentRetrospectivesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRetrospectiveEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/list_post_mortem_questions_parameters.go b/client/retrospectives/list_post_mortem_questions_parameters.go new file mode 100644 index 0000000..45ab951 --- /dev/null +++ b/client/retrospectives/list_post_mortem_questions_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListPostMortemQuestionsParams creates a new ListPostMortemQuestionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListPostMortemQuestionsParams() *ListPostMortemQuestionsParams { + return &ListPostMortemQuestionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListPostMortemQuestionsParamsWithTimeout creates a new ListPostMortemQuestionsParams object +// with the ability to set a timeout on a request. +func NewListPostMortemQuestionsParamsWithTimeout(timeout time.Duration) *ListPostMortemQuestionsParams { + return &ListPostMortemQuestionsParams{ + timeout: timeout, + } +} + +// NewListPostMortemQuestionsParamsWithContext creates a new ListPostMortemQuestionsParams object +// with the ability to set a context for a request. +func NewListPostMortemQuestionsParamsWithContext(ctx context.Context) *ListPostMortemQuestionsParams { + return &ListPostMortemQuestionsParams{ + Context: ctx, + } +} + +// NewListPostMortemQuestionsParamsWithHTTPClient creates a new ListPostMortemQuestionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListPostMortemQuestionsParamsWithHTTPClient(client *http.Client) *ListPostMortemQuestionsParams { + return &ListPostMortemQuestionsParams{ + HTTPClient: client, + } +} + +/* +ListPostMortemQuestionsParams contains all the parameters to send to the API endpoint + + for the list post mortem questions operation. + + Typically these are written to a http.Request. +*/ +type ListPostMortemQuestionsParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list post mortem questions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListPostMortemQuestionsParams) WithDefaults() *ListPostMortemQuestionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list post mortem questions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListPostMortemQuestionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list post mortem questions params +func (o *ListPostMortemQuestionsParams) WithTimeout(timeout time.Duration) *ListPostMortemQuestionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list post mortem questions params +func (o *ListPostMortemQuestionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list post mortem questions params +func (o *ListPostMortemQuestionsParams) WithContext(ctx context.Context) *ListPostMortemQuestionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list post mortem questions params +func (o *ListPostMortemQuestionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list post mortem questions params +func (o *ListPostMortemQuestionsParams) WithHTTPClient(client *http.Client) *ListPostMortemQuestionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list post mortem questions params +func (o *ListPostMortemQuestionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list post mortem questions params +func (o *ListPostMortemQuestionsParams) WithPage(page *int32) *ListPostMortemQuestionsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list post mortem questions params +func (o *ListPostMortemQuestionsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list post mortem questions params +func (o *ListPostMortemQuestionsParams) WithPerPage(perPage *int32) *ListPostMortemQuestionsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list post mortem questions params +func (o *ListPostMortemQuestionsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListPostMortemQuestionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/list_post_mortem_questions_responses.go b/client/retrospectives/list_post_mortem_questions_responses.go new file mode 100644 index 0000000..5df48ee --- /dev/null +++ b/client/retrospectives/list_post_mortem_questions_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListPostMortemQuestionsReader is a Reader for the ListPostMortemQuestions structure. +type ListPostMortemQuestionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListPostMortemQuestionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListPostMortemQuestionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListPostMortemQuestionsOK creates a ListPostMortemQuestionsOK with default headers values +func NewListPostMortemQuestionsOK() *ListPostMortemQuestionsOK { + return &ListPostMortemQuestionsOK{} +} + +/* +ListPostMortemQuestionsOK describes a response with status code 200, with default header values. + +List the questions configured to be provided and filled out on each retrospective report. +*/ +type ListPostMortemQuestionsOK struct { + Payload *models.PostMortemsQuestionTypeEntityPaginated +} + +// IsSuccess returns true when this list post mortem questions o k response has a 2xx status code +func (o *ListPostMortemQuestionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list post mortem questions o k response has a 3xx status code +func (o *ListPostMortemQuestionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list post mortem questions o k response has a 4xx status code +func (o *ListPostMortemQuestionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list post mortem questions o k response has a 5xx status code +func (o *ListPostMortemQuestionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list post mortem questions o k response a status code equal to that given +func (o *ListPostMortemQuestionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListPostMortemQuestionsOK) Error() string { + return fmt.Sprintf("[GET /v1/post_mortems/questions][%d] listPostMortemQuestionsOK %+v", 200, o.Payload) +} + +func (o *ListPostMortemQuestionsOK) String() string { + return fmt.Sprintf("[GET /v1/post_mortems/questions][%d] listPostMortemQuestionsOK %+v", 200, o.Payload) +} + +func (o *ListPostMortemQuestionsOK) GetPayload() *models.PostMortemsQuestionTypeEntityPaginated { + return o.Payload +} + +func (o *ListPostMortemQuestionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PostMortemsQuestionTypeEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/list_post_mortem_reasons_parameters.go b/client/retrospectives/list_post_mortem_reasons_parameters.go new file mode 100644 index 0000000..19fb757 --- /dev/null +++ b/client/retrospectives/list_post_mortem_reasons_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListPostMortemReasonsParams creates a new ListPostMortemReasonsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListPostMortemReasonsParams() *ListPostMortemReasonsParams { + return &ListPostMortemReasonsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListPostMortemReasonsParamsWithTimeout creates a new ListPostMortemReasonsParams object +// with the ability to set a timeout on a request. +func NewListPostMortemReasonsParamsWithTimeout(timeout time.Duration) *ListPostMortemReasonsParams { + return &ListPostMortemReasonsParams{ + timeout: timeout, + } +} + +// NewListPostMortemReasonsParamsWithContext creates a new ListPostMortemReasonsParams object +// with the ability to set a context for a request. +func NewListPostMortemReasonsParamsWithContext(ctx context.Context) *ListPostMortemReasonsParams { + return &ListPostMortemReasonsParams{ + Context: ctx, + } +} + +// NewListPostMortemReasonsParamsWithHTTPClient creates a new ListPostMortemReasonsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListPostMortemReasonsParamsWithHTTPClient(client *http.Client) *ListPostMortemReasonsParams { + return &ListPostMortemReasonsParams{ + HTTPClient: client, + } +} + +/* +ListPostMortemReasonsParams contains all the parameters to send to the API endpoint + + for the list post mortem reasons operation. + + Typically these are written to a http.Request. +*/ +type ListPostMortemReasonsParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + // ReportID. + ReportID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list post mortem reasons params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListPostMortemReasonsParams) WithDefaults() *ListPostMortemReasonsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list post mortem reasons params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListPostMortemReasonsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list post mortem reasons params +func (o *ListPostMortemReasonsParams) WithTimeout(timeout time.Duration) *ListPostMortemReasonsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list post mortem reasons params +func (o *ListPostMortemReasonsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list post mortem reasons params +func (o *ListPostMortemReasonsParams) WithContext(ctx context.Context) *ListPostMortemReasonsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list post mortem reasons params +func (o *ListPostMortemReasonsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list post mortem reasons params +func (o *ListPostMortemReasonsParams) WithHTTPClient(client *http.Client) *ListPostMortemReasonsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list post mortem reasons params +func (o *ListPostMortemReasonsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list post mortem reasons params +func (o *ListPostMortemReasonsParams) WithPage(page *int32) *ListPostMortemReasonsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list post mortem reasons params +func (o *ListPostMortemReasonsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list post mortem reasons params +func (o *ListPostMortemReasonsParams) WithPerPage(perPage *int32) *ListPostMortemReasonsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list post mortem reasons params +func (o *ListPostMortemReasonsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithReportID adds the reportID to the list post mortem reasons params +func (o *ListPostMortemReasonsParams) WithReportID(reportID string) *ListPostMortemReasonsParams { + o.SetReportID(reportID) + return o +} + +// SetReportID adds the reportId to the list post mortem reasons params +func (o *ListPostMortemReasonsParams) SetReportID(reportID string) { + o.ReportID = reportID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListPostMortemReasonsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + // path param report_id + if err := r.SetPathParam("report_id", o.ReportID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/list_post_mortem_reasons_responses.go b/client/retrospectives/list_post_mortem_reasons_responses.go new file mode 100644 index 0000000..dedc351 --- /dev/null +++ b/client/retrospectives/list_post_mortem_reasons_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListPostMortemReasonsReader is a Reader for the ListPostMortemReasons structure. +type ListPostMortemReasonsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListPostMortemReasonsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListPostMortemReasonsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListPostMortemReasonsOK creates a ListPostMortemReasonsOK with default headers values +func NewListPostMortemReasonsOK() *ListPostMortemReasonsOK { + return &ListPostMortemReasonsOK{} +} + +/* +ListPostMortemReasonsOK describes a response with status code 200, with default header values. + +List all contributing factors to an incident +*/ +type ListPostMortemReasonsOK struct { + Payload *models.PostMortemsReasonEntityPaginated +} + +// IsSuccess returns true when this list post mortem reasons o k response has a 2xx status code +func (o *ListPostMortemReasonsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list post mortem reasons o k response has a 3xx status code +func (o *ListPostMortemReasonsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list post mortem reasons o k response has a 4xx status code +func (o *ListPostMortemReasonsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list post mortem reasons o k response has a 5xx status code +func (o *ListPostMortemReasonsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list post mortem reasons o k response a status code equal to that given +func (o *ListPostMortemReasonsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListPostMortemReasonsOK) Error() string { + return fmt.Sprintf("[GET /v1/post_mortems/reports/{report_id}/reasons][%d] listPostMortemReasonsOK %+v", 200, o.Payload) +} + +func (o *ListPostMortemReasonsOK) String() string { + return fmt.Sprintf("[GET /v1/post_mortems/reports/{report_id}/reasons][%d] listPostMortemReasonsOK %+v", 200, o.Payload) +} + +func (o *ListPostMortemReasonsOK) GetPayload() *models.PostMortemsReasonEntityPaginated { + return o.Payload +} + +func (o *ListPostMortemReasonsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PostMortemsReasonEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/list_post_mortem_reports_parameters.go b/client/retrospectives/list_post_mortem_reports_parameters.go new file mode 100644 index 0000000..fc1578d --- /dev/null +++ b/client/retrospectives/list_post_mortem_reports_parameters.go @@ -0,0 +1,266 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListPostMortemReportsParams creates a new ListPostMortemReportsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListPostMortemReportsParams() *ListPostMortemReportsParams { + return &ListPostMortemReportsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListPostMortemReportsParamsWithTimeout creates a new ListPostMortemReportsParams object +// with the ability to set a timeout on a request. +func NewListPostMortemReportsParamsWithTimeout(timeout time.Duration) *ListPostMortemReportsParams { + return &ListPostMortemReportsParams{ + timeout: timeout, + } +} + +// NewListPostMortemReportsParamsWithContext creates a new ListPostMortemReportsParams object +// with the ability to set a context for a request. +func NewListPostMortemReportsParamsWithContext(ctx context.Context) *ListPostMortemReportsParams { + return &ListPostMortemReportsParams{ + Context: ctx, + } +} + +// NewListPostMortemReportsParamsWithHTTPClient creates a new ListPostMortemReportsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListPostMortemReportsParamsWithHTTPClient(client *http.Client) *ListPostMortemReportsParams { + return &ListPostMortemReportsParams{ + HTTPClient: client, + } +} + +/* +ListPostMortemReportsParams contains all the parameters to send to the API endpoint + + for the list post mortem reports operation. + + Typically these are written to a http.Request. +*/ +type ListPostMortemReportsParams struct { + + /* IncidentID. + + Filter the reports by an incident ID + */ + IncidentID *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* UpdatedSince. + + Filter for reports updated after the given ISO8601 timestamp + + Format: date-time + */ + UpdatedSince *strfmt.DateTime + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list post mortem reports params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListPostMortemReportsParams) WithDefaults() *ListPostMortemReportsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list post mortem reports params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListPostMortemReportsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list post mortem reports params +func (o *ListPostMortemReportsParams) WithTimeout(timeout time.Duration) *ListPostMortemReportsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list post mortem reports params +func (o *ListPostMortemReportsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list post mortem reports params +func (o *ListPostMortemReportsParams) WithContext(ctx context.Context) *ListPostMortemReportsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list post mortem reports params +func (o *ListPostMortemReportsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list post mortem reports params +func (o *ListPostMortemReportsParams) WithHTTPClient(client *http.Client) *ListPostMortemReportsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list post mortem reports params +func (o *ListPostMortemReportsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list post mortem reports params +func (o *ListPostMortemReportsParams) WithIncidentID(incidentID *string) *ListPostMortemReportsParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list post mortem reports params +func (o *ListPostMortemReportsParams) SetIncidentID(incidentID *string) { + o.IncidentID = incidentID +} + +// WithPage adds the page to the list post mortem reports params +func (o *ListPostMortemReportsParams) WithPage(page *int32) *ListPostMortemReportsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list post mortem reports params +func (o *ListPostMortemReportsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list post mortem reports params +func (o *ListPostMortemReportsParams) WithPerPage(perPage *int32) *ListPostMortemReportsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list post mortem reports params +func (o *ListPostMortemReportsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithUpdatedSince adds the updatedSince to the list post mortem reports params +func (o *ListPostMortemReportsParams) WithUpdatedSince(updatedSince *strfmt.DateTime) *ListPostMortemReportsParams { + o.SetUpdatedSince(updatedSince) + return o +} + +// SetUpdatedSince adds the updatedSince to the list post mortem reports params +func (o *ListPostMortemReportsParams) SetUpdatedSince(updatedSince *strfmt.DateTime) { + o.UpdatedSince = updatedSince +} + +// WriteToRequest writes these params to a swagger request +func (o *ListPostMortemReportsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.IncidentID != nil { + + // query param incident_id + var qrIncidentID string + + if o.IncidentID != nil { + qrIncidentID = *o.IncidentID + } + qIncidentID := qrIncidentID + if qIncidentID != "" { + + if err := r.SetQueryParam("incident_id", qIncidentID); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.UpdatedSince != nil { + + // query param updated_since + var qrUpdatedSince strfmt.DateTime + + if o.UpdatedSince != nil { + qrUpdatedSince = *o.UpdatedSince + } + qUpdatedSince := qrUpdatedSince.String() + if qUpdatedSince != "" { + + if err := r.SetQueryParam("updated_since", qUpdatedSince); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/list_post_mortem_reports_responses.go b/client/retrospectives/list_post_mortem_reports_responses.go new file mode 100644 index 0000000..5c7f084 --- /dev/null +++ b/client/retrospectives/list_post_mortem_reports_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListPostMortemReportsReader is a Reader for the ListPostMortemReports structure. +type ListPostMortemReportsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListPostMortemReportsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListPostMortemReportsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListPostMortemReportsOK creates a ListPostMortemReportsOK with default headers values +func NewListPostMortemReportsOK() *ListPostMortemReportsOK { + return &ListPostMortemReportsOK{} +} + +/* +ListPostMortemReportsOK describes a response with status code 200, with default header values. + +List all reports +*/ +type ListPostMortemReportsOK struct { + Payload *models.PostMortemsPostMortemReportEntityPaginated +} + +// IsSuccess returns true when this list post mortem reports o k response has a 2xx status code +func (o *ListPostMortemReportsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list post mortem reports o k response has a 3xx status code +func (o *ListPostMortemReportsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list post mortem reports o k response has a 4xx status code +func (o *ListPostMortemReportsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list post mortem reports o k response has a 5xx status code +func (o *ListPostMortemReportsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list post mortem reports o k response a status code equal to that given +func (o *ListPostMortemReportsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListPostMortemReportsOK) Error() string { + return fmt.Sprintf("[GET /v1/post_mortems/reports][%d] listPostMortemReportsOK %+v", 200, o.Payload) +} + +func (o *ListPostMortemReportsOK) String() string { + return fmt.Sprintf("[GET /v1/post_mortems/reports][%d] listPostMortemReportsOK %+v", 200, o.Payload) +} + +func (o *ListPostMortemReportsOK) GetPayload() *models.PostMortemsPostMortemReportEntityPaginated { + return o.Payload +} + +func (o *ListPostMortemReportsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PostMortemsPostMortemReportEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/list_retrospective_templates_parameters.go b/client/retrospectives/list_retrospective_templates_parameters.go new file mode 100644 index 0000000..696a4e0 --- /dev/null +++ b/client/retrospectives/list_retrospective_templates_parameters.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListRetrospectiveTemplatesParams creates a new ListRetrospectiveTemplatesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListRetrospectiveTemplatesParams() *ListRetrospectiveTemplatesParams { + return &ListRetrospectiveTemplatesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListRetrospectiveTemplatesParamsWithTimeout creates a new ListRetrospectiveTemplatesParams object +// with the ability to set a timeout on a request. +func NewListRetrospectiveTemplatesParamsWithTimeout(timeout time.Duration) *ListRetrospectiveTemplatesParams { + return &ListRetrospectiveTemplatesParams{ + timeout: timeout, + } +} + +// NewListRetrospectiveTemplatesParamsWithContext creates a new ListRetrospectiveTemplatesParams object +// with the ability to set a context for a request. +func NewListRetrospectiveTemplatesParamsWithContext(ctx context.Context) *ListRetrospectiveTemplatesParams { + return &ListRetrospectiveTemplatesParams{ + Context: ctx, + } +} + +// NewListRetrospectiveTemplatesParamsWithHTTPClient creates a new ListRetrospectiveTemplatesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListRetrospectiveTemplatesParamsWithHTTPClient(client *http.Client) *ListRetrospectiveTemplatesParams { + return &ListRetrospectiveTemplatesParams{ + HTTPClient: client, + } +} + +/* +ListRetrospectiveTemplatesParams contains all the parameters to send to the API endpoint + + for the list retrospective templates operation. + + Typically these are written to a http.Request. +*/ +type ListRetrospectiveTemplatesParams struct { + + // ForIncident. + ForIncident *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list retrospective templates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRetrospectiveTemplatesParams) WithDefaults() *ListRetrospectiveTemplatesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list retrospective templates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRetrospectiveTemplatesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list retrospective templates params +func (o *ListRetrospectiveTemplatesParams) WithTimeout(timeout time.Duration) *ListRetrospectiveTemplatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list retrospective templates params +func (o *ListRetrospectiveTemplatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list retrospective templates params +func (o *ListRetrospectiveTemplatesParams) WithContext(ctx context.Context) *ListRetrospectiveTemplatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list retrospective templates params +func (o *ListRetrospectiveTemplatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list retrospective templates params +func (o *ListRetrospectiveTemplatesParams) WithHTTPClient(client *http.Client) *ListRetrospectiveTemplatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list retrospective templates params +func (o *ListRetrospectiveTemplatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithForIncident adds the forIncident to the list retrospective templates params +func (o *ListRetrospectiveTemplatesParams) WithForIncident(forIncident *string) *ListRetrospectiveTemplatesParams { + o.SetForIncident(forIncident) + return o +} + +// SetForIncident adds the forIncident to the list retrospective templates params +func (o *ListRetrospectiveTemplatesParams) SetForIncident(forIncident *string) { + o.ForIncident = forIncident +} + +// WithPage adds the page to the list retrospective templates params +func (o *ListRetrospectiveTemplatesParams) WithPage(page *int32) *ListRetrospectiveTemplatesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list retrospective templates params +func (o *ListRetrospectiveTemplatesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list retrospective templates params +func (o *ListRetrospectiveTemplatesParams) WithPerPage(perPage *int32) *ListRetrospectiveTemplatesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list retrospective templates params +func (o *ListRetrospectiveTemplatesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListRetrospectiveTemplatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ForIncident != nil { + + // query param for_incident + var qrForIncident string + + if o.ForIncident != nil { + qrForIncident = *o.ForIncident + } + qForIncident := qrForIncident + if qForIncident != "" { + + if err := r.SetQueryParam("for_incident", qForIncident); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/list_retrospective_templates_responses.go b/client/retrospectives/list_retrospective_templates_responses.go new file mode 100644 index 0000000..ef41766 --- /dev/null +++ b/client/retrospectives/list_retrospective_templates_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListRetrospectiveTemplatesReader is a Reader for the ListRetrospectiveTemplates structure. +type ListRetrospectiveTemplatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListRetrospectiveTemplatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListRetrospectiveTemplatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListRetrospectiveTemplatesOK creates a ListRetrospectiveTemplatesOK with default headers values +func NewListRetrospectiveTemplatesOK() *ListRetrospectiveTemplatesOK { + return &ListRetrospectiveTemplatesOK{} +} + +/* +ListRetrospectiveTemplatesOK describes a response with status code 200, with default header values. + +List all retrospective templates +*/ +type ListRetrospectiveTemplatesOK struct { + Payload *models.RetrospectivesIndexTemplateEntityPaginated +} + +// IsSuccess returns true when this list retrospective templates o k response has a 2xx status code +func (o *ListRetrospectiveTemplatesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list retrospective templates o k response has a 3xx status code +func (o *ListRetrospectiveTemplatesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list retrospective templates o k response has a 4xx status code +func (o *ListRetrospectiveTemplatesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list retrospective templates o k response has a 5xx status code +func (o *ListRetrospectiveTemplatesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list retrospective templates o k response a status code equal to that given +func (o *ListRetrospectiveTemplatesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListRetrospectiveTemplatesOK) Error() string { + return fmt.Sprintf("[GET /v1/retrospective_templates][%d] listRetrospectiveTemplatesOK %+v", 200, o.Payload) +} + +func (o *ListRetrospectiveTemplatesOK) String() string { + return fmt.Sprintf("[GET /v1/retrospective_templates][%d] listRetrospectiveTemplatesOK %+v", 200, o.Payload) +} + +func (o *ListRetrospectiveTemplatesOK) GetPayload() *models.RetrospectivesIndexTemplateEntityPaginated { + return o.Payload +} + +func (o *ListRetrospectiveTemplatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RetrospectivesIndexTemplateEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/list_retrospectives_parameters.go b/client/retrospectives/list_retrospectives_parameters.go new file mode 100644 index 0000000..b1f115e --- /dev/null +++ b/client/retrospectives/list_retrospectives_parameters.go @@ -0,0 +1,266 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListRetrospectivesParams creates a new ListRetrospectivesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListRetrospectivesParams() *ListRetrospectivesParams { + return &ListRetrospectivesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListRetrospectivesParamsWithTimeout creates a new ListRetrospectivesParams object +// with the ability to set a timeout on a request. +func NewListRetrospectivesParamsWithTimeout(timeout time.Duration) *ListRetrospectivesParams { + return &ListRetrospectivesParams{ + timeout: timeout, + } +} + +// NewListRetrospectivesParamsWithContext creates a new ListRetrospectivesParams object +// with the ability to set a context for a request. +func NewListRetrospectivesParamsWithContext(ctx context.Context) *ListRetrospectivesParams { + return &ListRetrospectivesParams{ + Context: ctx, + } +} + +// NewListRetrospectivesParamsWithHTTPClient creates a new ListRetrospectivesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListRetrospectivesParamsWithHTTPClient(client *http.Client) *ListRetrospectivesParams { + return &ListRetrospectivesParams{ + HTTPClient: client, + } +} + +/* +ListRetrospectivesParams contains all the parameters to send to the API endpoint + + for the list retrospectives operation. + + Typically these are written to a http.Request. +*/ +type ListRetrospectivesParams struct { + + /* IncidentID. + + Filter the reports by an incident ID + */ + IncidentID *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* UpdatedSince. + + Filter for reports updated after the given ISO8601 timestamp + + Format: date-time + */ + UpdatedSince *strfmt.DateTime + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list retrospectives params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRetrospectivesParams) WithDefaults() *ListRetrospectivesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list retrospectives params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRetrospectivesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list retrospectives params +func (o *ListRetrospectivesParams) WithTimeout(timeout time.Duration) *ListRetrospectivesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list retrospectives params +func (o *ListRetrospectivesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list retrospectives params +func (o *ListRetrospectivesParams) WithContext(ctx context.Context) *ListRetrospectivesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list retrospectives params +func (o *ListRetrospectivesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list retrospectives params +func (o *ListRetrospectivesParams) WithHTTPClient(client *http.Client) *ListRetrospectivesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list retrospectives params +func (o *ListRetrospectivesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list retrospectives params +func (o *ListRetrospectivesParams) WithIncidentID(incidentID *string) *ListRetrospectivesParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list retrospectives params +func (o *ListRetrospectivesParams) SetIncidentID(incidentID *string) { + o.IncidentID = incidentID +} + +// WithPage adds the page to the list retrospectives params +func (o *ListRetrospectivesParams) WithPage(page *int32) *ListRetrospectivesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list retrospectives params +func (o *ListRetrospectivesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list retrospectives params +func (o *ListRetrospectivesParams) WithPerPage(perPage *int32) *ListRetrospectivesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list retrospectives params +func (o *ListRetrospectivesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithUpdatedSince adds the updatedSince to the list retrospectives params +func (o *ListRetrospectivesParams) WithUpdatedSince(updatedSince *strfmt.DateTime) *ListRetrospectivesParams { + o.SetUpdatedSince(updatedSince) + return o +} + +// SetUpdatedSince adds the updatedSince to the list retrospectives params +func (o *ListRetrospectivesParams) SetUpdatedSince(updatedSince *strfmt.DateTime) { + o.UpdatedSince = updatedSince +} + +// WriteToRequest writes these params to a swagger request +func (o *ListRetrospectivesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.IncidentID != nil { + + // query param incident_id + var qrIncidentID string + + if o.IncidentID != nil { + qrIncidentID = *o.IncidentID + } + qIncidentID := qrIncidentID + if qIncidentID != "" { + + if err := r.SetQueryParam("incident_id", qIncidentID); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.UpdatedSince != nil { + + // query param updated_since + var qrUpdatedSince strfmt.DateTime + + if o.UpdatedSince != nil { + qrUpdatedSince = *o.UpdatedSince + } + qUpdatedSince := qrUpdatedSince.String() + if qUpdatedSince != "" { + + if err := r.SetQueryParam("updated_since", qUpdatedSince); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/list_retrospectives_responses.go b/client/retrospectives/list_retrospectives_responses.go new file mode 100644 index 0000000..62699cb --- /dev/null +++ b/client/retrospectives/list_retrospectives_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListRetrospectivesReader is a Reader for the ListRetrospectives structure. +type ListRetrospectivesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListRetrospectivesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListRetrospectivesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListRetrospectivesOK creates a ListRetrospectivesOK with default headers values +func NewListRetrospectivesOK() *ListRetrospectivesOK { + return &ListRetrospectivesOK{} +} + +/* +ListRetrospectivesOK describes a response with status code 200, with default header values. + +List all retrospective reports +*/ +type ListRetrospectivesOK struct { + Payload *models.IncidentsRetrospectiveEntityPaginated +} + +// IsSuccess returns true when this list retrospectives o k response has a 2xx status code +func (o *ListRetrospectivesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list retrospectives o k response has a 3xx status code +func (o *ListRetrospectivesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list retrospectives o k response has a 4xx status code +func (o *ListRetrospectivesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list retrospectives o k response has a 5xx status code +func (o *ListRetrospectivesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list retrospectives o k response a status code equal to that given +func (o *ListRetrospectivesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListRetrospectivesOK) Error() string { + return fmt.Sprintf("[GET /v1/retrospectives][%d] listRetrospectivesOK %+v", 200, o.Payload) +} + +func (o *ListRetrospectivesOK) String() string { + return fmt.Sprintf("[GET /v1/retrospectives][%d] listRetrospectivesOK %+v", 200, o.Payload) +} + +func (o *ListRetrospectivesOK) GetPayload() *models.IncidentsRetrospectiveEntityPaginated { + return o.Payload +} + +func (o *ListRetrospectivesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRetrospectiveEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/publish_post_mortem_report_parameters.go b/client/retrospectives/publish_post_mortem_report_parameters.go new file mode 100644 index 0000000..96e62ba --- /dev/null +++ b/client/retrospectives/publish_post_mortem_report_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewPublishPostMortemReportParams creates a new PublishPostMortemReportParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPublishPostMortemReportParams() *PublishPostMortemReportParams { + return &PublishPostMortemReportParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPublishPostMortemReportParamsWithTimeout creates a new PublishPostMortemReportParams object +// with the ability to set a timeout on a request. +func NewPublishPostMortemReportParamsWithTimeout(timeout time.Duration) *PublishPostMortemReportParams { + return &PublishPostMortemReportParams{ + timeout: timeout, + } +} + +// NewPublishPostMortemReportParamsWithContext creates a new PublishPostMortemReportParams object +// with the ability to set a context for a request. +func NewPublishPostMortemReportParamsWithContext(ctx context.Context) *PublishPostMortemReportParams { + return &PublishPostMortemReportParams{ + Context: ctx, + } +} + +// NewPublishPostMortemReportParamsWithHTTPClient creates a new PublishPostMortemReportParams object +// with the ability to set a custom HTTPClient for a request. +func NewPublishPostMortemReportParamsWithHTTPClient(client *http.Client) *PublishPostMortemReportParams { + return &PublishPostMortemReportParams{ + HTTPClient: client, + } +} + +/* +PublishPostMortemReportParams contains all the parameters to send to the API endpoint + + for the publish post mortem report operation. + + Typically these are written to a http.Request. +*/ +type PublishPostMortemReportParams struct { + + // PublishPostMortemReport. + PublishPostMortemReport *models.PublishPostMortemReport + + // ReportID. + ReportID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the publish post mortem report params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PublishPostMortemReportParams) WithDefaults() *PublishPostMortemReportParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the publish post mortem report params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PublishPostMortemReportParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the publish post mortem report params +func (o *PublishPostMortemReportParams) WithTimeout(timeout time.Duration) *PublishPostMortemReportParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the publish post mortem report params +func (o *PublishPostMortemReportParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the publish post mortem report params +func (o *PublishPostMortemReportParams) WithContext(ctx context.Context) *PublishPostMortemReportParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the publish post mortem report params +func (o *PublishPostMortemReportParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the publish post mortem report params +func (o *PublishPostMortemReportParams) WithHTTPClient(client *http.Client) *PublishPostMortemReportParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the publish post mortem report params +func (o *PublishPostMortemReportParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPublishPostMortemReport adds the publishPostMortemReport to the publish post mortem report params +func (o *PublishPostMortemReportParams) WithPublishPostMortemReport(publishPostMortemReport *models.PublishPostMortemReport) *PublishPostMortemReportParams { + o.SetPublishPostMortemReport(publishPostMortemReport) + return o +} + +// SetPublishPostMortemReport adds the publishPostMortemReport to the publish post mortem report params +func (o *PublishPostMortemReportParams) SetPublishPostMortemReport(publishPostMortemReport *models.PublishPostMortemReport) { + o.PublishPostMortemReport = publishPostMortemReport +} + +// WithReportID adds the reportID to the publish post mortem report params +func (o *PublishPostMortemReportParams) WithReportID(reportID string) *PublishPostMortemReportParams { + o.SetReportID(reportID) + return o +} + +// SetReportID adds the reportId to the publish post mortem report params +func (o *PublishPostMortemReportParams) SetReportID(reportID string) { + o.ReportID = reportID +} + +// WriteToRequest writes these params to a swagger request +func (o *PublishPostMortemReportParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.PublishPostMortemReport != nil { + if err := r.SetBodyParam(o.PublishPostMortemReport); err != nil { + return err + } + } + + // path param report_id + if err := r.SetPathParam("report_id", o.ReportID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/publish_post_mortem_report_responses.go b/client/retrospectives/publish_post_mortem_report_responses.go new file mode 100644 index 0000000..ba56124 --- /dev/null +++ b/client/retrospectives/publish_post_mortem_report_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// PublishPostMortemReportReader is a Reader for the PublishPostMortemReport structure. +type PublishPostMortemReportReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PublishPostMortemReportReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewPublishPostMortemReportCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPublishPostMortemReportBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPublishPostMortemReportCreated creates a PublishPostMortemReportCreated with default headers values +func NewPublishPostMortemReportCreated() *PublishPostMortemReportCreated { + return &PublishPostMortemReportCreated{} +} + +/* +PublishPostMortemReportCreated describes a response with status code 201, with default header values. + +Marks an incident retrospective as published and emails all of the participants in the report the summary +*/ +type PublishPostMortemReportCreated struct { + Payload *models.PostMortemsPostMortemReportEntity +} + +// IsSuccess returns true when this publish post mortem report created response has a 2xx status code +func (o *PublishPostMortemReportCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this publish post mortem report created response has a 3xx status code +func (o *PublishPostMortemReportCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this publish post mortem report created response has a 4xx status code +func (o *PublishPostMortemReportCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this publish post mortem report created response has a 5xx status code +func (o *PublishPostMortemReportCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this publish post mortem report created response a status code equal to that given +func (o *PublishPostMortemReportCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *PublishPostMortemReportCreated) Error() string { + return fmt.Sprintf("[POST /v1/post_mortems/reports/{report_id}/publish][%d] publishPostMortemReportCreated %+v", 201, o.Payload) +} + +func (o *PublishPostMortemReportCreated) String() string { + return fmt.Sprintf("[POST /v1/post_mortems/reports/{report_id}/publish][%d] publishPostMortemReportCreated %+v", 201, o.Payload) +} + +func (o *PublishPostMortemReportCreated) GetPayload() *models.PostMortemsPostMortemReportEntity { + return o.Payload +} + +func (o *PublishPostMortemReportCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PostMortemsPostMortemReportEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPublishPostMortemReportBadRequest creates a PublishPostMortemReportBadRequest with default headers values +func NewPublishPostMortemReportBadRequest() *PublishPostMortemReportBadRequest { + return &PublishPostMortemReportBadRequest{} +} + +/* +PublishPostMortemReportBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PublishPostMortemReportBadRequest struct { + Payload *models.ErrorEntity +} + +// IsSuccess returns true when this publish post mortem report bad request response has a 2xx status code +func (o *PublishPostMortemReportBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this publish post mortem report bad request response has a 3xx status code +func (o *PublishPostMortemReportBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this publish post mortem report bad request response has a 4xx status code +func (o *PublishPostMortemReportBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this publish post mortem report bad request response has a 5xx status code +func (o *PublishPostMortemReportBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this publish post mortem report bad request response a status code equal to that given +func (o *PublishPostMortemReportBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *PublishPostMortemReportBadRequest) Error() string { + return fmt.Sprintf("[POST /v1/post_mortems/reports/{report_id}/publish][%d] publishPostMortemReportBadRequest %+v", 400, o.Payload) +} + +func (o *PublishPostMortemReportBadRequest) String() string { + return fmt.Sprintf("[POST /v1/post_mortems/reports/{report_id}/publish][%d] publishPostMortemReportBadRequest %+v", 400, o.Payload) +} + +func (o *PublishPostMortemReportBadRequest) GetPayload() *models.ErrorEntity { + return o.Payload +} + +func (o *PublishPostMortemReportBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/reorder_post_mortem_reasons_parameters.go b/client/retrospectives/reorder_post_mortem_reasons_parameters.go new file mode 100644 index 0000000..d653a5a --- /dev/null +++ b/client/retrospectives/reorder_post_mortem_reasons_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewReorderPostMortemReasonsParams creates a new ReorderPostMortemReasonsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReorderPostMortemReasonsParams() *ReorderPostMortemReasonsParams { + return &ReorderPostMortemReasonsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReorderPostMortemReasonsParamsWithTimeout creates a new ReorderPostMortemReasonsParams object +// with the ability to set a timeout on a request. +func NewReorderPostMortemReasonsParamsWithTimeout(timeout time.Duration) *ReorderPostMortemReasonsParams { + return &ReorderPostMortemReasonsParams{ + timeout: timeout, + } +} + +// NewReorderPostMortemReasonsParamsWithContext creates a new ReorderPostMortemReasonsParams object +// with the ability to set a context for a request. +func NewReorderPostMortemReasonsParamsWithContext(ctx context.Context) *ReorderPostMortemReasonsParams { + return &ReorderPostMortemReasonsParams{ + Context: ctx, + } +} + +// NewReorderPostMortemReasonsParamsWithHTTPClient creates a new ReorderPostMortemReasonsParams object +// with the ability to set a custom HTTPClient for a request. +func NewReorderPostMortemReasonsParamsWithHTTPClient(client *http.Client) *ReorderPostMortemReasonsParams { + return &ReorderPostMortemReasonsParams{ + HTTPClient: client, + } +} + +/* +ReorderPostMortemReasonsParams contains all the parameters to send to the API endpoint + + for the reorder post mortem reasons operation. + + Typically these are written to a http.Request. +*/ +type ReorderPostMortemReasonsParams struct { + + // ReorderPostMortemReasons. + ReorderPostMortemReasons *models.ReorderPostMortemReasons + + // ReportID. + ReportID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the reorder post mortem reasons params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReorderPostMortemReasonsParams) WithDefaults() *ReorderPostMortemReasonsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reorder post mortem reasons params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReorderPostMortemReasonsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the reorder post mortem reasons params +func (o *ReorderPostMortemReasonsParams) WithTimeout(timeout time.Duration) *ReorderPostMortemReasonsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the reorder post mortem reasons params +func (o *ReorderPostMortemReasonsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the reorder post mortem reasons params +func (o *ReorderPostMortemReasonsParams) WithContext(ctx context.Context) *ReorderPostMortemReasonsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the reorder post mortem reasons params +func (o *ReorderPostMortemReasonsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the reorder post mortem reasons params +func (o *ReorderPostMortemReasonsParams) WithHTTPClient(client *http.Client) *ReorderPostMortemReasonsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the reorder post mortem reasons params +func (o *ReorderPostMortemReasonsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithReorderPostMortemReasons adds the reorderPostMortemReasons to the reorder post mortem reasons params +func (o *ReorderPostMortemReasonsParams) WithReorderPostMortemReasons(reorderPostMortemReasons *models.ReorderPostMortemReasons) *ReorderPostMortemReasonsParams { + o.SetReorderPostMortemReasons(reorderPostMortemReasons) + return o +} + +// SetReorderPostMortemReasons adds the reorderPostMortemReasons to the reorder post mortem reasons params +func (o *ReorderPostMortemReasonsParams) SetReorderPostMortemReasons(reorderPostMortemReasons *models.ReorderPostMortemReasons) { + o.ReorderPostMortemReasons = reorderPostMortemReasons +} + +// WithReportID adds the reportID to the reorder post mortem reasons params +func (o *ReorderPostMortemReasonsParams) WithReportID(reportID string) *ReorderPostMortemReasonsParams { + o.SetReportID(reportID) + return o +} + +// SetReportID adds the reportId to the reorder post mortem reasons params +func (o *ReorderPostMortemReasonsParams) SetReportID(reportID string) { + o.ReportID = reportID +} + +// WriteToRequest writes these params to a swagger request +func (o *ReorderPostMortemReasonsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.ReorderPostMortemReasons != nil { + if err := r.SetBodyParam(o.ReorderPostMortemReasons); err != nil { + return err + } + } + + // path param report_id + if err := r.SetPathParam("report_id", o.ReportID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/reorder_post_mortem_reasons_responses.go b/client/retrospectives/reorder_post_mortem_reasons_responses.go new file mode 100644 index 0000000..5986580 --- /dev/null +++ b/client/retrospectives/reorder_post_mortem_reasons_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ReorderPostMortemReasonsReader is a Reader for the ReorderPostMortemReasons structure. +type ReorderPostMortemReasonsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReorderPostMortemReasonsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReorderPostMortemReasonsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReorderPostMortemReasonsOK creates a ReorderPostMortemReasonsOK with default headers values +func NewReorderPostMortemReasonsOK() *ReorderPostMortemReasonsOK { + return &ReorderPostMortemReasonsOK{} +} + +/* +ReorderPostMortemReasonsOK describes a response with status code 200, with default header values. + +Update the order of contributing factors in a retrospective report +*/ +type ReorderPostMortemReasonsOK struct { + Payload *models.PostMortemsReasonEntity +} + +// IsSuccess returns true when this reorder post mortem reasons o k response has a 2xx status code +func (o *ReorderPostMortemReasonsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this reorder post mortem reasons o k response has a 3xx status code +func (o *ReorderPostMortemReasonsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this reorder post mortem reasons o k response has a 4xx status code +func (o *ReorderPostMortemReasonsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this reorder post mortem reasons o k response has a 5xx status code +func (o *ReorderPostMortemReasonsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this reorder post mortem reasons o k response a status code equal to that given +func (o *ReorderPostMortemReasonsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ReorderPostMortemReasonsOK) Error() string { + return fmt.Sprintf("[PUT /v1/post_mortems/reports/{report_id}/reasons/order][%d] reorderPostMortemReasonsOK %+v", 200, o.Payload) +} + +func (o *ReorderPostMortemReasonsOK) String() string { + return fmt.Sprintf("[PUT /v1/post_mortems/reports/{report_id}/reasons/order][%d] reorderPostMortemReasonsOK %+v", 200, o.Payload) +} + +func (o *ReorderPostMortemReasonsOK) GetPayload() *models.PostMortemsReasonEntity { + return o.Payload +} + +func (o *ReorderPostMortemReasonsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PostMortemsReasonEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/retrospectives_client.go b/client/retrospectives/retrospectives_client.go index cfe5e2f..452b8a1 100644 --- a/client/retrospectives/retrospectives_client.go +++ b/client/retrospectives/retrospectives_client.go @@ -30,88 +30,88 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputs(params *DeleteV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputsOK, error) + CreateIncidentRetrospective(params *CreateIncidentRetrospectiveParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentRetrospectiveCreated, error) - DeleteV1PostMortemsReportsReportIDReasonsReasonID(params *DeleteV1PostMortemsReportsReportIDReasonsReasonIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1PostMortemsReportsReportIDReasonsReasonIDOK, error) + CreateIncidentRetrospectiveDynamicInput(params *CreateIncidentRetrospectiveDynamicInputParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentRetrospectiveDynamicInputCreated, error) - DeleteV1RetrospectiveTemplatesRetrospectiveTemplateID(params *DeleteV1RetrospectiveTemplatesRetrospectiveTemplateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1RetrospectiveTemplatesRetrospectiveTemplateIDOK, error) + CreateIncidentRetrospectiveField(params *CreateIncidentRetrospectiveFieldParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentRetrospectiveFieldOK, error) - GetV1IncidentsIncidentIDRetrospectives(params *GetV1IncidentsIncidentIDRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDRetrospectivesOK, error) + CreatePostMortemReason(params *CreatePostMortemReasonParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePostMortemReasonCreated, error) - GetV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldID(params *GetV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDOK, error) + CreatePostMortemReport(params *CreatePostMortemReportParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePostMortemReportCreated, error) - GetV1PostMortemsQuestions(params *GetV1PostMortemsQuestionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PostMortemsQuestionsOK, error) + CreateRetrospectiveTemplate(params *CreateRetrospectiveTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateRetrospectiveTemplateCreated, error) - GetV1PostMortemsQuestionsQuestionID(params *GetV1PostMortemsQuestionsQuestionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PostMortemsQuestionsQuestionIDOK, error) + DeleteIncidentRetrospectiveDynamicInput(params *DeleteIncidentRetrospectiveDynamicInputParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentRetrospectiveDynamicInputOK, error) - GetV1PostMortemsReports(params *GetV1PostMortemsReportsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PostMortemsReportsOK, error) + DeletePostMortemReason(params *DeletePostMortemReasonParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeletePostMortemReasonOK, error) - GetV1PostMortemsReportsReportID(params *GetV1PostMortemsReportsReportIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PostMortemsReportsReportIDOK, error) + DeleteRetrospectiveTemplate(params *DeleteRetrospectiveTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteRetrospectiveTemplateOK, error) - GetV1PostMortemsReportsReportIDReasons(params *GetV1PostMortemsReportsReportIDReasonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PostMortemsReportsReportIDReasonsOK, error) + ExportIncidentRetrospectives(params *ExportIncidentRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportIncidentRetrospectivesCreated, error) - GetV1RetrospectiveTemplates(params *GetV1RetrospectiveTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RetrospectiveTemplatesOK, error) + GetIncidentRetrospectiveField(params *GetIncidentRetrospectiveFieldParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentRetrospectiveFieldOK, error) - GetV1RetrospectiveTemplatesRetrospectiveTemplateID(params *GetV1RetrospectiveTemplatesRetrospectiveTemplateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RetrospectiveTemplatesRetrospectiveTemplateIDOK, error) + GetPostMortemQuestion(params *GetPostMortemQuestionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPostMortemQuestionOK, error) - GetV1Retrospectives(params *GetV1RetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RetrospectivesOK, error) + GetPostMortemReport(params *GetPostMortemReportParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPostMortemReportOK, error) - PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveID(params *PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDOK, error) + GetRetrospectiveTemplate(params *GetRetrospectiveTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRetrospectiveTemplateOK, error) - PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFields(params *PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsOK, error) + ListIncidentRetrospectives(params *ListIncidentRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentRetrospectivesOK, error) - PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldID(params *PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDOK, error) + ListPostMortemQuestions(params *ListPostMortemQuestionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostMortemQuestionsOK, error) - PatchV1PostMortemsReportsReportID(params *PatchV1PostMortemsReportsReportIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1PostMortemsReportsReportIDOK, error) + ListPostMortemReasons(params *ListPostMortemReasonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostMortemReasonsOK, error) - PatchV1PostMortemsReportsReportIDFieldsFieldID(params *PatchV1PostMortemsReportsReportIDFieldsFieldIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1PostMortemsReportsReportIDFieldsFieldIDOK, error) + ListPostMortemReports(params *ListPostMortemReportsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostMortemReportsOK, error) - PatchV1PostMortemsReportsReportIDReasonsReasonID(params *PatchV1PostMortemsReportsReportIDReasonsReasonIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1PostMortemsReportsReportIDReasonsReasonIDOK, error) + ListRetrospectiveTemplates(params *ListRetrospectiveTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRetrospectiveTemplatesOK, error) - PatchV1RetrospectiveTemplatesRetrospectiveTemplateID(params *PatchV1RetrospectiveTemplatesRetrospectiveTemplateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1RetrospectiveTemplatesRetrospectiveTemplateIDOK, error) + ListRetrospectives(params *ListRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRetrospectivesOK, error) - PostV1IncidentsIncidentIDRetrospectives(params *PostV1IncidentsIncidentIDRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDRetrospectivesCreated, error) + PublishPostMortemReport(params *PublishPostMortemReportParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PublishPostMortemReportCreated, error) - PostV1IncidentsIncidentIDRetrospectivesExport(params *PostV1IncidentsIncidentIDRetrospectivesExportParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDRetrospectivesExportCreated, error) + ReorderPostMortemReasons(params *ReorderPostMortemReasonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReorderPostMortemReasonsOK, error) - PostV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputs(params *PostV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputsCreated, error) + ShareIncidentRetrospectives(params *ShareIncidentRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ShareIncidentRetrospectivesCreated, error) - PostV1IncidentsIncidentIDRetrospectivesShare(params *PostV1IncidentsIncidentIDRetrospectivesShareParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDRetrospectivesShareCreated, error) + UpdateIncidentRetrospective(params *UpdateIncidentRetrospectiveParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentRetrospectiveOK, error) - PostV1PostMortemsReports(params *PostV1PostMortemsReportsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1PostMortemsReportsCreated, error) + UpdateIncidentRetrospectiveField(params *UpdateIncidentRetrospectiveFieldParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentRetrospectiveFieldOK, error) - PostV1PostMortemsReportsReportIDPublish(params *PostV1PostMortemsReportsReportIDPublishParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1PostMortemsReportsReportIDPublishCreated, error) + UpdatePostMortemField(params *UpdatePostMortemFieldParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePostMortemFieldOK, error) - PostV1PostMortemsReportsReportIDReasons(params *PostV1PostMortemsReportsReportIDReasonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1PostMortemsReportsReportIDReasonsCreated, error) + UpdatePostMortemQuestions(params *UpdatePostMortemQuestionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePostMortemQuestionsOK, error) - PostV1RetrospectiveTemplates(params *PostV1RetrospectiveTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1RetrospectiveTemplatesCreated, error) + UpdatePostMortemReason(params *UpdatePostMortemReasonParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePostMortemReasonOK, error) - PutV1PostMortemsQuestions(params *PutV1PostMortemsQuestionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1PostMortemsQuestionsOK, error) + UpdatePostMortemReport(params *UpdatePostMortemReportParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePostMortemReportOK, error) - PutV1PostMortemsReportsReportIDReasonsOrder(params *PutV1PostMortemsReportsReportIDReasonsOrderParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1PostMortemsReportsReportIDReasonsOrderOK, error) + UpdateRetrospectiveTemplate(params *UpdateRetrospectiveTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateRetrospectiveTemplateOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputs removes a dynamic input from a retrospective s dynamic input group field +CreateIncidentRetrospective creates a new retrospective on the incident using the template -Delete a dynamic input on a dynamic input group +Create a new retrospective for an incident */ -func (a *Client) DeleteV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputs(params *DeleteV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputsOK, error) { +func (a *Client) CreateIncidentRetrospective(params *CreateIncidentRetrospectiveParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentRetrospectiveCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputsParams() + params = NewCreateIncidentRetrospectiveParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IncidentsIncidentIdRetrospectivesRetrospectiveIdFieldsFieldIdInputs", - Method: "DELETE", - PathPattern: "/v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}/inputs", + ID: "create_incident_retrospective", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/retrospectives", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputsReader{formats: a.formats}, + Reader: &CreateIncidentRetrospectiveReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -124,35 +124,35 @@ func (a *Client) DeleteV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsF if err != nil { return nil, err } - success, ok := result.(*DeleteV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputsOK) + success, ok := result.(*CreateIncidentRetrospectiveCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IncidentsIncidentIdRetrospectivesRetrospectiveIdFieldsFieldIdInputs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_retrospective: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1PostMortemsReportsReportIDReasonsReasonID deletes a contributing factor from a retrospective report +CreateIncidentRetrospectiveDynamicInput adds a new dynamic input field to a retrospective s dynamic input group field -Delete a contributing factor +Add a new dynamic input field to a dynamic input group */ -func (a *Client) DeleteV1PostMortemsReportsReportIDReasonsReasonID(params *DeleteV1PostMortemsReportsReportIDReasonsReasonIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1PostMortemsReportsReportIDReasonsReasonIDOK, error) { +func (a *Client) CreateIncidentRetrospectiveDynamicInput(params *CreateIncidentRetrospectiveDynamicInputParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentRetrospectiveDynamicInputCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1PostMortemsReportsReportIDReasonsReasonIDParams() + params = NewCreateIncidentRetrospectiveDynamicInputParams() } op := &runtime.ClientOperation{ - ID: "deleteV1PostMortemsReportsReportIdReasonsReasonId", - Method: "DELETE", - PathPattern: "/v1/post_mortems/reports/{report_id}/reasons/{reason_id}", + ID: "create_incident_retrospective_dynamic_input", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}/inputs", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1PostMortemsReportsReportIDReasonsReasonIDReader{formats: a.formats}, + Reader: &CreateIncidentRetrospectiveDynamicInputReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -165,35 +165,35 @@ func (a *Client) DeleteV1PostMortemsReportsReportIDReasonsReasonID(params *Delet if err != nil { return nil, err } - success, ok := result.(*DeleteV1PostMortemsReportsReportIDReasonsReasonIDOK) + success, ok := result.(*CreateIncidentRetrospectiveDynamicInputCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1PostMortemsReportsReportIdReasonsReasonId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_retrospective_dynamic_input: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1RetrospectiveTemplatesRetrospectiveTemplateID deletes a retrospective template +CreateIncidentRetrospectiveField appends a new incident retrospective field to an incident retrospective -Delete a single retrospective template +Add a new field to an incident retrospective */ -func (a *Client) DeleteV1RetrospectiveTemplatesRetrospectiveTemplateID(params *DeleteV1RetrospectiveTemplatesRetrospectiveTemplateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1RetrospectiveTemplatesRetrospectiveTemplateIDOK, error) { +func (a *Client) CreateIncidentRetrospectiveField(params *CreateIncidentRetrospectiveFieldParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentRetrospectiveFieldOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1RetrospectiveTemplatesRetrospectiveTemplateIDParams() + params = NewCreateIncidentRetrospectiveFieldParams() } op := &runtime.ClientOperation{ - ID: "deleteV1RetrospectiveTemplatesRetrospectiveTemplateId", - Method: "DELETE", - PathPattern: "/v1/retrospective_templates/{retrospective_template_id}", + ID: "create_incident_retrospective_field", + Method: "PATCH", + PathPattern: "/v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1RetrospectiveTemplatesRetrospectiveTemplateIDReader{formats: a.formats}, + Reader: &CreateIncidentRetrospectiveFieldReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -206,35 +206,35 @@ func (a *Client) DeleteV1RetrospectiveTemplatesRetrospectiveTemplateID(params *D if err != nil { return nil, err } - success, ok := result.(*DeleteV1RetrospectiveTemplatesRetrospectiveTemplateIDOK) + success, ok := result.(*CreateIncidentRetrospectiveFieldOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1RetrospectiveTemplatesRetrospectiveTemplateId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_retrospective_field: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDRetrospectives alls attached retrospectives for an incident +CreatePostMortemReason creates a contributing factor for a retrospective report -Retrieve retrospectives attached to an incident +Add a new contributing factor to an incident */ -func (a *Client) GetV1IncidentsIncidentIDRetrospectives(params *GetV1IncidentsIncidentIDRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDRetrospectivesOK, error) { +func (a *Client) CreatePostMortemReason(params *CreatePostMortemReasonParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePostMortemReasonCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDRetrospectivesParams() + params = NewCreatePostMortemReasonParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdRetrospectives", - Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/retrospectives", + ID: "create_post_mortem_reason", + Method: "POST", + PathPattern: "/v1/post_mortems/reports/{report_id}/reasons", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDRetrospectivesReader{formats: a.formats}, + Reader: &CreatePostMortemReasonReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -247,35 +247,35 @@ func (a *Client) GetV1IncidentsIncidentIDRetrospectives(params *GetV1IncidentsIn if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDRetrospectivesOK) + success, ok := result.(*CreatePostMortemReasonCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdRetrospectives: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_post_mortem_reason: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldID gets a retrospective field +CreatePostMortemReport creates a retrospective report -Retrieve a field on an incident retrospective +Create a report */ -func (a *Client) GetV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldID(params *GetV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDOK, error) { +func (a *Client) CreatePostMortemReport(params *CreatePostMortemReportParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePostMortemReportCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDParams() + params = NewCreatePostMortemReportParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdRetrospectivesRetrospectiveIdFieldsFieldId", - Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}", + ID: "create_post_mortem_report", + Method: "POST", + PathPattern: "/v1/post_mortems/reports", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDReader{formats: a.formats}, + Reader: &CreatePostMortemReportReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -288,35 +288,35 @@ func (a *Client) GetV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFiel if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDOK) + success, ok := result.(*CreatePostMortemReportCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdRetrospectivesRetrospectiveIdFieldsFieldId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_post_mortem_report: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1PostMortemsQuestions lists retrospective questions +CreateRetrospectiveTemplate creates a retrospective template -List the questions configured to be provided and filled out on each retrospective report. +Create a new retrospective template */ -func (a *Client) GetV1PostMortemsQuestions(params *GetV1PostMortemsQuestionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PostMortemsQuestionsOK, error) { +func (a *Client) CreateRetrospectiveTemplate(params *CreateRetrospectiveTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateRetrospectiveTemplateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1PostMortemsQuestionsParams() + params = NewCreateRetrospectiveTemplateParams() } op := &runtime.ClientOperation{ - ID: "getV1PostMortemsQuestions", - Method: "GET", - PathPattern: "/v1/post_mortems/questions", + ID: "create_retrospective_template", + Method: "POST", + PathPattern: "/v1/retrospective_templates", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1PostMortemsQuestionsReader{formats: a.formats}, + Reader: &CreateRetrospectiveTemplateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -329,35 +329,35 @@ func (a *Client) GetV1PostMortemsQuestions(params *GetV1PostMortemsQuestionsPara if err != nil { return nil, err } - success, ok := result.(*GetV1PostMortemsQuestionsOK) + success, ok := result.(*CreateRetrospectiveTemplateCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1PostMortemsQuestions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_retrospective_template: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1PostMortemsQuestionsQuestionID gets a retrospective question +DeleteIncidentRetrospectiveDynamicInput removes a dynamic input from a retrospective s dynamic input group field -Get an incident retrospective question configured to be provided and filled out on each retrospective report. +Delete a dynamic input on a dynamic input group */ -func (a *Client) GetV1PostMortemsQuestionsQuestionID(params *GetV1PostMortemsQuestionsQuestionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PostMortemsQuestionsQuestionIDOK, error) { +func (a *Client) DeleteIncidentRetrospectiveDynamicInput(params *DeleteIncidentRetrospectiveDynamicInputParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentRetrospectiveDynamicInputOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1PostMortemsQuestionsQuestionIDParams() + params = NewDeleteIncidentRetrospectiveDynamicInputParams() } op := &runtime.ClientOperation{ - ID: "getV1PostMortemsQuestionsQuestionId", - Method: "GET", - PathPattern: "/v1/post_mortems/questions/{question_id}", + ID: "delete_incident_retrospective_dynamic_input", + Method: "DELETE", + PathPattern: "/v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}/inputs", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1PostMortemsQuestionsQuestionIDReader{formats: a.formats}, + Reader: &DeleteIncidentRetrospectiveDynamicInputReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -370,35 +370,35 @@ func (a *Client) GetV1PostMortemsQuestionsQuestionID(params *GetV1PostMortemsQue if err != nil { return nil, err } - success, ok := result.(*GetV1PostMortemsQuestionsQuestionIDOK) + success, ok := result.(*DeleteIncidentRetrospectiveDynamicInputOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1PostMortemsQuestionsQuestionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_incident_retrospective_dynamic_input: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1PostMortemsReports lists retrospective reports +DeletePostMortemReason deletes a contributing factor from a retrospective report -List all reports +Delete a contributing factor */ -func (a *Client) GetV1PostMortemsReports(params *GetV1PostMortemsReportsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PostMortemsReportsOK, error) { +func (a *Client) DeletePostMortemReason(params *DeletePostMortemReasonParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeletePostMortemReasonOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1PostMortemsReportsParams() + params = NewDeletePostMortemReasonParams() } op := &runtime.ClientOperation{ - ID: "getV1PostMortemsReports", - Method: "GET", - PathPattern: "/v1/post_mortems/reports", + ID: "delete_post_mortem_reason", + Method: "DELETE", + PathPattern: "/v1/post_mortems/reports/{report_id}/reasons/{reason_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1PostMortemsReportsReader{formats: a.formats}, + Reader: &DeletePostMortemReasonReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -411,35 +411,35 @@ func (a *Client) GetV1PostMortemsReports(params *GetV1PostMortemsReportsParams, if err != nil { return nil, err } - success, ok := result.(*GetV1PostMortemsReportsOK) + success, ok := result.(*DeletePostMortemReasonOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1PostMortemsReports: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_post_mortem_reason: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1PostMortemsReportsReportID gets a retrospective report +DeleteRetrospectiveTemplate deletes a retrospective template -Get a report +Delete a single retrospective template */ -func (a *Client) GetV1PostMortemsReportsReportID(params *GetV1PostMortemsReportsReportIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PostMortemsReportsReportIDOK, error) { +func (a *Client) DeleteRetrospectiveTemplate(params *DeleteRetrospectiveTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteRetrospectiveTemplateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1PostMortemsReportsReportIDParams() + params = NewDeleteRetrospectiveTemplateParams() } op := &runtime.ClientOperation{ - ID: "getV1PostMortemsReportsReportId", - Method: "GET", - PathPattern: "/v1/post_mortems/reports/{report_id}", + ID: "delete_retrospective_template", + Method: "DELETE", + PathPattern: "/v1/retrospective_templates/{retrospective_template_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1PostMortemsReportsReportIDReader{formats: a.formats}, + Reader: &DeleteRetrospectiveTemplateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -452,35 +452,35 @@ func (a *Client) GetV1PostMortemsReportsReportID(params *GetV1PostMortemsReports if err != nil { return nil, err } - success, ok := result.(*GetV1PostMortemsReportsReportIDOK) + success, ok := result.(*DeleteRetrospectiveTemplateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1PostMortemsReportsReportId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_retrospective_template: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1PostMortemsReportsReportIDReasons lists contributing factors for a retrospective report +ExportIncidentRetrospectives exports an incident s retrospective s -List all contributing factors to an incident +Export incident's retrospective(s) using their templates */ -func (a *Client) GetV1PostMortemsReportsReportIDReasons(params *GetV1PostMortemsReportsReportIDReasonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1PostMortemsReportsReportIDReasonsOK, error) { +func (a *Client) ExportIncidentRetrospectives(params *ExportIncidentRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportIncidentRetrospectivesCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1PostMortemsReportsReportIDReasonsParams() + params = NewExportIncidentRetrospectivesParams() } op := &runtime.ClientOperation{ - ID: "getV1PostMortemsReportsReportIdReasons", - Method: "GET", - PathPattern: "/v1/post_mortems/reports/{report_id}/reasons", + ID: "export_incident_retrospectives", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/retrospectives/export", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1PostMortemsReportsReportIDReasonsReader{formats: a.formats}, + Reader: &ExportIncidentRetrospectivesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -493,35 +493,35 @@ func (a *Client) GetV1PostMortemsReportsReportIDReasons(params *GetV1PostMortems if err != nil { return nil, err } - success, ok := result.(*GetV1PostMortemsReportsReportIDReasonsOK) + success, ok := result.(*ExportIncidentRetrospectivesCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1PostMortemsReportsReportIdReasons: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for export_incident_retrospectives: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1RetrospectiveTemplates lists retrospective templates +GetIncidentRetrospectiveField gets a retrospective field -List all retrospective templates +Retrieve a field on an incident retrospective */ -func (a *Client) GetV1RetrospectiveTemplates(params *GetV1RetrospectiveTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RetrospectiveTemplatesOK, error) { +func (a *Client) GetIncidentRetrospectiveField(params *GetIncidentRetrospectiveFieldParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentRetrospectiveFieldOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1RetrospectiveTemplatesParams() + params = NewGetIncidentRetrospectiveFieldParams() } op := &runtime.ClientOperation{ - ID: "getV1RetrospectiveTemplates", + ID: "get_incident_retrospective_field", Method: "GET", - PathPattern: "/v1/retrospective_templates", + PathPattern: "/v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1RetrospectiveTemplatesReader{formats: a.formats}, + Reader: &GetIncidentRetrospectiveFieldReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -534,35 +534,35 @@ func (a *Client) GetV1RetrospectiveTemplates(params *GetV1RetrospectiveTemplates if err != nil { return nil, err } - success, ok := result.(*GetV1RetrospectiveTemplatesOK) + success, ok := result.(*GetIncidentRetrospectiveFieldOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1RetrospectiveTemplates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_incident_retrospective_field: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1RetrospectiveTemplatesRetrospectiveTemplateID gets a retrospective template +GetPostMortemQuestion gets a retrospective question -Retrieve a single retrospective template by ID +Get an incident retrospective question configured to be provided and filled out on each retrospective report. */ -func (a *Client) GetV1RetrospectiveTemplatesRetrospectiveTemplateID(params *GetV1RetrospectiveTemplatesRetrospectiveTemplateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RetrospectiveTemplatesRetrospectiveTemplateIDOK, error) { +func (a *Client) GetPostMortemQuestion(params *GetPostMortemQuestionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPostMortemQuestionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1RetrospectiveTemplatesRetrospectiveTemplateIDParams() + params = NewGetPostMortemQuestionParams() } op := &runtime.ClientOperation{ - ID: "getV1RetrospectiveTemplatesRetrospectiveTemplateId", + ID: "get_post_mortem_question", Method: "GET", - PathPattern: "/v1/retrospective_templates/{retrospective_template_id}", + PathPattern: "/v1/post_mortems/questions/{question_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1RetrospectiveTemplatesRetrospectiveTemplateIDReader{formats: a.formats}, + Reader: &GetPostMortemQuestionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -575,35 +575,35 @@ func (a *Client) GetV1RetrospectiveTemplatesRetrospectiveTemplateID(params *GetV if err != nil { return nil, err } - success, ok := result.(*GetV1RetrospectiveTemplatesRetrospectiveTemplateIDOK) + success, ok := result.(*GetPostMortemQuestionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1RetrospectiveTemplatesRetrospectiveTemplateId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_post_mortem_question: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Retrospectives lists retrospective reports +GetPostMortemReport gets a retrospective report -List all retrospective reports +Get a report */ -func (a *Client) GetV1Retrospectives(params *GetV1RetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RetrospectivesOK, error) { +func (a *Client) GetPostMortemReport(params *GetPostMortemReportParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPostMortemReportOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1RetrospectivesParams() + params = NewGetPostMortemReportParams() } op := &runtime.ClientOperation{ - ID: "getV1Retrospectives", + ID: "get_post_mortem_report", Method: "GET", - PathPattern: "/v1/retrospectives", + PathPattern: "/v1/post_mortems/reports/{report_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1RetrospectivesReader{formats: a.formats}, + Reader: &GetPostMortemReportReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -616,35 +616,35 @@ func (a *Client) GetV1Retrospectives(params *GetV1RetrospectivesParams, authInfo if err != nil { return nil, err } - success, ok := result.(*GetV1RetrospectivesOK) + success, ok := result.(*GetPostMortemReportOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Retrospectives: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_post_mortem_report: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveID updates a retrospective on the incident +GetRetrospectiveTemplate gets a retrospective template -Update a retrospective attached to an incident +Retrieve a single retrospective template by ID */ -func (a *Client) PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveID(params *PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDOK, error) { +func (a *Client) GetRetrospectiveTemplate(params *GetRetrospectiveTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRetrospectiveTemplateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDParams() + params = NewGetRetrospectiveTemplateParams() } op := &runtime.ClientOperation{ - ID: "patchV1IncidentsIncidentIdRetrospectivesRetrospectiveId", - Method: "PATCH", - PathPattern: "/v1/incidents/{incident_id}/retrospectives/{retrospective_id}", + ID: "get_retrospective_template", + Method: "GET", + PathPattern: "/v1/retrospective_templates/{retrospective_template_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDReader{formats: a.formats}, + Reader: &GetRetrospectiveTemplateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -657,35 +657,35 @@ func (a *Client) PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveID(params if err != nil { return nil, err } - success, ok := result.(*PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDOK) + success, ok := result.(*GetRetrospectiveTemplateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IncidentsIncidentIdRetrospectivesRetrospectiveId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_retrospective_template: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFields appends a new incident retrospective field to an incident retrospective +ListIncidentRetrospectives alls attached retrospectives for an incident -Add a new field to an incident retrospective +Retrieve retrospectives attached to an incident */ -func (a *Client) PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFields(params *PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsOK, error) { +func (a *Client) ListIncidentRetrospectives(params *ListIncidentRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentRetrospectivesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsParams() + params = NewListIncidentRetrospectivesParams() } op := &runtime.ClientOperation{ - ID: "patchV1IncidentsIncidentIdRetrospectivesRetrospectiveIdFields", - Method: "PATCH", - PathPattern: "/v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields", + ID: "list_incident_retrospectives", + Method: "GET", + PathPattern: "/v1/incidents/{incident_id}/retrospectives", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsReader{formats: a.formats}, + Reader: &ListIncidentRetrospectivesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -698,35 +698,35 @@ func (a *Client) PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFields(p if err != nil { return nil, err } - success, ok := result.(*PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsOK) + success, ok := result.(*ListIncidentRetrospectivesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IncidentsIncidentIdRetrospectivesRetrospectiveIdFields: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_retrospectives: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldID updates the value on a retrospective field +ListPostMortemQuestions lists retrospective questions -Update retrospective field value +List the questions configured to be provided and filled out on each retrospective report. */ -func (a *Client) PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldID(params *PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDOK, error) { +func (a *Client) ListPostMortemQuestions(params *ListPostMortemQuestionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostMortemQuestionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDParams() + params = NewListPostMortemQuestionsParams() } op := &runtime.ClientOperation{ - ID: "patchV1IncidentsIncidentIdRetrospectivesRetrospectiveIdFieldsFieldId", - Method: "PATCH", - PathPattern: "/v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}", + ID: "list_post_mortem_questions", + Method: "GET", + PathPattern: "/v1/post_mortems/questions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDReader{formats: a.formats}, + Reader: &ListPostMortemQuestionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -739,35 +739,35 @@ func (a *Client) PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFi if err != nil { return nil, err } - success, ok := result.(*PatchV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDOK) + success, ok := result.(*ListPostMortemQuestionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IncidentsIncidentIdRetrospectivesRetrospectiveIdFieldsFieldId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_post_mortem_questions: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1PostMortemsReportsReportID updates a retrospective report +ListPostMortemReasons lists contributing factors for a retrospective report -Update a report +List all contributing factors to an incident */ -func (a *Client) PatchV1PostMortemsReportsReportID(params *PatchV1PostMortemsReportsReportIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1PostMortemsReportsReportIDOK, error) { +func (a *Client) ListPostMortemReasons(params *ListPostMortemReasonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostMortemReasonsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1PostMortemsReportsReportIDParams() + params = NewListPostMortemReasonsParams() } op := &runtime.ClientOperation{ - ID: "patchV1PostMortemsReportsReportId", - Method: "PATCH", - PathPattern: "/v1/post_mortems/reports/{report_id}", + ID: "list_post_mortem_reasons", + Method: "GET", + PathPattern: "/v1/post_mortems/reports/{report_id}/reasons", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1PostMortemsReportsReportIDReader{formats: a.formats}, + Reader: &ListPostMortemReasonsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -780,35 +780,35 @@ func (a *Client) PatchV1PostMortemsReportsReportID(params *PatchV1PostMortemsRep if err != nil { return nil, err } - success, ok := result.(*PatchV1PostMortemsReportsReportIDOK) + success, ok := result.(*ListPostMortemReasonsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1PostMortemsReportsReportId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_post_mortem_reasons: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1PostMortemsReportsReportIDFieldsFieldID updates a retrospective field +ListPostMortemReports lists retrospective reports -Update a field value on a post mortem report +List all reports */ -func (a *Client) PatchV1PostMortemsReportsReportIDFieldsFieldID(params *PatchV1PostMortemsReportsReportIDFieldsFieldIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1PostMortemsReportsReportIDFieldsFieldIDOK, error) { +func (a *Client) ListPostMortemReports(params *ListPostMortemReportsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostMortemReportsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1PostMortemsReportsReportIDFieldsFieldIDParams() + params = NewListPostMortemReportsParams() } op := &runtime.ClientOperation{ - ID: "patchV1PostMortemsReportsReportIdFieldsFieldId", - Method: "PATCH", - PathPattern: "/v1/post_mortems/reports/{report_id}/fields/{field_id}", + ID: "list_post_mortem_reports", + Method: "GET", + PathPattern: "/v1/post_mortems/reports", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1PostMortemsReportsReportIDFieldsFieldIDReader{formats: a.formats}, + Reader: &ListPostMortemReportsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -821,35 +821,35 @@ func (a *Client) PatchV1PostMortemsReportsReportIDFieldsFieldID(params *PatchV1P if err != nil { return nil, err } - success, ok := result.(*PatchV1PostMortemsReportsReportIDFieldsFieldIDOK) + success, ok := result.(*ListPostMortemReportsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1PostMortemsReportsReportIdFieldsFieldId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_post_mortem_reports: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1PostMortemsReportsReportIDReasonsReasonID updates a contributing factor in a retrospective report +ListRetrospectiveTemplates lists retrospective templates -Update a contributing factor +List all retrospective templates */ -func (a *Client) PatchV1PostMortemsReportsReportIDReasonsReasonID(params *PatchV1PostMortemsReportsReportIDReasonsReasonIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1PostMortemsReportsReportIDReasonsReasonIDOK, error) { +func (a *Client) ListRetrospectiveTemplates(params *ListRetrospectiveTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRetrospectiveTemplatesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1PostMortemsReportsReportIDReasonsReasonIDParams() + params = NewListRetrospectiveTemplatesParams() } op := &runtime.ClientOperation{ - ID: "patchV1PostMortemsReportsReportIdReasonsReasonId", - Method: "PATCH", - PathPattern: "/v1/post_mortems/reports/{report_id}/reasons/{reason_id}", + ID: "list_retrospective_templates", + Method: "GET", + PathPattern: "/v1/retrospective_templates", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1PostMortemsReportsReportIDReasonsReasonIDReader{formats: a.formats}, + Reader: &ListRetrospectiveTemplatesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -862,35 +862,35 @@ func (a *Client) PatchV1PostMortemsReportsReportIDReasonsReasonID(params *PatchV if err != nil { return nil, err } - success, ok := result.(*PatchV1PostMortemsReportsReportIDReasonsReasonIDOK) + success, ok := result.(*ListRetrospectiveTemplatesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1PostMortemsReportsReportIdReasonsReasonId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_retrospective_templates: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1RetrospectiveTemplatesRetrospectiveTemplateID updates a retrospective template +ListRetrospectives lists retrospective reports -Update a single retrospective template +List all retrospective reports */ -func (a *Client) PatchV1RetrospectiveTemplatesRetrospectiveTemplateID(params *PatchV1RetrospectiveTemplatesRetrospectiveTemplateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1RetrospectiveTemplatesRetrospectiveTemplateIDOK, error) { +func (a *Client) ListRetrospectives(params *ListRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRetrospectivesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1RetrospectiveTemplatesRetrospectiveTemplateIDParams() + params = NewListRetrospectivesParams() } op := &runtime.ClientOperation{ - ID: "patchV1RetrospectiveTemplatesRetrospectiveTemplateId", - Method: "PATCH", - PathPattern: "/v1/retrospective_templates/{retrospective_template_id}", + ID: "list_retrospectives", + Method: "GET", + PathPattern: "/v1/retrospectives", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1RetrospectiveTemplatesRetrospectiveTemplateIDReader{formats: a.formats}, + Reader: &ListRetrospectivesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -903,35 +903,35 @@ func (a *Client) PatchV1RetrospectiveTemplatesRetrospectiveTemplateID(params *Pa if err != nil { return nil, err } - success, ok := result.(*PatchV1RetrospectiveTemplatesRetrospectiveTemplateIDOK) + success, ok := result.(*ListRetrospectivesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1RetrospectiveTemplatesRetrospectiveTemplateId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_retrospectives: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDRetrospectives creates a new retrospective on the incident using the template +PublishPostMortemReport publishes a retrospective report -Create a new retrospective for an incident +Marks an incident retrospective as published and emails all of the participants in the report the summary */ -func (a *Client) PostV1IncidentsIncidentIDRetrospectives(params *PostV1IncidentsIncidentIDRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDRetrospectivesCreated, error) { +func (a *Client) PublishPostMortemReport(params *PublishPostMortemReportParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PublishPostMortemReportCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDRetrospectivesParams() + params = NewPublishPostMortemReportParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdRetrospectives", + ID: "publish_post_mortem_report", Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/retrospectives", + PathPattern: "/v1/post_mortems/reports/{report_id}/publish", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDRetrospectivesReader{formats: a.formats}, + Reader: &PublishPostMortemReportReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -944,35 +944,35 @@ func (a *Client) PostV1IncidentsIncidentIDRetrospectives(params *PostV1Incidents if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDRetrospectivesCreated) + success, ok := result.(*PublishPostMortemReportCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdRetrospectives: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for publish_post_mortem_report: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDRetrospectivesExport exports an incident s retrospective s +ReorderPostMortemReasons reorders a contributing factor for a retrospective report -Export incident's retrospective(s) using their templates +Update the order of contributing factors in a retrospective report */ -func (a *Client) PostV1IncidentsIncidentIDRetrospectivesExport(params *PostV1IncidentsIncidentIDRetrospectivesExportParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDRetrospectivesExportCreated, error) { +func (a *Client) ReorderPostMortemReasons(params *ReorderPostMortemReasonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReorderPostMortemReasonsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDRetrospectivesExportParams() + params = NewReorderPostMortemReasonsParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdRetrospectivesExport", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/retrospectives/export", + ID: "reorder_post_mortem_reasons", + Method: "PUT", + PathPattern: "/v1/post_mortems/reports/{report_id}/reasons/order", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDRetrospectivesExportReader{formats: a.formats}, + Reader: &ReorderPostMortemReasonsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -985,35 +985,35 @@ func (a *Client) PostV1IncidentsIncidentIDRetrospectivesExport(params *PostV1Inc if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDRetrospectivesExportCreated) + success, ok := result.(*ReorderPostMortemReasonsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdRetrospectivesExport: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for reorder_post_mortem_reasons: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputs adds a new dynamic input field to a retrospective s dynamic input group field +ShareIncidentRetrospectives shares an incident s retrospective -Add a new dynamic input field to a dynamic input group +Share incident retrospectives with users or teams */ -func (a *Client) PostV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputs(params *PostV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputsCreated, error) { +func (a *Client) ShareIncidentRetrospectives(params *ShareIncidentRetrospectivesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ShareIncidentRetrospectivesCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputsParams() + params = NewShareIncidentRetrospectivesParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdRetrospectivesRetrospectiveIdFieldsFieldIdInputs", + ID: "share_incident_retrospectives", Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}/inputs", + PathPattern: "/v1/incidents/{incident_id}/retrospectives/share", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputsReader{formats: a.formats}, + Reader: &ShareIncidentRetrospectivesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1026,35 +1026,35 @@ func (a *Client) PostV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFie if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDRetrospectivesRetrospectiveIDFieldsFieldIDInputsCreated) + success, ok := result.(*ShareIncidentRetrospectivesCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdRetrospectivesRetrospectiveIdFieldsFieldIdInputs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for share_incident_retrospectives: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDRetrospectivesShare shares an incident s retrospective +UpdateIncidentRetrospective updates a retrospective on the incident -Share incident retrospectives with users or teams +Update a retrospective attached to an incident */ -func (a *Client) PostV1IncidentsIncidentIDRetrospectivesShare(params *PostV1IncidentsIncidentIDRetrospectivesShareParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDRetrospectivesShareCreated, error) { +func (a *Client) UpdateIncidentRetrospective(params *UpdateIncidentRetrospectiveParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentRetrospectiveOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDRetrospectivesShareParams() + params = NewUpdateIncidentRetrospectiveParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdRetrospectivesShare", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/retrospectives/share", + ID: "update_incident_retrospective", + Method: "PATCH", + PathPattern: "/v1/incidents/{incident_id}/retrospectives/{retrospective_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDRetrospectivesShareReader{formats: a.formats}, + Reader: &UpdateIncidentRetrospectiveReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1067,35 +1067,35 @@ func (a *Client) PostV1IncidentsIncidentIDRetrospectivesShare(params *PostV1Inci if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDRetrospectivesShareCreated) + success, ok := result.(*UpdateIncidentRetrospectiveOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdRetrospectivesShare: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_incident_retrospective: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1PostMortemsReports creates a retrospective report +UpdateIncidentRetrospectiveField updates the value on a retrospective field -Create a report +Update retrospective field value */ -func (a *Client) PostV1PostMortemsReports(params *PostV1PostMortemsReportsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1PostMortemsReportsCreated, error) { +func (a *Client) UpdateIncidentRetrospectiveField(params *UpdateIncidentRetrospectiveFieldParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentRetrospectiveFieldOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1PostMortemsReportsParams() + params = NewUpdateIncidentRetrospectiveFieldParams() } op := &runtime.ClientOperation{ - ID: "postV1PostMortemsReports", - Method: "POST", - PathPattern: "/v1/post_mortems/reports", + ID: "update_incident_retrospective_field", + Method: "PATCH", + PathPattern: "/v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1PostMortemsReportsReader{formats: a.formats}, + Reader: &UpdateIncidentRetrospectiveFieldReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1108,35 +1108,35 @@ func (a *Client) PostV1PostMortemsReports(params *PostV1PostMortemsReportsParams if err != nil { return nil, err } - success, ok := result.(*PostV1PostMortemsReportsCreated) + success, ok := result.(*UpdateIncidentRetrospectiveFieldOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1PostMortemsReports: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_incident_retrospective_field: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1PostMortemsReportsReportIDPublish publishes a retrospective report +UpdatePostMortemField updates a retrospective field -Marks an incident retrospective as published and emails all of the participants in the report the summary +Update a field value on a post mortem report */ -func (a *Client) PostV1PostMortemsReportsReportIDPublish(params *PostV1PostMortemsReportsReportIDPublishParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1PostMortemsReportsReportIDPublishCreated, error) { +func (a *Client) UpdatePostMortemField(params *UpdatePostMortemFieldParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePostMortemFieldOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1PostMortemsReportsReportIDPublishParams() + params = NewUpdatePostMortemFieldParams() } op := &runtime.ClientOperation{ - ID: "postV1PostMortemsReportsReportIdPublish", - Method: "POST", - PathPattern: "/v1/post_mortems/reports/{report_id}/publish", + ID: "update_post_mortem_field", + Method: "PATCH", + PathPattern: "/v1/post_mortems/reports/{report_id}/fields/{field_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1PostMortemsReportsReportIDPublishReader{formats: a.formats}, + Reader: &UpdatePostMortemFieldReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1149,35 +1149,35 @@ func (a *Client) PostV1PostMortemsReportsReportIDPublish(params *PostV1PostMorte if err != nil { return nil, err } - success, ok := result.(*PostV1PostMortemsReportsReportIDPublishCreated) + success, ok := result.(*UpdatePostMortemFieldOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1PostMortemsReportsReportIdPublish: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_post_mortem_field: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1PostMortemsReportsReportIDReasons creates a contributing factor for a retrospective report +UpdatePostMortemQuestions updates retrospective questions -Add a new contributing factor to an incident +Update the questions configured to be provided and filled out on future retrospective reports. */ -func (a *Client) PostV1PostMortemsReportsReportIDReasons(params *PostV1PostMortemsReportsReportIDReasonsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1PostMortemsReportsReportIDReasonsCreated, error) { +func (a *Client) UpdatePostMortemQuestions(params *UpdatePostMortemQuestionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePostMortemQuestionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1PostMortemsReportsReportIDReasonsParams() + params = NewUpdatePostMortemQuestionsParams() } op := &runtime.ClientOperation{ - ID: "postV1PostMortemsReportsReportIdReasons", - Method: "POST", - PathPattern: "/v1/post_mortems/reports/{report_id}/reasons", + ID: "update_post_mortem_questions", + Method: "PUT", + PathPattern: "/v1/post_mortems/questions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1PostMortemsReportsReportIDReasonsReader{formats: a.formats}, + Reader: &UpdatePostMortemQuestionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1190,35 +1190,35 @@ func (a *Client) PostV1PostMortemsReportsReportIDReasons(params *PostV1PostMorte if err != nil { return nil, err } - success, ok := result.(*PostV1PostMortemsReportsReportIDReasonsCreated) + success, ok := result.(*UpdatePostMortemQuestionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1PostMortemsReportsReportIdReasons: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_post_mortem_questions: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1RetrospectiveTemplates creates a retrospective template +UpdatePostMortemReason updates a contributing factor in a retrospective report -Create a new retrospective template +Update a contributing factor */ -func (a *Client) PostV1RetrospectiveTemplates(params *PostV1RetrospectiveTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1RetrospectiveTemplatesCreated, error) { +func (a *Client) UpdatePostMortemReason(params *UpdatePostMortemReasonParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePostMortemReasonOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1RetrospectiveTemplatesParams() + params = NewUpdatePostMortemReasonParams() } op := &runtime.ClientOperation{ - ID: "postV1RetrospectiveTemplates", - Method: "POST", - PathPattern: "/v1/retrospective_templates", + ID: "update_post_mortem_reason", + Method: "PATCH", + PathPattern: "/v1/post_mortems/reports/{report_id}/reasons/{reason_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1RetrospectiveTemplatesReader{formats: a.formats}, + Reader: &UpdatePostMortemReasonReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1231,35 +1231,35 @@ func (a *Client) PostV1RetrospectiveTemplates(params *PostV1RetrospectiveTemplat if err != nil { return nil, err } - success, ok := result.(*PostV1RetrospectiveTemplatesCreated) + success, ok := result.(*UpdatePostMortemReasonOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1RetrospectiveTemplates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_post_mortem_reason: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1PostMortemsQuestions updates retrospective questions +UpdatePostMortemReport updates a retrospective report -Update the questions configured to be provided and filled out on future retrospective reports. +Update a report */ -func (a *Client) PutV1PostMortemsQuestions(params *PutV1PostMortemsQuestionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1PostMortemsQuestionsOK, error) { +func (a *Client) UpdatePostMortemReport(params *UpdatePostMortemReportParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePostMortemReportOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1PostMortemsQuestionsParams() + params = NewUpdatePostMortemReportParams() } op := &runtime.ClientOperation{ - ID: "putV1PostMortemsQuestions", - Method: "PUT", - PathPattern: "/v1/post_mortems/questions", + ID: "update_post_mortem_report", + Method: "PATCH", + PathPattern: "/v1/post_mortems/reports/{report_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1PostMortemsQuestionsReader{formats: a.formats}, + Reader: &UpdatePostMortemReportReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1272,35 +1272,35 @@ func (a *Client) PutV1PostMortemsQuestions(params *PutV1PostMortemsQuestionsPara if err != nil { return nil, err } - success, ok := result.(*PutV1PostMortemsQuestionsOK) + success, ok := result.(*UpdatePostMortemReportOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1PostMortemsQuestions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_post_mortem_report: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1PostMortemsReportsReportIDReasonsOrder reorders a contributing factor for a retrospective report +UpdateRetrospectiveTemplate updates a retrospective template -Update the order of contributing factors in a retrospective report +Update a single retrospective template */ -func (a *Client) PutV1PostMortemsReportsReportIDReasonsOrder(params *PutV1PostMortemsReportsReportIDReasonsOrderParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1PostMortemsReportsReportIDReasonsOrderOK, error) { +func (a *Client) UpdateRetrospectiveTemplate(params *UpdateRetrospectiveTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateRetrospectiveTemplateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1PostMortemsReportsReportIDReasonsOrderParams() + params = NewUpdateRetrospectiveTemplateParams() } op := &runtime.ClientOperation{ - ID: "putV1PostMortemsReportsReportIdReasonsOrder", - Method: "PUT", - PathPattern: "/v1/post_mortems/reports/{report_id}/reasons/order", + ID: "update_retrospective_template", + Method: "PATCH", + PathPattern: "/v1/retrospective_templates/{retrospective_template_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1PostMortemsReportsReportIDReasonsOrderReader{formats: a.formats}, + Reader: &UpdateRetrospectiveTemplateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1313,13 +1313,13 @@ func (a *Client) PutV1PostMortemsReportsReportIDReasonsOrder(params *PutV1PostMo if err != nil { return nil, err } - success, ok := result.(*PutV1PostMortemsReportsReportIDReasonsOrderOK) + success, ok := result.(*UpdateRetrospectiveTemplateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1PostMortemsReportsReportIdReasonsOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_retrospective_template: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/retrospectives/share_incident_retrospectives_parameters.go b/client/retrospectives/share_incident_retrospectives_parameters.go new file mode 100644 index 0000000..6477bc0 --- /dev/null +++ b/client/retrospectives/share_incident_retrospectives_parameters.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewShareIncidentRetrospectivesParams creates a new ShareIncidentRetrospectivesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewShareIncidentRetrospectivesParams() *ShareIncidentRetrospectivesParams { + return &ShareIncidentRetrospectivesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewShareIncidentRetrospectivesParamsWithTimeout creates a new ShareIncidentRetrospectivesParams object +// with the ability to set a timeout on a request. +func NewShareIncidentRetrospectivesParamsWithTimeout(timeout time.Duration) *ShareIncidentRetrospectivesParams { + return &ShareIncidentRetrospectivesParams{ + timeout: timeout, + } +} + +// NewShareIncidentRetrospectivesParamsWithContext creates a new ShareIncidentRetrospectivesParams object +// with the ability to set a context for a request. +func NewShareIncidentRetrospectivesParamsWithContext(ctx context.Context) *ShareIncidentRetrospectivesParams { + return &ShareIncidentRetrospectivesParams{ + Context: ctx, + } +} + +// NewShareIncidentRetrospectivesParamsWithHTTPClient creates a new ShareIncidentRetrospectivesParams object +// with the ability to set a custom HTTPClient for a request. +func NewShareIncidentRetrospectivesParamsWithHTTPClient(client *http.Client) *ShareIncidentRetrospectivesParams { + return &ShareIncidentRetrospectivesParams{ + HTTPClient: client, + } +} + +/* +ShareIncidentRetrospectivesParams contains all the parameters to send to the API endpoint + + for the share incident retrospectives operation. + + Typically these are written to a http.Request. +*/ +type ShareIncidentRetrospectivesParams struct { + + // IncidentID. + IncidentID string + + /* RetrospectiveIds. + + An array of retrospective IDs to share + */ + RetrospectiveIds []string + + /* TeamIds. + + An array of team IDs with whom to share the report + */ + TeamIds []string + + /* UserIds. + + An array of user IDs with whom to share the report + */ + UserIds []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the share incident retrospectives params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ShareIncidentRetrospectivesParams) WithDefaults() *ShareIncidentRetrospectivesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the share incident retrospectives params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ShareIncidentRetrospectivesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the share incident retrospectives params +func (o *ShareIncidentRetrospectivesParams) WithTimeout(timeout time.Duration) *ShareIncidentRetrospectivesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the share incident retrospectives params +func (o *ShareIncidentRetrospectivesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the share incident retrospectives params +func (o *ShareIncidentRetrospectivesParams) WithContext(ctx context.Context) *ShareIncidentRetrospectivesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the share incident retrospectives params +func (o *ShareIncidentRetrospectivesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the share incident retrospectives params +func (o *ShareIncidentRetrospectivesParams) WithHTTPClient(client *http.Client) *ShareIncidentRetrospectivesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the share incident retrospectives params +func (o *ShareIncidentRetrospectivesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the share incident retrospectives params +func (o *ShareIncidentRetrospectivesParams) WithIncidentID(incidentID string) *ShareIncidentRetrospectivesParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the share incident retrospectives params +func (o *ShareIncidentRetrospectivesParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithRetrospectiveIds adds the retrospectiveIds to the share incident retrospectives params +func (o *ShareIncidentRetrospectivesParams) WithRetrospectiveIds(retrospectiveIds []string) *ShareIncidentRetrospectivesParams { + o.SetRetrospectiveIds(retrospectiveIds) + return o +} + +// SetRetrospectiveIds adds the retrospectiveIds to the share incident retrospectives params +func (o *ShareIncidentRetrospectivesParams) SetRetrospectiveIds(retrospectiveIds []string) { + o.RetrospectiveIds = retrospectiveIds +} + +// WithTeamIds adds the teamIds to the share incident retrospectives params +func (o *ShareIncidentRetrospectivesParams) WithTeamIds(teamIds []string) *ShareIncidentRetrospectivesParams { + o.SetTeamIds(teamIds) + return o +} + +// SetTeamIds adds the teamIds to the share incident retrospectives params +func (o *ShareIncidentRetrospectivesParams) SetTeamIds(teamIds []string) { + o.TeamIds = teamIds +} + +// WithUserIds adds the userIds to the share incident retrospectives params +func (o *ShareIncidentRetrospectivesParams) WithUserIds(userIds []string) *ShareIncidentRetrospectivesParams { + o.SetUserIds(userIds) + return o +} + +// SetUserIds adds the userIds to the share incident retrospectives params +func (o *ShareIncidentRetrospectivesParams) SetUserIds(userIds []string) { + o.UserIds = userIds +} + +// WriteToRequest writes these params to a swagger request +func (o *ShareIncidentRetrospectivesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if o.RetrospectiveIds != nil { + + // binding items for retrospective_ids + joinedRetrospectiveIds := o.bindParamRetrospectiveIds(reg) + + // form array param retrospective_ids + if err := r.SetFormParam("retrospective_ids", joinedRetrospectiveIds...); err != nil { + return err + } + } + + if o.TeamIds != nil { + + // binding items for team_ids + joinedTeamIds := o.bindParamTeamIds(reg) + + // form array param team_ids + if err := r.SetFormParam("team_ids", joinedTeamIds...); err != nil { + return err + } + } + + if o.UserIds != nil { + + // binding items for user_ids + joinedUserIds := o.bindParamUserIds(reg) + + // form array param user_ids + if err := r.SetFormParam("user_ids", joinedUserIds...); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamShareIncidentRetrospectives binds the parameter retrospective_ids +func (o *ShareIncidentRetrospectivesParams) bindParamRetrospectiveIds(formats strfmt.Registry) []string { + retrospectiveIdsIR := o.RetrospectiveIds + + var retrospectiveIdsIC []string + for _, retrospectiveIdsIIR := range retrospectiveIdsIR { // explode []string + + retrospectiveIdsIIV := retrospectiveIdsIIR // string as string + retrospectiveIdsIC = append(retrospectiveIdsIC, retrospectiveIdsIIV) + } + + // items.CollectionFormat: "" + retrospectiveIdsIS := swag.JoinByFormat(retrospectiveIdsIC, "") + + return retrospectiveIdsIS +} + +// bindParamShareIncidentRetrospectives binds the parameter team_ids +func (o *ShareIncidentRetrospectivesParams) bindParamTeamIds(formats strfmt.Registry) []string { + teamIdsIR := o.TeamIds + + var teamIdsIC []string + for _, teamIdsIIR := range teamIdsIR { // explode []string + + teamIdsIIV := teamIdsIIR // string as string + teamIdsIC = append(teamIdsIC, teamIdsIIV) + } + + // items.CollectionFormat: "" + teamIdsIS := swag.JoinByFormat(teamIdsIC, "") + + return teamIdsIS +} + +// bindParamShareIncidentRetrospectives binds the parameter user_ids +func (o *ShareIncidentRetrospectivesParams) bindParamUserIds(formats strfmt.Registry) []string { + userIdsIR := o.UserIds + + var userIdsIC []string + for _, userIdsIIR := range userIdsIR { // explode []string + + userIdsIIV := userIdsIIR // string as string + userIdsIC = append(userIdsIC, userIdsIIV) + } + + // items.CollectionFormat: "" + userIdsIS := swag.JoinByFormat(userIdsIC, "") + + return userIdsIS +} diff --git a/client/retrospectives/share_incident_retrospectives_responses.go b/client/retrospectives/share_incident_retrospectives_responses.go new file mode 100644 index 0000000..35c10f1 --- /dev/null +++ b/client/retrospectives/share_incident_retrospectives_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ShareIncidentRetrospectivesReader is a Reader for the ShareIncidentRetrospectives structure. +type ShareIncidentRetrospectivesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ShareIncidentRetrospectivesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewShareIncidentRetrospectivesCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewShareIncidentRetrospectivesCreated creates a ShareIncidentRetrospectivesCreated with default headers values +func NewShareIncidentRetrospectivesCreated() *ShareIncidentRetrospectivesCreated { + return &ShareIncidentRetrospectivesCreated{} +} + +/* +ShareIncidentRetrospectivesCreated describes a response with status code 201, with default header values. + +Share incident retrospectives with users or teams +*/ +type ShareIncidentRetrospectivesCreated struct { + Payload *models.IncidentsShareRetrospectivesResultEntity +} + +// IsSuccess returns true when this share incident retrospectives created response has a 2xx status code +func (o *ShareIncidentRetrospectivesCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this share incident retrospectives created response has a 3xx status code +func (o *ShareIncidentRetrospectivesCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this share incident retrospectives created response has a 4xx status code +func (o *ShareIncidentRetrospectivesCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this share incident retrospectives created response has a 5xx status code +func (o *ShareIncidentRetrospectivesCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this share incident retrospectives created response a status code equal to that given +func (o *ShareIncidentRetrospectivesCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *ShareIncidentRetrospectivesCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/retrospectives/share][%d] shareIncidentRetrospectivesCreated %+v", 201, o.Payload) +} + +func (o *ShareIncidentRetrospectivesCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/retrospectives/share][%d] shareIncidentRetrospectivesCreated %+v", 201, o.Payload) +} + +func (o *ShareIncidentRetrospectivesCreated) GetPayload() *models.IncidentsShareRetrospectivesResultEntity { + return o.Payload +} + +func (o *ShareIncidentRetrospectivesCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsShareRetrospectivesResultEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/update_incident_retrospective_field_parameters.go b/client/retrospectives/update_incident_retrospective_field_parameters.go new file mode 100644 index 0000000..ede36f5 --- /dev/null +++ b/client/retrospectives/update_incident_retrospective_field_parameters.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateIncidentRetrospectiveFieldParams creates a new UpdateIncidentRetrospectiveFieldParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIncidentRetrospectiveFieldParams() *UpdateIncidentRetrospectiveFieldParams { + return &UpdateIncidentRetrospectiveFieldParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIncidentRetrospectiveFieldParamsWithTimeout creates a new UpdateIncidentRetrospectiveFieldParams object +// with the ability to set a timeout on a request. +func NewUpdateIncidentRetrospectiveFieldParamsWithTimeout(timeout time.Duration) *UpdateIncidentRetrospectiveFieldParams { + return &UpdateIncidentRetrospectiveFieldParams{ + timeout: timeout, + } +} + +// NewUpdateIncidentRetrospectiveFieldParamsWithContext creates a new UpdateIncidentRetrospectiveFieldParams object +// with the ability to set a context for a request. +func NewUpdateIncidentRetrospectiveFieldParamsWithContext(ctx context.Context) *UpdateIncidentRetrospectiveFieldParams { + return &UpdateIncidentRetrospectiveFieldParams{ + Context: ctx, + } +} + +// NewUpdateIncidentRetrospectiveFieldParamsWithHTTPClient creates a new UpdateIncidentRetrospectiveFieldParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIncidentRetrospectiveFieldParamsWithHTTPClient(client *http.Client) *UpdateIncidentRetrospectiveFieldParams { + return &UpdateIncidentRetrospectiveFieldParams{ + HTTPClient: client, + } +} + +/* +UpdateIncidentRetrospectiveFieldParams contains all the parameters to send to the API endpoint + + for the update incident retrospective field operation. + + Typically these are written to a http.Request. +*/ +type UpdateIncidentRetrospectiveFieldParams struct { + + // FieldID. + FieldID string + + // IncidentID. + IncidentID string + + // RetrospectiveID. + RetrospectiveID string + + // UpdateIncidentRetrospectiveField. + UpdateIncidentRetrospectiveField *models.UpdateIncidentRetrospectiveField + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update incident retrospective field params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentRetrospectiveFieldParams) WithDefaults() *UpdateIncidentRetrospectiveFieldParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update incident retrospective field params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentRetrospectiveFieldParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update incident retrospective field params +func (o *UpdateIncidentRetrospectiveFieldParams) WithTimeout(timeout time.Duration) *UpdateIncidentRetrospectiveFieldParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update incident retrospective field params +func (o *UpdateIncidentRetrospectiveFieldParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update incident retrospective field params +func (o *UpdateIncidentRetrospectiveFieldParams) WithContext(ctx context.Context) *UpdateIncidentRetrospectiveFieldParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update incident retrospective field params +func (o *UpdateIncidentRetrospectiveFieldParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update incident retrospective field params +func (o *UpdateIncidentRetrospectiveFieldParams) WithHTTPClient(client *http.Client) *UpdateIncidentRetrospectiveFieldParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update incident retrospective field params +func (o *UpdateIncidentRetrospectiveFieldParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFieldID adds the fieldID to the update incident retrospective field params +func (o *UpdateIncidentRetrospectiveFieldParams) WithFieldID(fieldID string) *UpdateIncidentRetrospectiveFieldParams { + o.SetFieldID(fieldID) + return o +} + +// SetFieldID adds the fieldId to the update incident retrospective field params +func (o *UpdateIncidentRetrospectiveFieldParams) SetFieldID(fieldID string) { + o.FieldID = fieldID +} + +// WithIncidentID adds the incidentID to the update incident retrospective field params +func (o *UpdateIncidentRetrospectiveFieldParams) WithIncidentID(incidentID string) *UpdateIncidentRetrospectiveFieldParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the update incident retrospective field params +func (o *UpdateIncidentRetrospectiveFieldParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithRetrospectiveID adds the retrospectiveID to the update incident retrospective field params +func (o *UpdateIncidentRetrospectiveFieldParams) WithRetrospectiveID(retrospectiveID string) *UpdateIncidentRetrospectiveFieldParams { + o.SetRetrospectiveID(retrospectiveID) + return o +} + +// SetRetrospectiveID adds the retrospectiveId to the update incident retrospective field params +func (o *UpdateIncidentRetrospectiveFieldParams) SetRetrospectiveID(retrospectiveID string) { + o.RetrospectiveID = retrospectiveID +} + +// WithUpdateIncidentRetrospectiveField adds the updateIncidentRetrospectiveField to the update incident retrospective field params +func (o *UpdateIncidentRetrospectiveFieldParams) WithUpdateIncidentRetrospectiveField(updateIncidentRetrospectiveField *models.UpdateIncidentRetrospectiveField) *UpdateIncidentRetrospectiveFieldParams { + o.SetUpdateIncidentRetrospectiveField(updateIncidentRetrospectiveField) + return o +} + +// SetUpdateIncidentRetrospectiveField adds the updateIncidentRetrospectiveField to the update incident retrospective field params +func (o *UpdateIncidentRetrospectiveFieldParams) SetUpdateIncidentRetrospectiveField(updateIncidentRetrospectiveField *models.UpdateIncidentRetrospectiveField) { + o.UpdateIncidentRetrospectiveField = updateIncidentRetrospectiveField +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIncidentRetrospectiveFieldParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param field_id + if err := r.SetPathParam("field_id", o.FieldID); err != nil { + return err + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param retrospective_id + if err := r.SetPathParam("retrospective_id", o.RetrospectiveID); err != nil { + return err + } + if o.UpdateIncidentRetrospectiveField != nil { + if err := r.SetBodyParam(o.UpdateIncidentRetrospectiveField); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/update_incident_retrospective_field_responses.go b/client/retrospectives/update_incident_retrospective_field_responses.go new file mode 100644 index 0000000..2fdf172 --- /dev/null +++ b/client/retrospectives/update_incident_retrospective_field_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateIncidentRetrospectiveFieldReader is a Reader for the UpdateIncidentRetrospectiveField structure. +type UpdateIncidentRetrospectiveFieldReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIncidentRetrospectiveFieldReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIncidentRetrospectiveFieldOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIncidentRetrospectiveFieldOK creates a UpdateIncidentRetrospectiveFieldOK with default headers values +func NewUpdateIncidentRetrospectiveFieldOK() *UpdateIncidentRetrospectiveFieldOK { + return &UpdateIncidentRetrospectiveFieldOK{} +} + +/* +UpdateIncidentRetrospectiveFieldOK describes a response with status code 200, with default header values. + +Update retrospective field value +*/ +type UpdateIncidentRetrospectiveFieldOK struct { + Payload *models.IncidentsRetrospectiveFieldEntity +} + +// IsSuccess returns true when this update incident retrospective field o k response has a 2xx status code +func (o *UpdateIncidentRetrospectiveFieldOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update incident retrospective field o k response has a 3xx status code +func (o *UpdateIncidentRetrospectiveFieldOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident retrospective field o k response has a 4xx status code +func (o *UpdateIncidentRetrospectiveFieldOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update incident retrospective field o k response has a 5xx status code +func (o *UpdateIncidentRetrospectiveFieldOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident retrospective field o k response a status code equal to that given +func (o *UpdateIncidentRetrospectiveFieldOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateIncidentRetrospectiveFieldOK) Error() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}][%d] updateIncidentRetrospectiveFieldOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentRetrospectiveFieldOK) String() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/retrospectives/{retrospective_id}/fields/{field_id}][%d] updateIncidentRetrospectiveFieldOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentRetrospectiveFieldOK) GetPayload() *models.IncidentsRetrospectiveFieldEntity { + return o.Payload +} + +func (o *UpdateIncidentRetrospectiveFieldOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRetrospectiveFieldEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/update_incident_retrospective_parameters.go b/client/retrospectives/update_incident_retrospective_parameters.go new file mode 100644 index 0000000..24b1384 --- /dev/null +++ b/client/retrospectives/update_incident_retrospective_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateIncidentRetrospectiveParams creates a new UpdateIncidentRetrospectiveParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIncidentRetrospectiveParams() *UpdateIncidentRetrospectiveParams { + return &UpdateIncidentRetrospectiveParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIncidentRetrospectiveParamsWithTimeout creates a new UpdateIncidentRetrospectiveParams object +// with the ability to set a timeout on a request. +func NewUpdateIncidentRetrospectiveParamsWithTimeout(timeout time.Duration) *UpdateIncidentRetrospectiveParams { + return &UpdateIncidentRetrospectiveParams{ + timeout: timeout, + } +} + +// NewUpdateIncidentRetrospectiveParamsWithContext creates a new UpdateIncidentRetrospectiveParams object +// with the ability to set a context for a request. +func NewUpdateIncidentRetrospectiveParamsWithContext(ctx context.Context) *UpdateIncidentRetrospectiveParams { + return &UpdateIncidentRetrospectiveParams{ + Context: ctx, + } +} + +// NewUpdateIncidentRetrospectiveParamsWithHTTPClient creates a new UpdateIncidentRetrospectiveParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIncidentRetrospectiveParamsWithHTTPClient(client *http.Client) *UpdateIncidentRetrospectiveParams { + return &UpdateIncidentRetrospectiveParams{ + HTTPClient: client, + } +} + +/* +UpdateIncidentRetrospectiveParams contains all the parameters to send to the API endpoint + + for the update incident retrospective operation. + + Typically these are written to a http.Request. +*/ +type UpdateIncidentRetrospectiveParams struct { + + // IncidentID. + IncidentID string + + // RetrospectiveID. + RetrospectiveID string + + // UpdateIncidentRetrospective. + UpdateIncidentRetrospective *models.UpdateIncidentRetrospective + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update incident retrospective params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentRetrospectiveParams) WithDefaults() *UpdateIncidentRetrospectiveParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update incident retrospective params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentRetrospectiveParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update incident retrospective params +func (o *UpdateIncidentRetrospectiveParams) WithTimeout(timeout time.Duration) *UpdateIncidentRetrospectiveParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update incident retrospective params +func (o *UpdateIncidentRetrospectiveParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update incident retrospective params +func (o *UpdateIncidentRetrospectiveParams) WithContext(ctx context.Context) *UpdateIncidentRetrospectiveParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update incident retrospective params +func (o *UpdateIncidentRetrospectiveParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update incident retrospective params +func (o *UpdateIncidentRetrospectiveParams) WithHTTPClient(client *http.Client) *UpdateIncidentRetrospectiveParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update incident retrospective params +func (o *UpdateIncidentRetrospectiveParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the update incident retrospective params +func (o *UpdateIncidentRetrospectiveParams) WithIncidentID(incidentID string) *UpdateIncidentRetrospectiveParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the update incident retrospective params +func (o *UpdateIncidentRetrospectiveParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithRetrospectiveID adds the retrospectiveID to the update incident retrospective params +func (o *UpdateIncidentRetrospectiveParams) WithRetrospectiveID(retrospectiveID string) *UpdateIncidentRetrospectiveParams { + o.SetRetrospectiveID(retrospectiveID) + return o +} + +// SetRetrospectiveID adds the retrospectiveId to the update incident retrospective params +func (o *UpdateIncidentRetrospectiveParams) SetRetrospectiveID(retrospectiveID string) { + o.RetrospectiveID = retrospectiveID +} + +// WithUpdateIncidentRetrospective adds the updateIncidentRetrospective to the update incident retrospective params +func (o *UpdateIncidentRetrospectiveParams) WithUpdateIncidentRetrospective(updateIncidentRetrospective *models.UpdateIncidentRetrospective) *UpdateIncidentRetrospectiveParams { + o.SetUpdateIncidentRetrospective(updateIncidentRetrospective) + return o +} + +// SetUpdateIncidentRetrospective adds the updateIncidentRetrospective to the update incident retrospective params +func (o *UpdateIncidentRetrospectiveParams) SetUpdateIncidentRetrospective(updateIncidentRetrospective *models.UpdateIncidentRetrospective) { + o.UpdateIncidentRetrospective = updateIncidentRetrospective +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIncidentRetrospectiveParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param retrospective_id + if err := r.SetPathParam("retrospective_id", o.RetrospectiveID); err != nil { + return err + } + if o.UpdateIncidentRetrospective != nil { + if err := r.SetBodyParam(o.UpdateIncidentRetrospective); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/update_incident_retrospective_responses.go b/client/retrospectives/update_incident_retrospective_responses.go new file mode 100644 index 0000000..3a176fd --- /dev/null +++ b/client/retrospectives/update_incident_retrospective_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateIncidentRetrospectiveReader is a Reader for the UpdateIncidentRetrospective structure. +type UpdateIncidentRetrospectiveReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIncidentRetrospectiveReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIncidentRetrospectiveOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIncidentRetrospectiveOK creates a UpdateIncidentRetrospectiveOK with default headers values +func NewUpdateIncidentRetrospectiveOK() *UpdateIncidentRetrospectiveOK { + return &UpdateIncidentRetrospectiveOK{} +} + +/* +UpdateIncidentRetrospectiveOK describes a response with status code 200, with default header values. + +Update a retrospective attached to an incident +*/ +type UpdateIncidentRetrospectiveOK struct { + Payload *models.IncidentsRetrospectiveEntity +} + +// IsSuccess returns true when this update incident retrospective o k response has a 2xx status code +func (o *UpdateIncidentRetrospectiveOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update incident retrospective o k response has a 3xx status code +func (o *UpdateIncidentRetrospectiveOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident retrospective o k response has a 4xx status code +func (o *UpdateIncidentRetrospectiveOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update incident retrospective o k response has a 5xx status code +func (o *UpdateIncidentRetrospectiveOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident retrospective o k response a status code equal to that given +func (o *UpdateIncidentRetrospectiveOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateIncidentRetrospectiveOK) Error() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/retrospectives/{retrospective_id}][%d] updateIncidentRetrospectiveOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentRetrospectiveOK) String() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/retrospectives/{retrospective_id}][%d] updateIncidentRetrospectiveOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentRetrospectiveOK) GetPayload() *models.IncidentsRetrospectiveEntity { + return o.Payload +} + +func (o *UpdateIncidentRetrospectiveOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IncidentsRetrospectiveEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/update_post_mortem_field_parameters.go b/client/retrospectives/update_post_mortem_field_parameters.go new file mode 100644 index 0000000..e9351c8 --- /dev/null +++ b/client/retrospectives/update_post_mortem_field_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdatePostMortemFieldParams creates a new UpdatePostMortemFieldParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdatePostMortemFieldParams() *UpdatePostMortemFieldParams { + return &UpdatePostMortemFieldParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdatePostMortemFieldParamsWithTimeout creates a new UpdatePostMortemFieldParams object +// with the ability to set a timeout on a request. +func NewUpdatePostMortemFieldParamsWithTimeout(timeout time.Duration) *UpdatePostMortemFieldParams { + return &UpdatePostMortemFieldParams{ + timeout: timeout, + } +} + +// NewUpdatePostMortemFieldParamsWithContext creates a new UpdatePostMortemFieldParams object +// with the ability to set a context for a request. +func NewUpdatePostMortemFieldParamsWithContext(ctx context.Context) *UpdatePostMortemFieldParams { + return &UpdatePostMortemFieldParams{ + Context: ctx, + } +} + +// NewUpdatePostMortemFieldParamsWithHTTPClient creates a new UpdatePostMortemFieldParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdatePostMortemFieldParamsWithHTTPClient(client *http.Client) *UpdatePostMortemFieldParams { + return &UpdatePostMortemFieldParams{ + HTTPClient: client, + } +} + +/* +UpdatePostMortemFieldParams contains all the parameters to send to the API endpoint + + for the update post mortem field operation. + + Typically these are written to a http.Request. +*/ +type UpdatePostMortemFieldParams struct { + + // FieldID. + FieldID string + + // ReportID. + ReportID string + + // UpdatePostMortemField. + UpdatePostMortemField *models.UpdatePostMortemField + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update post mortem field params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePostMortemFieldParams) WithDefaults() *UpdatePostMortemFieldParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update post mortem field params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePostMortemFieldParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update post mortem field params +func (o *UpdatePostMortemFieldParams) WithTimeout(timeout time.Duration) *UpdatePostMortemFieldParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update post mortem field params +func (o *UpdatePostMortemFieldParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update post mortem field params +func (o *UpdatePostMortemFieldParams) WithContext(ctx context.Context) *UpdatePostMortemFieldParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update post mortem field params +func (o *UpdatePostMortemFieldParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update post mortem field params +func (o *UpdatePostMortemFieldParams) WithHTTPClient(client *http.Client) *UpdatePostMortemFieldParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update post mortem field params +func (o *UpdatePostMortemFieldParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFieldID adds the fieldID to the update post mortem field params +func (o *UpdatePostMortemFieldParams) WithFieldID(fieldID string) *UpdatePostMortemFieldParams { + o.SetFieldID(fieldID) + return o +} + +// SetFieldID adds the fieldId to the update post mortem field params +func (o *UpdatePostMortemFieldParams) SetFieldID(fieldID string) { + o.FieldID = fieldID +} + +// WithReportID adds the reportID to the update post mortem field params +func (o *UpdatePostMortemFieldParams) WithReportID(reportID string) *UpdatePostMortemFieldParams { + o.SetReportID(reportID) + return o +} + +// SetReportID adds the reportId to the update post mortem field params +func (o *UpdatePostMortemFieldParams) SetReportID(reportID string) { + o.ReportID = reportID +} + +// WithUpdatePostMortemField adds the updatePostMortemField to the update post mortem field params +func (o *UpdatePostMortemFieldParams) WithUpdatePostMortemField(updatePostMortemField *models.UpdatePostMortemField) *UpdatePostMortemFieldParams { + o.SetUpdatePostMortemField(updatePostMortemField) + return o +} + +// SetUpdatePostMortemField adds the updatePostMortemField to the update post mortem field params +func (o *UpdatePostMortemFieldParams) SetUpdatePostMortemField(updatePostMortemField *models.UpdatePostMortemField) { + o.UpdatePostMortemField = updatePostMortemField +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdatePostMortemFieldParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param field_id + if err := r.SetPathParam("field_id", o.FieldID); err != nil { + return err + } + + // path param report_id + if err := r.SetPathParam("report_id", o.ReportID); err != nil { + return err + } + if o.UpdatePostMortemField != nil { + if err := r.SetBodyParam(o.UpdatePostMortemField); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/update_post_mortem_field_responses.go b/client/retrospectives/update_post_mortem_field_responses.go new file mode 100644 index 0000000..1adc3d2 --- /dev/null +++ b/client/retrospectives/update_post_mortem_field_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdatePostMortemFieldReader is a Reader for the UpdatePostMortemField structure. +type UpdatePostMortemFieldReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdatePostMortemFieldReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdatePostMortemFieldOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdatePostMortemFieldOK creates a UpdatePostMortemFieldOK with default headers values +func NewUpdatePostMortemFieldOK() *UpdatePostMortemFieldOK { + return &UpdatePostMortemFieldOK{} +} + +/* +UpdatePostMortemFieldOK describes a response with status code 200, with default header values. + +Update a field value on a post mortem report +*/ +type UpdatePostMortemFieldOK struct { + Payload *models.PostMortemsSectionFieldEntity +} + +// IsSuccess returns true when this update post mortem field o k response has a 2xx status code +func (o *UpdatePostMortemFieldOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update post mortem field o k response has a 3xx status code +func (o *UpdatePostMortemFieldOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update post mortem field o k response has a 4xx status code +func (o *UpdatePostMortemFieldOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update post mortem field o k response has a 5xx status code +func (o *UpdatePostMortemFieldOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update post mortem field o k response a status code equal to that given +func (o *UpdatePostMortemFieldOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdatePostMortemFieldOK) Error() string { + return fmt.Sprintf("[PATCH /v1/post_mortems/reports/{report_id}/fields/{field_id}][%d] updatePostMortemFieldOK %+v", 200, o.Payload) +} + +func (o *UpdatePostMortemFieldOK) String() string { + return fmt.Sprintf("[PATCH /v1/post_mortems/reports/{report_id}/fields/{field_id}][%d] updatePostMortemFieldOK %+v", 200, o.Payload) +} + +func (o *UpdatePostMortemFieldOK) GetPayload() *models.PostMortemsSectionFieldEntity { + return o.Payload +} + +func (o *UpdatePostMortemFieldOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PostMortemsSectionFieldEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/update_post_mortem_questions_parameters.go b/client/retrospectives/update_post_mortem_questions_parameters.go new file mode 100644 index 0000000..193b599 --- /dev/null +++ b/client/retrospectives/update_post_mortem_questions_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdatePostMortemQuestionsParams creates a new UpdatePostMortemQuestionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdatePostMortemQuestionsParams() *UpdatePostMortemQuestionsParams { + return &UpdatePostMortemQuestionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdatePostMortemQuestionsParamsWithTimeout creates a new UpdatePostMortemQuestionsParams object +// with the ability to set a timeout on a request. +func NewUpdatePostMortemQuestionsParamsWithTimeout(timeout time.Duration) *UpdatePostMortemQuestionsParams { + return &UpdatePostMortemQuestionsParams{ + timeout: timeout, + } +} + +// NewUpdatePostMortemQuestionsParamsWithContext creates a new UpdatePostMortemQuestionsParams object +// with the ability to set a context for a request. +func NewUpdatePostMortemQuestionsParamsWithContext(ctx context.Context) *UpdatePostMortemQuestionsParams { + return &UpdatePostMortemQuestionsParams{ + Context: ctx, + } +} + +// NewUpdatePostMortemQuestionsParamsWithHTTPClient creates a new UpdatePostMortemQuestionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdatePostMortemQuestionsParamsWithHTTPClient(client *http.Client) *UpdatePostMortemQuestionsParams { + return &UpdatePostMortemQuestionsParams{ + HTTPClient: client, + } +} + +/* +UpdatePostMortemQuestionsParams contains all the parameters to send to the API endpoint + + for the update post mortem questions operation. + + Typically these are written to a http.Request. +*/ +type UpdatePostMortemQuestionsParams struct { + + // UpdatePostMortemQuestions. + UpdatePostMortemQuestions *models.UpdatePostMortemQuestions + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update post mortem questions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePostMortemQuestionsParams) WithDefaults() *UpdatePostMortemQuestionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update post mortem questions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePostMortemQuestionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update post mortem questions params +func (o *UpdatePostMortemQuestionsParams) WithTimeout(timeout time.Duration) *UpdatePostMortemQuestionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update post mortem questions params +func (o *UpdatePostMortemQuestionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update post mortem questions params +func (o *UpdatePostMortemQuestionsParams) WithContext(ctx context.Context) *UpdatePostMortemQuestionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update post mortem questions params +func (o *UpdatePostMortemQuestionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update post mortem questions params +func (o *UpdatePostMortemQuestionsParams) WithHTTPClient(client *http.Client) *UpdatePostMortemQuestionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update post mortem questions params +func (o *UpdatePostMortemQuestionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithUpdatePostMortemQuestions adds the updatePostMortemQuestions to the update post mortem questions params +func (o *UpdatePostMortemQuestionsParams) WithUpdatePostMortemQuestions(updatePostMortemQuestions *models.UpdatePostMortemQuestions) *UpdatePostMortemQuestionsParams { + o.SetUpdatePostMortemQuestions(updatePostMortemQuestions) + return o +} + +// SetUpdatePostMortemQuestions adds the updatePostMortemQuestions to the update post mortem questions params +func (o *UpdatePostMortemQuestionsParams) SetUpdatePostMortemQuestions(updatePostMortemQuestions *models.UpdatePostMortemQuestions) { + o.UpdatePostMortemQuestions = updatePostMortemQuestions +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdatePostMortemQuestionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.UpdatePostMortemQuestions != nil { + if err := r.SetBodyParam(o.UpdatePostMortemQuestions); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/update_post_mortem_questions_responses.go b/client/retrospectives/update_post_mortem_questions_responses.go new file mode 100644 index 0000000..adbbb61 --- /dev/null +++ b/client/retrospectives/update_post_mortem_questions_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdatePostMortemQuestionsReader is a Reader for the UpdatePostMortemQuestions structure. +type UpdatePostMortemQuestionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdatePostMortemQuestionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdatePostMortemQuestionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdatePostMortemQuestionsOK creates a UpdatePostMortemQuestionsOK with default headers values +func NewUpdatePostMortemQuestionsOK() *UpdatePostMortemQuestionsOK { + return &UpdatePostMortemQuestionsOK{} +} + +/* +UpdatePostMortemQuestionsOK describes a response with status code 200, with default header values. + +Update the questions configured to be provided and filled out on future retrospective reports. +*/ +type UpdatePostMortemQuestionsOK struct { + Payload *models.PostMortemsQuestionTypeEntity +} + +// IsSuccess returns true when this update post mortem questions o k response has a 2xx status code +func (o *UpdatePostMortemQuestionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update post mortem questions o k response has a 3xx status code +func (o *UpdatePostMortemQuestionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update post mortem questions o k response has a 4xx status code +func (o *UpdatePostMortemQuestionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update post mortem questions o k response has a 5xx status code +func (o *UpdatePostMortemQuestionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update post mortem questions o k response a status code equal to that given +func (o *UpdatePostMortemQuestionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdatePostMortemQuestionsOK) Error() string { + return fmt.Sprintf("[PUT /v1/post_mortems/questions][%d] updatePostMortemQuestionsOK %+v", 200, o.Payload) +} + +func (o *UpdatePostMortemQuestionsOK) String() string { + return fmt.Sprintf("[PUT /v1/post_mortems/questions][%d] updatePostMortemQuestionsOK %+v", 200, o.Payload) +} + +func (o *UpdatePostMortemQuestionsOK) GetPayload() *models.PostMortemsQuestionTypeEntity { + return o.Payload +} + +func (o *UpdatePostMortemQuestionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PostMortemsQuestionTypeEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/update_post_mortem_reason_parameters.go b/client/retrospectives/update_post_mortem_reason_parameters.go new file mode 100644 index 0000000..cc4d6f8 --- /dev/null +++ b/client/retrospectives/update_post_mortem_reason_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdatePostMortemReasonParams creates a new UpdatePostMortemReasonParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdatePostMortemReasonParams() *UpdatePostMortemReasonParams { + return &UpdatePostMortemReasonParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdatePostMortemReasonParamsWithTimeout creates a new UpdatePostMortemReasonParams object +// with the ability to set a timeout on a request. +func NewUpdatePostMortemReasonParamsWithTimeout(timeout time.Duration) *UpdatePostMortemReasonParams { + return &UpdatePostMortemReasonParams{ + timeout: timeout, + } +} + +// NewUpdatePostMortemReasonParamsWithContext creates a new UpdatePostMortemReasonParams object +// with the ability to set a context for a request. +func NewUpdatePostMortemReasonParamsWithContext(ctx context.Context) *UpdatePostMortemReasonParams { + return &UpdatePostMortemReasonParams{ + Context: ctx, + } +} + +// NewUpdatePostMortemReasonParamsWithHTTPClient creates a new UpdatePostMortemReasonParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdatePostMortemReasonParamsWithHTTPClient(client *http.Client) *UpdatePostMortemReasonParams { + return &UpdatePostMortemReasonParams{ + HTTPClient: client, + } +} + +/* +UpdatePostMortemReasonParams contains all the parameters to send to the API endpoint + + for the update post mortem reason operation. + + Typically these are written to a http.Request. +*/ +type UpdatePostMortemReasonParams struct { + + // ReasonID. + ReasonID string + + // ReportID. + ReportID string + + // UpdatePostMortemReason. + UpdatePostMortemReason *models.UpdatePostMortemReason + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update post mortem reason params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePostMortemReasonParams) WithDefaults() *UpdatePostMortemReasonParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update post mortem reason params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePostMortemReasonParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update post mortem reason params +func (o *UpdatePostMortemReasonParams) WithTimeout(timeout time.Duration) *UpdatePostMortemReasonParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update post mortem reason params +func (o *UpdatePostMortemReasonParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update post mortem reason params +func (o *UpdatePostMortemReasonParams) WithContext(ctx context.Context) *UpdatePostMortemReasonParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update post mortem reason params +func (o *UpdatePostMortemReasonParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update post mortem reason params +func (o *UpdatePostMortemReasonParams) WithHTTPClient(client *http.Client) *UpdatePostMortemReasonParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update post mortem reason params +func (o *UpdatePostMortemReasonParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithReasonID adds the reasonID to the update post mortem reason params +func (o *UpdatePostMortemReasonParams) WithReasonID(reasonID string) *UpdatePostMortemReasonParams { + o.SetReasonID(reasonID) + return o +} + +// SetReasonID adds the reasonId to the update post mortem reason params +func (o *UpdatePostMortemReasonParams) SetReasonID(reasonID string) { + o.ReasonID = reasonID +} + +// WithReportID adds the reportID to the update post mortem reason params +func (o *UpdatePostMortemReasonParams) WithReportID(reportID string) *UpdatePostMortemReasonParams { + o.SetReportID(reportID) + return o +} + +// SetReportID adds the reportId to the update post mortem reason params +func (o *UpdatePostMortemReasonParams) SetReportID(reportID string) { + o.ReportID = reportID +} + +// WithUpdatePostMortemReason adds the updatePostMortemReason to the update post mortem reason params +func (o *UpdatePostMortemReasonParams) WithUpdatePostMortemReason(updatePostMortemReason *models.UpdatePostMortemReason) *UpdatePostMortemReasonParams { + o.SetUpdatePostMortemReason(updatePostMortemReason) + return o +} + +// SetUpdatePostMortemReason adds the updatePostMortemReason to the update post mortem reason params +func (o *UpdatePostMortemReasonParams) SetUpdatePostMortemReason(updatePostMortemReason *models.UpdatePostMortemReason) { + o.UpdatePostMortemReason = updatePostMortemReason +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdatePostMortemReasonParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param reason_id + if err := r.SetPathParam("reason_id", o.ReasonID); err != nil { + return err + } + + // path param report_id + if err := r.SetPathParam("report_id", o.ReportID); err != nil { + return err + } + if o.UpdatePostMortemReason != nil { + if err := r.SetBodyParam(o.UpdatePostMortemReason); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/update_post_mortem_reason_responses.go b/client/retrospectives/update_post_mortem_reason_responses.go new file mode 100644 index 0000000..6037cc9 --- /dev/null +++ b/client/retrospectives/update_post_mortem_reason_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdatePostMortemReasonReader is a Reader for the UpdatePostMortemReason structure. +type UpdatePostMortemReasonReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdatePostMortemReasonReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdatePostMortemReasonOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdatePostMortemReasonOK creates a UpdatePostMortemReasonOK with default headers values +func NewUpdatePostMortemReasonOK() *UpdatePostMortemReasonOK { + return &UpdatePostMortemReasonOK{} +} + +/* +UpdatePostMortemReasonOK describes a response with status code 200, with default header values. + +Update a contributing factor +*/ +type UpdatePostMortemReasonOK struct { + Payload *models.PostMortemsReasonEntity +} + +// IsSuccess returns true when this update post mortem reason o k response has a 2xx status code +func (o *UpdatePostMortemReasonOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update post mortem reason o k response has a 3xx status code +func (o *UpdatePostMortemReasonOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update post mortem reason o k response has a 4xx status code +func (o *UpdatePostMortemReasonOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update post mortem reason o k response has a 5xx status code +func (o *UpdatePostMortemReasonOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update post mortem reason o k response a status code equal to that given +func (o *UpdatePostMortemReasonOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdatePostMortemReasonOK) Error() string { + return fmt.Sprintf("[PATCH /v1/post_mortems/reports/{report_id}/reasons/{reason_id}][%d] updatePostMortemReasonOK %+v", 200, o.Payload) +} + +func (o *UpdatePostMortemReasonOK) String() string { + return fmt.Sprintf("[PATCH /v1/post_mortems/reports/{report_id}/reasons/{reason_id}][%d] updatePostMortemReasonOK %+v", 200, o.Payload) +} + +func (o *UpdatePostMortemReasonOK) GetPayload() *models.PostMortemsReasonEntity { + return o.Payload +} + +func (o *UpdatePostMortemReasonOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PostMortemsReasonEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/update_post_mortem_report_parameters.go b/client/retrospectives/update_post_mortem_report_parameters.go new file mode 100644 index 0000000..0ea5af0 --- /dev/null +++ b/client/retrospectives/update_post_mortem_report_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdatePostMortemReportParams creates a new UpdatePostMortemReportParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdatePostMortemReportParams() *UpdatePostMortemReportParams { + return &UpdatePostMortemReportParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdatePostMortemReportParamsWithTimeout creates a new UpdatePostMortemReportParams object +// with the ability to set a timeout on a request. +func NewUpdatePostMortemReportParamsWithTimeout(timeout time.Duration) *UpdatePostMortemReportParams { + return &UpdatePostMortemReportParams{ + timeout: timeout, + } +} + +// NewUpdatePostMortemReportParamsWithContext creates a new UpdatePostMortemReportParams object +// with the ability to set a context for a request. +func NewUpdatePostMortemReportParamsWithContext(ctx context.Context) *UpdatePostMortemReportParams { + return &UpdatePostMortemReportParams{ + Context: ctx, + } +} + +// NewUpdatePostMortemReportParamsWithHTTPClient creates a new UpdatePostMortemReportParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdatePostMortemReportParamsWithHTTPClient(client *http.Client) *UpdatePostMortemReportParams { + return &UpdatePostMortemReportParams{ + HTTPClient: client, + } +} + +/* +UpdatePostMortemReportParams contains all the parameters to send to the API endpoint + + for the update post mortem report operation. + + Typically these are written to a http.Request. +*/ +type UpdatePostMortemReportParams struct { + + // ReportID. + ReportID string + + // UpdatePostMortemReport. + UpdatePostMortemReport *models.UpdatePostMortemReport + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update post mortem report params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePostMortemReportParams) WithDefaults() *UpdatePostMortemReportParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update post mortem report params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePostMortemReportParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update post mortem report params +func (o *UpdatePostMortemReportParams) WithTimeout(timeout time.Duration) *UpdatePostMortemReportParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update post mortem report params +func (o *UpdatePostMortemReportParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update post mortem report params +func (o *UpdatePostMortemReportParams) WithContext(ctx context.Context) *UpdatePostMortemReportParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update post mortem report params +func (o *UpdatePostMortemReportParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update post mortem report params +func (o *UpdatePostMortemReportParams) WithHTTPClient(client *http.Client) *UpdatePostMortemReportParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update post mortem report params +func (o *UpdatePostMortemReportParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithReportID adds the reportID to the update post mortem report params +func (o *UpdatePostMortemReportParams) WithReportID(reportID string) *UpdatePostMortemReportParams { + o.SetReportID(reportID) + return o +} + +// SetReportID adds the reportId to the update post mortem report params +func (o *UpdatePostMortemReportParams) SetReportID(reportID string) { + o.ReportID = reportID +} + +// WithUpdatePostMortemReport adds the updatePostMortemReport to the update post mortem report params +func (o *UpdatePostMortemReportParams) WithUpdatePostMortemReport(updatePostMortemReport *models.UpdatePostMortemReport) *UpdatePostMortemReportParams { + o.SetUpdatePostMortemReport(updatePostMortemReport) + return o +} + +// SetUpdatePostMortemReport adds the updatePostMortemReport to the update post mortem report params +func (o *UpdatePostMortemReportParams) SetUpdatePostMortemReport(updatePostMortemReport *models.UpdatePostMortemReport) { + o.UpdatePostMortemReport = updatePostMortemReport +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdatePostMortemReportParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param report_id + if err := r.SetPathParam("report_id", o.ReportID); err != nil { + return err + } + if o.UpdatePostMortemReport != nil { + if err := r.SetBodyParam(o.UpdatePostMortemReport); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/retrospectives/update_post_mortem_report_responses.go b/client/retrospectives/update_post_mortem_report_responses.go new file mode 100644 index 0000000..b3e1277 --- /dev/null +++ b/client/retrospectives/update_post_mortem_report_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdatePostMortemReportReader is a Reader for the UpdatePostMortemReport structure. +type UpdatePostMortemReportReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdatePostMortemReportReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdatePostMortemReportOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdatePostMortemReportOK creates a UpdatePostMortemReportOK with default headers values +func NewUpdatePostMortemReportOK() *UpdatePostMortemReportOK { + return &UpdatePostMortemReportOK{} +} + +/* +UpdatePostMortemReportOK describes a response with status code 200, with default header values. + +Update a report +*/ +type UpdatePostMortemReportOK struct { + Payload *models.PostMortemsPostMortemReportEntity +} + +// IsSuccess returns true when this update post mortem report o k response has a 2xx status code +func (o *UpdatePostMortemReportOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update post mortem report o k response has a 3xx status code +func (o *UpdatePostMortemReportOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update post mortem report o k response has a 4xx status code +func (o *UpdatePostMortemReportOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update post mortem report o k response has a 5xx status code +func (o *UpdatePostMortemReportOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update post mortem report o k response a status code equal to that given +func (o *UpdatePostMortemReportOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdatePostMortemReportOK) Error() string { + return fmt.Sprintf("[PATCH /v1/post_mortems/reports/{report_id}][%d] updatePostMortemReportOK %+v", 200, o.Payload) +} + +func (o *UpdatePostMortemReportOK) String() string { + return fmt.Sprintf("[PATCH /v1/post_mortems/reports/{report_id}][%d] updatePostMortemReportOK %+v", 200, o.Payload) +} + +func (o *UpdatePostMortemReportOK) GetPayload() *models.PostMortemsPostMortemReportEntity { + return o.Payload +} + +func (o *UpdatePostMortemReportOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PostMortemsPostMortemReportEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/retrospectives/update_retrospective_template_parameters.go b/client/retrospectives/update_retrospective_template_parameters.go new file mode 100644 index 0000000..934bc31 --- /dev/null +++ b/client/retrospectives/update_retrospective_template_parameters.go @@ -0,0 +1,614 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewUpdateRetrospectiveTemplateParams creates a new UpdateRetrospectiveTemplateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateRetrospectiveTemplateParams() *UpdateRetrospectiveTemplateParams { + return &UpdateRetrospectiveTemplateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateRetrospectiveTemplateParamsWithTimeout creates a new UpdateRetrospectiveTemplateParams object +// with the ability to set a timeout on a request. +func NewUpdateRetrospectiveTemplateParamsWithTimeout(timeout time.Duration) *UpdateRetrospectiveTemplateParams { + return &UpdateRetrospectiveTemplateParams{ + timeout: timeout, + } +} + +// NewUpdateRetrospectiveTemplateParamsWithContext creates a new UpdateRetrospectiveTemplateParams object +// with the ability to set a context for a request. +func NewUpdateRetrospectiveTemplateParamsWithContext(ctx context.Context) *UpdateRetrospectiveTemplateParams { + return &UpdateRetrospectiveTemplateParams{ + Context: ctx, + } +} + +// NewUpdateRetrospectiveTemplateParamsWithHTTPClient creates a new UpdateRetrospectiveTemplateParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateRetrospectiveTemplateParamsWithHTTPClient(client *http.Client) *UpdateRetrospectiveTemplateParams { + return &UpdateRetrospectiveTemplateParams{ + HTTPClient: client, + } +} + +/* +UpdateRetrospectiveTemplateParams contains all the parameters to send to the API endpoint + + for the update retrospective template operation. + + Typically these are written to a http.Request. +*/ +type UpdateRetrospectiveTemplateParams struct { + + // Description. + Description *string + + // FieldsHelpText. + FieldsHelpText []string + + // FieldsID. + FieldsID []string + + // FieldsIsRequired. + FieldsIsRequired []bool + + // FieldsLabel. + FieldsLabel []string + + // FieldsPermissibleValues. + FieldsPermissibleValues []string + + // FieldsSchema. + FieldsSchema []string + + // FieldsType. + FieldsType []string + + // IsDefault. + IsDefault *bool + + // Name. + Name *string + + // RetrospectiveTemplateID. + RetrospectiveTemplateID string + + // SectionsElements. + SectionsElements []string + + // SectionsSlug. + SectionsSlug []string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update retrospective template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateRetrospectiveTemplateParams) WithDefaults() *UpdateRetrospectiveTemplateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update retrospective template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateRetrospectiveTemplateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithTimeout(timeout time.Duration) *UpdateRetrospectiveTemplateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithContext(ctx context.Context) *UpdateRetrospectiveTemplateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithHTTPClient(client *http.Client) *UpdateRetrospectiveTemplateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDescription adds the description to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithDescription(description *string) *UpdateRetrospectiveTemplateParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetDescription(description *string) { + o.Description = description +} + +// WithFieldsHelpText adds the fieldsHelpText to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithFieldsHelpText(fieldsHelpText []string) *UpdateRetrospectiveTemplateParams { + o.SetFieldsHelpText(fieldsHelpText) + return o +} + +// SetFieldsHelpText adds the fieldsHelpText to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetFieldsHelpText(fieldsHelpText []string) { + o.FieldsHelpText = fieldsHelpText +} + +// WithFieldsID adds the fieldsID to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithFieldsID(fieldsID []string) *UpdateRetrospectiveTemplateParams { + o.SetFieldsID(fieldsID) + return o +} + +// SetFieldsID adds the fieldsId to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetFieldsID(fieldsID []string) { + o.FieldsID = fieldsID +} + +// WithFieldsIsRequired adds the fieldsIsRequired to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithFieldsIsRequired(fieldsIsRequired []bool) *UpdateRetrospectiveTemplateParams { + o.SetFieldsIsRequired(fieldsIsRequired) + return o +} + +// SetFieldsIsRequired adds the fieldsIsRequired to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetFieldsIsRequired(fieldsIsRequired []bool) { + o.FieldsIsRequired = fieldsIsRequired +} + +// WithFieldsLabel adds the fieldsLabel to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithFieldsLabel(fieldsLabel []string) *UpdateRetrospectiveTemplateParams { + o.SetFieldsLabel(fieldsLabel) + return o +} + +// SetFieldsLabel adds the fieldsLabel to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetFieldsLabel(fieldsLabel []string) { + o.FieldsLabel = fieldsLabel +} + +// WithFieldsPermissibleValues adds the fieldsPermissibleValues to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithFieldsPermissibleValues(fieldsPermissibleValues []string) *UpdateRetrospectiveTemplateParams { + o.SetFieldsPermissibleValues(fieldsPermissibleValues) + return o +} + +// SetFieldsPermissibleValues adds the fieldsPermissibleValues to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetFieldsPermissibleValues(fieldsPermissibleValues []string) { + o.FieldsPermissibleValues = fieldsPermissibleValues +} + +// WithFieldsSchema adds the fieldsSchema to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithFieldsSchema(fieldsSchema []string) *UpdateRetrospectiveTemplateParams { + o.SetFieldsSchema(fieldsSchema) + return o +} + +// SetFieldsSchema adds the fieldsSchema to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetFieldsSchema(fieldsSchema []string) { + o.FieldsSchema = fieldsSchema +} + +// WithFieldsType adds the fieldsType to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithFieldsType(fieldsType []string) *UpdateRetrospectiveTemplateParams { + o.SetFieldsType(fieldsType) + return o +} + +// SetFieldsType adds the fieldsType to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetFieldsType(fieldsType []string) { + o.FieldsType = fieldsType +} + +// WithIsDefault adds the isDefault to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithIsDefault(isDefault *bool) *UpdateRetrospectiveTemplateParams { + o.SetIsDefault(isDefault) + return o +} + +// SetIsDefault adds the isDefault to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetIsDefault(isDefault *bool) { + o.IsDefault = isDefault +} + +// WithName adds the name to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithName(name *string) *UpdateRetrospectiveTemplateParams { + o.SetName(name) + return o +} + +// SetName adds the name to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetName(name *string) { + o.Name = name +} + +// WithRetrospectiveTemplateID adds the retrospectiveTemplateID to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithRetrospectiveTemplateID(retrospectiveTemplateID string) *UpdateRetrospectiveTemplateParams { + o.SetRetrospectiveTemplateID(retrospectiveTemplateID) + return o +} + +// SetRetrospectiveTemplateID adds the retrospectiveTemplateId to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetRetrospectiveTemplateID(retrospectiveTemplateID string) { + o.RetrospectiveTemplateID = retrospectiveTemplateID +} + +// WithSectionsElements adds the sectionsElements to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithSectionsElements(sectionsElements []string) *UpdateRetrospectiveTemplateParams { + o.SetSectionsElements(sectionsElements) + return o +} + +// SetSectionsElements adds the sectionsElements to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetSectionsElements(sectionsElements []string) { + o.SectionsElements = sectionsElements +} + +// WithSectionsSlug adds the sectionsSlug to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) WithSectionsSlug(sectionsSlug []string) *UpdateRetrospectiveTemplateParams { + o.SetSectionsSlug(sectionsSlug) + return o +} + +// SetSectionsSlug adds the sectionsSlug to the update retrospective template params +func (o *UpdateRetrospectiveTemplateParams) SetSectionsSlug(sectionsSlug []string) { + o.SectionsSlug = sectionsSlug +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateRetrospectiveTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Description != nil { + + // form param description + var frDescription string + if o.Description != nil { + frDescription = *o.Description + } + fDescription := frDescription + if fDescription != "" { + if err := r.SetFormParam("description", fDescription); err != nil { + return err + } + } + } + + if o.FieldsHelpText != nil { + + // binding items for fields[help_text] + joinedFieldsHelpText := o.bindParamFieldsHelpText(reg) + + // form array param fields[help_text] + if err := r.SetFormParam("fields[help_text]", joinedFieldsHelpText...); err != nil { + return err + } + } + + if o.FieldsID != nil { + + // binding items for fields[id] + joinedFieldsID := o.bindParamFieldsID(reg) + + // form array param fields[id] + if err := r.SetFormParam("fields[id]", joinedFieldsID...); err != nil { + return err + } + } + + if o.FieldsIsRequired != nil { + + // binding items for fields[is_required] + joinedFieldsIsRequired := o.bindParamFieldsIsRequired(reg) + + // form array param fields[is_required] + if err := r.SetFormParam("fields[is_required]", joinedFieldsIsRequired...); err != nil { + return err + } + } + + if o.FieldsLabel != nil { + + // binding items for fields[label] + joinedFieldsLabel := o.bindParamFieldsLabel(reg) + + // form array param fields[label] + if err := r.SetFormParam("fields[label]", joinedFieldsLabel...); err != nil { + return err + } + } + + if o.FieldsPermissibleValues != nil { + + // binding items for fields[permissible_values] + joinedFieldsPermissibleValues := o.bindParamFieldsPermissibleValues(reg) + + // form array param fields[permissible_values] + if err := r.SetFormParam("fields[permissible_values]", joinedFieldsPermissibleValues...); err != nil { + return err + } + } + + if o.FieldsSchema != nil { + + // binding items for fields[schema] + joinedFieldsSchema := o.bindParamFieldsSchema(reg) + + // form array param fields[schema] + if err := r.SetFormParam("fields[schema]", joinedFieldsSchema...); err != nil { + return err + } + } + + if o.FieldsType != nil { + + // binding items for fields[type] + joinedFieldsType := o.bindParamFieldsType(reg) + + // form array param fields[type] + if err := r.SetFormParam("fields[type]", joinedFieldsType...); err != nil { + return err + } + } + + if o.IsDefault != nil { + + // form param is_default + var frIsDefault bool + if o.IsDefault != nil { + frIsDefault = *o.IsDefault + } + fIsDefault := swag.FormatBool(frIsDefault) + if fIsDefault != "" { + if err := r.SetFormParam("is_default", fIsDefault); err != nil { + return err + } + } + } + + if o.Name != nil { + + // form param name + var frName string + if o.Name != nil { + frName = *o.Name + } + fName := frName + if fName != "" { + if err := r.SetFormParam("name", fName); err != nil { + return err + } + } + } + + // path param retrospective_template_id + if err := r.SetPathParam("retrospective_template_id", o.RetrospectiveTemplateID); err != nil { + return err + } + + if o.SectionsElements != nil { + + // binding items for sections[elements] + joinedSectionsElements := o.bindParamSectionsElements(reg) + + // form array param sections[elements] + if err := r.SetFormParam("sections[elements]", joinedSectionsElements...); err != nil { + return err + } + } + + if o.SectionsSlug != nil { + + // binding items for sections[slug] + joinedSectionsSlug := o.bindParamSectionsSlug(reg) + + // form array param sections[slug] + if err := r.SetFormParam("sections[slug]", joinedSectionsSlug...); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamUpdateRetrospectiveTemplate binds the parameter fields[help_text] +func (o *UpdateRetrospectiveTemplateParams) bindParamFieldsHelpText(formats strfmt.Registry) []string { + fieldsHelpTextIR := o.FieldsHelpText + + var fieldsHelpTextIC []string + for _, fieldsHelpTextIIR := range fieldsHelpTextIR { // explode []string + + fieldsHelpTextIIV := fieldsHelpTextIIR // string as string + fieldsHelpTextIC = append(fieldsHelpTextIC, fieldsHelpTextIIV) + } + + // items.CollectionFormat: "" + fieldsHelpTextIS := swag.JoinByFormat(fieldsHelpTextIC, "") + + return fieldsHelpTextIS +} + +// bindParamUpdateRetrospectiveTemplate binds the parameter fields[id] +func (o *UpdateRetrospectiveTemplateParams) bindParamFieldsID(formats strfmt.Registry) []string { + fieldsIDIR := o.FieldsID + + var fieldsIDIC []string + for _, fieldsIDIIR := range fieldsIDIR { // explode []string + + fieldsIDIIV := fieldsIDIIR // string as string + fieldsIDIC = append(fieldsIDIC, fieldsIDIIV) + } + + // items.CollectionFormat: "" + fieldsIDIS := swag.JoinByFormat(fieldsIDIC, "") + + return fieldsIDIS +} + +// bindParamUpdateRetrospectiveTemplate binds the parameter fields[is_required] +func (o *UpdateRetrospectiveTemplateParams) bindParamFieldsIsRequired(formats strfmt.Registry) []string { + fieldsIsRequiredIR := o.FieldsIsRequired + + var fieldsIsRequiredIC []string + for _, fieldsIsRequiredIIR := range fieldsIsRequiredIR { // explode []bool + + fieldsIsRequiredIIV := swag.FormatBool(fieldsIsRequiredIIR) // bool as string + fieldsIsRequiredIC = append(fieldsIsRequiredIC, fieldsIsRequiredIIV) + } + + // items.CollectionFormat: "" + fieldsIsRequiredIS := swag.JoinByFormat(fieldsIsRequiredIC, "") + + return fieldsIsRequiredIS +} + +// bindParamUpdateRetrospectiveTemplate binds the parameter fields[label] +func (o *UpdateRetrospectiveTemplateParams) bindParamFieldsLabel(formats strfmt.Registry) []string { + fieldsLabelIR := o.FieldsLabel + + var fieldsLabelIC []string + for _, fieldsLabelIIR := range fieldsLabelIR { // explode []string + + fieldsLabelIIV := fieldsLabelIIR // string as string + fieldsLabelIC = append(fieldsLabelIC, fieldsLabelIIV) + } + + // items.CollectionFormat: "" + fieldsLabelIS := swag.JoinByFormat(fieldsLabelIC, "") + + return fieldsLabelIS +} + +// bindParamUpdateRetrospectiveTemplate binds the parameter fields[permissible_values] +func (o *UpdateRetrospectiveTemplateParams) bindParamFieldsPermissibleValues(formats strfmt.Registry) []string { + fieldsPermissibleValuesIR := o.FieldsPermissibleValues + + var fieldsPermissibleValuesIC []string + for _, fieldsPermissibleValuesIIR := range fieldsPermissibleValuesIR { // explode []string + + fieldsPermissibleValuesIIV := fieldsPermissibleValuesIIR // string as string + fieldsPermissibleValuesIC = append(fieldsPermissibleValuesIC, fieldsPermissibleValuesIIV) + } + + // items.CollectionFormat: "" + fieldsPermissibleValuesIS := swag.JoinByFormat(fieldsPermissibleValuesIC, "") + + return fieldsPermissibleValuesIS +} + +// bindParamUpdateRetrospectiveTemplate binds the parameter fields[schema] +func (o *UpdateRetrospectiveTemplateParams) bindParamFieldsSchema(formats strfmt.Registry) []string { + fieldsSchemaIR := o.FieldsSchema + + var fieldsSchemaIC []string + for _, fieldsSchemaIIR := range fieldsSchemaIR { // explode []string + + fieldsSchemaIIV := fieldsSchemaIIR // string as string + fieldsSchemaIC = append(fieldsSchemaIC, fieldsSchemaIIV) + } + + // items.CollectionFormat: "" + fieldsSchemaIS := swag.JoinByFormat(fieldsSchemaIC, "") + + return fieldsSchemaIS +} + +// bindParamUpdateRetrospectiveTemplate binds the parameter fields[type] +func (o *UpdateRetrospectiveTemplateParams) bindParamFieldsType(formats strfmt.Registry) []string { + fieldsTypeIR := o.FieldsType + + var fieldsTypeIC []string + for _, fieldsTypeIIR := range fieldsTypeIR { // explode []string + + fieldsTypeIIV := fieldsTypeIIR // string as string + fieldsTypeIC = append(fieldsTypeIC, fieldsTypeIIV) + } + + // items.CollectionFormat: "" + fieldsTypeIS := swag.JoinByFormat(fieldsTypeIC, "") + + return fieldsTypeIS +} + +// bindParamUpdateRetrospectiveTemplate binds the parameter sections[elements] +func (o *UpdateRetrospectiveTemplateParams) bindParamSectionsElements(formats strfmt.Registry) []string { + sectionsElementsIR := o.SectionsElements + + var sectionsElementsIC []string + for _, sectionsElementsIIR := range sectionsElementsIR { // explode []string + + sectionsElementsIIV := sectionsElementsIIR // string as string + sectionsElementsIC = append(sectionsElementsIC, sectionsElementsIIV) + } + + // items.CollectionFormat: "" + sectionsElementsIS := swag.JoinByFormat(sectionsElementsIC, "") + + return sectionsElementsIS +} + +// bindParamUpdateRetrospectiveTemplate binds the parameter sections[slug] +func (o *UpdateRetrospectiveTemplateParams) bindParamSectionsSlug(formats strfmt.Registry) []string { + sectionsSlugIR := o.SectionsSlug + + var sectionsSlugIC []string + for _, sectionsSlugIIR := range sectionsSlugIR { // explode []string + + sectionsSlugIIV := sectionsSlugIIR // string as string + sectionsSlugIC = append(sectionsSlugIC, sectionsSlugIIV) + } + + // items.CollectionFormat: "" + sectionsSlugIS := swag.JoinByFormat(sectionsSlugIC, "") + + return sectionsSlugIS +} diff --git a/client/retrospectives/update_retrospective_template_responses.go b/client/retrospectives/update_retrospective_template_responses.go new file mode 100644 index 0000000..16c3fe8 --- /dev/null +++ b/client/retrospectives/update_retrospective_template_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package retrospectives + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateRetrospectiveTemplateReader is a Reader for the UpdateRetrospectiveTemplate structure. +type UpdateRetrospectiveTemplateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateRetrospectiveTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateRetrospectiveTemplateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateRetrospectiveTemplateOK creates a UpdateRetrospectiveTemplateOK with default headers values +func NewUpdateRetrospectiveTemplateOK() *UpdateRetrospectiveTemplateOK { + return &UpdateRetrospectiveTemplateOK{} +} + +/* +UpdateRetrospectiveTemplateOK describes a response with status code 200, with default header values. + +Update a single retrospective template +*/ +type UpdateRetrospectiveTemplateOK struct { + Payload *models.RetrospectivesTemplateEntity +} + +// IsSuccess returns true when this update retrospective template o k response has a 2xx status code +func (o *UpdateRetrospectiveTemplateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update retrospective template o k response has a 3xx status code +func (o *UpdateRetrospectiveTemplateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update retrospective template o k response has a 4xx status code +func (o *UpdateRetrospectiveTemplateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update retrospective template o k response has a 5xx status code +func (o *UpdateRetrospectiveTemplateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update retrospective template o k response a status code equal to that given +func (o *UpdateRetrospectiveTemplateOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateRetrospectiveTemplateOK) Error() string { + return fmt.Sprintf("[PATCH /v1/retrospective_templates/{retrospective_template_id}][%d] updateRetrospectiveTemplateOK %+v", 200, o.Payload) +} + +func (o *UpdateRetrospectiveTemplateOK) String() string { + return fmt.Sprintf("[PATCH /v1/retrospective_templates/{retrospective_template_id}][%d] updateRetrospectiveTemplateOK %+v", 200, o.Payload) +} + +func (o *UpdateRetrospectiveTemplateOK) GetPayload() *models.RetrospectivesTemplateEntity { + return o.Payload +} + +func (o *UpdateRetrospectiveTemplateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RetrospectivesTemplateEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/runbooks/create_runbook_execution_parameters.go b/client/runbooks/create_runbook_execution_parameters.go new file mode 100644 index 0000000..1e329cd --- /dev/null +++ b/client/runbooks/create_runbook_execution_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateRunbookExecutionParams creates a new CreateRunbookExecutionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateRunbookExecutionParams() *CreateRunbookExecutionParams { + return &CreateRunbookExecutionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateRunbookExecutionParamsWithTimeout creates a new CreateRunbookExecutionParams object +// with the ability to set a timeout on a request. +func NewCreateRunbookExecutionParamsWithTimeout(timeout time.Duration) *CreateRunbookExecutionParams { + return &CreateRunbookExecutionParams{ + timeout: timeout, + } +} + +// NewCreateRunbookExecutionParamsWithContext creates a new CreateRunbookExecutionParams object +// with the ability to set a context for a request. +func NewCreateRunbookExecutionParamsWithContext(ctx context.Context) *CreateRunbookExecutionParams { + return &CreateRunbookExecutionParams{ + Context: ctx, + } +} + +// NewCreateRunbookExecutionParamsWithHTTPClient creates a new CreateRunbookExecutionParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateRunbookExecutionParamsWithHTTPClient(client *http.Client) *CreateRunbookExecutionParams { + return &CreateRunbookExecutionParams{ + HTTPClient: client, + } +} + +/* +CreateRunbookExecutionParams contains all the parameters to send to the API endpoint + + for the create runbook execution operation. + + Typically these are written to a http.Request. +*/ +type CreateRunbookExecutionParams struct { + + // CreateRunbookExecution. + CreateRunbookExecution *models.CreateRunbookExecution + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create runbook execution params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateRunbookExecutionParams) WithDefaults() *CreateRunbookExecutionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create runbook execution params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateRunbookExecutionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create runbook execution params +func (o *CreateRunbookExecutionParams) WithTimeout(timeout time.Duration) *CreateRunbookExecutionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create runbook execution params +func (o *CreateRunbookExecutionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create runbook execution params +func (o *CreateRunbookExecutionParams) WithContext(ctx context.Context) *CreateRunbookExecutionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create runbook execution params +func (o *CreateRunbookExecutionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create runbook execution params +func (o *CreateRunbookExecutionParams) WithHTTPClient(client *http.Client) *CreateRunbookExecutionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create runbook execution params +func (o *CreateRunbookExecutionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateRunbookExecution adds the createRunbookExecution to the create runbook execution params +func (o *CreateRunbookExecutionParams) WithCreateRunbookExecution(createRunbookExecution *models.CreateRunbookExecution) *CreateRunbookExecutionParams { + o.SetCreateRunbookExecution(createRunbookExecution) + return o +} + +// SetCreateRunbookExecution adds the createRunbookExecution to the create runbook execution params +func (o *CreateRunbookExecutionParams) SetCreateRunbookExecution(createRunbookExecution *models.CreateRunbookExecution) { + o.CreateRunbookExecution = createRunbookExecution +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateRunbookExecutionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateRunbookExecution != nil { + if err := r.SetBodyParam(o.CreateRunbookExecution); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/create_runbook_execution_responses.go b/client/runbooks/create_runbook_execution_responses.go new file mode 100644 index 0000000..c11248f --- /dev/null +++ b/client/runbooks/create_runbook_execution_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateRunbookExecutionReader is a Reader for the CreateRunbookExecution structure. +type CreateRunbookExecutionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateRunbookExecutionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateRunbookExecutionCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateRunbookExecutionCreated creates a CreateRunbookExecutionCreated with default headers values +func NewCreateRunbookExecutionCreated() *CreateRunbookExecutionCreated { + return &CreateRunbookExecutionCreated{} +} + +/* +CreateRunbookExecutionCreated describes a response with status code 201, with default header values. + +Attaches a runbook to an incident and executes it +*/ +type CreateRunbookExecutionCreated struct { + Payload *models.RunbooksExecutionEntity +} + +// IsSuccess returns true when this create runbook execution created response has a 2xx status code +func (o *CreateRunbookExecutionCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create runbook execution created response has a 3xx status code +func (o *CreateRunbookExecutionCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create runbook execution created response has a 4xx status code +func (o *CreateRunbookExecutionCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create runbook execution created response has a 5xx status code +func (o *CreateRunbookExecutionCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create runbook execution created response a status code equal to that given +func (o *CreateRunbookExecutionCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateRunbookExecutionCreated) Error() string { + return fmt.Sprintf("[POST /v1/runbooks/executions][%d] createRunbookExecutionCreated %+v", 201, o.Payload) +} + +func (o *CreateRunbookExecutionCreated) String() string { + return fmt.Sprintf("[POST /v1/runbooks/executions][%d] createRunbookExecutionCreated %+v", 201, o.Payload) +} + +func (o *CreateRunbookExecutionCreated) GetPayload() *models.RunbooksExecutionEntity { + return o.Payload +} + +func (o *CreateRunbookExecutionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RunbooksExecutionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/runbooks/create_runbook_parameters.go b/client/runbooks/create_runbook_parameters.go new file mode 100644 index 0000000..2610d2e --- /dev/null +++ b/client/runbooks/create_runbook_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateRunbookParams creates a new CreateRunbookParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateRunbookParams() *CreateRunbookParams { + return &CreateRunbookParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateRunbookParamsWithTimeout creates a new CreateRunbookParams object +// with the ability to set a timeout on a request. +func NewCreateRunbookParamsWithTimeout(timeout time.Duration) *CreateRunbookParams { + return &CreateRunbookParams{ + timeout: timeout, + } +} + +// NewCreateRunbookParamsWithContext creates a new CreateRunbookParams object +// with the ability to set a context for a request. +func NewCreateRunbookParamsWithContext(ctx context.Context) *CreateRunbookParams { + return &CreateRunbookParams{ + Context: ctx, + } +} + +// NewCreateRunbookParamsWithHTTPClient creates a new CreateRunbookParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateRunbookParamsWithHTTPClient(client *http.Client) *CreateRunbookParams { + return &CreateRunbookParams{ + HTTPClient: client, + } +} + +/* +CreateRunbookParams contains all the parameters to send to the API endpoint + + for the create runbook operation. + + Typically these are written to a http.Request. +*/ +type CreateRunbookParams struct { + + // CreateRunbook. + CreateRunbook *models.CreateRunbook + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create runbook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateRunbookParams) WithDefaults() *CreateRunbookParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create runbook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateRunbookParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create runbook params +func (o *CreateRunbookParams) WithTimeout(timeout time.Duration) *CreateRunbookParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create runbook params +func (o *CreateRunbookParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create runbook params +func (o *CreateRunbookParams) WithContext(ctx context.Context) *CreateRunbookParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create runbook params +func (o *CreateRunbookParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create runbook params +func (o *CreateRunbookParams) WithHTTPClient(client *http.Client) *CreateRunbookParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create runbook params +func (o *CreateRunbookParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateRunbook adds the createRunbook to the create runbook params +func (o *CreateRunbookParams) WithCreateRunbook(createRunbook *models.CreateRunbook) *CreateRunbookParams { + o.SetCreateRunbook(createRunbook) + return o +} + +// SetCreateRunbook adds the createRunbook to the create runbook params +func (o *CreateRunbookParams) SetCreateRunbook(createRunbook *models.CreateRunbook) { + o.CreateRunbook = createRunbook +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateRunbookParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateRunbook != nil { + if err := r.SetBodyParam(o.CreateRunbook); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/create_runbook_responses.go b/client/runbooks/create_runbook_responses.go new file mode 100644 index 0000000..7206611 --- /dev/null +++ b/client/runbooks/create_runbook_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateRunbookReader is a Reader for the CreateRunbook structure. +type CreateRunbookReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateRunbookReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateRunbookCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateRunbookCreated creates a CreateRunbookCreated with default headers values +func NewCreateRunbookCreated() *CreateRunbookCreated { + return &CreateRunbookCreated{} +} + +/* +CreateRunbookCreated describes a response with status code 201, with default header values. + +Create a new runbook for use with incidents. +*/ +type CreateRunbookCreated struct { + Payload *models.RunbookEntity +} + +// IsSuccess returns true when this create runbook created response has a 2xx status code +func (o *CreateRunbookCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create runbook created response has a 3xx status code +func (o *CreateRunbookCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create runbook created response has a 4xx status code +func (o *CreateRunbookCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create runbook created response has a 5xx status code +func (o *CreateRunbookCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create runbook created response a status code equal to that given +func (o *CreateRunbookCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateRunbookCreated) Error() string { + return fmt.Sprintf("[POST /v1/runbooks][%d] createRunbookCreated %+v", 201, o.Payload) +} + +func (o *CreateRunbookCreated) String() string { + return fmt.Sprintf("[POST /v1/runbooks][%d] createRunbookCreated %+v", 201, o.Payload) +} + +func (o *CreateRunbookCreated) GetPayload() *models.RunbookEntity { + return o.Payload +} + +func (o *CreateRunbookCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RunbookEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/runbooks/delete_runbook_execution_parameters.go b/client/runbooks/delete_runbook_execution_parameters.go new file mode 100644 index 0000000..838e521 --- /dev/null +++ b/client/runbooks/delete_runbook_execution_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteRunbookExecutionParams creates a new DeleteRunbookExecutionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteRunbookExecutionParams() *DeleteRunbookExecutionParams { + return &DeleteRunbookExecutionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteRunbookExecutionParamsWithTimeout creates a new DeleteRunbookExecutionParams object +// with the ability to set a timeout on a request. +func NewDeleteRunbookExecutionParamsWithTimeout(timeout time.Duration) *DeleteRunbookExecutionParams { + return &DeleteRunbookExecutionParams{ + timeout: timeout, + } +} + +// NewDeleteRunbookExecutionParamsWithContext creates a new DeleteRunbookExecutionParams object +// with the ability to set a context for a request. +func NewDeleteRunbookExecutionParamsWithContext(ctx context.Context) *DeleteRunbookExecutionParams { + return &DeleteRunbookExecutionParams{ + Context: ctx, + } +} + +// NewDeleteRunbookExecutionParamsWithHTTPClient creates a new DeleteRunbookExecutionParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteRunbookExecutionParamsWithHTTPClient(client *http.Client) *DeleteRunbookExecutionParams { + return &DeleteRunbookExecutionParams{ + HTTPClient: client, + } +} + +/* +DeleteRunbookExecutionParams contains all the parameters to send to the API endpoint + + for the delete runbook execution operation. + + Typically these are written to a http.Request. +*/ +type DeleteRunbookExecutionParams struct { + + // ExecutionID. + ExecutionID string + + /* Reason. + + The reason for terminating the runbook execution + */ + Reason string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete runbook execution params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteRunbookExecutionParams) WithDefaults() *DeleteRunbookExecutionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete runbook execution params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteRunbookExecutionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete runbook execution params +func (o *DeleteRunbookExecutionParams) WithTimeout(timeout time.Duration) *DeleteRunbookExecutionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete runbook execution params +func (o *DeleteRunbookExecutionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete runbook execution params +func (o *DeleteRunbookExecutionParams) WithContext(ctx context.Context) *DeleteRunbookExecutionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete runbook execution params +func (o *DeleteRunbookExecutionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete runbook execution params +func (o *DeleteRunbookExecutionParams) WithHTTPClient(client *http.Client) *DeleteRunbookExecutionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete runbook execution params +func (o *DeleteRunbookExecutionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithExecutionID adds the executionID to the delete runbook execution params +func (o *DeleteRunbookExecutionParams) WithExecutionID(executionID string) *DeleteRunbookExecutionParams { + o.SetExecutionID(executionID) + return o +} + +// SetExecutionID adds the executionId to the delete runbook execution params +func (o *DeleteRunbookExecutionParams) SetExecutionID(executionID string) { + o.ExecutionID = executionID +} + +// WithReason adds the reason to the delete runbook execution params +func (o *DeleteRunbookExecutionParams) WithReason(reason string) *DeleteRunbookExecutionParams { + o.SetReason(reason) + return o +} + +// SetReason adds the reason to the delete runbook execution params +func (o *DeleteRunbookExecutionParams) SetReason(reason string) { + o.Reason = reason +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteRunbookExecutionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param execution_id + if err := r.SetPathParam("execution_id", o.ExecutionID); err != nil { + return err + } + + // query param reason + qrReason := o.Reason + qReason := qrReason + if qReason != "" { + + if err := r.SetQueryParam("reason", qReason); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/delete_runbook_execution_responses.go b/client/runbooks/delete_runbook_execution_responses.go new file mode 100644 index 0000000..ea5cd69 --- /dev/null +++ b/client/runbooks/delete_runbook_execution_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteRunbookExecutionReader is a Reader for the DeleteRunbookExecution structure. +type DeleteRunbookExecutionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteRunbookExecutionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteRunbookExecutionNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteRunbookExecutionNoContent creates a DeleteRunbookExecutionNoContent with default headers values +func NewDeleteRunbookExecutionNoContent() *DeleteRunbookExecutionNoContent { + return &DeleteRunbookExecutionNoContent{} +} + +/* +DeleteRunbookExecutionNoContent describes a response with status code 204, with default header values. + +Terminates a runbook execution, preventing any further steps from being executed +*/ +type DeleteRunbookExecutionNoContent struct { +} + +// IsSuccess returns true when this delete runbook execution no content response has a 2xx status code +func (o *DeleteRunbookExecutionNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete runbook execution no content response has a 3xx status code +func (o *DeleteRunbookExecutionNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete runbook execution no content response has a 4xx status code +func (o *DeleteRunbookExecutionNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete runbook execution no content response has a 5xx status code +func (o *DeleteRunbookExecutionNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete runbook execution no content response a status code equal to that given +func (o *DeleteRunbookExecutionNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteRunbookExecutionNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/runbooks/executions/{execution_id}][%d] deleteRunbookExecutionNoContent ", 204) +} + +func (o *DeleteRunbookExecutionNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/runbooks/executions/{execution_id}][%d] deleteRunbookExecutionNoContent ", 204) +} + +func (o *DeleteRunbookExecutionNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/runbooks/delete_runbook_parameters.go b/client/runbooks/delete_runbook_parameters.go new file mode 100644 index 0000000..4195000 --- /dev/null +++ b/client/runbooks/delete_runbook_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteRunbookParams creates a new DeleteRunbookParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteRunbookParams() *DeleteRunbookParams { + return &DeleteRunbookParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteRunbookParamsWithTimeout creates a new DeleteRunbookParams object +// with the ability to set a timeout on a request. +func NewDeleteRunbookParamsWithTimeout(timeout time.Duration) *DeleteRunbookParams { + return &DeleteRunbookParams{ + timeout: timeout, + } +} + +// NewDeleteRunbookParamsWithContext creates a new DeleteRunbookParams object +// with the ability to set a context for a request. +func NewDeleteRunbookParamsWithContext(ctx context.Context) *DeleteRunbookParams { + return &DeleteRunbookParams{ + Context: ctx, + } +} + +// NewDeleteRunbookParamsWithHTTPClient creates a new DeleteRunbookParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteRunbookParamsWithHTTPClient(client *http.Client) *DeleteRunbookParams { + return &DeleteRunbookParams{ + HTTPClient: client, + } +} + +/* +DeleteRunbookParams contains all the parameters to send to the API endpoint + + for the delete runbook operation. + + Typically these are written to a http.Request. +*/ +type DeleteRunbookParams struct { + + // RunbookID. + RunbookID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete runbook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteRunbookParams) WithDefaults() *DeleteRunbookParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete runbook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteRunbookParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete runbook params +func (o *DeleteRunbookParams) WithTimeout(timeout time.Duration) *DeleteRunbookParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete runbook params +func (o *DeleteRunbookParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete runbook params +func (o *DeleteRunbookParams) WithContext(ctx context.Context) *DeleteRunbookParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete runbook params +func (o *DeleteRunbookParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete runbook params +func (o *DeleteRunbookParams) WithHTTPClient(client *http.Client) *DeleteRunbookParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete runbook params +func (o *DeleteRunbookParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRunbookID adds the runbookID to the delete runbook params +func (o *DeleteRunbookParams) WithRunbookID(runbookID string) *DeleteRunbookParams { + o.SetRunbookID(runbookID) + return o +} + +// SetRunbookID adds the runbookId to the delete runbook params +func (o *DeleteRunbookParams) SetRunbookID(runbookID string) { + o.RunbookID = runbookID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteRunbookParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param runbook_id + if err := r.SetPathParam("runbook_id", o.RunbookID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/delete_runbook_responses.go b/client/runbooks/delete_runbook_responses.go new file mode 100644 index 0000000..ee1890f --- /dev/null +++ b/client/runbooks/delete_runbook_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteRunbookReader is a Reader for the DeleteRunbook structure. +type DeleteRunbookReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteRunbookReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteRunbookOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteRunbookOK creates a DeleteRunbookOK with default headers values +func NewDeleteRunbookOK() *DeleteRunbookOK { + return &DeleteRunbookOK{} +} + +/* +DeleteRunbookOK describes a response with status code 200, with default header values. + +Delete a runbook and make it unavailable for any future incidents. +*/ +type DeleteRunbookOK struct { + Payload *models.RunbookEntity +} + +// IsSuccess returns true when this delete runbook o k response has a 2xx status code +func (o *DeleteRunbookOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete runbook o k response has a 3xx status code +func (o *DeleteRunbookOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete runbook o k response has a 4xx status code +func (o *DeleteRunbookOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete runbook o k response has a 5xx status code +func (o *DeleteRunbookOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete runbook o k response a status code equal to that given +func (o *DeleteRunbookOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteRunbookOK) Error() string { + return fmt.Sprintf("[DELETE /v1/runbooks/{runbook_id}][%d] deleteRunbookOK %+v", 200, o.Payload) +} + +func (o *DeleteRunbookOK) String() string { + return fmt.Sprintf("[DELETE /v1/runbooks/{runbook_id}][%d] deleteRunbookOK %+v", 200, o.Payload) +} + +func (o *DeleteRunbookOK) GetPayload() *models.RunbookEntity { + return o.Payload +} + +func (o *DeleteRunbookOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RunbookEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/runbooks/get_runbook_action_field_options_parameters.go b/client/runbooks/get_runbook_action_field_options_parameters.go new file mode 100644 index 0000000..07bd345 --- /dev/null +++ b/client/runbooks/get_runbook_action_field_options_parameters.go @@ -0,0 +1,291 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetRunbookActionFieldOptionsParams creates a new GetRunbookActionFieldOptionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetRunbookActionFieldOptionsParams() *GetRunbookActionFieldOptionsParams { + return &GetRunbookActionFieldOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetRunbookActionFieldOptionsParamsWithTimeout creates a new GetRunbookActionFieldOptionsParams object +// with the ability to set a timeout on a request. +func NewGetRunbookActionFieldOptionsParamsWithTimeout(timeout time.Duration) *GetRunbookActionFieldOptionsParams { + return &GetRunbookActionFieldOptionsParams{ + timeout: timeout, + } +} + +// NewGetRunbookActionFieldOptionsParamsWithContext creates a new GetRunbookActionFieldOptionsParams object +// with the ability to set a context for a request. +func NewGetRunbookActionFieldOptionsParamsWithContext(ctx context.Context) *GetRunbookActionFieldOptionsParams { + return &GetRunbookActionFieldOptionsParams{ + Context: ctx, + } +} + +// NewGetRunbookActionFieldOptionsParamsWithHTTPClient creates a new GetRunbookActionFieldOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetRunbookActionFieldOptionsParamsWithHTTPClient(client *http.Client) *GetRunbookActionFieldOptionsParams { + return &GetRunbookActionFieldOptionsParams{ + HTTPClient: client, + } +} + +/* +GetRunbookActionFieldOptionsParams contains all the parameters to send to the API endpoint + + for the get runbook action field options operation. + + Typically these are written to a http.Request. +*/ +type GetRunbookActionFieldOptionsParams struct { + + // ActionSlug. + ActionSlug string + + // Field. + Field string + + // IntegrationSlug. + IntegrationSlug string + + /* PerPage. + + Maximum number of items to return. + + Format: int32 + */ + PerPage *int32 + + /* Query. + + Text string of a query for filtering values. + */ + Query *string + + /* Scope. + + Generic params used to add specificity (eg an id of some kind) to the select options request + */ + Scope *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get runbook action field options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRunbookActionFieldOptionsParams) WithDefaults() *GetRunbookActionFieldOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get runbook action field options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRunbookActionFieldOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) WithTimeout(timeout time.Duration) *GetRunbookActionFieldOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) WithContext(ctx context.Context) *GetRunbookActionFieldOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) WithHTTPClient(client *http.Client) *GetRunbookActionFieldOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithActionSlug adds the actionSlug to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) WithActionSlug(actionSlug string) *GetRunbookActionFieldOptionsParams { + o.SetActionSlug(actionSlug) + return o +} + +// SetActionSlug adds the actionSlug to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) SetActionSlug(actionSlug string) { + o.ActionSlug = actionSlug +} + +// WithField adds the field to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) WithField(field string) *GetRunbookActionFieldOptionsParams { + o.SetField(field) + return o +} + +// SetField adds the field to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) SetField(field string) { + o.Field = field +} + +// WithIntegrationSlug adds the integrationSlug to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) WithIntegrationSlug(integrationSlug string) *GetRunbookActionFieldOptionsParams { + o.SetIntegrationSlug(integrationSlug) + return o +} + +// SetIntegrationSlug adds the integrationSlug to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) SetIntegrationSlug(integrationSlug string) { + o.IntegrationSlug = integrationSlug +} + +// WithPerPage adds the perPage to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) WithPerPage(perPage *int32) *GetRunbookActionFieldOptionsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) WithQuery(query *string) *GetRunbookActionFieldOptionsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) SetQuery(query *string) { + o.Query = query +} + +// WithScope adds the scope to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) WithScope(scope *string) *GetRunbookActionFieldOptionsParams { + o.SetScope(scope) + return o +} + +// SetScope adds the scope to the get runbook action field options params +func (o *GetRunbookActionFieldOptionsParams) SetScope(scope *string) { + o.Scope = scope +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRunbookActionFieldOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param action_slug + if err := r.SetPathParam("action_slug", o.ActionSlug); err != nil { + return err + } + + // path param field + if err := r.SetPathParam("field", o.Field); err != nil { + return err + } + + // path param integration_slug + if err := r.SetPathParam("integration_slug", o.IntegrationSlug); err != nil { + return err + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if o.Scope != nil { + + // query param scope + var qrScope string + + if o.Scope != nil { + qrScope = *o.Scope + } + qScope := qrScope + if qScope != "" { + + if err := r.SetQueryParam("scope", qScope); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/get_runbook_action_field_options_responses.go b/client/runbooks/get_runbook_action_field_options_responses.go new file mode 100644 index 0000000..b128de1 --- /dev/null +++ b/client/runbooks/get_runbook_action_field_options_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetRunbookActionFieldOptionsReader is a Reader for the GetRunbookActionFieldOptions structure. +type GetRunbookActionFieldOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRunbookActionFieldOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRunbookActionFieldOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetRunbookActionFieldOptionsOK creates a GetRunbookActionFieldOptionsOK with default headers values +func NewGetRunbookActionFieldOptionsOK() *GetRunbookActionFieldOptionsOK { + return &GetRunbookActionFieldOptionsOK{} +} + +/* +GetRunbookActionFieldOptionsOK describes a response with status code 200, with default header values. + +List select options for a runbook integration action field +*/ +type GetRunbookActionFieldOptionsOK struct { +} + +// IsSuccess returns true when this get runbook action field options o k response has a 2xx status code +func (o *GetRunbookActionFieldOptionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get runbook action field options o k response has a 3xx status code +func (o *GetRunbookActionFieldOptionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get runbook action field options o k response has a 4xx status code +func (o *GetRunbookActionFieldOptionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get runbook action field options o k response has a 5xx status code +func (o *GetRunbookActionFieldOptionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get runbook action field options o k response a status code equal to that given +func (o *GetRunbookActionFieldOptionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetRunbookActionFieldOptionsOK) Error() string { + return fmt.Sprintf("[GET /v1/runbooks/select_options/{integration_slug}/{action_slug}/{field}][%d] getRunbookActionFieldOptionsOK ", 200) +} + +func (o *GetRunbookActionFieldOptionsOK) String() string { + return fmt.Sprintf("[GET /v1/runbooks/select_options/{integration_slug}/{action_slug}/{field}][%d] getRunbookActionFieldOptionsOK ", 200) +} + +func (o *GetRunbookActionFieldOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/runbooks/get_runbook_execution_parameters.go b/client/runbooks/get_runbook_execution_parameters.go new file mode 100644 index 0000000..edf55dd --- /dev/null +++ b/client/runbooks/get_runbook_execution_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetRunbookExecutionParams creates a new GetRunbookExecutionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetRunbookExecutionParams() *GetRunbookExecutionParams { + return &GetRunbookExecutionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetRunbookExecutionParamsWithTimeout creates a new GetRunbookExecutionParams object +// with the ability to set a timeout on a request. +func NewGetRunbookExecutionParamsWithTimeout(timeout time.Duration) *GetRunbookExecutionParams { + return &GetRunbookExecutionParams{ + timeout: timeout, + } +} + +// NewGetRunbookExecutionParamsWithContext creates a new GetRunbookExecutionParams object +// with the ability to set a context for a request. +func NewGetRunbookExecutionParamsWithContext(ctx context.Context) *GetRunbookExecutionParams { + return &GetRunbookExecutionParams{ + Context: ctx, + } +} + +// NewGetRunbookExecutionParamsWithHTTPClient creates a new GetRunbookExecutionParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetRunbookExecutionParamsWithHTTPClient(client *http.Client) *GetRunbookExecutionParams { + return &GetRunbookExecutionParams{ + HTTPClient: client, + } +} + +/* +GetRunbookExecutionParams contains all the parameters to send to the API endpoint + + for the get runbook execution operation. + + Typically these are written to a http.Request. +*/ +type GetRunbookExecutionParams struct { + + // ExecutionID. + ExecutionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get runbook execution params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRunbookExecutionParams) WithDefaults() *GetRunbookExecutionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get runbook execution params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRunbookExecutionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get runbook execution params +func (o *GetRunbookExecutionParams) WithTimeout(timeout time.Duration) *GetRunbookExecutionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get runbook execution params +func (o *GetRunbookExecutionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get runbook execution params +func (o *GetRunbookExecutionParams) WithContext(ctx context.Context) *GetRunbookExecutionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get runbook execution params +func (o *GetRunbookExecutionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get runbook execution params +func (o *GetRunbookExecutionParams) WithHTTPClient(client *http.Client) *GetRunbookExecutionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get runbook execution params +func (o *GetRunbookExecutionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithExecutionID adds the executionID to the get runbook execution params +func (o *GetRunbookExecutionParams) WithExecutionID(executionID string) *GetRunbookExecutionParams { + o.SetExecutionID(executionID) + return o +} + +// SetExecutionID adds the executionId to the get runbook execution params +func (o *GetRunbookExecutionParams) SetExecutionID(executionID string) { + o.ExecutionID = executionID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRunbookExecutionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param execution_id + if err := r.SetPathParam("execution_id", o.ExecutionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/get_runbook_execution_responses.go b/client/runbooks/get_runbook_execution_responses.go new file mode 100644 index 0000000..18819ad --- /dev/null +++ b/client/runbooks/get_runbook_execution_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetRunbookExecutionReader is a Reader for the GetRunbookExecution structure. +type GetRunbookExecutionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRunbookExecutionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRunbookExecutionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetRunbookExecutionOK creates a GetRunbookExecutionOK with default headers values +func NewGetRunbookExecutionOK() *GetRunbookExecutionOK { + return &GetRunbookExecutionOK{} +} + +/* +GetRunbookExecutionOK describes a response with status code 200, with default header values. + +Retrieve a runbook execution by ID +*/ +type GetRunbookExecutionOK struct { + Payload *models.RunbooksExecutionEntity +} + +// IsSuccess returns true when this get runbook execution o k response has a 2xx status code +func (o *GetRunbookExecutionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get runbook execution o k response has a 3xx status code +func (o *GetRunbookExecutionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get runbook execution o k response has a 4xx status code +func (o *GetRunbookExecutionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get runbook execution o k response has a 5xx status code +func (o *GetRunbookExecutionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get runbook execution o k response a status code equal to that given +func (o *GetRunbookExecutionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetRunbookExecutionOK) Error() string { + return fmt.Sprintf("[GET /v1/runbooks/executions/{execution_id}][%d] getRunbookExecutionOK %+v", 200, o.Payload) +} + +func (o *GetRunbookExecutionOK) String() string { + return fmt.Sprintf("[GET /v1/runbooks/executions/{execution_id}][%d] getRunbookExecutionOK %+v", 200, o.Payload) +} + +func (o *GetRunbookExecutionOK) GetPayload() *models.RunbooksExecutionEntity { + return o.Payload +} + +func (o *GetRunbookExecutionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RunbooksExecutionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/runbooks/get_runbook_execution_step_script_parameters.go b/client/runbooks/get_runbook_execution_step_script_parameters.go new file mode 100644 index 0000000..9a64c7d --- /dev/null +++ b/client/runbooks/get_runbook_execution_step_script_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetRunbookExecutionStepScriptParams creates a new GetRunbookExecutionStepScriptParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetRunbookExecutionStepScriptParams() *GetRunbookExecutionStepScriptParams { + return &GetRunbookExecutionStepScriptParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetRunbookExecutionStepScriptParamsWithTimeout creates a new GetRunbookExecutionStepScriptParams object +// with the ability to set a timeout on a request. +func NewGetRunbookExecutionStepScriptParamsWithTimeout(timeout time.Duration) *GetRunbookExecutionStepScriptParams { + return &GetRunbookExecutionStepScriptParams{ + timeout: timeout, + } +} + +// NewGetRunbookExecutionStepScriptParamsWithContext creates a new GetRunbookExecutionStepScriptParams object +// with the ability to set a context for a request. +func NewGetRunbookExecutionStepScriptParamsWithContext(ctx context.Context) *GetRunbookExecutionStepScriptParams { + return &GetRunbookExecutionStepScriptParams{ + Context: ctx, + } +} + +// NewGetRunbookExecutionStepScriptParamsWithHTTPClient creates a new GetRunbookExecutionStepScriptParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetRunbookExecutionStepScriptParamsWithHTTPClient(client *http.Client) *GetRunbookExecutionStepScriptParams { + return &GetRunbookExecutionStepScriptParams{ + HTTPClient: client, + } +} + +/* +GetRunbookExecutionStepScriptParams contains all the parameters to send to the API endpoint + + for the get runbook execution step script operation. + + Typically these are written to a http.Request. +*/ +type GetRunbookExecutionStepScriptParams struct { + + // ExecutionID. + ExecutionID string + + // StepID. + StepID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get runbook execution step script params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRunbookExecutionStepScriptParams) WithDefaults() *GetRunbookExecutionStepScriptParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get runbook execution step script params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRunbookExecutionStepScriptParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get runbook execution step script params +func (o *GetRunbookExecutionStepScriptParams) WithTimeout(timeout time.Duration) *GetRunbookExecutionStepScriptParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get runbook execution step script params +func (o *GetRunbookExecutionStepScriptParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get runbook execution step script params +func (o *GetRunbookExecutionStepScriptParams) WithContext(ctx context.Context) *GetRunbookExecutionStepScriptParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get runbook execution step script params +func (o *GetRunbookExecutionStepScriptParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get runbook execution step script params +func (o *GetRunbookExecutionStepScriptParams) WithHTTPClient(client *http.Client) *GetRunbookExecutionStepScriptParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get runbook execution step script params +func (o *GetRunbookExecutionStepScriptParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithExecutionID adds the executionID to the get runbook execution step script params +func (o *GetRunbookExecutionStepScriptParams) WithExecutionID(executionID string) *GetRunbookExecutionStepScriptParams { + o.SetExecutionID(executionID) + return o +} + +// SetExecutionID adds the executionId to the get runbook execution step script params +func (o *GetRunbookExecutionStepScriptParams) SetExecutionID(executionID string) { + o.ExecutionID = executionID +} + +// WithStepID adds the stepID to the get runbook execution step script params +func (o *GetRunbookExecutionStepScriptParams) WithStepID(stepID string) *GetRunbookExecutionStepScriptParams { + o.SetStepID(stepID) + return o +} + +// SetStepID adds the stepId to the get runbook execution step script params +func (o *GetRunbookExecutionStepScriptParams) SetStepID(stepID string) { + o.StepID = stepID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRunbookExecutionStepScriptParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param execution_id + if err := r.SetPathParam("execution_id", o.ExecutionID); err != nil { + return err + } + + // path param step_id + if err := r.SetPathParam("step_id", o.StepID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/get_runbook_execution_step_script_responses.go b/client/runbooks/get_runbook_execution_step_script_responses.go new file mode 100644 index 0000000..6ceb9ad --- /dev/null +++ b/client/runbooks/get_runbook_execution_step_script_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetRunbookExecutionStepScriptReader is a Reader for the GetRunbookExecutionStepScript structure. +type GetRunbookExecutionStepScriptReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRunbookExecutionStepScriptReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRunbookExecutionStepScriptOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetRunbookExecutionStepScriptOK creates a GetRunbookExecutionStepScriptOK with default headers values +func NewGetRunbookExecutionStepScriptOK() *GetRunbookExecutionStepScriptOK { + return &GetRunbookExecutionStepScriptOK{} +} + +/* +GetRunbookExecutionStepScriptOK describes a response with status code 200, with default header values. + +Retrieves the bash script from a "script" step. +*/ +type GetRunbookExecutionStepScriptOK struct { + Payload *models.RunbooksExecutionEntity +} + +// IsSuccess returns true when this get runbook execution step script o k response has a 2xx status code +func (o *GetRunbookExecutionStepScriptOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get runbook execution step script o k response has a 3xx status code +func (o *GetRunbookExecutionStepScriptOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get runbook execution step script o k response has a 4xx status code +func (o *GetRunbookExecutionStepScriptOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get runbook execution step script o k response has a 5xx status code +func (o *GetRunbookExecutionStepScriptOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get runbook execution step script o k response a status code equal to that given +func (o *GetRunbookExecutionStepScriptOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetRunbookExecutionStepScriptOK) Error() string { + return fmt.Sprintf("[GET /v1/runbooks/executions/{execution_id}/steps/{step_id}/script][%d] getRunbookExecutionStepScriptOK %+v", 200, o.Payload) +} + +func (o *GetRunbookExecutionStepScriptOK) String() string { + return fmt.Sprintf("[GET /v1/runbooks/executions/{execution_id}/steps/{step_id}/script][%d] getRunbookExecutionStepScriptOK %+v", 200, o.Payload) +} + +func (o *GetRunbookExecutionStepScriptOK) GetPayload() *models.RunbooksExecutionEntity { + return o.Payload +} + +func (o *GetRunbookExecutionStepScriptOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RunbooksExecutionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/runbooks/get_runbook_parameters.go b/client/runbooks/get_runbook_parameters.go new file mode 100644 index 0000000..63260fb --- /dev/null +++ b/client/runbooks/get_runbook_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetRunbookParams creates a new GetRunbookParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetRunbookParams() *GetRunbookParams { + return &GetRunbookParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetRunbookParamsWithTimeout creates a new GetRunbookParams object +// with the ability to set a timeout on a request. +func NewGetRunbookParamsWithTimeout(timeout time.Duration) *GetRunbookParams { + return &GetRunbookParams{ + timeout: timeout, + } +} + +// NewGetRunbookParamsWithContext creates a new GetRunbookParams object +// with the ability to set a context for a request. +func NewGetRunbookParamsWithContext(ctx context.Context) *GetRunbookParams { + return &GetRunbookParams{ + Context: ctx, + } +} + +// NewGetRunbookParamsWithHTTPClient creates a new GetRunbookParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetRunbookParamsWithHTTPClient(client *http.Client) *GetRunbookParams { + return &GetRunbookParams{ + HTTPClient: client, + } +} + +/* +GetRunbookParams contains all the parameters to send to the API endpoint + + for the get runbook operation. + + Typically these are written to a http.Request. +*/ +type GetRunbookParams struct { + + // RunbookID. + RunbookID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get runbook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRunbookParams) WithDefaults() *GetRunbookParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get runbook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetRunbookParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get runbook params +func (o *GetRunbookParams) WithTimeout(timeout time.Duration) *GetRunbookParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get runbook params +func (o *GetRunbookParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get runbook params +func (o *GetRunbookParams) WithContext(ctx context.Context) *GetRunbookParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get runbook params +func (o *GetRunbookParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get runbook params +func (o *GetRunbookParams) WithHTTPClient(client *http.Client) *GetRunbookParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get runbook params +func (o *GetRunbookParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRunbookID adds the runbookID to the get runbook params +func (o *GetRunbookParams) WithRunbookID(runbookID string) *GetRunbookParams { + o.SetRunbookID(runbookID) + return o +} + +// SetRunbookID adds the runbookId to the get runbook params +func (o *GetRunbookParams) SetRunbookID(runbookID string) { + o.RunbookID = runbookID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetRunbookParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param runbook_id + if err := r.SetPathParam("runbook_id", o.RunbookID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/get_runbook_responses.go b/client/runbooks/get_runbook_responses.go new file mode 100644 index 0000000..dc21f8e --- /dev/null +++ b/client/runbooks/get_runbook_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetRunbookReader is a Reader for the GetRunbook structure. +type GetRunbookReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetRunbookReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetRunbookOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetRunbookOK creates a GetRunbookOK with default headers values +func NewGetRunbookOK() *GetRunbookOK { + return &GetRunbookOK{} +} + +/* +GetRunbookOK describes a response with status code 200, with default header values. + +Get a runbook and all its configuration +*/ +type GetRunbookOK struct { + Payload *models.RunbookEntity +} + +// IsSuccess returns true when this get runbook o k response has a 2xx status code +func (o *GetRunbookOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get runbook o k response has a 3xx status code +func (o *GetRunbookOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get runbook o k response has a 4xx status code +func (o *GetRunbookOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get runbook o k response has a 5xx status code +func (o *GetRunbookOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get runbook o k response a status code equal to that given +func (o *GetRunbookOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetRunbookOK) Error() string { + return fmt.Sprintf("[GET /v1/runbooks/{runbook_id}][%d] getRunbookOK %+v", 200, o.Payload) +} + +func (o *GetRunbookOK) String() string { + return fmt.Sprintf("[GET /v1/runbooks/{runbook_id}][%d] getRunbookOK %+v", 200, o.Payload) +} + +func (o *GetRunbookOK) GetPayload() *models.RunbookEntity { + return o.Payload +} + +func (o *GetRunbookOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RunbookEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/runbooks/list_runbook_actions_parameters.go b/client/runbooks/list_runbook_actions_parameters.go new file mode 100644 index 0000000..fca6310 --- /dev/null +++ b/client/runbooks/list_runbook_actions_parameters.go @@ -0,0 +1,264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListRunbookActionsParams creates a new ListRunbookActionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListRunbookActionsParams() *ListRunbookActionsParams { + return &ListRunbookActionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListRunbookActionsParamsWithTimeout creates a new ListRunbookActionsParams object +// with the ability to set a timeout on a request. +func NewListRunbookActionsParamsWithTimeout(timeout time.Duration) *ListRunbookActionsParams { + return &ListRunbookActionsParams{ + timeout: timeout, + } +} + +// NewListRunbookActionsParamsWithContext creates a new ListRunbookActionsParams object +// with the ability to set a context for a request. +func NewListRunbookActionsParamsWithContext(ctx context.Context) *ListRunbookActionsParams { + return &ListRunbookActionsParams{ + Context: ctx, + } +} + +// NewListRunbookActionsParamsWithHTTPClient creates a new ListRunbookActionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListRunbookActionsParamsWithHTTPClient(client *http.Client) *ListRunbookActionsParams { + return &ListRunbookActionsParams{ + HTTPClient: client, + } +} + +/* +ListRunbookActionsParams contains all the parameters to send to the API endpoint + + for the list runbook actions operation. + + Typically these are written to a http.Request. +*/ +type ListRunbookActionsParams struct { + + /* Lite. + + Boolean to determine whether to return a slimified version of the action object's integration + */ + Lite *bool + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Type. + + List actions supporting this specific Runbook type + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list runbook actions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRunbookActionsParams) WithDefaults() *ListRunbookActionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list runbook actions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRunbookActionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list runbook actions params +func (o *ListRunbookActionsParams) WithTimeout(timeout time.Duration) *ListRunbookActionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list runbook actions params +func (o *ListRunbookActionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list runbook actions params +func (o *ListRunbookActionsParams) WithContext(ctx context.Context) *ListRunbookActionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list runbook actions params +func (o *ListRunbookActionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list runbook actions params +func (o *ListRunbookActionsParams) WithHTTPClient(client *http.Client) *ListRunbookActionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list runbook actions params +func (o *ListRunbookActionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLite adds the lite to the list runbook actions params +func (o *ListRunbookActionsParams) WithLite(lite *bool) *ListRunbookActionsParams { + o.SetLite(lite) + return o +} + +// SetLite adds the lite to the list runbook actions params +func (o *ListRunbookActionsParams) SetLite(lite *bool) { + o.Lite = lite +} + +// WithPage adds the page to the list runbook actions params +func (o *ListRunbookActionsParams) WithPage(page *int32) *ListRunbookActionsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list runbook actions params +func (o *ListRunbookActionsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list runbook actions params +func (o *ListRunbookActionsParams) WithPerPage(perPage *int32) *ListRunbookActionsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list runbook actions params +func (o *ListRunbookActionsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithType adds the typeVar to the list runbook actions params +func (o *ListRunbookActionsParams) WithType(typeVar *string) *ListRunbookActionsParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the list runbook actions params +func (o *ListRunbookActionsParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ListRunbookActionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Lite != nil { + + // query param lite + var qrLite bool + + if o.Lite != nil { + qrLite = *o.Lite + } + qLite := swag.FormatBool(qrLite) + if qLite != "" { + + if err := r.SetQueryParam("lite", qLite); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/list_runbook_actions_responses.go b/client/runbooks/list_runbook_actions_responses.go new file mode 100644 index 0000000..583ce4d --- /dev/null +++ b/client/runbooks/list_runbook_actions_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListRunbookActionsReader is a Reader for the ListRunbookActions structure. +type ListRunbookActionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListRunbookActionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListRunbookActionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListRunbookActionsOK creates a ListRunbookActionsOK with default headers values +func NewListRunbookActionsOK() *ListRunbookActionsOK { + return &ListRunbookActionsOK{} +} + +/* +ListRunbookActionsOK describes a response with status code 200, with default header values. + +List all runbook actions available through your connected integrations +*/ +type ListRunbookActionsOK struct { + Payload *models.RunbooksActionsEntityPaginated +} + +// IsSuccess returns true when this list runbook actions o k response has a 2xx status code +func (o *ListRunbookActionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list runbook actions o k response has a 3xx status code +func (o *ListRunbookActionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list runbook actions o k response has a 4xx status code +func (o *ListRunbookActionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list runbook actions o k response has a 5xx status code +func (o *ListRunbookActionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list runbook actions o k response a status code equal to that given +func (o *ListRunbookActionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListRunbookActionsOK) Error() string { + return fmt.Sprintf("[GET /v1/runbooks/actions][%d] listRunbookActionsOK %+v", 200, o.Payload) +} + +func (o *ListRunbookActionsOK) String() string { + return fmt.Sprintf("[GET /v1/runbooks/actions][%d] listRunbookActionsOK %+v", 200, o.Payload) +} + +func (o *ListRunbookActionsOK) GetPayload() *models.RunbooksActionsEntityPaginated { + return o.Payload +} + +func (o *ListRunbookActionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RunbooksActionsEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/runbooks/list_runbook_audits_parameters.go b/client/runbooks/list_runbook_audits_parameters.go new file mode 100644 index 0000000..da90a63 --- /dev/null +++ b/client/runbooks/list_runbook_audits_parameters.go @@ -0,0 +1,277 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListRunbookAuditsParams creates a new ListRunbookAuditsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListRunbookAuditsParams() *ListRunbookAuditsParams { + return &ListRunbookAuditsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListRunbookAuditsParamsWithTimeout creates a new ListRunbookAuditsParams object +// with the ability to set a timeout on a request. +func NewListRunbookAuditsParamsWithTimeout(timeout time.Duration) *ListRunbookAuditsParams { + return &ListRunbookAuditsParams{ + timeout: timeout, + } +} + +// NewListRunbookAuditsParamsWithContext creates a new ListRunbookAuditsParams object +// with the ability to set a context for a request. +func NewListRunbookAuditsParamsWithContext(ctx context.Context) *ListRunbookAuditsParams { + return &ListRunbookAuditsParams{ + Context: ctx, + } +} + +// NewListRunbookAuditsParamsWithHTTPClient creates a new ListRunbookAuditsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListRunbookAuditsParamsWithHTTPClient(client *http.Client) *ListRunbookAuditsParams { + return &ListRunbookAuditsParams{ + HTTPClient: client, + } +} + +/* +ListRunbookAuditsParams contains all the parameters to send to the API endpoint + + for the list runbook audits operation. + + Typically these are written to a http.Request. +*/ +type ListRunbookAuditsParams struct { + + /* AuditableType. + + A query to filter audits by type + + Default: "Runbooks::Step" + */ + AuditableType *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Sort. + + A query to sort audits by their created_at timestamp. Options are 'asc' or 'desc' + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list runbook audits params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRunbookAuditsParams) WithDefaults() *ListRunbookAuditsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list runbook audits params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRunbookAuditsParams) SetDefaults() { + var ( + auditableTypeDefault = string("Runbooks::Step") + ) + + val := ListRunbookAuditsParams{ + AuditableType: &auditableTypeDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the list runbook audits params +func (o *ListRunbookAuditsParams) WithTimeout(timeout time.Duration) *ListRunbookAuditsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list runbook audits params +func (o *ListRunbookAuditsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list runbook audits params +func (o *ListRunbookAuditsParams) WithContext(ctx context.Context) *ListRunbookAuditsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list runbook audits params +func (o *ListRunbookAuditsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list runbook audits params +func (o *ListRunbookAuditsParams) WithHTTPClient(client *http.Client) *ListRunbookAuditsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list runbook audits params +func (o *ListRunbookAuditsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuditableType adds the auditableType to the list runbook audits params +func (o *ListRunbookAuditsParams) WithAuditableType(auditableType *string) *ListRunbookAuditsParams { + o.SetAuditableType(auditableType) + return o +} + +// SetAuditableType adds the auditableType to the list runbook audits params +func (o *ListRunbookAuditsParams) SetAuditableType(auditableType *string) { + o.AuditableType = auditableType +} + +// WithPage adds the page to the list runbook audits params +func (o *ListRunbookAuditsParams) WithPage(page *int32) *ListRunbookAuditsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list runbook audits params +func (o *ListRunbookAuditsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list runbook audits params +func (o *ListRunbookAuditsParams) WithPerPage(perPage *int32) *ListRunbookAuditsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list runbook audits params +func (o *ListRunbookAuditsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithSort adds the sort to the list runbook audits params +func (o *ListRunbookAuditsParams) WithSort(sort *string) *ListRunbookAuditsParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the list runbook audits params +func (o *ListRunbookAuditsParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *ListRunbookAuditsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AuditableType != nil { + + // query param auditable_type + var qrAuditableType string + + if o.AuditableType != nil { + qrAuditableType = *o.AuditableType + } + qAuditableType := qrAuditableType + if qAuditableType != "" { + + if err := r.SetQueryParam("auditable_type", qAuditableType); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Sort != nil { + + // query param sort + var qrSort string + + if o.Sort != nil { + qrSort = *o.Sort + } + qSort := qrSort + if qSort != "" { + + if err := r.SetQueryParam("sort", qSort); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/list_runbook_audits_responses.go b/client/runbooks/list_runbook_audits_responses.go new file mode 100644 index 0000000..31b78cd --- /dev/null +++ b/client/runbooks/list_runbook_audits_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListRunbookAuditsReader is a Reader for the ListRunbookAudits structure. +type ListRunbookAuditsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListRunbookAuditsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListRunbookAuditsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListRunbookAuditsOK creates a ListRunbookAuditsOK with default headers values +func NewListRunbookAuditsOK() *ListRunbookAuditsOK { + return &ListRunbookAuditsOK{} +} + +/* +ListRunbookAuditsOK describes a response with status code 200, with default header values. + +List runbook audits +*/ +type ListRunbookAuditsOK struct { +} + +// IsSuccess returns true when this list runbook audits o k response has a 2xx status code +func (o *ListRunbookAuditsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list runbook audits o k response has a 3xx status code +func (o *ListRunbookAuditsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list runbook audits o k response has a 4xx status code +func (o *ListRunbookAuditsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list runbook audits o k response has a 5xx status code +func (o *ListRunbookAuditsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list runbook audits o k response a status code equal to that given +func (o *ListRunbookAuditsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListRunbookAuditsOK) Error() string { + return fmt.Sprintf("[GET /v1/runbook_audits][%d] listRunbookAuditsOK ", 200) +} + +func (o *ListRunbookAuditsOK) String() string { + return fmt.Sprintf("[GET /v1/runbook_audits][%d] listRunbookAuditsOK ", 200) +} + +func (o *ListRunbookAuditsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/runbooks/list_runbook_executions_parameters.go b/client/runbooks/list_runbook_executions_parameters.go new file mode 100644 index 0000000..733e4d8 --- /dev/null +++ b/client/runbooks/list_runbook_executions_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListRunbookExecutionsParams creates a new ListRunbookExecutionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListRunbookExecutionsParams() *ListRunbookExecutionsParams { + return &ListRunbookExecutionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListRunbookExecutionsParamsWithTimeout creates a new ListRunbookExecutionsParams object +// with the ability to set a timeout on a request. +func NewListRunbookExecutionsParamsWithTimeout(timeout time.Duration) *ListRunbookExecutionsParams { + return &ListRunbookExecutionsParams{ + timeout: timeout, + } +} + +// NewListRunbookExecutionsParamsWithContext creates a new ListRunbookExecutionsParams object +// with the ability to set a context for a request. +func NewListRunbookExecutionsParamsWithContext(ctx context.Context) *ListRunbookExecutionsParams { + return &ListRunbookExecutionsParams{ + Context: ctx, + } +} + +// NewListRunbookExecutionsParamsWithHTTPClient creates a new ListRunbookExecutionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListRunbookExecutionsParamsWithHTTPClient(client *http.Client) *ListRunbookExecutionsParams { + return &ListRunbookExecutionsParams{ + HTTPClient: client, + } +} + +/* +ListRunbookExecutionsParams contains all the parameters to send to the API endpoint + + for the list runbook executions operation. + + Typically these are written to a http.Request. +*/ +type ListRunbookExecutionsParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list runbook executions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRunbookExecutionsParams) WithDefaults() *ListRunbookExecutionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list runbook executions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRunbookExecutionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list runbook executions params +func (o *ListRunbookExecutionsParams) WithTimeout(timeout time.Duration) *ListRunbookExecutionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list runbook executions params +func (o *ListRunbookExecutionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list runbook executions params +func (o *ListRunbookExecutionsParams) WithContext(ctx context.Context) *ListRunbookExecutionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list runbook executions params +func (o *ListRunbookExecutionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list runbook executions params +func (o *ListRunbookExecutionsParams) WithHTTPClient(client *http.Client) *ListRunbookExecutionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list runbook executions params +func (o *ListRunbookExecutionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list runbook executions params +func (o *ListRunbookExecutionsParams) WithPage(page *int32) *ListRunbookExecutionsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list runbook executions params +func (o *ListRunbookExecutionsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list runbook executions params +func (o *ListRunbookExecutionsParams) WithPerPage(perPage *int32) *ListRunbookExecutionsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list runbook executions params +func (o *ListRunbookExecutionsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListRunbookExecutionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/list_runbook_executions_responses.go b/client/runbooks/list_runbook_executions_responses.go new file mode 100644 index 0000000..801fdf5 --- /dev/null +++ b/client/runbooks/list_runbook_executions_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListRunbookExecutionsReader is a Reader for the ListRunbookExecutions structure. +type ListRunbookExecutionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListRunbookExecutionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListRunbookExecutionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListRunbookExecutionsOK creates a ListRunbookExecutionsOK with default headers values +func NewListRunbookExecutionsOK() *ListRunbookExecutionsOK { + return &ListRunbookExecutionsOK{} +} + +/* +ListRunbookExecutionsOK describes a response with status code 200, with default header values. + +List all runbook executions across all runbooks +*/ +type ListRunbookExecutionsOK struct { + Payload *models.RunbooksExecutionEntityPaginated +} + +// IsSuccess returns true when this list runbook executions o k response has a 2xx status code +func (o *ListRunbookExecutionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list runbook executions o k response has a 3xx status code +func (o *ListRunbookExecutionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list runbook executions o k response has a 4xx status code +func (o *ListRunbookExecutionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list runbook executions o k response has a 5xx status code +func (o *ListRunbookExecutionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list runbook executions o k response a status code equal to that given +func (o *ListRunbookExecutionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListRunbookExecutionsOK) Error() string { + return fmt.Sprintf("[GET /v1/runbooks/executions][%d] listRunbookExecutionsOK %+v", 200, o.Payload) +} + +func (o *ListRunbookExecutionsOK) String() string { + return fmt.Sprintf("[GET /v1/runbooks/executions][%d] listRunbookExecutionsOK %+v", 200, o.Payload) +} + +func (o *ListRunbookExecutionsOK) GetPayload() *models.RunbooksExecutionEntityPaginated { + return o.Payload +} + +func (o *ListRunbookExecutionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RunbooksExecutionEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/runbooks/list_runbooks_parameters.go b/client/runbooks/list_runbooks_parameters.go new file mode 100644 index 0000000..f6e2fa4 --- /dev/null +++ b/client/runbooks/list_runbooks_parameters.go @@ -0,0 +1,366 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListRunbooksParams creates a new ListRunbooksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListRunbooksParams() *ListRunbooksParams { + return &ListRunbooksParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListRunbooksParamsWithTimeout creates a new ListRunbooksParams object +// with the ability to set a timeout on a request. +func NewListRunbooksParamsWithTimeout(timeout time.Duration) *ListRunbooksParams { + return &ListRunbooksParams{ + timeout: timeout, + } +} + +// NewListRunbooksParamsWithContext creates a new ListRunbooksParams object +// with the ability to set a context for a request. +func NewListRunbooksParamsWithContext(ctx context.Context) *ListRunbooksParams { + return &ListRunbooksParams{ + Context: ctx, + } +} + +// NewListRunbooksParamsWithHTTPClient creates a new ListRunbooksParams object +// with the ability to set a custom HTTPClient for a request. +func NewListRunbooksParamsWithHTTPClient(client *http.Client) *ListRunbooksParams { + return &ListRunbooksParams{ + HTTPClient: client, + } +} + +/* +ListRunbooksParams contains all the parameters to send to the API endpoint + + for the list runbooks operation. + + Typically these are written to a http.Request. +*/ +type ListRunbooksParams struct { + + /* Name. + + A query to search runbooks by their name + */ + Name *string + + /* OrderBy. + + Sort runbooks by their updated date or name. Accepts 'updated_at', 'name', and 'created_at'. + */ + OrderBy *string + + /* OrderDirection. + + Allows assigning a direction to how the specified `order_by` parameter is sorted. This parameter must be paired with `order_by` and does nothing on its own. + */ + OrderDirection *string + + /* Owners. + + A query to search runbooks by their owners + */ + Owners *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Sort. + + Sort runbooks by their updated date. Accepts 'asc', 'desc'. This parameter is deprecated in favor of 'order_by' and 'order_direction'. + */ + Sort *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list runbooks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRunbooksParams) WithDefaults() *ListRunbooksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list runbooks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListRunbooksParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list runbooks params +func (o *ListRunbooksParams) WithTimeout(timeout time.Duration) *ListRunbooksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list runbooks params +func (o *ListRunbooksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list runbooks params +func (o *ListRunbooksParams) WithContext(ctx context.Context) *ListRunbooksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list runbooks params +func (o *ListRunbooksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list runbooks params +func (o *ListRunbooksParams) WithHTTPClient(client *http.Client) *ListRunbooksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list runbooks params +func (o *ListRunbooksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the list runbooks params +func (o *ListRunbooksParams) WithName(name *string) *ListRunbooksParams { + o.SetName(name) + return o +} + +// SetName adds the name to the list runbooks params +func (o *ListRunbooksParams) SetName(name *string) { + o.Name = name +} + +// WithOrderBy adds the orderBy to the list runbooks params +func (o *ListRunbooksParams) WithOrderBy(orderBy *string) *ListRunbooksParams { + o.SetOrderBy(orderBy) + return o +} + +// SetOrderBy adds the orderBy to the list runbooks params +func (o *ListRunbooksParams) SetOrderBy(orderBy *string) { + o.OrderBy = orderBy +} + +// WithOrderDirection adds the orderDirection to the list runbooks params +func (o *ListRunbooksParams) WithOrderDirection(orderDirection *string) *ListRunbooksParams { + o.SetOrderDirection(orderDirection) + return o +} + +// SetOrderDirection adds the orderDirection to the list runbooks params +func (o *ListRunbooksParams) SetOrderDirection(orderDirection *string) { + o.OrderDirection = orderDirection +} + +// WithOwners adds the owners to the list runbooks params +func (o *ListRunbooksParams) WithOwners(owners *string) *ListRunbooksParams { + o.SetOwners(owners) + return o +} + +// SetOwners adds the owners to the list runbooks params +func (o *ListRunbooksParams) SetOwners(owners *string) { + o.Owners = owners +} + +// WithPage adds the page to the list runbooks params +func (o *ListRunbooksParams) WithPage(page *int32) *ListRunbooksParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list runbooks params +func (o *ListRunbooksParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list runbooks params +func (o *ListRunbooksParams) WithPerPage(perPage *int32) *ListRunbooksParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list runbooks params +func (o *ListRunbooksParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithSort adds the sort to the list runbooks params +func (o *ListRunbooksParams) WithSort(sort *string) *ListRunbooksParams { + o.SetSort(sort) + return o +} + +// SetSort adds the sort to the list runbooks params +func (o *ListRunbooksParams) SetSort(sort *string) { + o.Sort = sort +} + +// WriteToRequest writes these params to a swagger request +func (o *ListRunbooksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.OrderBy != nil { + + // query param order_by + var qrOrderBy string + + if o.OrderBy != nil { + qrOrderBy = *o.OrderBy + } + qOrderBy := qrOrderBy + if qOrderBy != "" { + + if err := r.SetQueryParam("order_by", qOrderBy); err != nil { + return err + } + } + } + + if o.OrderDirection != nil { + + // query param order_direction + var qrOrderDirection string + + if o.OrderDirection != nil { + qrOrderDirection = *o.OrderDirection + } + qOrderDirection := qrOrderDirection + if qOrderDirection != "" { + + if err := r.SetQueryParam("order_direction", qOrderDirection); err != nil { + return err + } + } + } + + if o.Owners != nil { + + // query param owners + var qrOwners string + + if o.Owners != nil { + qrOwners = *o.Owners + } + qOwners := qrOwners + if qOwners != "" { + + if err := r.SetQueryParam("owners", qOwners); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Sort != nil { + + // query param sort + var qrSort string + + if o.Sort != nil { + qrSort = *o.Sort + } + qSort := qrSort + if qSort != "" { + + if err := r.SetQueryParam("sort", qSort); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/list_runbooks_responses.go b/client/runbooks/list_runbooks_responses.go new file mode 100644 index 0000000..85cdb91 --- /dev/null +++ b/client/runbooks/list_runbooks_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListRunbooksReader is a Reader for the ListRunbooks structure. +type ListRunbooksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListRunbooksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListRunbooksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListRunbooksOK creates a ListRunbooksOK with default headers values +func NewListRunbooksOK() *ListRunbooksOK { + return &ListRunbooksOK{} +} + +/* +ListRunbooksOK describes a response with status code 200, with default header values. + +Lists all available runbooks. +*/ +type ListRunbooksOK struct { + Payload *models.RunbookEntity +} + +// IsSuccess returns true when this list runbooks o k response has a 2xx status code +func (o *ListRunbooksOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list runbooks o k response has a 3xx status code +func (o *ListRunbooksOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list runbooks o k response has a 4xx status code +func (o *ListRunbooksOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list runbooks o k response has a 5xx status code +func (o *ListRunbooksOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list runbooks o k response a status code equal to that given +func (o *ListRunbooksOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListRunbooksOK) Error() string { + return fmt.Sprintf("[GET /v1/runbooks][%d] listRunbooksOK %+v", 200, o.Payload) +} + +func (o *ListRunbooksOK) String() string { + return fmt.Sprintf("[GET /v1/runbooks][%d] listRunbooksOK %+v", 200, o.Payload) +} + +func (o *ListRunbooksOK) GetPayload() *models.RunbookEntity { + return o.Payload +} + +func (o *ListRunbooksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RunbookEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/runbooks/runbooks_client.go b/client/runbooks/runbooks_client.go index 9341dd9..682aacd 100644 --- a/client/runbooks/runbooks_client.go +++ b/client/runbooks/runbooks_client.go @@ -30,58 +30,58 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1RunbooksExecutionsExecutionID(params *DeleteV1RunbooksExecutionsExecutionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1RunbooksExecutionsExecutionIDNoContent, error) + CreateRunbook(params *CreateRunbookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateRunbookCreated, error) - DeleteV1RunbooksRunbookID(params *DeleteV1RunbooksRunbookIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1RunbooksRunbookIDOK, error) + CreateRunbookExecution(params *CreateRunbookExecutionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateRunbookExecutionCreated, error) - GetV1RunbookAudits(params *GetV1RunbookAuditsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbookAuditsOK, error) + DeleteRunbook(params *DeleteRunbookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteRunbookOK, error) - GetV1Runbooks(params *GetV1RunbooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksOK, error) + DeleteRunbookExecution(params *DeleteRunbookExecutionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteRunbookExecutionNoContent, error) - GetV1RunbooksActions(params *GetV1RunbooksActionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksActionsOK, error) + GetRunbook(params *GetRunbookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRunbookOK, error) - GetV1RunbooksExecutions(params *GetV1RunbooksExecutionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksExecutionsOK, error) + GetRunbookActionFieldOptions(params *GetRunbookActionFieldOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRunbookActionFieldOptionsOK, error) - GetV1RunbooksExecutionsExecutionID(params *GetV1RunbooksExecutionsExecutionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksExecutionsExecutionIDOK, error) + GetRunbookExecution(params *GetRunbookExecutionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRunbookExecutionOK, error) - GetV1RunbooksExecutionsExecutionIDStepsStepIDScript(params *GetV1RunbooksExecutionsExecutionIDStepsStepIDScriptParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksExecutionsExecutionIDStepsStepIDScriptOK, error) + GetRunbookExecutionStepScript(params *GetRunbookExecutionStepScriptParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRunbookExecutionStepScriptOK, error) - GetV1RunbooksRunbookID(params *GetV1RunbooksRunbookIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksRunbookIDOK, error) + ListRunbookActions(params *ListRunbookActionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRunbookActionsOK, error) - GetV1RunbooksSelectOptionsIntegrationSlugActionSlugField(params *GetV1RunbooksSelectOptionsIntegrationSlugActionSlugFieldParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksSelectOptionsIntegrationSlugActionSlugFieldOK, error) + ListRunbookAudits(params *ListRunbookAuditsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRunbookAuditsOK, error) - PostV1Runbooks(params *PostV1RunbooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1RunbooksCreated, error) + ListRunbookExecutions(params *ListRunbookExecutionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRunbookExecutionsOK, error) - PostV1RunbooksExecutions(params *PostV1RunbooksExecutionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1RunbooksExecutionsCreated, error) + ListRunbooks(params *ListRunbooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRunbooksOK, error) - PutV1RunbooksExecutionsExecutionIDStepsStepID(params *PutV1RunbooksExecutionsExecutionIDStepsStepIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1RunbooksExecutionsExecutionIDStepsStepIDOK, error) + UpdateRunbook(params *UpdateRunbookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateRunbookOK, error) - PutV1RunbooksExecutionsExecutionIDStepsStepIDScriptState(params *PutV1RunbooksExecutionsExecutionIDStepsStepIDScriptStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1RunbooksExecutionsExecutionIDStepsStepIDScriptStateOK, error) + UpdateRunbookExecutionStep(params *UpdateRunbookExecutionStepParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateRunbookExecutionStepOK, error) - PutV1RunbooksRunbookID(params *PutV1RunbooksRunbookIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1RunbooksRunbookIDOK, error) + UpdateRunbookExecutionStepScript(params *UpdateRunbookExecutionStepScriptParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateRunbookExecutionStepScriptOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1RunbooksExecutionsExecutionID terminates a runbook execution +CreateRunbook creates a runbook -Terminates a runbook execution, preventing any further steps from being executed +Create a new runbook for use with incidents. */ -func (a *Client) DeleteV1RunbooksExecutionsExecutionID(params *DeleteV1RunbooksExecutionsExecutionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1RunbooksExecutionsExecutionIDNoContent, error) { +func (a *Client) CreateRunbook(params *CreateRunbookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateRunbookCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1RunbooksExecutionsExecutionIDParams() + params = NewCreateRunbookParams() } op := &runtime.ClientOperation{ - ID: "deleteV1RunbooksExecutionsExecutionId", - Method: "DELETE", - PathPattern: "/v1/runbooks/executions/{execution_id}", + ID: "create_runbook", + Method: "POST", + PathPattern: "/v1/runbooks", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1RunbooksExecutionsExecutionIDReader{formats: a.formats}, + Reader: &CreateRunbookReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -94,35 +94,35 @@ func (a *Client) DeleteV1RunbooksExecutionsExecutionID(params *DeleteV1RunbooksE if err != nil { return nil, err } - success, ok := result.(*DeleteV1RunbooksExecutionsExecutionIDNoContent) + success, ok := result.(*CreateRunbookCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1RunbooksExecutionsExecutionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_runbook: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1RunbooksRunbookID deletes a runbook +CreateRunbookExecution creates a runbook execution -Delete a runbook and make it unavailable for any future incidents. +Attaches a runbook to an incident and executes it */ -func (a *Client) DeleteV1RunbooksRunbookID(params *DeleteV1RunbooksRunbookIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1RunbooksRunbookIDOK, error) { +func (a *Client) CreateRunbookExecution(params *CreateRunbookExecutionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateRunbookExecutionCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1RunbooksRunbookIDParams() + params = NewCreateRunbookExecutionParams() } op := &runtime.ClientOperation{ - ID: "deleteV1RunbooksRunbookId", - Method: "DELETE", - PathPattern: "/v1/runbooks/{runbook_id}", + ID: "create_runbook_execution", + Method: "POST", + PathPattern: "/v1/runbooks/executions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1RunbooksRunbookIDReader{formats: a.formats}, + Reader: &CreateRunbookExecutionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -135,35 +135,35 @@ func (a *Client) DeleteV1RunbooksRunbookID(params *DeleteV1RunbooksRunbookIDPara if err != nil { return nil, err } - success, ok := result.(*DeleteV1RunbooksRunbookIDOK) + success, ok := result.(*CreateRunbookExecutionCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1RunbooksRunbookId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_runbook_execution: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1RunbookAudits lists runbook audits +DeleteRunbook deletes a runbook -Please contact support to enable audit logging for your account. +Delete a runbook and make it unavailable for any future incidents. */ -func (a *Client) GetV1RunbookAudits(params *GetV1RunbookAuditsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbookAuditsOK, error) { +func (a *Client) DeleteRunbook(params *DeleteRunbookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteRunbookOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1RunbookAuditsParams() + params = NewDeleteRunbookParams() } op := &runtime.ClientOperation{ - ID: "getV1RunbookAudits", - Method: "GET", - PathPattern: "/v1/runbook_audits", + ID: "delete_runbook", + Method: "DELETE", + PathPattern: "/v1/runbooks/{runbook_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1RunbookAuditsReader{formats: a.formats}, + Reader: &DeleteRunbookReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -176,35 +176,35 @@ func (a *Client) GetV1RunbookAudits(params *GetV1RunbookAuditsParams, authInfo r if err != nil { return nil, err } - success, ok := result.(*GetV1RunbookAuditsOK) + success, ok := result.(*DeleteRunbookOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1RunbookAudits: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_runbook: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Runbooks lists runbooks +DeleteRunbookExecution terminates a runbook execution -Lists all available runbooks. +Terminates a runbook execution, preventing any further steps from being executed */ -func (a *Client) GetV1Runbooks(params *GetV1RunbooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksOK, error) { +func (a *Client) DeleteRunbookExecution(params *DeleteRunbookExecutionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteRunbookExecutionNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1RunbooksParams() + params = NewDeleteRunbookExecutionParams() } op := &runtime.ClientOperation{ - ID: "getV1Runbooks", - Method: "GET", - PathPattern: "/v1/runbooks", + ID: "delete_runbook_execution", + Method: "DELETE", + PathPattern: "/v1/runbooks/executions/{execution_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1RunbooksReader{formats: a.formats}, + Reader: &DeleteRunbookExecutionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -217,35 +217,35 @@ func (a *Client) GetV1Runbooks(params *GetV1RunbooksParams, authInfo runtime.Cli if err != nil { return nil, err } - success, ok := result.(*GetV1RunbooksOK) + success, ok := result.(*DeleteRunbookExecutionNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Runbooks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_runbook_execution: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1RunbooksActions lists runbook actions +GetRunbook gets a runbook -List all runbook actions available through your connected integrations +Get a runbook and all its configuration */ -func (a *Client) GetV1RunbooksActions(params *GetV1RunbooksActionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksActionsOK, error) { +func (a *Client) GetRunbook(params *GetRunbookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRunbookOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1RunbooksActionsParams() + params = NewGetRunbookParams() } op := &runtime.ClientOperation{ - ID: "getV1RunbooksActions", + ID: "get_runbook", Method: "GET", - PathPattern: "/v1/runbooks/actions", + PathPattern: "/v1/runbooks/{runbook_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1RunbooksActionsReader{formats: a.formats}, + Reader: &GetRunbookReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -258,35 +258,35 @@ func (a *Client) GetV1RunbooksActions(params *GetV1RunbooksActionsParams, authIn if err != nil { return nil, err } - success, ok := result.(*GetV1RunbooksActionsOK) + success, ok := result.(*GetRunbookOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1RunbooksActions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_runbook: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1RunbooksExecutions lists runbook executions +GetRunbookActionFieldOptions lists select options for a runbook integration action field -List all runbook executions across all runbooks +List select options for a runbook integration action field */ -func (a *Client) GetV1RunbooksExecutions(params *GetV1RunbooksExecutionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksExecutionsOK, error) { +func (a *Client) GetRunbookActionFieldOptions(params *GetRunbookActionFieldOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRunbookActionFieldOptionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1RunbooksExecutionsParams() + params = NewGetRunbookActionFieldOptionsParams() } op := &runtime.ClientOperation{ - ID: "getV1RunbooksExecutions", + ID: "get_runbook_action_field_options", Method: "GET", - PathPattern: "/v1/runbooks/executions", + PathPattern: "/v1/runbooks/select_options/{integration_slug}/{action_slug}/{field}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1RunbooksExecutionsReader{formats: a.formats}, + Reader: &GetRunbookActionFieldOptionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -299,35 +299,35 @@ func (a *Client) GetV1RunbooksExecutions(params *GetV1RunbooksExecutionsParams, if err != nil { return nil, err } - success, ok := result.(*GetV1RunbooksExecutionsOK) + success, ok := result.(*GetRunbookActionFieldOptionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1RunbooksExecutions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_runbook_action_field_options: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1RunbooksExecutionsExecutionID gets a runbook execution +GetRunbookExecution gets a runbook execution Retrieve a runbook execution by ID */ -func (a *Client) GetV1RunbooksExecutionsExecutionID(params *GetV1RunbooksExecutionsExecutionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksExecutionsExecutionIDOK, error) { +func (a *Client) GetRunbookExecution(params *GetRunbookExecutionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRunbookExecutionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1RunbooksExecutionsExecutionIDParams() + params = NewGetRunbookExecutionParams() } op := &runtime.ClientOperation{ - ID: "getV1RunbooksExecutionsExecutionId", + ID: "get_runbook_execution", Method: "GET", PathPattern: "/v1/runbooks/executions/{execution_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1RunbooksExecutionsExecutionIDReader{formats: a.formats}, + Reader: &GetRunbookExecutionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -340,35 +340,35 @@ func (a *Client) GetV1RunbooksExecutionsExecutionID(params *GetV1RunbooksExecuti if err != nil { return nil, err } - success, ok := result.(*GetV1RunbooksExecutionsExecutionIDOK) + success, ok := result.(*GetRunbookExecutionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1RunbooksExecutionsExecutionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_runbook_execution: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1RunbooksExecutionsExecutionIDStepsStepIDScript gets a step s bash script +GetRunbookExecutionStepScript gets a step s bash script Retrieves the bash script from a "script" step. */ -func (a *Client) GetV1RunbooksExecutionsExecutionIDStepsStepIDScript(params *GetV1RunbooksExecutionsExecutionIDStepsStepIDScriptParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksExecutionsExecutionIDStepsStepIDScriptOK, error) { +func (a *Client) GetRunbookExecutionStepScript(params *GetRunbookExecutionStepScriptParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetRunbookExecutionStepScriptOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1RunbooksExecutionsExecutionIDStepsStepIDScriptParams() + params = NewGetRunbookExecutionStepScriptParams() } op := &runtime.ClientOperation{ - ID: "getV1RunbooksExecutionsExecutionIdStepsStepIdScript", + ID: "get_runbook_execution_step_script", Method: "GET", PathPattern: "/v1/runbooks/executions/{execution_id}/steps/{step_id}/script", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1RunbooksExecutionsExecutionIDStepsStepIDScriptReader{formats: a.formats}, + Reader: &GetRunbookExecutionStepScriptReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -381,35 +381,35 @@ func (a *Client) GetV1RunbooksExecutionsExecutionIDStepsStepIDScript(params *Get if err != nil { return nil, err } - success, ok := result.(*GetV1RunbooksExecutionsExecutionIDStepsStepIDScriptOK) + success, ok := result.(*GetRunbookExecutionStepScriptOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1RunbooksExecutionsExecutionIdStepsStepIdScript: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_runbook_execution_step_script: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1RunbooksRunbookID gets a runbook +ListRunbookActions lists runbook actions -Get a runbook and all its configuration +List all runbook actions available through your connected integrations */ -func (a *Client) GetV1RunbooksRunbookID(params *GetV1RunbooksRunbookIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksRunbookIDOK, error) { +func (a *Client) ListRunbookActions(params *ListRunbookActionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRunbookActionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1RunbooksRunbookIDParams() + params = NewListRunbookActionsParams() } op := &runtime.ClientOperation{ - ID: "getV1RunbooksRunbookId", + ID: "list_runbook_actions", Method: "GET", - PathPattern: "/v1/runbooks/{runbook_id}", + PathPattern: "/v1/runbooks/actions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1RunbooksRunbookIDReader{formats: a.formats}, + Reader: &ListRunbookActionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -422,35 +422,35 @@ func (a *Client) GetV1RunbooksRunbookID(params *GetV1RunbooksRunbookIDParams, au if err != nil { return nil, err } - success, ok := result.(*GetV1RunbooksRunbookIDOK) + success, ok := result.(*ListRunbookActionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1RunbooksRunbookId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_runbook_actions: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1RunbooksSelectOptionsIntegrationSlugActionSlugField lists select options for a runbook integration action field +ListRunbookAudits lists runbook audits -List select options for a runbook integration action field +Please contact support to enable audit logging for your account. */ -func (a *Client) GetV1RunbooksSelectOptionsIntegrationSlugActionSlugField(params *GetV1RunbooksSelectOptionsIntegrationSlugActionSlugFieldParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1RunbooksSelectOptionsIntegrationSlugActionSlugFieldOK, error) { +func (a *Client) ListRunbookAudits(params *ListRunbookAuditsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRunbookAuditsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1RunbooksSelectOptionsIntegrationSlugActionSlugFieldParams() + params = NewListRunbookAuditsParams() } op := &runtime.ClientOperation{ - ID: "getV1RunbooksSelectOptionsIntegrationSlugActionSlugField", + ID: "list_runbook_audits", Method: "GET", - PathPattern: "/v1/runbooks/select_options/{integration_slug}/{action_slug}/{field}", + PathPattern: "/v1/runbook_audits", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1RunbooksSelectOptionsIntegrationSlugActionSlugFieldReader{formats: a.formats}, + Reader: &ListRunbookAuditsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -463,35 +463,35 @@ func (a *Client) GetV1RunbooksSelectOptionsIntegrationSlugActionSlugField(params if err != nil { return nil, err } - success, ok := result.(*GetV1RunbooksSelectOptionsIntegrationSlugActionSlugFieldOK) + success, ok := result.(*ListRunbookAuditsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1RunbooksSelectOptionsIntegrationSlugActionSlugField: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_runbook_audits: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1Runbooks creates a runbook +ListRunbookExecutions lists runbook executions -Create a new runbook for use with incidents. +List all runbook executions across all runbooks */ -func (a *Client) PostV1Runbooks(params *PostV1RunbooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1RunbooksCreated, error) { +func (a *Client) ListRunbookExecutions(params *ListRunbookExecutionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRunbookExecutionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1RunbooksParams() + params = NewListRunbookExecutionsParams() } op := &runtime.ClientOperation{ - ID: "postV1Runbooks", - Method: "POST", - PathPattern: "/v1/runbooks", + ID: "list_runbook_executions", + Method: "GET", + PathPattern: "/v1/runbooks/executions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1RunbooksReader{formats: a.formats}, + Reader: &ListRunbookExecutionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -504,35 +504,35 @@ func (a *Client) PostV1Runbooks(params *PostV1RunbooksParams, authInfo runtime.C if err != nil { return nil, err } - success, ok := result.(*PostV1RunbooksCreated) + success, ok := result.(*ListRunbookExecutionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1Runbooks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_runbook_executions: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1RunbooksExecutions creates a runbook execution +ListRunbooks lists runbooks -Attaches a runbook to an incident and executes it +Lists all available runbooks. */ -func (a *Client) PostV1RunbooksExecutions(params *PostV1RunbooksExecutionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1RunbooksExecutionsCreated, error) { +func (a *Client) ListRunbooks(params *ListRunbooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRunbooksOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1RunbooksExecutionsParams() + params = NewListRunbooksParams() } op := &runtime.ClientOperation{ - ID: "postV1RunbooksExecutions", - Method: "POST", - PathPattern: "/v1/runbooks/executions", + ID: "list_runbooks", + Method: "GET", + PathPattern: "/v1/runbooks", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1RunbooksExecutionsReader{formats: a.formats}, + Reader: &ListRunbooksReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -545,35 +545,37 @@ func (a *Client) PostV1RunbooksExecutions(params *PostV1RunbooksExecutionsParams if err != nil { return nil, err } - success, ok := result.(*PostV1RunbooksExecutionsCreated) + success, ok := result.(*ListRunbooksOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1RunbooksExecutions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_runbooks: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1RunbooksExecutionsExecutionIDStepsStepID updates a runbook step execution + UpdateRunbook updates a runbook -Updates a runbook step execution, especially for changing the state of a step execution. + Update a runbook and any attachment rules associated with it. This endpoint is used to configure nearly everything + +about a runbook, including but not limited to the steps, environments, attachment rules, and severities. */ -func (a *Client) PutV1RunbooksExecutionsExecutionIDStepsStepID(params *PutV1RunbooksExecutionsExecutionIDStepsStepIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1RunbooksExecutionsExecutionIDStepsStepIDOK, error) { +func (a *Client) UpdateRunbook(params *UpdateRunbookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateRunbookOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1RunbooksExecutionsExecutionIDStepsStepIDParams() + params = NewUpdateRunbookParams() } op := &runtime.ClientOperation{ - ID: "putV1RunbooksExecutionsExecutionIdStepsStepId", + ID: "update_runbook", Method: "PUT", - PathPattern: "/v1/runbooks/executions/{execution_id}/steps/{step_id}", + PathPattern: "/v1/runbooks/{runbook_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1RunbooksExecutionsExecutionIDStepsStepIDReader{formats: a.formats}, + Reader: &UpdateRunbookReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -586,35 +588,35 @@ func (a *Client) PutV1RunbooksExecutionsExecutionIDStepsStepID(params *PutV1Runb if err != nil { return nil, err } - success, ok := result.(*PutV1RunbooksExecutionsExecutionIDStepsStepIDOK) + success, ok := result.(*UpdateRunbookOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1RunbooksExecutionsExecutionIdStepsStepId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_runbook: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1RunbooksExecutionsExecutionIDStepsStepIDScriptState updates a script step s execution status +UpdateRunbookExecutionStep updates a runbook step execution -Updates the execution's step. +Updates a runbook step execution, especially for changing the state of a step execution. */ -func (a *Client) PutV1RunbooksExecutionsExecutionIDStepsStepIDScriptState(params *PutV1RunbooksExecutionsExecutionIDStepsStepIDScriptStateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1RunbooksExecutionsExecutionIDStepsStepIDScriptStateOK, error) { +func (a *Client) UpdateRunbookExecutionStep(params *UpdateRunbookExecutionStepParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateRunbookExecutionStepOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1RunbooksExecutionsExecutionIDStepsStepIDScriptStateParams() + params = NewUpdateRunbookExecutionStepParams() } op := &runtime.ClientOperation{ - ID: "putV1RunbooksExecutionsExecutionIdStepsStepIdScriptState", + ID: "update_runbook_execution_step", Method: "PUT", - PathPattern: "/v1/runbooks/executions/{execution_id}/steps/{step_id}/script/{state}", + PathPattern: "/v1/runbooks/executions/{execution_id}/steps/{step_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1RunbooksExecutionsExecutionIDStepsStepIDScriptStateReader{formats: a.formats}, + Reader: &UpdateRunbookExecutionStepReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -627,37 +629,35 @@ func (a *Client) PutV1RunbooksExecutionsExecutionIDStepsStepIDScriptState(params if err != nil { return nil, err } - success, ok := result.(*PutV1RunbooksExecutionsExecutionIDStepsStepIDScriptStateOK) + success, ok := result.(*UpdateRunbookExecutionStepOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1RunbooksExecutionsExecutionIdStepsStepIdScriptState: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_runbook_execution_step: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - PutV1RunbooksRunbookID updates a runbook - - Update a runbook and any attachment rules associated with it. This endpoint is used to configure nearly everything +UpdateRunbookExecutionStepScript updates a script step s execution status -about a runbook, including but not limited to the steps, environments, attachment rules, and severities. +Updates the execution's step. */ -func (a *Client) PutV1RunbooksRunbookID(params *PutV1RunbooksRunbookIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1RunbooksRunbookIDOK, error) { +func (a *Client) UpdateRunbookExecutionStepScript(params *UpdateRunbookExecutionStepScriptParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateRunbookExecutionStepScriptOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1RunbooksRunbookIDParams() + params = NewUpdateRunbookExecutionStepScriptParams() } op := &runtime.ClientOperation{ - ID: "putV1RunbooksRunbookId", + ID: "update_runbook_execution_step_script", Method: "PUT", - PathPattern: "/v1/runbooks/{runbook_id}", + PathPattern: "/v1/runbooks/executions/{execution_id}/steps/{step_id}/script/{state}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1RunbooksRunbookIDReader{formats: a.formats}, + Reader: &UpdateRunbookExecutionStepScriptReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -670,13 +670,13 @@ func (a *Client) PutV1RunbooksRunbookID(params *PutV1RunbooksRunbookIDParams, au if err != nil { return nil, err } - success, ok := result.(*PutV1RunbooksRunbookIDOK) + success, ok := result.(*UpdateRunbookExecutionStepScriptOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1RunbooksRunbookId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_runbook_execution_step_script: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/runbooks/update_runbook_execution_step_parameters.go b/client/runbooks/update_runbook_execution_step_parameters.go new file mode 100644 index 0000000..86e32db --- /dev/null +++ b/client/runbooks/update_runbook_execution_step_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateRunbookExecutionStepParams creates a new UpdateRunbookExecutionStepParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateRunbookExecutionStepParams() *UpdateRunbookExecutionStepParams { + return &UpdateRunbookExecutionStepParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateRunbookExecutionStepParamsWithTimeout creates a new UpdateRunbookExecutionStepParams object +// with the ability to set a timeout on a request. +func NewUpdateRunbookExecutionStepParamsWithTimeout(timeout time.Duration) *UpdateRunbookExecutionStepParams { + return &UpdateRunbookExecutionStepParams{ + timeout: timeout, + } +} + +// NewUpdateRunbookExecutionStepParamsWithContext creates a new UpdateRunbookExecutionStepParams object +// with the ability to set a context for a request. +func NewUpdateRunbookExecutionStepParamsWithContext(ctx context.Context) *UpdateRunbookExecutionStepParams { + return &UpdateRunbookExecutionStepParams{ + Context: ctx, + } +} + +// NewUpdateRunbookExecutionStepParamsWithHTTPClient creates a new UpdateRunbookExecutionStepParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateRunbookExecutionStepParamsWithHTTPClient(client *http.Client) *UpdateRunbookExecutionStepParams { + return &UpdateRunbookExecutionStepParams{ + HTTPClient: client, + } +} + +/* +UpdateRunbookExecutionStepParams contains all the parameters to send to the API endpoint + + for the update runbook execution step operation. + + Typically these are written to a http.Request. +*/ +type UpdateRunbookExecutionStepParams struct { + + // ExecutionID. + ExecutionID string + + // StepID. + StepID string + + // UpdateRunbookExecutionStep. + UpdateRunbookExecutionStep *models.UpdateRunbookExecutionStep + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update runbook execution step params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateRunbookExecutionStepParams) WithDefaults() *UpdateRunbookExecutionStepParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update runbook execution step params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateRunbookExecutionStepParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update runbook execution step params +func (o *UpdateRunbookExecutionStepParams) WithTimeout(timeout time.Duration) *UpdateRunbookExecutionStepParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update runbook execution step params +func (o *UpdateRunbookExecutionStepParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update runbook execution step params +func (o *UpdateRunbookExecutionStepParams) WithContext(ctx context.Context) *UpdateRunbookExecutionStepParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update runbook execution step params +func (o *UpdateRunbookExecutionStepParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update runbook execution step params +func (o *UpdateRunbookExecutionStepParams) WithHTTPClient(client *http.Client) *UpdateRunbookExecutionStepParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update runbook execution step params +func (o *UpdateRunbookExecutionStepParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithExecutionID adds the executionID to the update runbook execution step params +func (o *UpdateRunbookExecutionStepParams) WithExecutionID(executionID string) *UpdateRunbookExecutionStepParams { + o.SetExecutionID(executionID) + return o +} + +// SetExecutionID adds the executionId to the update runbook execution step params +func (o *UpdateRunbookExecutionStepParams) SetExecutionID(executionID string) { + o.ExecutionID = executionID +} + +// WithStepID adds the stepID to the update runbook execution step params +func (o *UpdateRunbookExecutionStepParams) WithStepID(stepID string) *UpdateRunbookExecutionStepParams { + o.SetStepID(stepID) + return o +} + +// SetStepID adds the stepId to the update runbook execution step params +func (o *UpdateRunbookExecutionStepParams) SetStepID(stepID string) { + o.StepID = stepID +} + +// WithUpdateRunbookExecutionStep adds the updateRunbookExecutionStep to the update runbook execution step params +func (o *UpdateRunbookExecutionStepParams) WithUpdateRunbookExecutionStep(updateRunbookExecutionStep *models.UpdateRunbookExecutionStep) *UpdateRunbookExecutionStepParams { + o.SetUpdateRunbookExecutionStep(updateRunbookExecutionStep) + return o +} + +// SetUpdateRunbookExecutionStep adds the updateRunbookExecutionStep to the update runbook execution step params +func (o *UpdateRunbookExecutionStepParams) SetUpdateRunbookExecutionStep(updateRunbookExecutionStep *models.UpdateRunbookExecutionStep) { + o.UpdateRunbookExecutionStep = updateRunbookExecutionStep +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateRunbookExecutionStepParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param execution_id + if err := r.SetPathParam("execution_id", o.ExecutionID); err != nil { + return err + } + + // path param step_id + if err := r.SetPathParam("step_id", o.StepID); err != nil { + return err + } + if o.UpdateRunbookExecutionStep != nil { + if err := r.SetBodyParam(o.UpdateRunbookExecutionStep); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/update_runbook_execution_step_responses.go b/client/runbooks/update_runbook_execution_step_responses.go new file mode 100644 index 0000000..bb0c285 --- /dev/null +++ b/client/runbooks/update_runbook_execution_step_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateRunbookExecutionStepReader is a Reader for the UpdateRunbookExecutionStep structure. +type UpdateRunbookExecutionStepReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateRunbookExecutionStepReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateRunbookExecutionStepOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateRunbookExecutionStepOK creates a UpdateRunbookExecutionStepOK with default headers values +func NewUpdateRunbookExecutionStepOK() *UpdateRunbookExecutionStepOK { + return &UpdateRunbookExecutionStepOK{} +} + +/* +UpdateRunbookExecutionStepOK describes a response with status code 200, with default header values. + +Updates a runbook step execution, especially for changing the state of a step execution. +*/ +type UpdateRunbookExecutionStepOK struct { + Payload *models.RunbooksExecutionEntity +} + +// IsSuccess returns true when this update runbook execution step o k response has a 2xx status code +func (o *UpdateRunbookExecutionStepOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update runbook execution step o k response has a 3xx status code +func (o *UpdateRunbookExecutionStepOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update runbook execution step o k response has a 4xx status code +func (o *UpdateRunbookExecutionStepOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update runbook execution step o k response has a 5xx status code +func (o *UpdateRunbookExecutionStepOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update runbook execution step o k response a status code equal to that given +func (o *UpdateRunbookExecutionStepOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateRunbookExecutionStepOK) Error() string { + return fmt.Sprintf("[PUT /v1/runbooks/executions/{execution_id}/steps/{step_id}][%d] updateRunbookExecutionStepOK %+v", 200, o.Payload) +} + +func (o *UpdateRunbookExecutionStepOK) String() string { + return fmt.Sprintf("[PUT /v1/runbooks/executions/{execution_id}/steps/{step_id}][%d] updateRunbookExecutionStepOK %+v", 200, o.Payload) +} + +func (o *UpdateRunbookExecutionStepOK) GetPayload() *models.RunbooksExecutionEntity { + return o.Payload +} + +func (o *UpdateRunbookExecutionStepOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RunbooksExecutionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/runbooks/update_runbook_execution_step_script_parameters.go b/client/runbooks/update_runbook_execution_step_script_parameters.go new file mode 100644 index 0000000..1654754 --- /dev/null +++ b/client/runbooks/update_runbook_execution_step_script_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateRunbookExecutionStepScriptParams creates a new UpdateRunbookExecutionStepScriptParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateRunbookExecutionStepScriptParams() *UpdateRunbookExecutionStepScriptParams { + return &UpdateRunbookExecutionStepScriptParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateRunbookExecutionStepScriptParamsWithTimeout creates a new UpdateRunbookExecutionStepScriptParams object +// with the ability to set a timeout on a request. +func NewUpdateRunbookExecutionStepScriptParamsWithTimeout(timeout time.Duration) *UpdateRunbookExecutionStepScriptParams { + return &UpdateRunbookExecutionStepScriptParams{ + timeout: timeout, + } +} + +// NewUpdateRunbookExecutionStepScriptParamsWithContext creates a new UpdateRunbookExecutionStepScriptParams object +// with the ability to set a context for a request. +func NewUpdateRunbookExecutionStepScriptParamsWithContext(ctx context.Context) *UpdateRunbookExecutionStepScriptParams { + return &UpdateRunbookExecutionStepScriptParams{ + Context: ctx, + } +} + +// NewUpdateRunbookExecutionStepScriptParamsWithHTTPClient creates a new UpdateRunbookExecutionStepScriptParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateRunbookExecutionStepScriptParamsWithHTTPClient(client *http.Client) *UpdateRunbookExecutionStepScriptParams { + return &UpdateRunbookExecutionStepScriptParams{ + HTTPClient: client, + } +} + +/* +UpdateRunbookExecutionStepScriptParams contains all the parameters to send to the API endpoint + + for the update runbook execution step script operation. + + Typically these are written to a http.Request. +*/ +type UpdateRunbookExecutionStepScriptParams struct { + + // ExecutionID. + ExecutionID string + + // State. + State string + + // StepID. + StepID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update runbook execution step script params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateRunbookExecutionStepScriptParams) WithDefaults() *UpdateRunbookExecutionStepScriptParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update runbook execution step script params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateRunbookExecutionStepScriptParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update runbook execution step script params +func (o *UpdateRunbookExecutionStepScriptParams) WithTimeout(timeout time.Duration) *UpdateRunbookExecutionStepScriptParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update runbook execution step script params +func (o *UpdateRunbookExecutionStepScriptParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update runbook execution step script params +func (o *UpdateRunbookExecutionStepScriptParams) WithContext(ctx context.Context) *UpdateRunbookExecutionStepScriptParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update runbook execution step script params +func (o *UpdateRunbookExecutionStepScriptParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update runbook execution step script params +func (o *UpdateRunbookExecutionStepScriptParams) WithHTTPClient(client *http.Client) *UpdateRunbookExecutionStepScriptParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update runbook execution step script params +func (o *UpdateRunbookExecutionStepScriptParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithExecutionID adds the executionID to the update runbook execution step script params +func (o *UpdateRunbookExecutionStepScriptParams) WithExecutionID(executionID string) *UpdateRunbookExecutionStepScriptParams { + o.SetExecutionID(executionID) + return o +} + +// SetExecutionID adds the executionId to the update runbook execution step script params +func (o *UpdateRunbookExecutionStepScriptParams) SetExecutionID(executionID string) { + o.ExecutionID = executionID +} + +// WithState adds the state to the update runbook execution step script params +func (o *UpdateRunbookExecutionStepScriptParams) WithState(state string) *UpdateRunbookExecutionStepScriptParams { + o.SetState(state) + return o +} + +// SetState adds the state to the update runbook execution step script params +func (o *UpdateRunbookExecutionStepScriptParams) SetState(state string) { + o.State = state +} + +// WithStepID adds the stepID to the update runbook execution step script params +func (o *UpdateRunbookExecutionStepScriptParams) WithStepID(stepID string) *UpdateRunbookExecutionStepScriptParams { + o.SetStepID(stepID) + return o +} + +// SetStepID adds the stepId to the update runbook execution step script params +func (o *UpdateRunbookExecutionStepScriptParams) SetStepID(stepID string) { + o.StepID = stepID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateRunbookExecutionStepScriptParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param execution_id + if err := r.SetPathParam("execution_id", o.ExecutionID); err != nil { + return err + } + + // path param state + if err := r.SetPathParam("state", o.State); err != nil { + return err + } + + // path param step_id + if err := r.SetPathParam("step_id", o.StepID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/update_runbook_execution_step_script_responses.go b/client/runbooks/update_runbook_execution_step_script_responses.go new file mode 100644 index 0000000..01baf40 --- /dev/null +++ b/client/runbooks/update_runbook_execution_step_script_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateRunbookExecutionStepScriptReader is a Reader for the UpdateRunbookExecutionStepScript structure. +type UpdateRunbookExecutionStepScriptReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateRunbookExecutionStepScriptReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateRunbookExecutionStepScriptOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateRunbookExecutionStepScriptOK creates a UpdateRunbookExecutionStepScriptOK with default headers values +func NewUpdateRunbookExecutionStepScriptOK() *UpdateRunbookExecutionStepScriptOK { + return &UpdateRunbookExecutionStepScriptOK{} +} + +/* +UpdateRunbookExecutionStepScriptOK describes a response with status code 200, with default header values. + +Updates the execution's step. +*/ +type UpdateRunbookExecutionStepScriptOK struct { + Payload *models.RunbooksExecutionEntity +} + +// IsSuccess returns true when this update runbook execution step script o k response has a 2xx status code +func (o *UpdateRunbookExecutionStepScriptOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update runbook execution step script o k response has a 3xx status code +func (o *UpdateRunbookExecutionStepScriptOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update runbook execution step script o k response has a 4xx status code +func (o *UpdateRunbookExecutionStepScriptOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update runbook execution step script o k response has a 5xx status code +func (o *UpdateRunbookExecutionStepScriptOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update runbook execution step script o k response a status code equal to that given +func (o *UpdateRunbookExecutionStepScriptOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateRunbookExecutionStepScriptOK) Error() string { + return fmt.Sprintf("[PUT /v1/runbooks/executions/{execution_id}/steps/{step_id}/script/{state}][%d] updateRunbookExecutionStepScriptOK %+v", 200, o.Payload) +} + +func (o *UpdateRunbookExecutionStepScriptOK) String() string { + return fmt.Sprintf("[PUT /v1/runbooks/executions/{execution_id}/steps/{step_id}/script/{state}][%d] updateRunbookExecutionStepScriptOK %+v", 200, o.Payload) +} + +func (o *UpdateRunbookExecutionStepScriptOK) GetPayload() *models.RunbooksExecutionEntity { + return o.Payload +} + +func (o *UpdateRunbookExecutionStepScriptOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RunbooksExecutionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/runbooks/update_runbook_parameters.go b/client/runbooks/update_runbook_parameters.go new file mode 100644 index 0000000..837667c --- /dev/null +++ b/client/runbooks/update_runbook_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateRunbookParams creates a new UpdateRunbookParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateRunbookParams() *UpdateRunbookParams { + return &UpdateRunbookParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateRunbookParamsWithTimeout creates a new UpdateRunbookParams object +// with the ability to set a timeout on a request. +func NewUpdateRunbookParamsWithTimeout(timeout time.Duration) *UpdateRunbookParams { + return &UpdateRunbookParams{ + timeout: timeout, + } +} + +// NewUpdateRunbookParamsWithContext creates a new UpdateRunbookParams object +// with the ability to set a context for a request. +func NewUpdateRunbookParamsWithContext(ctx context.Context) *UpdateRunbookParams { + return &UpdateRunbookParams{ + Context: ctx, + } +} + +// NewUpdateRunbookParamsWithHTTPClient creates a new UpdateRunbookParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateRunbookParamsWithHTTPClient(client *http.Client) *UpdateRunbookParams { + return &UpdateRunbookParams{ + HTTPClient: client, + } +} + +/* +UpdateRunbookParams contains all the parameters to send to the API endpoint + + for the update runbook operation. + + Typically these are written to a http.Request. +*/ +type UpdateRunbookParams struct { + + // RunbookID. + RunbookID string + + // UpdateRunbook. + UpdateRunbook *models.UpdateRunbook + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update runbook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateRunbookParams) WithDefaults() *UpdateRunbookParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update runbook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateRunbookParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update runbook params +func (o *UpdateRunbookParams) WithTimeout(timeout time.Duration) *UpdateRunbookParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update runbook params +func (o *UpdateRunbookParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update runbook params +func (o *UpdateRunbookParams) WithContext(ctx context.Context) *UpdateRunbookParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update runbook params +func (o *UpdateRunbookParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update runbook params +func (o *UpdateRunbookParams) WithHTTPClient(client *http.Client) *UpdateRunbookParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update runbook params +func (o *UpdateRunbookParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRunbookID adds the runbookID to the update runbook params +func (o *UpdateRunbookParams) WithRunbookID(runbookID string) *UpdateRunbookParams { + o.SetRunbookID(runbookID) + return o +} + +// SetRunbookID adds the runbookId to the update runbook params +func (o *UpdateRunbookParams) SetRunbookID(runbookID string) { + o.RunbookID = runbookID +} + +// WithUpdateRunbook adds the updateRunbook to the update runbook params +func (o *UpdateRunbookParams) WithUpdateRunbook(updateRunbook *models.UpdateRunbook) *UpdateRunbookParams { + o.SetUpdateRunbook(updateRunbook) + return o +} + +// SetUpdateRunbook adds the updateRunbook to the update runbook params +func (o *UpdateRunbookParams) SetUpdateRunbook(updateRunbook *models.UpdateRunbook) { + o.UpdateRunbook = updateRunbook +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateRunbookParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param runbook_id + if err := r.SetPathParam("runbook_id", o.RunbookID); err != nil { + return err + } + if o.UpdateRunbook != nil { + if err := r.SetBodyParam(o.UpdateRunbook); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/runbooks/update_runbook_responses.go b/client/runbooks/update_runbook_responses.go new file mode 100644 index 0000000..9302ca2 --- /dev/null +++ b/client/runbooks/update_runbook_responses.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package runbooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateRunbookReader is a Reader for the UpdateRunbook structure. +type UpdateRunbookReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateRunbookReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateRunbookOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateRunbookOK creates a UpdateRunbookOK with default headers values +func NewUpdateRunbookOK() *UpdateRunbookOK { + return &UpdateRunbookOK{} +} + +/* + UpdateRunbookOK describes a response with status code 200, with default header values. + + Update a runbook and any attachment rules associated with it. This endpoint is used to configure nearly everything + +about a runbook, including but not limited to the steps, environments, attachment rules, and severities. +*/ +type UpdateRunbookOK struct { + Payload *models.RunbookEntity +} + +// IsSuccess returns true when this update runbook o k response has a 2xx status code +func (o *UpdateRunbookOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update runbook o k response has a 3xx status code +func (o *UpdateRunbookOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update runbook o k response has a 4xx status code +func (o *UpdateRunbookOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update runbook o k response has a 5xx status code +func (o *UpdateRunbookOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update runbook o k response a status code equal to that given +func (o *UpdateRunbookOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateRunbookOK) Error() string { + return fmt.Sprintf("[PUT /v1/runbooks/{runbook_id}][%d] updateRunbookOK %+v", 200, o.Payload) +} + +func (o *UpdateRunbookOK) String() string { + return fmt.Sprintf("[PUT /v1/runbooks/{runbook_id}][%d] updateRunbookOK %+v", 200, o.Payload) +} + +func (o *UpdateRunbookOK) GetPayload() *models.RunbookEntity { + return o.Payload +} + +func (o *UpdateRunbookOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RunbookEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/s_c_i_m/create_scim_group_parameters.go b/client/s_c_i_m/create_scim_group_parameters.go new file mode 100644 index 0000000..f4170cc --- /dev/null +++ b/client/s_c_i_m/create_scim_group_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateScimGroupParams creates a new CreateScimGroupParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateScimGroupParams() *CreateScimGroupParams { + return &CreateScimGroupParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateScimGroupParamsWithTimeout creates a new CreateScimGroupParams object +// with the ability to set a timeout on a request. +func NewCreateScimGroupParamsWithTimeout(timeout time.Duration) *CreateScimGroupParams { + return &CreateScimGroupParams{ + timeout: timeout, + } +} + +// NewCreateScimGroupParamsWithContext creates a new CreateScimGroupParams object +// with the ability to set a context for a request. +func NewCreateScimGroupParamsWithContext(ctx context.Context) *CreateScimGroupParams { + return &CreateScimGroupParams{ + Context: ctx, + } +} + +// NewCreateScimGroupParamsWithHTTPClient creates a new CreateScimGroupParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateScimGroupParamsWithHTTPClient(client *http.Client) *CreateScimGroupParams { + return &CreateScimGroupParams{ + HTTPClient: client, + } +} + +/* +CreateScimGroupParams contains all the parameters to send to the API endpoint + + for the create scim group operation. + + Typically these are written to a http.Request. +*/ +type CreateScimGroupParams struct { + + // CreateScimGroup. + CreateScimGroup *models.CreateScimGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create scim group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateScimGroupParams) WithDefaults() *CreateScimGroupParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create scim group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateScimGroupParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create scim group params +func (o *CreateScimGroupParams) WithTimeout(timeout time.Duration) *CreateScimGroupParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create scim group params +func (o *CreateScimGroupParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create scim group params +func (o *CreateScimGroupParams) WithContext(ctx context.Context) *CreateScimGroupParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create scim group params +func (o *CreateScimGroupParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create scim group params +func (o *CreateScimGroupParams) WithHTTPClient(client *http.Client) *CreateScimGroupParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create scim group params +func (o *CreateScimGroupParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateScimGroup adds the createScimGroup to the create scim group params +func (o *CreateScimGroupParams) WithCreateScimGroup(createScimGroup *models.CreateScimGroup) *CreateScimGroupParams { + o.SetCreateScimGroup(createScimGroup) + return o +} + +// SetCreateScimGroup adds the createScimGroup to the create scim group params +func (o *CreateScimGroupParams) SetCreateScimGroup(createScimGroup *models.CreateScimGroup) { + o.CreateScimGroup = createScimGroup +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateScimGroupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateScimGroup != nil { + if err := r.SetBodyParam(o.CreateScimGroup); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/s_c_i_m/create_scim_group_responses.go b/client/s_c_i_m/create_scim_group_responses.go new file mode 100644 index 0000000..dd260ae --- /dev/null +++ b/client/s_c_i_m/create_scim_group_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateScimGroupReader is a Reader for the CreateScimGroup structure. +type CreateScimGroupReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateScimGroupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateScimGroupCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateScimGroupCreated creates a CreateScimGroupCreated with default headers values +func NewCreateScimGroupCreated() *CreateScimGroupCreated { + return &CreateScimGroupCreated{} +} + +/* +CreateScimGroupCreated describes a response with status code 201, with default header values. + +SCIM endpoint to create a new Team (Colloquial for Group in the SCIM protocol). Any members defined in the payload will be assigned to the team with no defined role. +*/ +type CreateScimGroupCreated struct { +} + +// IsSuccess returns true when this create scim group created response has a 2xx status code +func (o *CreateScimGroupCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create scim group created response has a 3xx status code +func (o *CreateScimGroupCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create scim group created response has a 4xx status code +func (o *CreateScimGroupCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create scim group created response has a 5xx status code +func (o *CreateScimGroupCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create scim group created response a status code equal to that given +func (o *CreateScimGroupCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateScimGroupCreated) Error() string { + return fmt.Sprintf("[POST /v1/scim/v2/Groups][%d] createScimGroupCreated ", 201) +} + +func (o *CreateScimGroupCreated) String() string { + return fmt.Sprintf("[POST /v1/scim/v2/Groups][%d] createScimGroupCreated ", 201) +} + +func (o *CreateScimGroupCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/s_c_i_m/create_scim_user_parameters.go b/client/s_c_i_m/create_scim_user_parameters.go new file mode 100644 index 0000000..cc841c3 --- /dev/null +++ b/client/s_c_i_m/create_scim_user_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateScimUserParams creates a new CreateScimUserParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateScimUserParams() *CreateScimUserParams { + return &CreateScimUserParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateScimUserParamsWithTimeout creates a new CreateScimUserParams object +// with the ability to set a timeout on a request. +func NewCreateScimUserParamsWithTimeout(timeout time.Duration) *CreateScimUserParams { + return &CreateScimUserParams{ + timeout: timeout, + } +} + +// NewCreateScimUserParamsWithContext creates a new CreateScimUserParams object +// with the ability to set a context for a request. +func NewCreateScimUserParamsWithContext(ctx context.Context) *CreateScimUserParams { + return &CreateScimUserParams{ + Context: ctx, + } +} + +// NewCreateScimUserParamsWithHTTPClient creates a new CreateScimUserParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateScimUserParamsWithHTTPClient(client *http.Client) *CreateScimUserParams { + return &CreateScimUserParams{ + HTTPClient: client, + } +} + +/* +CreateScimUserParams contains all the parameters to send to the API endpoint + + for the create scim user operation. + + Typically these are written to a http.Request. +*/ +type CreateScimUserParams struct { + + // CreateScimUser. + CreateScimUser *models.CreateScimUser + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create scim user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateScimUserParams) WithDefaults() *CreateScimUserParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create scim user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateScimUserParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create scim user params +func (o *CreateScimUserParams) WithTimeout(timeout time.Duration) *CreateScimUserParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create scim user params +func (o *CreateScimUserParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create scim user params +func (o *CreateScimUserParams) WithContext(ctx context.Context) *CreateScimUserParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create scim user params +func (o *CreateScimUserParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create scim user params +func (o *CreateScimUserParams) WithHTTPClient(client *http.Client) *CreateScimUserParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create scim user params +func (o *CreateScimUserParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateScimUser adds the createScimUser to the create scim user params +func (o *CreateScimUserParams) WithCreateScimUser(createScimUser *models.CreateScimUser) *CreateScimUserParams { + o.SetCreateScimUser(createScimUser) + return o +} + +// SetCreateScimUser adds the createScimUser to the create scim user params +func (o *CreateScimUserParams) SetCreateScimUser(createScimUser *models.CreateScimUser) { + o.CreateScimUser = createScimUser +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateScimUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateScimUser != nil { + if err := r.SetBodyParam(o.CreateScimUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/s_c_i_m/create_scim_user_responses.go b/client/s_c_i_m/create_scim_user_responses.go new file mode 100644 index 0000000..01e1d7a --- /dev/null +++ b/client/s_c_i_m/create_scim_user_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateScimUserReader is a Reader for the CreateScimUser structure. +type CreateScimUserReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateScimUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateScimUserCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateScimUserCreated creates a CreateScimUserCreated with default headers values +func NewCreateScimUserCreated() *CreateScimUserCreated { + return &CreateScimUserCreated{} +} + +/* +CreateScimUserCreated describes a response with status code 201, with default header values. + +SCIM endpoint to create and provision a new User. This endpoint will provision the User, which allows them to accept their account throught their IDP or via the Forgot Password flow. +*/ +type CreateScimUserCreated struct { +} + +// IsSuccess returns true when this create scim user created response has a 2xx status code +func (o *CreateScimUserCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create scim user created response has a 3xx status code +func (o *CreateScimUserCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create scim user created response has a 4xx status code +func (o *CreateScimUserCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create scim user created response has a 5xx status code +func (o *CreateScimUserCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create scim user created response a status code equal to that given +func (o *CreateScimUserCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateScimUserCreated) Error() string { + return fmt.Sprintf("[POST /v1/scim/v2/Users][%d] createScimUserCreated ", 201) +} + +func (o *CreateScimUserCreated) String() string { + return fmt.Sprintf("[POST /v1/scim/v2/Users][%d] createScimUserCreated ", 201) +} + +func (o *CreateScimUserCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/s_c_i_m/delete_scim_group_parameters.go b/client/s_c_i_m/delete_scim_group_parameters.go new file mode 100644 index 0000000..08c2983 --- /dev/null +++ b/client/s_c_i_m/delete_scim_group_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteScimGroupParams creates a new DeleteScimGroupParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteScimGroupParams() *DeleteScimGroupParams { + return &DeleteScimGroupParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteScimGroupParamsWithTimeout creates a new DeleteScimGroupParams object +// with the ability to set a timeout on a request. +func NewDeleteScimGroupParamsWithTimeout(timeout time.Duration) *DeleteScimGroupParams { + return &DeleteScimGroupParams{ + timeout: timeout, + } +} + +// NewDeleteScimGroupParamsWithContext creates a new DeleteScimGroupParams object +// with the ability to set a context for a request. +func NewDeleteScimGroupParamsWithContext(ctx context.Context) *DeleteScimGroupParams { + return &DeleteScimGroupParams{ + Context: ctx, + } +} + +// NewDeleteScimGroupParamsWithHTTPClient creates a new DeleteScimGroupParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteScimGroupParamsWithHTTPClient(client *http.Client) *DeleteScimGroupParams { + return &DeleteScimGroupParams{ + HTTPClient: client, + } +} + +/* +DeleteScimGroupParams contains all the parameters to send to the API endpoint + + for the delete scim group operation. + + Typically these are written to a http.Request. +*/ +type DeleteScimGroupParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete scim group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteScimGroupParams) WithDefaults() *DeleteScimGroupParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete scim group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteScimGroupParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete scim group params +func (o *DeleteScimGroupParams) WithTimeout(timeout time.Duration) *DeleteScimGroupParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete scim group params +func (o *DeleteScimGroupParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete scim group params +func (o *DeleteScimGroupParams) WithContext(ctx context.Context) *DeleteScimGroupParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete scim group params +func (o *DeleteScimGroupParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete scim group params +func (o *DeleteScimGroupParams) WithHTTPClient(client *http.Client) *DeleteScimGroupParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete scim group params +func (o *DeleteScimGroupParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete scim group params +func (o *DeleteScimGroupParams) WithID(id string) *DeleteScimGroupParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete scim group params +func (o *DeleteScimGroupParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteScimGroupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/s_c_i_m/delete_scim_group_responses.go b/client/s_c_i_m/delete_scim_group_responses.go new file mode 100644 index 0000000..d4f3cf6 --- /dev/null +++ b/client/s_c_i_m/delete_scim_group_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteScimGroupReader is a Reader for the DeleteScimGroup structure. +type DeleteScimGroupReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteScimGroupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteScimGroupNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteScimGroupNoContent creates a DeleteScimGroupNoContent with default headers values +func NewDeleteScimGroupNoContent() *DeleteScimGroupNoContent { + return &DeleteScimGroupNoContent{} +} + +/* +DeleteScimGroupNoContent describes a response with status code 204, with default header values. + +SCIM endpoint to delete a Team (Colloquial for Group in the SCIM protocol). +*/ +type DeleteScimGroupNoContent struct { +} + +// IsSuccess returns true when this delete scim group no content response has a 2xx status code +func (o *DeleteScimGroupNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete scim group no content response has a 3xx status code +func (o *DeleteScimGroupNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete scim group no content response has a 4xx status code +func (o *DeleteScimGroupNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete scim group no content response has a 5xx status code +func (o *DeleteScimGroupNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete scim group no content response a status code equal to that given +func (o *DeleteScimGroupNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteScimGroupNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/scim/v2/Groups/{id}][%d] deleteScimGroupNoContent ", 204) +} + +func (o *DeleteScimGroupNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/scim/v2/Groups/{id}][%d] deleteScimGroupNoContent ", 204) +} + +func (o *DeleteScimGroupNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/s_c_i_m/delete_scim_user_parameters.go b/client/s_c_i_m/delete_scim_user_parameters.go new file mode 100644 index 0000000..cf392e2 --- /dev/null +++ b/client/s_c_i_m/delete_scim_user_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteScimUserParams creates a new DeleteScimUserParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteScimUserParams() *DeleteScimUserParams { + return &DeleteScimUserParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteScimUserParamsWithTimeout creates a new DeleteScimUserParams object +// with the ability to set a timeout on a request. +func NewDeleteScimUserParamsWithTimeout(timeout time.Duration) *DeleteScimUserParams { + return &DeleteScimUserParams{ + timeout: timeout, + } +} + +// NewDeleteScimUserParamsWithContext creates a new DeleteScimUserParams object +// with the ability to set a context for a request. +func NewDeleteScimUserParamsWithContext(ctx context.Context) *DeleteScimUserParams { + return &DeleteScimUserParams{ + Context: ctx, + } +} + +// NewDeleteScimUserParamsWithHTTPClient creates a new DeleteScimUserParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteScimUserParamsWithHTTPClient(client *http.Client) *DeleteScimUserParams { + return &DeleteScimUserParams{ + HTTPClient: client, + } +} + +/* +DeleteScimUserParams contains all the parameters to send to the API endpoint + + for the delete scim user operation. + + Typically these are written to a http.Request. +*/ +type DeleteScimUserParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete scim user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteScimUserParams) WithDefaults() *DeleteScimUserParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete scim user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteScimUserParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete scim user params +func (o *DeleteScimUserParams) WithTimeout(timeout time.Duration) *DeleteScimUserParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete scim user params +func (o *DeleteScimUserParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete scim user params +func (o *DeleteScimUserParams) WithContext(ctx context.Context) *DeleteScimUserParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete scim user params +func (o *DeleteScimUserParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete scim user params +func (o *DeleteScimUserParams) WithHTTPClient(client *http.Client) *DeleteScimUserParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete scim user params +func (o *DeleteScimUserParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete scim user params +func (o *DeleteScimUserParams) WithID(id string) *DeleteScimUserParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete scim user params +func (o *DeleteScimUserParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteScimUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/s_c_i_m/delete_scim_user_responses.go b/client/s_c_i_m/delete_scim_user_responses.go new file mode 100644 index 0000000..fa7f986 --- /dev/null +++ b/client/s_c_i_m/delete_scim_user_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteScimUserReader is a Reader for the DeleteScimUser structure. +type DeleteScimUserReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteScimUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteScimUserNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteScimUserNoContent creates a DeleteScimUserNoContent with default headers values +func NewDeleteScimUserNoContent() *DeleteScimUserNoContent { + return &DeleteScimUserNoContent{} +} + +/* +DeleteScimUserNoContent describes a response with status code 204, with default header values. + +SCIM endpoint to delete a User. This endpoint will deactivate a confirmed User record in our system. +*/ +type DeleteScimUserNoContent struct { +} + +// IsSuccess returns true when this delete scim user no content response has a 2xx status code +func (o *DeleteScimUserNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete scim user no content response has a 3xx status code +func (o *DeleteScimUserNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete scim user no content response has a 4xx status code +func (o *DeleteScimUserNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete scim user no content response has a 5xx status code +func (o *DeleteScimUserNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete scim user no content response a status code equal to that given +func (o *DeleteScimUserNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteScimUserNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/scim/v2/Users/{id}][%d] deleteScimUserNoContent ", 204) +} + +func (o *DeleteScimUserNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/scim/v2/Users/{id}][%d] deleteScimUserNoContent ", 204) +} + +func (o *DeleteScimUserNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/s_c_i_m/get_scim_group_parameters.go b/client/s_c_i_m/get_scim_group_parameters.go new file mode 100644 index 0000000..1415b52 --- /dev/null +++ b/client/s_c_i_m/get_scim_group_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetScimGroupParams creates a new GetScimGroupParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetScimGroupParams() *GetScimGroupParams { + return &GetScimGroupParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetScimGroupParamsWithTimeout creates a new GetScimGroupParams object +// with the ability to set a timeout on a request. +func NewGetScimGroupParamsWithTimeout(timeout time.Duration) *GetScimGroupParams { + return &GetScimGroupParams{ + timeout: timeout, + } +} + +// NewGetScimGroupParamsWithContext creates a new GetScimGroupParams object +// with the ability to set a context for a request. +func NewGetScimGroupParamsWithContext(ctx context.Context) *GetScimGroupParams { + return &GetScimGroupParams{ + Context: ctx, + } +} + +// NewGetScimGroupParamsWithHTTPClient creates a new GetScimGroupParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetScimGroupParamsWithHTTPClient(client *http.Client) *GetScimGroupParams { + return &GetScimGroupParams{ + HTTPClient: client, + } +} + +/* +GetScimGroupParams contains all the parameters to send to the API endpoint + + for the get scim group operation. + + Typically these are written to a http.Request. +*/ +type GetScimGroupParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get scim group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetScimGroupParams) WithDefaults() *GetScimGroupParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get scim group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetScimGroupParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get scim group params +func (o *GetScimGroupParams) WithTimeout(timeout time.Duration) *GetScimGroupParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get scim group params +func (o *GetScimGroupParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get scim group params +func (o *GetScimGroupParams) WithContext(ctx context.Context) *GetScimGroupParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get scim group params +func (o *GetScimGroupParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get scim group params +func (o *GetScimGroupParams) WithHTTPClient(client *http.Client) *GetScimGroupParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get scim group params +func (o *GetScimGroupParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get scim group params +func (o *GetScimGroupParams) WithID(id string) *GetScimGroupParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get scim group params +func (o *GetScimGroupParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *GetScimGroupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/s_c_i_m/get_scim_group_responses.go b/client/s_c_i_m/get_scim_group_responses.go new file mode 100644 index 0000000..1297ed9 --- /dev/null +++ b/client/s_c_i_m/get_scim_group_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetScimGroupReader is a Reader for the GetScimGroup structure. +type GetScimGroupReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetScimGroupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetScimGroupOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetScimGroupOK creates a GetScimGroupOK with default headers values +func NewGetScimGroupOK() *GetScimGroupOK { + return &GetScimGroupOK{} +} + +/* +GetScimGroupOK describes a response with status code 200, with default header values. + +SCIM endpoint that lists a Team (Colloquial for Group in the SCIM protocol) +*/ +type GetScimGroupOK struct { +} + +// IsSuccess returns true when this get scim group o k response has a 2xx status code +func (o *GetScimGroupOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get scim group o k response has a 3xx status code +func (o *GetScimGroupOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get scim group o k response has a 4xx status code +func (o *GetScimGroupOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get scim group o k response has a 5xx status code +func (o *GetScimGroupOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get scim group o k response a status code equal to that given +func (o *GetScimGroupOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetScimGroupOK) Error() string { + return fmt.Sprintf("[GET /v1/scim/v2/Groups/{id}][%d] getScimGroupOK ", 200) +} + +func (o *GetScimGroupOK) String() string { + return fmt.Sprintf("[GET /v1/scim/v2/Groups/{id}][%d] getScimGroupOK ", 200) +} + +func (o *GetScimGroupOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/s_c_i_m/get_scim_user_parameters.go b/client/s_c_i_m/get_scim_user_parameters.go new file mode 100644 index 0000000..1bbe4e0 --- /dev/null +++ b/client/s_c_i_m/get_scim_user_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetScimUserParams creates a new GetScimUserParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetScimUserParams() *GetScimUserParams { + return &GetScimUserParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetScimUserParamsWithTimeout creates a new GetScimUserParams object +// with the ability to set a timeout on a request. +func NewGetScimUserParamsWithTimeout(timeout time.Duration) *GetScimUserParams { + return &GetScimUserParams{ + timeout: timeout, + } +} + +// NewGetScimUserParamsWithContext creates a new GetScimUserParams object +// with the ability to set a context for a request. +func NewGetScimUserParamsWithContext(ctx context.Context) *GetScimUserParams { + return &GetScimUserParams{ + Context: ctx, + } +} + +// NewGetScimUserParamsWithHTTPClient creates a new GetScimUserParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetScimUserParamsWithHTTPClient(client *http.Client) *GetScimUserParams { + return &GetScimUserParams{ + HTTPClient: client, + } +} + +/* +GetScimUserParams contains all the parameters to send to the API endpoint + + for the get scim user operation. + + Typically these are written to a http.Request. +*/ +type GetScimUserParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get scim user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetScimUserParams) WithDefaults() *GetScimUserParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get scim user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetScimUserParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get scim user params +func (o *GetScimUserParams) WithTimeout(timeout time.Duration) *GetScimUserParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get scim user params +func (o *GetScimUserParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get scim user params +func (o *GetScimUserParams) WithContext(ctx context.Context) *GetScimUserParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get scim user params +func (o *GetScimUserParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get scim user params +func (o *GetScimUserParams) WithHTTPClient(client *http.Client) *GetScimUserParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get scim user params +func (o *GetScimUserParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get scim user params +func (o *GetScimUserParams) WithID(id string) *GetScimUserParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get scim user params +func (o *GetScimUserParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *GetScimUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/s_c_i_m/get_scim_user_responses.go b/client/s_c_i_m/get_scim_user_responses.go new file mode 100644 index 0000000..43231a6 --- /dev/null +++ b/client/s_c_i_m/get_scim_user_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetScimUserReader is a Reader for the GetScimUser structure. +type GetScimUserReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetScimUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetScimUserOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetScimUserOK creates a GetScimUserOK with default headers values +func NewGetScimUserOK() *GetScimUserOK { + return &GetScimUserOK{} +} + +/* +GetScimUserOK describes a response with status code 200, with default header values. + +SCIM endpoint that lists a User +*/ +type GetScimUserOK struct { +} + +// IsSuccess returns true when this get scim user o k response has a 2xx status code +func (o *GetScimUserOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get scim user o k response has a 3xx status code +func (o *GetScimUserOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get scim user o k response has a 4xx status code +func (o *GetScimUserOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get scim user o k response has a 5xx status code +func (o *GetScimUserOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get scim user o k response a status code equal to that given +func (o *GetScimUserOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetScimUserOK) Error() string { + return fmt.Sprintf("[GET /v1/scim/v2/Users/{id}][%d] getScimUserOK ", 200) +} + +func (o *GetScimUserOK) String() string { + return fmt.Sprintf("[GET /v1/scim/v2/Users/{id}][%d] getScimUserOK ", 200) +} + +func (o *GetScimUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/s_c_i_m/list_scim_groups_parameters.go b/client/s_c_i_m/list_scim_groups_parameters.go new file mode 100644 index 0000000..69fd486 --- /dev/null +++ b/client/s_c_i_m/list_scim_groups_parameters.go @@ -0,0 +1,232 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListScimGroupsParams creates a new ListScimGroupsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListScimGroupsParams() *ListScimGroupsParams { + return &ListScimGroupsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListScimGroupsParamsWithTimeout creates a new ListScimGroupsParams object +// with the ability to set a timeout on a request. +func NewListScimGroupsParamsWithTimeout(timeout time.Duration) *ListScimGroupsParams { + return &ListScimGroupsParams{ + timeout: timeout, + } +} + +// NewListScimGroupsParamsWithContext creates a new ListScimGroupsParams object +// with the ability to set a context for a request. +func NewListScimGroupsParamsWithContext(ctx context.Context) *ListScimGroupsParams { + return &ListScimGroupsParams{ + Context: ctx, + } +} + +// NewListScimGroupsParamsWithHTTPClient creates a new ListScimGroupsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListScimGroupsParamsWithHTTPClient(client *http.Client) *ListScimGroupsParams { + return &ListScimGroupsParams{ + HTTPClient: client, + } +} + +/* +ListScimGroupsParams contains all the parameters to send to the API endpoint + + for the list scim groups operation. + + Typically these are written to a http.Request. +*/ +type ListScimGroupsParams struct { + + // Count. + // + // Format: int32 + Count *int32 + + /* Filter. + + This is a string used to query groups by displayName. + Proper example syntax for this would be `?filter=displayName eq "My Team Name"`. + Currently we only support the `eq` operator + */ + Filter *string + + // StartIndex. + // + // Format: int32 + StartIndex *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list scim groups params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListScimGroupsParams) WithDefaults() *ListScimGroupsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list scim groups params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListScimGroupsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list scim groups params +func (o *ListScimGroupsParams) WithTimeout(timeout time.Duration) *ListScimGroupsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list scim groups params +func (o *ListScimGroupsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list scim groups params +func (o *ListScimGroupsParams) WithContext(ctx context.Context) *ListScimGroupsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list scim groups params +func (o *ListScimGroupsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list scim groups params +func (o *ListScimGroupsParams) WithHTTPClient(client *http.Client) *ListScimGroupsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list scim groups params +func (o *ListScimGroupsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCount adds the count to the list scim groups params +func (o *ListScimGroupsParams) WithCount(count *int32) *ListScimGroupsParams { + o.SetCount(count) + return o +} + +// SetCount adds the count to the list scim groups params +func (o *ListScimGroupsParams) SetCount(count *int32) { + o.Count = count +} + +// WithFilter adds the filter to the list scim groups params +func (o *ListScimGroupsParams) WithFilter(filter *string) *ListScimGroupsParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the list scim groups params +func (o *ListScimGroupsParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithStartIndex adds the startIndex to the list scim groups params +func (o *ListScimGroupsParams) WithStartIndex(startIndex *int32) *ListScimGroupsParams { + o.SetStartIndex(startIndex) + return o +} + +// SetStartIndex adds the startIndex to the list scim groups params +func (o *ListScimGroupsParams) SetStartIndex(startIndex *int32) { + o.StartIndex = startIndex +} + +// WriteToRequest writes these params to a swagger request +func (o *ListScimGroupsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Count != nil { + + // query param count + var qrCount int32 + + if o.Count != nil { + qrCount = *o.Count + } + qCount := swag.FormatInt32(qrCount) + if qCount != "" { + + if err := r.SetQueryParam("count", qCount); err != nil { + return err + } + } + } + + if o.Filter != nil { + + // query param filter + var qrFilter string + + if o.Filter != nil { + qrFilter = *o.Filter + } + qFilter := qrFilter + if qFilter != "" { + + if err := r.SetQueryParam("filter", qFilter); err != nil { + return err + } + } + } + + if o.StartIndex != nil { + + // query param startIndex + var qrStartIndex int32 + + if o.StartIndex != nil { + qrStartIndex = *o.StartIndex + } + qStartIndex := swag.FormatInt32(qrStartIndex) + if qStartIndex != "" { + + if err := r.SetQueryParam("startIndex", qStartIndex); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/s_c_i_m/list_scim_groups_responses.go b/client/s_c_i_m/list_scim_groups_responses.go new file mode 100644 index 0000000..1ad1fcc --- /dev/null +++ b/client/s_c_i_m/list_scim_groups_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListScimGroupsReader is a Reader for the ListScimGroups structure. +type ListScimGroupsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListScimGroupsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListScimGroupsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListScimGroupsOK creates a ListScimGroupsOK with default headers values +func NewListScimGroupsOK() *ListScimGroupsOK { + return &ListScimGroupsOK{} +} + +/* +ListScimGroupsOK describes a response with status code 200, with default header values. + +SCIM endpoint that lists all Teams (Colloquial for Group in the SCIM protocol) +*/ +type ListScimGroupsOK struct { +} + +// IsSuccess returns true when this list scim groups o k response has a 2xx status code +func (o *ListScimGroupsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list scim groups o k response has a 3xx status code +func (o *ListScimGroupsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list scim groups o k response has a 4xx status code +func (o *ListScimGroupsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list scim groups o k response has a 5xx status code +func (o *ListScimGroupsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list scim groups o k response a status code equal to that given +func (o *ListScimGroupsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListScimGroupsOK) Error() string { + return fmt.Sprintf("[GET /v1/scim/v2/Groups][%d] listScimGroupsOK ", 200) +} + +func (o *ListScimGroupsOK) String() string { + return fmt.Sprintf("[GET /v1/scim/v2/Groups][%d] listScimGroupsOK ", 200) +} + +func (o *ListScimGroupsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/s_c_i_m/list_scim_users_parameters.go b/client/s_c_i_m/list_scim_users_parameters.go new file mode 100644 index 0000000..6042013 --- /dev/null +++ b/client/s_c_i_m/list_scim_users_parameters.go @@ -0,0 +1,238 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListScimUsersParams creates a new ListScimUsersParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListScimUsersParams() *ListScimUsersParams { + return &ListScimUsersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListScimUsersParamsWithTimeout creates a new ListScimUsersParams object +// with the ability to set a timeout on a request. +func NewListScimUsersParamsWithTimeout(timeout time.Duration) *ListScimUsersParams { + return &ListScimUsersParams{ + timeout: timeout, + } +} + +// NewListScimUsersParamsWithContext creates a new ListScimUsersParams object +// with the ability to set a context for a request. +func NewListScimUsersParamsWithContext(ctx context.Context) *ListScimUsersParams { + return &ListScimUsersParams{ + Context: ctx, + } +} + +// NewListScimUsersParamsWithHTTPClient creates a new ListScimUsersParams object +// with the ability to set a custom HTTPClient for a request. +func NewListScimUsersParamsWithHTTPClient(client *http.Client) *ListScimUsersParams { + return &ListScimUsersParams{ + HTTPClient: client, + } +} + +/* +ListScimUsersParams contains all the parameters to send to the API endpoint + + for the list scim users operation. + + Typically these are written to a http.Request. +*/ +type ListScimUsersParams struct { + + /* Count. + + This is an integer which represents the number of items per page in the response + + Format: int32 + */ + Count *int32 + + /* Filter. + + This is a string used to query users by either userName or email. + Proper example syntax for this would be `?filter=userName eq john` or `?filter=userName eq "john@firehydrant.com"`. + Currently we only support the `eq` operator + */ + Filter *string + + /* StartIndex. + + This is an integer which represents a pagination offset + + Format: int32 + */ + StartIndex *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list scim users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListScimUsersParams) WithDefaults() *ListScimUsersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list scim users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListScimUsersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list scim users params +func (o *ListScimUsersParams) WithTimeout(timeout time.Duration) *ListScimUsersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list scim users params +func (o *ListScimUsersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list scim users params +func (o *ListScimUsersParams) WithContext(ctx context.Context) *ListScimUsersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list scim users params +func (o *ListScimUsersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list scim users params +func (o *ListScimUsersParams) WithHTTPClient(client *http.Client) *ListScimUsersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list scim users params +func (o *ListScimUsersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCount adds the count to the list scim users params +func (o *ListScimUsersParams) WithCount(count *int32) *ListScimUsersParams { + o.SetCount(count) + return o +} + +// SetCount adds the count to the list scim users params +func (o *ListScimUsersParams) SetCount(count *int32) { + o.Count = count +} + +// WithFilter adds the filter to the list scim users params +func (o *ListScimUsersParams) WithFilter(filter *string) *ListScimUsersParams { + o.SetFilter(filter) + return o +} + +// SetFilter adds the filter to the list scim users params +func (o *ListScimUsersParams) SetFilter(filter *string) { + o.Filter = filter +} + +// WithStartIndex adds the startIndex to the list scim users params +func (o *ListScimUsersParams) WithStartIndex(startIndex *int32) *ListScimUsersParams { + o.SetStartIndex(startIndex) + return o +} + +// SetStartIndex adds the startIndex to the list scim users params +func (o *ListScimUsersParams) SetStartIndex(startIndex *int32) { + o.StartIndex = startIndex +} + +// WriteToRequest writes these params to a swagger request +func (o *ListScimUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Count != nil { + + // query param count + var qrCount int32 + + if o.Count != nil { + qrCount = *o.Count + } + qCount := swag.FormatInt32(qrCount) + if qCount != "" { + + if err := r.SetQueryParam("count", qCount); err != nil { + return err + } + } + } + + if o.Filter != nil { + + // query param filter + var qrFilter string + + if o.Filter != nil { + qrFilter = *o.Filter + } + qFilter := qrFilter + if qFilter != "" { + + if err := r.SetQueryParam("filter", qFilter); err != nil { + return err + } + } + } + + if o.StartIndex != nil { + + // query param startIndex + var qrStartIndex int32 + + if o.StartIndex != nil { + qrStartIndex = *o.StartIndex + } + qStartIndex := swag.FormatInt32(qrStartIndex) + if qStartIndex != "" { + + if err := r.SetQueryParam("startIndex", qStartIndex); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/s_c_i_m/list_scim_users_responses.go b/client/s_c_i_m/list_scim_users_responses.go new file mode 100644 index 0000000..75abdfe --- /dev/null +++ b/client/s_c_i_m/list_scim_users_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListScimUsersReader is a Reader for the ListScimUsers structure. +type ListScimUsersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListScimUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListScimUsersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListScimUsersOK creates a ListScimUsersOK with default headers values +func NewListScimUsersOK() *ListScimUsersOK { + return &ListScimUsersOK{} +} + +/* +ListScimUsersOK describes a response with status code 200, with default header values. + +SCIM endpoint that lists users. This endpoint will display a list of Users currently in the system. +*/ +type ListScimUsersOK struct { +} + +// IsSuccess returns true when this list scim users o k response has a 2xx status code +func (o *ListScimUsersOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list scim users o k response has a 3xx status code +func (o *ListScimUsersOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list scim users o k response has a 4xx status code +func (o *ListScimUsersOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list scim users o k response has a 5xx status code +func (o *ListScimUsersOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list scim users o k response a status code equal to that given +func (o *ListScimUsersOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListScimUsersOK) Error() string { + return fmt.Sprintf("[GET /v1/scim/v2/Users][%d] listScimUsersOK ", 200) +} + +func (o *ListScimUsersOK) String() string { + return fmt.Sprintf("[GET /v1/scim/v2/Users][%d] listScimUsersOK ", 200) +} + +func (o *ListScimUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/s_c_i_m/patch_scim_user_parameters.go b/client/s_c_i_m/patch_scim_user_parameters.go new file mode 100644 index 0000000..fa789b0 --- /dev/null +++ b/client/s_c_i_m/patch_scim_user_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewPatchScimUserParams creates a new PatchScimUserParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPatchScimUserParams() *PatchScimUserParams { + return &PatchScimUserParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPatchScimUserParamsWithTimeout creates a new PatchScimUserParams object +// with the ability to set a timeout on a request. +func NewPatchScimUserParamsWithTimeout(timeout time.Duration) *PatchScimUserParams { + return &PatchScimUserParams{ + timeout: timeout, + } +} + +// NewPatchScimUserParamsWithContext creates a new PatchScimUserParams object +// with the ability to set a context for a request. +func NewPatchScimUserParamsWithContext(ctx context.Context) *PatchScimUserParams { + return &PatchScimUserParams{ + Context: ctx, + } +} + +// NewPatchScimUserParamsWithHTTPClient creates a new PatchScimUserParams object +// with the ability to set a custom HTTPClient for a request. +func NewPatchScimUserParamsWithHTTPClient(client *http.Client) *PatchScimUserParams { + return &PatchScimUserParams{ + HTTPClient: client, + } +} + +/* +PatchScimUserParams contains all the parameters to send to the API endpoint + + for the patch scim user operation. + + Typically these are written to a http.Request. +*/ +type PatchScimUserParams struct { + + // ID. + ID string + + // PatchScimUser. + PatchScimUser *models.PatchScimUser + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the patch scim user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchScimUserParams) WithDefaults() *PatchScimUserParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the patch scim user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchScimUserParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the patch scim user params +func (o *PatchScimUserParams) WithTimeout(timeout time.Duration) *PatchScimUserParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the patch scim user params +func (o *PatchScimUserParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the patch scim user params +func (o *PatchScimUserParams) WithContext(ctx context.Context) *PatchScimUserParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the patch scim user params +func (o *PatchScimUserParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the patch scim user params +func (o *PatchScimUserParams) WithHTTPClient(client *http.Client) *PatchScimUserParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the patch scim user params +func (o *PatchScimUserParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the patch scim user params +func (o *PatchScimUserParams) WithID(id string) *PatchScimUserParams { + o.SetID(id) + return o +} + +// SetID adds the id to the patch scim user params +func (o *PatchScimUserParams) SetID(id string) { + o.ID = id +} + +// WithPatchScimUser adds the patchScimUser to the patch scim user params +func (o *PatchScimUserParams) WithPatchScimUser(patchScimUser *models.PatchScimUser) *PatchScimUserParams { + o.SetPatchScimUser(patchScimUser) + return o +} + +// SetPatchScimUser adds the patchScimUser to the patch scim user params +func (o *PatchScimUserParams) SetPatchScimUser(patchScimUser *models.PatchScimUser) { + o.PatchScimUser = patchScimUser +} + +// WriteToRequest writes these params to a swagger request +func (o *PatchScimUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + if o.PatchScimUser != nil { + if err := r.SetBodyParam(o.PatchScimUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/s_c_i_m/patch_scim_user_responses.go b/client/s_c_i_m/patch_scim_user_responses.go new file mode 100644 index 0000000..36ea031 --- /dev/null +++ b/client/s_c_i_m/patch_scim_user_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// PatchScimUserReader is a Reader for the PatchScimUser structure. +type PatchScimUserReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PatchScimUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPatchScimUserOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPatchScimUserOK creates a PatchScimUserOK with default headers values +func NewPatchScimUserOK() *PatchScimUserOK { + return &PatchScimUserOK{} +} + +/* +PatchScimUserOK describes a response with status code 200, with default header values. + +PATCH SCIM endpoint to update a User. This endpoint is used to update a resource's attributes. +*/ +type PatchScimUserOK struct { +} + +// IsSuccess returns true when this patch scim user o k response has a 2xx status code +func (o *PatchScimUserOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this patch scim user o k response has a 3xx status code +func (o *PatchScimUserOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this patch scim user o k response has a 4xx status code +func (o *PatchScimUserOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this patch scim user o k response has a 5xx status code +func (o *PatchScimUserOK) IsServerError() bool { + return false +} + +// IsCode returns true when this patch scim user o k response a status code equal to that given +func (o *PatchScimUserOK) IsCode(code int) bool { + return code == 200 +} + +func (o *PatchScimUserOK) Error() string { + return fmt.Sprintf("[PATCH /v1/scim/v2/Users/{id}][%d] patchScimUserOK ", 200) +} + +func (o *PatchScimUserOK) String() string { + return fmt.Sprintf("[PATCH /v1/scim/v2/Users/{id}][%d] patchScimUserOK ", 200) +} + +func (o *PatchScimUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/s_c_i_m/scim_client.go b/client/s_c_i_m/scim_client.go index 21b13b3..af3727f 100644 --- a/client/s_c_i_m/scim_client.go +++ b/client/s_c_i_m/scim_client.go @@ -30,50 +30,50 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1ScimV2GroupsID(params *DeleteV1ScimV2GroupsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ScimV2GroupsIDNoContent, error) + CreateScimGroup(params *CreateScimGroupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateScimGroupCreated, error) - DeleteV1ScimV2UsersID(params *DeleteV1ScimV2UsersIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ScimV2UsersIDNoContent, error) + CreateScimUser(params *CreateScimUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateScimUserCreated, error) - GetV1ScimV2Groups(params *GetV1ScimV2GroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ScimV2GroupsOK, error) + DeleteScimGroup(params *DeleteScimGroupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteScimGroupNoContent, error) - GetV1ScimV2GroupsID(params *GetV1ScimV2GroupsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ScimV2GroupsIDOK, error) + DeleteScimUser(params *DeleteScimUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteScimUserNoContent, error) - GetV1ScimV2Users(params *GetV1ScimV2UsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ScimV2UsersOK, error) + GetScimGroup(params *GetScimGroupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetScimGroupOK, error) - GetV1ScimV2UsersID(params *GetV1ScimV2UsersIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ScimV2UsersIDOK, error) + GetScimUser(params *GetScimUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetScimUserOK, error) - PatchV1ScimV2UsersID(params *PatchV1ScimV2UsersIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1ScimV2UsersIDOK, error) + ListScimGroups(params *ListScimGroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListScimGroupsOK, error) - PostV1ScimV2Groups(params *PostV1ScimV2GroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ScimV2GroupsCreated, error) + ListScimUsers(params *ListScimUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListScimUsersOK, error) - PostV1ScimV2Users(params *PostV1ScimV2UsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ScimV2UsersCreated, error) + PatchScimUser(params *PatchScimUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchScimUserOK, error) - PutV1ScimV2GroupsID(params *PutV1ScimV2GroupsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1ScimV2GroupsIDOK, error) + UpdateScimGroup(params *UpdateScimGroupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateScimGroupOK, error) - PutV1ScimV2UsersID(params *PutV1ScimV2UsersIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1ScimV2UsersIDOK, error) + UpdateScimUser(params *UpdateScimUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateScimUserOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1ScimV2GroupsID deletes a s c i m group +CreateScimGroup creates a s c i m group and assign members -SCIM endpoint to delete a Team (Colloquial for Group in the SCIM protocol). +SCIM endpoint to create a new Team (Colloquial for Group in the SCIM protocol). Any members defined in the payload will be assigned to the team with no defined role. */ -func (a *Client) DeleteV1ScimV2GroupsID(params *DeleteV1ScimV2GroupsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ScimV2GroupsIDNoContent, error) { +func (a *Client) CreateScimGroup(params *CreateScimGroupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateScimGroupCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1ScimV2GroupsIDParams() + params = NewCreateScimGroupParams() } op := &runtime.ClientOperation{ - ID: "deleteV1ScimV2GroupsId", - Method: "DELETE", - PathPattern: "/v1/scim/v2/Groups/{id}", + ID: "create_scim_group", + Method: "POST", + PathPattern: "/v1/scim/v2/Groups", ProducesMediaTypes: []string{"application/scim+json"}, - ConsumesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/scim+json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1ScimV2GroupsIDReader{formats: a.formats}, + Reader: &CreateScimGroupReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -86,35 +86,35 @@ func (a *Client) DeleteV1ScimV2GroupsID(params *DeleteV1ScimV2GroupsIDParams, au if err != nil { return nil, err } - success, ok := result.(*DeleteV1ScimV2GroupsIDNoContent) + success, ok := result.(*CreateScimGroupCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1ScimV2GroupsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_scim_group: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1ScimV2UsersID deletes a user matching s c i m data +CreateScimUser creates a user from s c i m data -SCIM endpoint to delete a User. This endpoint will deactivate a confirmed User record in our system. +SCIM endpoint to create and provision a new User. This endpoint will provision the User, which allows them to accept their account throught their IDP or via the Forgot Password flow. */ -func (a *Client) DeleteV1ScimV2UsersID(params *DeleteV1ScimV2UsersIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ScimV2UsersIDNoContent, error) { +func (a *Client) CreateScimUser(params *CreateScimUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateScimUserCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1ScimV2UsersIDParams() + params = NewCreateScimUserParams() } op := &runtime.ClientOperation{ - ID: "deleteV1ScimV2UsersId", - Method: "DELETE", - PathPattern: "/v1/scim/v2/Users/{id}", + ID: "create_scim_user", + Method: "POST", + PathPattern: "/v1/scim/v2/Users", ProducesMediaTypes: []string{"application/scim+json"}, - ConsumesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/scim+json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1ScimV2UsersIDReader{formats: a.formats}, + Reader: &CreateScimUserReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -127,35 +127,35 @@ func (a *Client) DeleteV1ScimV2UsersID(params *DeleteV1ScimV2UsersIDParams, auth if err != nil { return nil, err } - success, ok := result.(*DeleteV1ScimV2UsersIDNoContent) + success, ok := result.(*CreateScimUserCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1ScimV2UsersId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_scim_user: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ScimV2Groups lists s c i m groups +DeleteScimGroup deletes a s c i m group -SCIM endpoint that lists all Teams (Colloquial for Group in the SCIM protocol) +SCIM endpoint to delete a Team (Colloquial for Group in the SCIM protocol). */ -func (a *Client) GetV1ScimV2Groups(params *GetV1ScimV2GroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ScimV2GroupsOK, error) { +func (a *Client) DeleteScimGroup(params *DeleteScimGroupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteScimGroupNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ScimV2GroupsParams() + params = NewDeleteScimGroupParams() } op := &runtime.ClientOperation{ - ID: "getV1ScimV2Groups", - Method: "GET", - PathPattern: "/v1/scim/v2/Groups", + ID: "delete_scim_group", + Method: "DELETE", + PathPattern: "/v1/scim/v2/Groups/{id}", ProducesMediaTypes: []string{"application/scim+json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ScimV2GroupsReader{formats: a.formats}, + Reader: &DeleteScimGroupReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -168,35 +168,35 @@ func (a *Client) GetV1ScimV2Groups(params *GetV1ScimV2GroupsParams, authInfo run if err != nil { return nil, err } - success, ok := result.(*GetV1ScimV2GroupsOK) + success, ok := result.(*DeleteScimGroupNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ScimV2Groups: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_scim_group: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ScimV2GroupsID gets a s c i m group +DeleteScimUser deletes a user matching s c i m data -SCIM endpoint that lists a Team (Colloquial for Group in the SCIM protocol) +SCIM endpoint to delete a User. This endpoint will deactivate a confirmed User record in our system. */ -func (a *Client) GetV1ScimV2GroupsID(params *GetV1ScimV2GroupsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ScimV2GroupsIDOK, error) { +func (a *Client) DeleteScimUser(params *DeleteScimUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteScimUserNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ScimV2GroupsIDParams() + params = NewDeleteScimUserParams() } op := &runtime.ClientOperation{ - ID: "getV1ScimV2GroupsId", - Method: "GET", - PathPattern: "/v1/scim/v2/Groups/{id}", + ID: "delete_scim_user", + Method: "DELETE", + PathPattern: "/v1/scim/v2/Users/{id}", ProducesMediaTypes: []string{"application/scim+json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ScimV2GroupsIDReader{formats: a.formats}, + Reader: &DeleteScimUserReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -209,35 +209,35 @@ func (a *Client) GetV1ScimV2GroupsID(params *GetV1ScimV2GroupsIDParams, authInfo if err != nil { return nil, err } - success, ok := result.(*GetV1ScimV2GroupsIDOK) + success, ok := result.(*DeleteScimUserNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ScimV2GroupsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_scim_user: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ScimV2Users lists s c i m users +GetScimGroup gets a s c i m group -SCIM endpoint that lists users. This endpoint will display a list of Users currently in the system. +SCIM endpoint that lists a Team (Colloquial for Group in the SCIM protocol) */ -func (a *Client) GetV1ScimV2Users(params *GetV1ScimV2UsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ScimV2UsersOK, error) { +func (a *Client) GetScimGroup(params *GetScimGroupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetScimGroupOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ScimV2UsersParams() + params = NewGetScimGroupParams() } op := &runtime.ClientOperation{ - ID: "getV1ScimV2Users", + ID: "get_scim_group", Method: "GET", - PathPattern: "/v1/scim/v2/Users", + PathPattern: "/v1/scim/v2/Groups/{id}", ProducesMediaTypes: []string{"application/scim+json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ScimV2UsersReader{formats: a.formats}, + Reader: &GetScimGroupReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -250,35 +250,35 @@ func (a *Client) GetV1ScimV2Users(params *GetV1ScimV2UsersParams, authInfo runti if err != nil { return nil, err } - success, ok := result.(*GetV1ScimV2UsersOK) + success, ok := result.(*GetScimGroupOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ScimV2Users: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_scim_group: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ScimV2UsersID gets a s c i m user +GetScimUser gets a s c i m user SCIM endpoint that lists a User */ -func (a *Client) GetV1ScimV2UsersID(params *GetV1ScimV2UsersIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ScimV2UsersIDOK, error) { +func (a *Client) GetScimUser(params *GetScimUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetScimUserOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ScimV2UsersIDParams() + params = NewGetScimUserParams() } op := &runtime.ClientOperation{ - ID: "getV1ScimV2UsersId", + ID: "get_scim_user", Method: "GET", PathPattern: "/v1/scim/v2/Users/{id}", ProducesMediaTypes: []string{"application/scim+json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ScimV2UsersIDReader{formats: a.formats}, + Reader: &GetScimUserReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -291,35 +291,35 @@ func (a *Client) GetV1ScimV2UsersID(params *GetV1ScimV2UsersIDParams, authInfo r if err != nil { return nil, err } - success, ok := result.(*GetV1ScimV2UsersIDOK) + success, ok := result.(*GetScimUserOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ScimV2UsersId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_scim_user: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1ScimV2UsersID updates a user from s c i m data +ListScimGroups lists s c i m groups -PATCH SCIM endpoint to update a User. This endpoint is used to update a resource's attributes. +SCIM endpoint that lists all Teams (Colloquial for Group in the SCIM protocol) */ -func (a *Client) PatchV1ScimV2UsersID(params *PatchV1ScimV2UsersIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1ScimV2UsersIDOK, error) { +func (a *Client) ListScimGroups(params *ListScimGroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListScimGroupsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1ScimV2UsersIDParams() + params = NewListScimGroupsParams() } op := &runtime.ClientOperation{ - ID: "patchV1ScimV2UsersId", - Method: "PATCH", - PathPattern: "/v1/scim/v2/Users/{id}", + ID: "list_scim_groups", + Method: "GET", + PathPattern: "/v1/scim/v2/Groups", ProducesMediaTypes: []string{"application/scim+json"}, - ConsumesMediaTypes: []string{"application/scim+json"}, + ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1ScimV2UsersIDReader{formats: a.formats}, + Reader: &ListScimGroupsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -332,35 +332,35 @@ func (a *Client) PatchV1ScimV2UsersID(params *PatchV1ScimV2UsersIDParams, authIn if err != nil { return nil, err } - success, ok := result.(*PatchV1ScimV2UsersIDOK) + success, ok := result.(*ListScimGroupsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1ScimV2UsersId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_scim_groups: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1ScimV2Groups creates a s c i m group and assign members +ListScimUsers lists s c i m users -SCIM endpoint to create a new Team (Colloquial for Group in the SCIM protocol). Any members defined in the payload will be assigned to the team with no defined role. +SCIM endpoint that lists users. This endpoint will display a list of Users currently in the system. */ -func (a *Client) PostV1ScimV2Groups(params *PostV1ScimV2GroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ScimV2GroupsCreated, error) { +func (a *Client) ListScimUsers(params *ListScimUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListScimUsersOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1ScimV2GroupsParams() + params = NewListScimUsersParams() } op := &runtime.ClientOperation{ - ID: "postV1ScimV2Groups", - Method: "POST", - PathPattern: "/v1/scim/v2/Groups", + ID: "list_scim_users", + Method: "GET", + PathPattern: "/v1/scim/v2/Users", ProducesMediaTypes: []string{"application/scim+json"}, - ConsumesMediaTypes: []string{"application/scim+json"}, + ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1ScimV2GroupsReader{formats: a.formats}, + Reader: &ListScimUsersReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -373,35 +373,35 @@ func (a *Client) PostV1ScimV2Groups(params *PostV1ScimV2GroupsParams, authInfo r if err != nil { return nil, err } - success, ok := result.(*PostV1ScimV2GroupsCreated) + success, ok := result.(*ListScimUsersOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1ScimV2Groups: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_scim_users: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1ScimV2Users creates a user from s c i m data +PatchScimUser updates a user from s c i m data -SCIM endpoint to create and provision a new User. This endpoint will provision the User, which allows them to accept their account throught their IDP or via the Forgot Password flow. +PATCH SCIM endpoint to update a User. This endpoint is used to update a resource's attributes. */ -func (a *Client) PostV1ScimV2Users(params *PostV1ScimV2UsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ScimV2UsersCreated, error) { +func (a *Client) PatchScimUser(params *PatchScimUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchScimUserOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1ScimV2UsersParams() + params = NewPatchScimUserParams() } op := &runtime.ClientOperation{ - ID: "postV1ScimV2Users", - Method: "POST", - PathPattern: "/v1/scim/v2/Users", + ID: "patch_scim_user", + Method: "PATCH", + PathPattern: "/v1/scim/v2/Users/{id}", ProducesMediaTypes: []string{"application/scim+json"}, ConsumesMediaTypes: []string{"application/scim+json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1ScimV2UsersReader{formats: a.formats}, + Reader: &PatchScimUserReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -414,35 +414,35 @@ func (a *Client) PostV1ScimV2Users(params *PostV1ScimV2UsersParams, authInfo run if err != nil { return nil, err } - success, ok := result.(*PostV1ScimV2UsersCreated) + success, ok := result.(*PatchScimUserOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1ScimV2Users: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for patch_scim_user: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1ScimV2GroupsID updates a s c i m group and assign members +UpdateScimGroup updates a s c i m group and assign members SCIM endpoint to update a Team (Colloquial for Group in the SCIM protocol). Any members defined in the payload will be assigned to the team with no defined role, any missing members will be removed from the team. */ -func (a *Client) PutV1ScimV2GroupsID(params *PutV1ScimV2GroupsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1ScimV2GroupsIDOK, error) { +func (a *Client) UpdateScimGroup(params *UpdateScimGroupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateScimGroupOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1ScimV2GroupsIDParams() + params = NewUpdateScimGroupParams() } op := &runtime.ClientOperation{ - ID: "putV1ScimV2GroupsId", + ID: "update_scim_group", Method: "PUT", PathPattern: "/v1/scim/v2/Groups/{id}", ProducesMediaTypes: []string{"application/scim+json"}, ConsumesMediaTypes: []string{"application/scim+json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1ScimV2GroupsIDReader{formats: a.formats}, + Reader: &UpdateScimGroupReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -455,35 +455,35 @@ func (a *Client) PutV1ScimV2GroupsID(params *PutV1ScimV2GroupsIDParams, authInfo if err != nil { return nil, err } - success, ok := result.(*PutV1ScimV2GroupsIDOK) + success, ok := result.(*UpdateScimGroupOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1ScimV2GroupsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_scim_group: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1ScimV2UsersID updates a user from s c i m data +UpdateScimUser updates a user from s c i m data PUT SCIM endpoint to update a User. This endpoint is used to replace a resource's attributes. */ -func (a *Client) PutV1ScimV2UsersID(params *PutV1ScimV2UsersIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1ScimV2UsersIDOK, error) { +func (a *Client) UpdateScimUser(params *UpdateScimUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateScimUserOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1ScimV2UsersIDParams() + params = NewUpdateScimUserParams() } op := &runtime.ClientOperation{ - ID: "putV1ScimV2UsersId", + ID: "update_scim_user", Method: "PUT", PathPattern: "/v1/scim/v2/Users/{id}", ProducesMediaTypes: []string{"application/scim+json"}, ConsumesMediaTypes: []string{"application/scim+json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1ScimV2UsersIDReader{formats: a.formats}, + Reader: &UpdateScimUserReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -496,13 +496,13 @@ func (a *Client) PutV1ScimV2UsersID(params *PutV1ScimV2UsersIDParams, authInfo r if err != nil { return nil, err } - success, ok := result.(*PutV1ScimV2UsersIDOK) + success, ok := result.(*UpdateScimUserOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1ScimV2UsersId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_scim_user: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/s_c_i_m/update_scim_group_parameters.go b/client/s_c_i_m/update_scim_group_parameters.go new file mode 100644 index 0000000..ee9c049 --- /dev/null +++ b/client/s_c_i_m/update_scim_group_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateScimGroupParams creates a new UpdateScimGroupParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateScimGroupParams() *UpdateScimGroupParams { + return &UpdateScimGroupParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateScimGroupParamsWithTimeout creates a new UpdateScimGroupParams object +// with the ability to set a timeout on a request. +func NewUpdateScimGroupParamsWithTimeout(timeout time.Duration) *UpdateScimGroupParams { + return &UpdateScimGroupParams{ + timeout: timeout, + } +} + +// NewUpdateScimGroupParamsWithContext creates a new UpdateScimGroupParams object +// with the ability to set a context for a request. +func NewUpdateScimGroupParamsWithContext(ctx context.Context) *UpdateScimGroupParams { + return &UpdateScimGroupParams{ + Context: ctx, + } +} + +// NewUpdateScimGroupParamsWithHTTPClient creates a new UpdateScimGroupParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateScimGroupParamsWithHTTPClient(client *http.Client) *UpdateScimGroupParams { + return &UpdateScimGroupParams{ + HTTPClient: client, + } +} + +/* +UpdateScimGroupParams contains all the parameters to send to the API endpoint + + for the update scim group operation. + + Typically these are written to a http.Request. +*/ +type UpdateScimGroupParams struct { + + // ID. + ID string + + // UpdateScimGroup. + UpdateScimGroup *models.UpdateScimGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update scim group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateScimGroupParams) WithDefaults() *UpdateScimGroupParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update scim group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateScimGroupParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update scim group params +func (o *UpdateScimGroupParams) WithTimeout(timeout time.Duration) *UpdateScimGroupParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update scim group params +func (o *UpdateScimGroupParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update scim group params +func (o *UpdateScimGroupParams) WithContext(ctx context.Context) *UpdateScimGroupParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update scim group params +func (o *UpdateScimGroupParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update scim group params +func (o *UpdateScimGroupParams) WithHTTPClient(client *http.Client) *UpdateScimGroupParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update scim group params +func (o *UpdateScimGroupParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the update scim group params +func (o *UpdateScimGroupParams) WithID(id string) *UpdateScimGroupParams { + o.SetID(id) + return o +} + +// SetID adds the id to the update scim group params +func (o *UpdateScimGroupParams) SetID(id string) { + o.ID = id +} + +// WithUpdateScimGroup adds the updateScimGroup to the update scim group params +func (o *UpdateScimGroupParams) WithUpdateScimGroup(updateScimGroup *models.UpdateScimGroup) *UpdateScimGroupParams { + o.SetUpdateScimGroup(updateScimGroup) + return o +} + +// SetUpdateScimGroup adds the updateScimGroup to the update scim group params +func (o *UpdateScimGroupParams) SetUpdateScimGroup(updateScimGroup *models.UpdateScimGroup) { + o.UpdateScimGroup = updateScimGroup +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateScimGroupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + if o.UpdateScimGroup != nil { + if err := r.SetBodyParam(o.UpdateScimGroup); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/s_c_i_m/update_scim_group_responses.go b/client/s_c_i_m/update_scim_group_responses.go new file mode 100644 index 0000000..041f17a --- /dev/null +++ b/client/s_c_i_m/update_scim_group_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateScimGroupReader is a Reader for the UpdateScimGroup structure. +type UpdateScimGroupReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateScimGroupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateScimGroupOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateScimGroupOK creates a UpdateScimGroupOK with default headers values +func NewUpdateScimGroupOK() *UpdateScimGroupOK { + return &UpdateScimGroupOK{} +} + +/* +UpdateScimGroupOK describes a response with status code 200, with default header values. + +SCIM endpoint to update a Team (Colloquial for Group in the SCIM protocol). Any members defined in the payload will be assigned to the team with no defined role, any missing members will be removed from the team. +*/ +type UpdateScimGroupOK struct { +} + +// IsSuccess returns true when this update scim group o k response has a 2xx status code +func (o *UpdateScimGroupOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update scim group o k response has a 3xx status code +func (o *UpdateScimGroupOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update scim group o k response has a 4xx status code +func (o *UpdateScimGroupOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update scim group o k response has a 5xx status code +func (o *UpdateScimGroupOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update scim group o k response a status code equal to that given +func (o *UpdateScimGroupOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateScimGroupOK) Error() string { + return fmt.Sprintf("[PUT /v1/scim/v2/Groups/{id}][%d] updateScimGroupOK ", 200) +} + +func (o *UpdateScimGroupOK) String() string { + return fmt.Sprintf("[PUT /v1/scim/v2/Groups/{id}][%d] updateScimGroupOK ", 200) +} + +func (o *UpdateScimGroupOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/s_c_i_m/update_scim_user_parameters.go b/client/s_c_i_m/update_scim_user_parameters.go new file mode 100644 index 0000000..7363b25 --- /dev/null +++ b/client/s_c_i_m/update_scim_user_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateScimUserParams creates a new UpdateScimUserParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateScimUserParams() *UpdateScimUserParams { + return &UpdateScimUserParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateScimUserParamsWithTimeout creates a new UpdateScimUserParams object +// with the ability to set a timeout on a request. +func NewUpdateScimUserParamsWithTimeout(timeout time.Duration) *UpdateScimUserParams { + return &UpdateScimUserParams{ + timeout: timeout, + } +} + +// NewUpdateScimUserParamsWithContext creates a new UpdateScimUserParams object +// with the ability to set a context for a request. +func NewUpdateScimUserParamsWithContext(ctx context.Context) *UpdateScimUserParams { + return &UpdateScimUserParams{ + Context: ctx, + } +} + +// NewUpdateScimUserParamsWithHTTPClient creates a new UpdateScimUserParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateScimUserParamsWithHTTPClient(client *http.Client) *UpdateScimUserParams { + return &UpdateScimUserParams{ + HTTPClient: client, + } +} + +/* +UpdateScimUserParams contains all the parameters to send to the API endpoint + + for the update scim user operation. + + Typically these are written to a http.Request. +*/ +type UpdateScimUserParams struct { + + // ID. + ID string + + // UpdateScimUser. + UpdateScimUser *models.UpdateScimUser + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update scim user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateScimUserParams) WithDefaults() *UpdateScimUserParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update scim user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateScimUserParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update scim user params +func (o *UpdateScimUserParams) WithTimeout(timeout time.Duration) *UpdateScimUserParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update scim user params +func (o *UpdateScimUserParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update scim user params +func (o *UpdateScimUserParams) WithContext(ctx context.Context) *UpdateScimUserParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update scim user params +func (o *UpdateScimUserParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update scim user params +func (o *UpdateScimUserParams) WithHTTPClient(client *http.Client) *UpdateScimUserParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update scim user params +func (o *UpdateScimUserParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the update scim user params +func (o *UpdateScimUserParams) WithID(id string) *UpdateScimUserParams { + o.SetID(id) + return o +} + +// SetID adds the id to the update scim user params +func (o *UpdateScimUserParams) SetID(id string) { + o.ID = id +} + +// WithUpdateScimUser adds the updateScimUser to the update scim user params +func (o *UpdateScimUserParams) WithUpdateScimUser(updateScimUser *models.UpdateScimUser) *UpdateScimUserParams { + o.SetUpdateScimUser(updateScimUser) + return o +} + +// SetUpdateScimUser adds the updateScimUser to the update scim user params +func (o *UpdateScimUserParams) SetUpdateScimUser(updateScimUser *models.UpdateScimUser) { + o.UpdateScimUser = updateScimUser +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateScimUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + if o.UpdateScimUser != nil { + if err := r.SetBodyParam(o.UpdateScimUser); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/s_c_i_m/update_scim_user_responses.go b/client/s_c_i_m/update_scim_user_responses.go new file mode 100644 index 0000000..0ba9a19 --- /dev/null +++ b/client/s_c_i_m/update_scim_user_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package s_c_i_m + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateScimUserReader is a Reader for the UpdateScimUser structure. +type UpdateScimUserReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateScimUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateScimUserOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateScimUserOK creates a UpdateScimUserOK with default headers values +func NewUpdateScimUserOK() *UpdateScimUserOK { + return &UpdateScimUserOK{} +} + +/* +UpdateScimUserOK describes a response with status code 200, with default header values. + +PUT SCIM endpoint to update a User. This endpoint is used to replace a resource's attributes. +*/ +type UpdateScimUserOK struct { +} + +// IsSuccess returns true when this update scim user o k response has a 2xx status code +func (o *UpdateScimUserOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update scim user o k response has a 3xx status code +func (o *UpdateScimUserOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update scim user o k response has a 4xx status code +func (o *UpdateScimUserOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update scim user o k response has a 5xx status code +func (o *UpdateScimUserOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update scim user o k response a status code equal to that given +func (o *UpdateScimUserOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateScimUserOK) Error() string { + return fmt.Sprintf("[PUT /v1/scim/v2/Users/{id}][%d] updateScimUserOK ", 200) +} + +func (o *UpdateScimUserOK) String() string { + return fmt.Sprintf("[PUT /v1/scim/v2/Users/{id}][%d] updateScimUserOK ", 200) +} + +func (o *UpdateScimUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/create_on_call_shift_parameters.go b/client/signals/create_on_call_shift_parameters.go new file mode 100644 index 0000000..6531e60 --- /dev/null +++ b/client/signals/create_on_call_shift_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateOnCallShiftParams creates a new CreateOnCallShiftParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateOnCallShiftParams() *CreateOnCallShiftParams { + return &CreateOnCallShiftParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateOnCallShiftParamsWithTimeout creates a new CreateOnCallShiftParams object +// with the ability to set a timeout on a request. +func NewCreateOnCallShiftParamsWithTimeout(timeout time.Duration) *CreateOnCallShiftParams { + return &CreateOnCallShiftParams{ + timeout: timeout, + } +} + +// NewCreateOnCallShiftParamsWithContext creates a new CreateOnCallShiftParams object +// with the ability to set a context for a request. +func NewCreateOnCallShiftParamsWithContext(ctx context.Context) *CreateOnCallShiftParams { + return &CreateOnCallShiftParams{ + Context: ctx, + } +} + +// NewCreateOnCallShiftParamsWithHTTPClient creates a new CreateOnCallShiftParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateOnCallShiftParamsWithHTTPClient(client *http.Client) *CreateOnCallShiftParams { + return &CreateOnCallShiftParams{ + HTTPClient: client, + } +} + +/* +CreateOnCallShiftParams contains all the parameters to send to the API endpoint + + for the create on call shift operation. + + Typically these are written to a http.Request. +*/ +type CreateOnCallShiftParams struct { + + // CreateOnCallShift. + CreateOnCallShift *models.CreateOnCallShift + + // ScheduleID. + ScheduleID string + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create on call shift params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateOnCallShiftParams) WithDefaults() *CreateOnCallShiftParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create on call shift params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateOnCallShiftParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create on call shift params +func (o *CreateOnCallShiftParams) WithTimeout(timeout time.Duration) *CreateOnCallShiftParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create on call shift params +func (o *CreateOnCallShiftParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create on call shift params +func (o *CreateOnCallShiftParams) WithContext(ctx context.Context) *CreateOnCallShiftParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create on call shift params +func (o *CreateOnCallShiftParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create on call shift params +func (o *CreateOnCallShiftParams) WithHTTPClient(client *http.Client) *CreateOnCallShiftParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create on call shift params +func (o *CreateOnCallShiftParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateOnCallShift adds the createOnCallShift to the create on call shift params +func (o *CreateOnCallShiftParams) WithCreateOnCallShift(createOnCallShift *models.CreateOnCallShift) *CreateOnCallShiftParams { + o.SetCreateOnCallShift(createOnCallShift) + return o +} + +// SetCreateOnCallShift adds the createOnCallShift to the create on call shift params +func (o *CreateOnCallShiftParams) SetCreateOnCallShift(createOnCallShift *models.CreateOnCallShift) { + o.CreateOnCallShift = createOnCallShift +} + +// WithScheduleID adds the scheduleID to the create on call shift params +func (o *CreateOnCallShiftParams) WithScheduleID(scheduleID string) *CreateOnCallShiftParams { + o.SetScheduleID(scheduleID) + return o +} + +// SetScheduleID adds the scheduleId to the create on call shift params +func (o *CreateOnCallShiftParams) SetScheduleID(scheduleID string) { + o.ScheduleID = scheduleID +} + +// WithTeamID adds the teamID to the create on call shift params +func (o *CreateOnCallShiftParams) WithTeamID(teamID string) *CreateOnCallShiftParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the create on call shift params +func (o *CreateOnCallShiftParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateOnCallShiftParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateOnCallShift != nil { + if err := r.SetBodyParam(o.CreateOnCallShift); err != nil { + return err + } + } + + // path param schedule_id + if err := r.SetPathParam("schedule_id", o.ScheduleID); err != nil { + return err + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/create_on_call_shift_responses.go b/client/signals/create_on_call_shift_responses.go new file mode 100644 index 0000000..112b509 --- /dev/null +++ b/client/signals/create_on_call_shift_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateOnCallShiftReader is a Reader for the CreateOnCallShift structure. +type CreateOnCallShiftReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateOnCallShiftReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateOnCallShiftCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateOnCallShiftCreated creates a CreateOnCallShiftCreated with default headers values +func NewCreateOnCallShiftCreated() *CreateOnCallShiftCreated { + return &CreateOnCallShiftCreated{} +} + +/* +CreateOnCallShiftCreated describes a response with status code 201, with default header values. + +Create a Signals on-call shift in a schedule. +*/ +type CreateOnCallShiftCreated struct { +} + +// IsSuccess returns true when this create on call shift created response has a 2xx status code +func (o *CreateOnCallShiftCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create on call shift created response has a 3xx status code +func (o *CreateOnCallShiftCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create on call shift created response has a 4xx status code +func (o *CreateOnCallShiftCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create on call shift created response has a 5xx status code +func (o *CreateOnCallShiftCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create on call shift created response a status code equal to that given +func (o *CreateOnCallShiftCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateOnCallShiftCreated) Error() string { + return fmt.Sprintf("[POST /v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts][%d] createOnCallShiftCreated ", 201) +} + +func (o *CreateOnCallShiftCreated) String() string { + return fmt.Sprintf("[POST /v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts][%d] createOnCallShiftCreated ", 201) +} + +func (o *CreateOnCallShiftCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/create_signals_email_target_parameters.go b/client/signals/create_signals_email_target_parameters.go new file mode 100644 index 0000000..653760a --- /dev/null +++ b/client/signals/create_signals_email_target_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateSignalsEmailTargetParams creates a new CreateSignalsEmailTargetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateSignalsEmailTargetParams() *CreateSignalsEmailTargetParams { + return &CreateSignalsEmailTargetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateSignalsEmailTargetParamsWithTimeout creates a new CreateSignalsEmailTargetParams object +// with the ability to set a timeout on a request. +func NewCreateSignalsEmailTargetParamsWithTimeout(timeout time.Duration) *CreateSignalsEmailTargetParams { + return &CreateSignalsEmailTargetParams{ + timeout: timeout, + } +} + +// NewCreateSignalsEmailTargetParamsWithContext creates a new CreateSignalsEmailTargetParams object +// with the ability to set a context for a request. +func NewCreateSignalsEmailTargetParamsWithContext(ctx context.Context) *CreateSignalsEmailTargetParams { + return &CreateSignalsEmailTargetParams{ + Context: ctx, + } +} + +// NewCreateSignalsEmailTargetParamsWithHTTPClient creates a new CreateSignalsEmailTargetParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateSignalsEmailTargetParamsWithHTTPClient(client *http.Client) *CreateSignalsEmailTargetParams { + return &CreateSignalsEmailTargetParams{ + HTTPClient: client, + } +} + +/* +CreateSignalsEmailTargetParams contains all the parameters to send to the API endpoint + + for the create signals email target operation. + + Typically these are written to a http.Request. +*/ +type CreateSignalsEmailTargetParams struct { + + // CreateSignalsEmailTarget. + CreateSignalsEmailTarget *models.CreateSignalsEmailTarget + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create signals email target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSignalsEmailTargetParams) WithDefaults() *CreateSignalsEmailTargetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create signals email target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSignalsEmailTargetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create signals email target params +func (o *CreateSignalsEmailTargetParams) WithTimeout(timeout time.Duration) *CreateSignalsEmailTargetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create signals email target params +func (o *CreateSignalsEmailTargetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create signals email target params +func (o *CreateSignalsEmailTargetParams) WithContext(ctx context.Context) *CreateSignalsEmailTargetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create signals email target params +func (o *CreateSignalsEmailTargetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create signals email target params +func (o *CreateSignalsEmailTargetParams) WithHTTPClient(client *http.Client) *CreateSignalsEmailTargetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create signals email target params +func (o *CreateSignalsEmailTargetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateSignalsEmailTarget adds the createSignalsEmailTarget to the create signals email target params +func (o *CreateSignalsEmailTargetParams) WithCreateSignalsEmailTarget(createSignalsEmailTarget *models.CreateSignalsEmailTarget) *CreateSignalsEmailTargetParams { + o.SetCreateSignalsEmailTarget(createSignalsEmailTarget) + return o +} + +// SetCreateSignalsEmailTarget adds the createSignalsEmailTarget to the create signals email target params +func (o *CreateSignalsEmailTargetParams) SetCreateSignalsEmailTarget(createSignalsEmailTarget *models.CreateSignalsEmailTarget) { + o.CreateSignalsEmailTarget = createSignalsEmailTarget +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateSignalsEmailTargetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateSignalsEmailTarget != nil { + if err := r.SetBodyParam(o.CreateSignalsEmailTarget); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/create_signals_email_target_responses.go b/client/signals/create_signals_email_target_responses.go new file mode 100644 index 0000000..1bf6e28 --- /dev/null +++ b/client/signals/create_signals_email_target_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateSignalsEmailTargetReader is a Reader for the CreateSignalsEmailTarget structure. +type CreateSignalsEmailTargetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateSignalsEmailTargetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateSignalsEmailTargetCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateSignalsEmailTargetCreated creates a CreateSignalsEmailTargetCreated with default headers values +func NewCreateSignalsEmailTargetCreated() *CreateSignalsEmailTargetCreated { + return &CreateSignalsEmailTargetCreated{} +} + +/* +CreateSignalsEmailTargetCreated describes a response with status code 201, with default header values. + +Create a Signals email target for a team. +*/ +type CreateSignalsEmailTargetCreated struct { +} + +// IsSuccess returns true when this create signals email target created response has a 2xx status code +func (o *CreateSignalsEmailTargetCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create signals email target created response has a 3xx status code +func (o *CreateSignalsEmailTargetCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create signals email target created response has a 4xx status code +func (o *CreateSignalsEmailTargetCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create signals email target created response has a 5xx status code +func (o *CreateSignalsEmailTargetCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create signals email target created response a status code equal to that given +func (o *CreateSignalsEmailTargetCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateSignalsEmailTargetCreated) Error() string { + return fmt.Sprintf("[POST /v1/signals/email_targets][%d] createSignalsEmailTargetCreated ", 201) +} + +func (o *CreateSignalsEmailTargetCreated) String() string { + return fmt.Sprintf("[POST /v1/signals/email_targets][%d] createSignalsEmailTargetCreated ", 201) +} + +func (o *CreateSignalsEmailTargetCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/create_signals_webhook_target_parameters.go b/client/signals/create_signals_webhook_target_parameters.go new file mode 100644 index 0000000..5b794b7 --- /dev/null +++ b/client/signals/create_signals_webhook_target_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateSignalsWebhookTargetParams creates a new CreateSignalsWebhookTargetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateSignalsWebhookTargetParams() *CreateSignalsWebhookTargetParams { + return &CreateSignalsWebhookTargetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateSignalsWebhookTargetParamsWithTimeout creates a new CreateSignalsWebhookTargetParams object +// with the ability to set a timeout on a request. +func NewCreateSignalsWebhookTargetParamsWithTimeout(timeout time.Duration) *CreateSignalsWebhookTargetParams { + return &CreateSignalsWebhookTargetParams{ + timeout: timeout, + } +} + +// NewCreateSignalsWebhookTargetParamsWithContext creates a new CreateSignalsWebhookTargetParams object +// with the ability to set a context for a request. +func NewCreateSignalsWebhookTargetParamsWithContext(ctx context.Context) *CreateSignalsWebhookTargetParams { + return &CreateSignalsWebhookTargetParams{ + Context: ctx, + } +} + +// NewCreateSignalsWebhookTargetParamsWithHTTPClient creates a new CreateSignalsWebhookTargetParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateSignalsWebhookTargetParamsWithHTTPClient(client *http.Client) *CreateSignalsWebhookTargetParams { + return &CreateSignalsWebhookTargetParams{ + HTTPClient: client, + } +} + +/* +CreateSignalsWebhookTargetParams contains all the parameters to send to the API endpoint + + for the create signals webhook target operation. + + Typically these are written to a http.Request. +*/ +type CreateSignalsWebhookTargetParams struct { + + // CreateSignalsWebhookTarget. + CreateSignalsWebhookTarget *models.CreateSignalsWebhookTarget + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create signals webhook target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSignalsWebhookTargetParams) WithDefaults() *CreateSignalsWebhookTargetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create signals webhook target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSignalsWebhookTargetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create signals webhook target params +func (o *CreateSignalsWebhookTargetParams) WithTimeout(timeout time.Duration) *CreateSignalsWebhookTargetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create signals webhook target params +func (o *CreateSignalsWebhookTargetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create signals webhook target params +func (o *CreateSignalsWebhookTargetParams) WithContext(ctx context.Context) *CreateSignalsWebhookTargetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create signals webhook target params +func (o *CreateSignalsWebhookTargetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create signals webhook target params +func (o *CreateSignalsWebhookTargetParams) WithHTTPClient(client *http.Client) *CreateSignalsWebhookTargetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create signals webhook target params +func (o *CreateSignalsWebhookTargetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateSignalsWebhookTarget adds the createSignalsWebhookTarget to the create signals webhook target params +func (o *CreateSignalsWebhookTargetParams) WithCreateSignalsWebhookTarget(createSignalsWebhookTarget *models.CreateSignalsWebhookTarget) *CreateSignalsWebhookTargetParams { + o.SetCreateSignalsWebhookTarget(createSignalsWebhookTarget) + return o +} + +// SetCreateSignalsWebhookTarget adds the createSignalsWebhookTarget to the create signals webhook target params +func (o *CreateSignalsWebhookTargetParams) SetCreateSignalsWebhookTarget(createSignalsWebhookTarget *models.CreateSignalsWebhookTarget) { + o.CreateSignalsWebhookTarget = createSignalsWebhookTarget +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateSignalsWebhookTargetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateSignalsWebhookTarget != nil { + if err := r.SetBodyParam(o.CreateSignalsWebhookTarget); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/create_signals_webhook_target_responses.go b/client/signals/create_signals_webhook_target_responses.go new file mode 100644 index 0000000..7336427 --- /dev/null +++ b/client/signals/create_signals_webhook_target_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateSignalsWebhookTargetReader is a Reader for the CreateSignalsWebhookTarget structure. +type CreateSignalsWebhookTargetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateSignalsWebhookTargetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateSignalsWebhookTargetCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateSignalsWebhookTargetCreated creates a CreateSignalsWebhookTargetCreated with default headers values +func NewCreateSignalsWebhookTargetCreated() *CreateSignalsWebhookTargetCreated { + return &CreateSignalsWebhookTargetCreated{} +} + +/* +CreateSignalsWebhookTargetCreated describes a response with status code 201, with default header values. + +Create a Signals webhook target. +*/ +type CreateSignalsWebhookTargetCreated struct { +} + +// IsSuccess returns true when this create signals webhook target created response has a 2xx status code +func (o *CreateSignalsWebhookTargetCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create signals webhook target created response has a 3xx status code +func (o *CreateSignalsWebhookTargetCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create signals webhook target created response has a 4xx status code +func (o *CreateSignalsWebhookTargetCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create signals webhook target created response has a 5xx status code +func (o *CreateSignalsWebhookTargetCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create signals webhook target created response a status code equal to that given +func (o *CreateSignalsWebhookTargetCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateSignalsWebhookTargetCreated) Error() string { + return fmt.Sprintf("[POST /v1/signals/webhook_targets][%d] createSignalsWebhookTargetCreated ", 201) +} + +func (o *CreateSignalsWebhookTargetCreated) String() string { + return fmt.Sprintf("[POST /v1/signals/webhook_targets][%d] createSignalsWebhookTargetCreated ", 201) +} + +func (o *CreateSignalsWebhookTargetCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/create_team_escalation_policy_parameters.go b/client/signals/create_team_escalation_policy_parameters.go new file mode 100644 index 0000000..84f4c18 --- /dev/null +++ b/client/signals/create_team_escalation_policy_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateTeamEscalationPolicyParams creates a new CreateTeamEscalationPolicyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateTeamEscalationPolicyParams() *CreateTeamEscalationPolicyParams { + return &CreateTeamEscalationPolicyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateTeamEscalationPolicyParamsWithTimeout creates a new CreateTeamEscalationPolicyParams object +// with the ability to set a timeout on a request. +func NewCreateTeamEscalationPolicyParamsWithTimeout(timeout time.Duration) *CreateTeamEscalationPolicyParams { + return &CreateTeamEscalationPolicyParams{ + timeout: timeout, + } +} + +// NewCreateTeamEscalationPolicyParamsWithContext creates a new CreateTeamEscalationPolicyParams object +// with the ability to set a context for a request. +func NewCreateTeamEscalationPolicyParamsWithContext(ctx context.Context) *CreateTeamEscalationPolicyParams { + return &CreateTeamEscalationPolicyParams{ + Context: ctx, + } +} + +// NewCreateTeamEscalationPolicyParamsWithHTTPClient creates a new CreateTeamEscalationPolicyParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateTeamEscalationPolicyParamsWithHTTPClient(client *http.Client) *CreateTeamEscalationPolicyParams { + return &CreateTeamEscalationPolicyParams{ + HTTPClient: client, + } +} + +/* +CreateTeamEscalationPolicyParams contains all the parameters to send to the API endpoint + + for the create team escalation policy operation. + + Typically these are written to a http.Request. +*/ +type CreateTeamEscalationPolicyParams struct { + + // CreateTeamEscalationPolicy. + CreateTeamEscalationPolicy *models.CreateTeamEscalationPolicy + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create team escalation policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTeamEscalationPolicyParams) WithDefaults() *CreateTeamEscalationPolicyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create team escalation policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTeamEscalationPolicyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create team escalation policy params +func (o *CreateTeamEscalationPolicyParams) WithTimeout(timeout time.Duration) *CreateTeamEscalationPolicyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create team escalation policy params +func (o *CreateTeamEscalationPolicyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create team escalation policy params +func (o *CreateTeamEscalationPolicyParams) WithContext(ctx context.Context) *CreateTeamEscalationPolicyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create team escalation policy params +func (o *CreateTeamEscalationPolicyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create team escalation policy params +func (o *CreateTeamEscalationPolicyParams) WithHTTPClient(client *http.Client) *CreateTeamEscalationPolicyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create team escalation policy params +func (o *CreateTeamEscalationPolicyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateTeamEscalationPolicy adds the createTeamEscalationPolicy to the create team escalation policy params +func (o *CreateTeamEscalationPolicyParams) WithCreateTeamEscalationPolicy(createTeamEscalationPolicy *models.CreateTeamEscalationPolicy) *CreateTeamEscalationPolicyParams { + o.SetCreateTeamEscalationPolicy(createTeamEscalationPolicy) + return o +} + +// SetCreateTeamEscalationPolicy adds the createTeamEscalationPolicy to the create team escalation policy params +func (o *CreateTeamEscalationPolicyParams) SetCreateTeamEscalationPolicy(createTeamEscalationPolicy *models.CreateTeamEscalationPolicy) { + o.CreateTeamEscalationPolicy = createTeamEscalationPolicy +} + +// WithTeamID adds the teamID to the create team escalation policy params +func (o *CreateTeamEscalationPolicyParams) WithTeamID(teamID string) *CreateTeamEscalationPolicyParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the create team escalation policy params +func (o *CreateTeamEscalationPolicyParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateTeamEscalationPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateTeamEscalationPolicy != nil { + if err := r.SetBodyParam(o.CreateTeamEscalationPolicy); err != nil { + return err + } + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/create_team_escalation_policy_responses.go b/client/signals/create_team_escalation_policy_responses.go new file mode 100644 index 0000000..902b3d6 --- /dev/null +++ b/client/signals/create_team_escalation_policy_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateTeamEscalationPolicyReader is a Reader for the CreateTeamEscalationPolicy structure. +type CreateTeamEscalationPolicyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateTeamEscalationPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateTeamEscalationPolicyCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateTeamEscalationPolicyCreated creates a CreateTeamEscalationPolicyCreated with default headers values +func NewCreateTeamEscalationPolicyCreated() *CreateTeamEscalationPolicyCreated { + return &CreateTeamEscalationPolicyCreated{} +} + +/* +CreateTeamEscalationPolicyCreated describes a response with status code 201, with default header values. + +Create a Signals escalation policy for a team. +*/ +type CreateTeamEscalationPolicyCreated struct { +} + +// IsSuccess returns true when this create team escalation policy created response has a 2xx status code +func (o *CreateTeamEscalationPolicyCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create team escalation policy created response has a 3xx status code +func (o *CreateTeamEscalationPolicyCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create team escalation policy created response has a 4xx status code +func (o *CreateTeamEscalationPolicyCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create team escalation policy created response has a 5xx status code +func (o *CreateTeamEscalationPolicyCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create team escalation policy created response a status code equal to that given +func (o *CreateTeamEscalationPolicyCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateTeamEscalationPolicyCreated) Error() string { + return fmt.Sprintf("[POST /v1/teams/{team_id}/escalation_policies][%d] createTeamEscalationPolicyCreated ", 201) +} + +func (o *CreateTeamEscalationPolicyCreated) String() string { + return fmt.Sprintf("[POST /v1/teams/{team_id}/escalation_policies][%d] createTeamEscalationPolicyCreated ", 201) +} + +func (o *CreateTeamEscalationPolicyCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/create_team_on_call_schedule_parameters.go b/client/signals/create_team_on_call_schedule_parameters.go new file mode 100644 index 0000000..5daa02b --- /dev/null +++ b/client/signals/create_team_on_call_schedule_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateTeamOnCallScheduleParams creates a new CreateTeamOnCallScheduleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateTeamOnCallScheduleParams() *CreateTeamOnCallScheduleParams { + return &CreateTeamOnCallScheduleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateTeamOnCallScheduleParamsWithTimeout creates a new CreateTeamOnCallScheduleParams object +// with the ability to set a timeout on a request. +func NewCreateTeamOnCallScheduleParamsWithTimeout(timeout time.Duration) *CreateTeamOnCallScheduleParams { + return &CreateTeamOnCallScheduleParams{ + timeout: timeout, + } +} + +// NewCreateTeamOnCallScheduleParamsWithContext creates a new CreateTeamOnCallScheduleParams object +// with the ability to set a context for a request. +func NewCreateTeamOnCallScheduleParamsWithContext(ctx context.Context) *CreateTeamOnCallScheduleParams { + return &CreateTeamOnCallScheduleParams{ + Context: ctx, + } +} + +// NewCreateTeamOnCallScheduleParamsWithHTTPClient creates a new CreateTeamOnCallScheduleParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateTeamOnCallScheduleParamsWithHTTPClient(client *http.Client) *CreateTeamOnCallScheduleParams { + return &CreateTeamOnCallScheduleParams{ + HTTPClient: client, + } +} + +/* +CreateTeamOnCallScheduleParams contains all the parameters to send to the API endpoint + + for the create team on call schedule operation. + + Typically these are written to a http.Request. +*/ +type CreateTeamOnCallScheduleParams struct { + + // CreateTeamOnCallSchedule. + CreateTeamOnCallSchedule *models.CreateTeamOnCallSchedule + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create team on call schedule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTeamOnCallScheduleParams) WithDefaults() *CreateTeamOnCallScheduleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create team on call schedule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTeamOnCallScheduleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create team on call schedule params +func (o *CreateTeamOnCallScheduleParams) WithTimeout(timeout time.Duration) *CreateTeamOnCallScheduleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create team on call schedule params +func (o *CreateTeamOnCallScheduleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create team on call schedule params +func (o *CreateTeamOnCallScheduleParams) WithContext(ctx context.Context) *CreateTeamOnCallScheduleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create team on call schedule params +func (o *CreateTeamOnCallScheduleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create team on call schedule params +func (o *CreateTeamOnCallScheduleParams) WithHTTPClient(client *http.Client) *CreateTeamOnCallScheduleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create team on call schedule params +func (o *CreateTeamOnCallScheduleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateTeamOnCallSchedule adds the createTeamOnCallSchedule to the create team on call schedule params +func (o *CreateTeamOnCallScheduleParams) WithCreateTeamOnCallSchedule(createTeamOnCallSchedule *models.CreateTeamOnCallSchedule) *CreateTeamOnCallScheduleParams { + o.SetCreateTeamOnCallSchedule(createTeamOnCallSchedule) + return o +} + +// SetCreateTeamOnCallSchedule adds the createTeamOnCallSchedule to the create team on call schedule params +func (o *CreateTeamOnCallScheduleParams) SetCreateTeamOnCallSchedule(createTeamOnCallSchedule *models.CreateTeamOnCallSchedule) { + o.CreateTeamOnCallSchedule = createTeamOnCallSchedule +} + +// WithTeamID adds the teamID to the create team on call schedule params +func (o *CreateTeamOnCallScheduleParams) WithTeamID(teamID string) *CreateTeamOnCallScheduleParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the create team on call schedule params +func (o *CreateTeamOnCallScheduleParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateTeamOnCallScheduleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateTeamOnCallSchedule != nil { + if err := r.SetBodyParam(o.CreateTeamOnCallSchedule); err != nil { + return err + } + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/create_team_on_call_schedule_responses.go b/client/signals/create_team_on_call_schedule_responses.go new file mode 100644 index 0000000..22f0b8b --- /dev/null +++ b/client/signals/create_team_on_call_schedule_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateTeamOnCallScheduleReader is a Reader for the CreateTeamOnCallSchedule structure. +type CreateTeamOnCallScheduleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateTeamOnCallScheduleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateTeamOnCallScheduleCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateTeamOnCallScheduleCreated creates a CreateTeamOnCallScheduleCreated with default headers values +func NewCreateTeamOnCallScheduleCreated() *CreateTeamOnCallScheduleCreated { + return &CreateTeamOnCallScheduleCreated{} +} + +/* +CreateTeamOnCallScheduleCreated describes a response with status code 201, with default header values. + +Create a Signals on-call schedule for a team. +*/ +type CreateTeamOnCallScheduleCreated struct { +} + +// IsSuccess returns true when this create team on call schedule created response has a 2xx status code +func (o *CreateTeamOnCallScheduleCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create team on call schedule created response has a 3xx status code +func (o *CreateTeamOnCallScheduleCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create team on call schedule created response has a 4xx status code +func (o *CreateTeamOnCallScheduleCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create team on call schedule created response has a 5xx status code +func (o *CreateTeamOnCallScheduleCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create team on call schedule created response a status code equal to that given +func (o *CreateTeamOnCallScheduleCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateTeamOnCallScheduleCreated) Error() string { + return fmt.Sprintf("[POST /v1/teams/{team_id}/on_call_schedules][%d] createTeamOnCallScheduleCreated ", 201) +} + +func (o *CreateTeamOnCallScheduleCreated) String() string { + return fmt.Sprintf("[POST /v1/teams/{team_id}/on_call_schedules][%d] createTeamOnCallScheduleCreated ", 201) +} + +func (o *CreateTeamOnCallScheduleCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/create_team_signal_rule_parameters.go b/client/signals/create_team_signal_rule_parameters.go new file mode 100644 index 0000000..7022d11 --- /dev/null +++ b/client/signals/create_team_signal_rule_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateTeamSignalRuleParams creates a new CreateTeamSignalRuleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateTeamSignalRuleParams() *CreateTeamSignalRuleParams { + return &CreateTeamSignalRuleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateTeamSignalRuleParamsWithTimeout creates a new CreateTeamSignalRuleParams object +// with the ability to set a timeout on a request. +func NewCreateTeamSignalRuleParamsWithTimeout(timeout time.Duration) *CreateTeamSignalRuleParams { + return &CreateTeamSignalRuleParams{ + timeout: timeout, + } +} + +// NewCreateTeamSignalRuleParamsWithContext creates a new CreateTeamSignalRuleParams object +// with the ability to set a context for a request. +func NewCreateTeamSignalRuleParamsWithContext(ctx context.Context) *CreateTeamSignalRuleParams { + return &CreateTeamSignalRuleParams{ + Context: ctx, + } +} + +// NewCreateTeamSignalRuleParamsWithHTTPClient creates a new CreateTeamSignalRuleParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateTeamSignalRuleParamsWithHTTPClient(client *http.Client) *CreateTeamSignalRuleParams { + return &CreateTeamSignalRuleParams{ + HTTPClient: client, + } +} + +/* +CreateTeamSignalRuleParams contains all the parameters to send to the API endpoint + + for the create team signal rule operation. + + Typically these are written to a http.Request. +*/ +type CreateTeamSignalRuleParams struct { + + // CreateTeamSignalRule. + CreateTeamSignalRule *models.CreateTeamSignalRule + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create team signal rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTeamSignalRuleParams) WithDefaults() *CreateTeamSignalRuleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create team signal rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTeamSignalRuleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create team signal rule params +func (o *CreateTeamSignalRuleParams) WithTimeout(timeout time.Duration) *CreateTeamSignalRuleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create team signal rule params +func (o *CreateTeamSignalRuleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create team signal rule params +func (o *CreateTeamSignalRuleParams) WithContext(ctx context.Context) *CreateTeamSignalRuleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create team signal rule params +func (o *CreateTeamSignalRuleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create team signal rule params +func (o *CreateTeamSignalRuleParams) WithHTTPClient(client *http.Client) *CreateTeamSignalRuleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create team signal rule params +func (o *CreateTeamSignalRuleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateTeamSignalRule adds the createTeamSignalRule to the create team signal rule params +func (o *CreateTeamSignalRuleParams) WithCreateTeamSignalRule(createTeamSignalRule *models.CreateTeamSignalRule) *CreateTeamSignalRuleParams { + o.SetCreateTeamSignalRule(createTeamSignalRule) + return o +} + +// SetCreateTeamSignalRule adds the createTeamSignalRule to the create team signal rule params +func (o *CreateTeamSignalRuleParams) SetCreateTeamSignalRule(createTeamSignalRule *models.CreateTeamSignalRule) { + o.CreateTeamSignalRule = createTeamSignalRule +} + +// WithTeamID adds the teamID to the create team signal rule params +func (o *CreateTeamSignalRuleParams) WithTeamID(teamID string) *CreateTeamSignalRuleParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the create team signal rule params +func (o *CreateTeamSignalRuleParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateTeamSignalRuleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateTeamSignalRule != nil { + if err := r.SetBodyParam(o.CreateTeamSignalRule); err != nil { + return err + } + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/create_team_signal_rule_responses.go b/client/signals/create_team_signal_rule_responses.go new file mode 100644 index 0000000..115c8dd --- /dev/null +++ b/client/signals/create_team_signal_rule_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateTeamSignalRuleReader is a Reader for the CreateTeamSignalRule structure. +type CreateTeamSignalRuleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateTeamSignalRuleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateTeamSignalRuleCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateTeamSignalRuleCreated creates a CreateTeamSignalRuleCreated with default headers values +func NewCreateTeamSignalRuleCreated() *CreateTeamSignalRuleCreated { + return &CreateTeamSignalRuleCreated{} +} + +/* +CreateTeamSignalRuleCreated describes a response with status code 201, with default header values. + +Create a Signals rule for a team. +*/ +type CreateTeamSignalRuleCreated struct { +} + +// IsSuccess returns true when this create team signal rule created response has a 2xx status code +func (o *CreateTeamSignalRuleCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create team signal rule created response has a 3xx status code +func (o *CreateTeamSignalRuleCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create team signal rule created response has a 4xx status code +func (o *CreateTeamSignalRuleCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create team signal rule created response has a 5xx status code +func (o *CreateTeamSignalRuleCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create team signal rule created response a status code equal to that given +func (o *CreateTeamSignalRuleCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateTeamSignalRuleCreated) Error() string { + return fmt.Sprintf("[POST /v1/teams/{team_id}/signal_rules][%d] createTeamSignalRuleCreated ", 201) +} + +func (o *CreateTeamSignalRuleCreated) String() string { + return fmt.Sprintf("[POST /v1/teams/{team_id}/signal_rules][%d] createTeamSignalRuleCreated ", 201) +} + +func (o *CreateTeamSignalRuleCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/debug_signals_expression_parameters.go b/client/signals/debug_signals_expression_parameters.go new file mode 100644 index 0000000..01bbcf0 --- /dev/null +++ b/client/signals/debug_signals_expression_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewDebugSignalsExpressionParams creates a new DebugSignalsExpressionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDebugSignalsExpressionParams() *DebugSignalsExpressionParams { + return &DebugSignalsExpressionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDebugSignalsExpressionParamsWithTimeout creates a new DebugSignalsExpressionParams object +// with the ability to set a timeout on a request. +func NewDebugSignalsExpressionParamsWithTimeout(timeout time.Duration) *DebugSignalsExpressionParams { + return &DebugSignalsExpressionParams{ + timeout: timeout, + } +} + +// NewDebugSignalsExpressionParamsWithContext creates a new DebugSignalsExpressionParams object +// with the ability to set a context for a request. +func NewDebugSignalsExpressionParamsWithContext(ctx context.Context) *DebugSignalsExpressionParams { + return &DebugSignalsExpressionParams{ + Context: ctx, + } +} + +// NewDebugSignalsExpressionParamsWithHTTPClient creates a new DebugSignalsExpressionParams object +// with the ability to set a custom HTTPClient for a request. +func NewDebugSignalsExpressionParamsWithHTTPClient(client *http.Client) *DebugSignalsExpressionParams { + return &DebugSignalsExpressionParams{ + HTTPClient: client, + } +} + +/* +DebugSignalsExpressionParams contains all the parameters to send to the API endpoint + + for the debug signals expression operation. + + Typically these are written to a http.Request. +*/ +type DebugSignalsExpressionParams struct { + + // DebugSignalsExpression. + DebugSignalsExpression *models.DebugSignalsExpression + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the debug signals expression params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DebugSignalsExpressionParams) WithDefaults() *DebugSignalsExpressionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the debug signals expression params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DebugSignalsExpressionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the debug signals expression params +func (o *DebugSignalsExpressionParams) WithTimeout(timeout time.Duration) *DebugSignalsExpressionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the debug signals expression params +func (o *DebugSignalsExpressionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the debug signals expression params +func (o *DebugSignalsExpressionParams) WithContext(ctx context.Context) *DebugSignalsExpressionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the debug signals expression params +func (o *DebugSignalsExpressionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the debug signals expression params +func (o *DebugSignalsExpressionParams) WithHTTPClient(client *http.Client) *DebugSignalsExpressionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the debug signals expression params +func (o *DebugSignalsExpressionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDebugSignalsExpression adds the debugSignalsExpression to the debug signals expression params +func (o *DebugSignalsExpressionParams) WithDebugSignalsExpression(debugSignalsExpression *models.DebugSignalsExpression) *DebugSignalsExpressionParams { + o.SetDebugSignalsExpression(debugSignalsExpression) + return o +} + +// SetDebugSignalsExpression adds the debugSignalsExpression to the debug signals expression params +func (o *DebugSignalsExpressionParams) SetDebugSignalsExpression(debugSignalsExpression *models.DebugSignalsExpression) { + o.DebugSignalsExpression = debugSignalsExpression +} + +// WriteToRequest writes these params to a swagger request +func (o *DebugSignalsExpressionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.DebugSignalsExpression != nil { + if err := r.SetBodyParam(o.DebugSignalsExpression); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/debug_signals_expression_responses.go b/client/signals/debug_signals_expression_responses.go new file mode 100644 index 0000000..88c2d13 --- /dev/null +++ b/client/signals/debug_signals_expression_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DebugSignalsExpressionReader is a Reader for the DebugSignalsExpression structure. +type DebugSignalsExpressionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DebugSignalsExpressionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewDebugSignalsExpressionCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDebugSignalsExpressionCreated creates a DebugSignalsExpressionCreated with default headers values +func NewDebugSignalsExpressionCreated() *DebugSignalsExpressionCreated { + return &DebugSignalsExpressionCreated{} +} + +/* +DebugSignalsExpressionCreated describes a response with status code 201, with default header values. + +Debug Signals expressions +*/ +type DebugSignalsExpressionCreated struct { +} + +// IsSuccess returns true when this debug signals expression created response has a 2xx status code +func (o *DebugSignalsExpressionCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this debug signals expression created response has a 3xx status code +func (o *DebugSignalsExpressionCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this debug signals expression created response has a 4xx status code +func (o *DebugSignalsExpressionCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this debug signals expression created response has a 5xx status code +func (o *DebugSignalsExpressionCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this debug signals expression created response a status code equal to that given +func (o *DebugSignalsExpressionCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *DebugSignalsExpressionCreated) Error() string { + return fmt.Sprintf("[POST /v1/signals/debugger][%d] debugSignalsExpressionCreated ", 201) +} + +func (o *DebugSignalsExpressionCreated) String() string { + return fmt.Sprintf("[POST /v1/signals/debugger][%d] debugSignalsExpressionCreated ", 201) +} + +func (o *DebugSignalsExpressionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/delete_on_call_shift_parameters.go b/client/signals/delete_on_call_shift_parameters.go new file mode 100644 index 0000000..8340a32 --- /dev/null +++ b/client/signals/delete_on_call_shift_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteOnCallShiftParams creates a new DeleteOnCallShiftParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteOnCallShiftParams() *DeleteOnCallShiftParams { + return &DeleteOnCallShiftParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteOnCallShiftParamsWithTimeout creates a new DeleteOnCallShiftParams object +// with the ability to set a timeout on a request. +func NewDeleteOnCallShiftParamsWithTimeout(timeout time.Duration) *DeleteOnCallShiftParams { + return &DeleteOnCallShiftParams{ + timeout: timeout, + } +} + +// NewDeleteOnCallShiftParamsWithContext creates a new DeleteOnCallShiftParams object +// with the ability to set a context for a request. +func NewDeleteOnCallShiftParamsWithContext(ctx context.Context) *DeleteOnCallShiftParams { + return &DeleteOnCallShiftParams{ + Context: ctx, + } +} + +// NewDeleteOnCallShiftParamsWithHTTPClient creates a new DeleteOnCallShiftParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteOnCallShiftParamsWithHTTPClient(client *http.Client) *DeleteOnCallShiftParams { + return &DeleteOnCallShiftParams{ + HTTPClient: client, + } +} + +/* +DeleteOnCallShiftParams contains all the parameters to send to the API endpoint + + for the delete on call shift operation. + + Typically these are written to a http.Request. +*/ +type DeleteOnCallShiftParams struct { + + // ID. + ID string + + // ScheduleID. + ScheduleID string + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete on call shift params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteOnCallShiftParams) WithDefaults() *DeleteOnCallShiftParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete on call shift params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteOnCallShiftParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete on call shift params +func (o *DeleteOnCallShiftParams) WithTimeout(timeout time.Duration) *DeleteOnCallShiftParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete on call shift params +func (o *DeleteOnCallShiftParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete on call shift params +func (o *DeleteOnCallShiftParams) WithContext(ctx context.Context) *DeleteOnCallShiftParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete on call shift params +func (o *DeleteOnCallShiftParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete on call shift params +func (o *DeleteOnCallShiftParams) WithHTTPClient(client *http.Client) *DeleteOnCallShiftParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete on call shift params +func (o *DeleteOnCallShiftParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete on call shift params +func (o *DeleteOnCallShiftParams) WithID(id string) *DeleteOnCallShiftParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete on call shift params +func (o *DeleteOnCallShiftParams) SetID(id string) { + o.ID = id +} + +// WithScheduleID adds the scheduleID to the delete on call shift params +func (o *DeleteOnCallShiftParams) WithScheduleID(scheduleID string) *DeleteOnCallShiftParams { + o.SetScheduleID(scheduleID) + return o +} + +// SetScheduleID adds the scheduleId to the delete on call shift params +func (o *DeleteOnCallShiftParams) SetScheduleID(scheduleID string) { + o.ScheduleID = scheduleID +} + +// WithTeamID adds the teamID to the delete on call shift params +func (o *DeleteOnCallShiftParams) WithTeamID(teamID string) *DeleteOnCallShiftParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the delete on call shift params +func (o *DeleteOnCallShiftParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteOnCallShiftParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + // path param schedule_id + if err := r.SetPathParam("schedule_id", o.ScheduleID); err != nil { + return err + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/delete_on_call_shift_responses.go b/client/signals/delete_on_call_shift_responses.go new file mode 100644 index 0000000..9404269 --- /dev/null +++ b/client/signals/delete_on_call_shift_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteOnCallShiftReader is a Reader for the DeleteOnCallShift structure. +type DeleteOnCallShiftReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteOnCallShiftReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteOnCallShiftNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteOnCallShiftNoContent creates a DeleteOnCallShiftNoContent with default headers values +func NewDeleteOnCallShiftNoContent() *DeleteOnCallShiftNoContent { + return &DeleteOnCallShiftNoContent{} +} + +/* +DeleteOnCallShiftNoContent describes a response with status code 204, with default header values. + +Delete a Signals on-call shift by ID +*/ +type DeleteOnCallShiftNoContent struct { +} + +// IsSuccess returns true when this delete on call shift no content response has a 2xx status code +func (o *DeleteOnCallShiftNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete on call shift no content response has a 3xx status code +func (o *DeleteOnCallShiftNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete on call shift no content response has a 4xx status code +func (o *DeleteOnCallShiftNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete on call shift no content response has a 5xx status code +func (o *DeleteOnCallShiftNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete on call shift no content response a status code equal to that given +func (o *DeleteOnCallShiftNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteOnCallShiftNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts/{id}][%d] deleteOnCallShiftNoContent ", 204) +} + +func (o *DeleteOnCallShiftNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts/{id}][%d] deleteOnCallShiftNoContent ", 204) +} + +func (o *DeleteOnCallShiftNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/delete_signals_email_target_parameters.go b/client/signals/delete_signals_email_target_parameters.go new file mode 100644 index 0000000..14ee55a --- /dev/null +++ b/client/signals/delete_signals_email_target_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteSignalsEmailTargetParams creates a new DeleteSignalsEmailTargetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteSignalsEmailTargetParams() *DeleteSignalsEmailTargetParams { + return &DeleteSignalsEmailTargetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSignalsEmailTargetParamsWithTimeout creates a new DeleteSignalsEmailTargetParams object +// with the ability to set a timeout on a request. +func NewDeleteSignalsEmailTargetParamsWithTimeout(timeout time.Duration) *DeleteSignalsEmailTargetParams { + return &DeleteSignalsEmailTargetParams{ + timeout: timeout, + } +} + +// NewDeleteSignalsEmailTargetParamsWithContext creates a new DeleteSignalsEmailTargetParams object +// with the ability to set a context for a request. +func NewDeleteSignalsEmailTargetParamsWithContext(ctx context.Context) *DeleteSignalsEmailTargetParams { + return &DeleteSignalsEmailTargetParams{ + Context: ctx, + } +} + +// NewDeleteSignalsEmailTargetParamsWithHTTPClient creates a new DeleteSignalsEmailTargetParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteSignalsEmailTargetParamsWithHTTPClient(client *http.Client) *DeleteSignalsEmailTargetParams { + return &DeleteSignalsEmailTargetParams{ + HTTPClient: client, + } +} + +/* +DeleteSignalsEmailTargetParams contains all the parameters to send to the API endpoint + + for the delete signals email target operation. + + Typically these are written to a http.Request. +*/ +type DeleteSignalsEmailTargetParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete signals email target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSignalsEmailTargetParams) WithDefaults() *DeleteSignalsEmailTargetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete signals email target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSignalsEmailTargetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete signals email target params +func (o *DeleteSignalsEmailTargetParams) WithTimeout(timeout time.Duration) *DeleteSignalsEmailTargetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete signals email target params +func (o *DeleteSignalsEmailTargetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete signals email target params +func (o *DeleteSignalsEmailTargetParams) WithContext(ctx context.Context) *DeleteSignalsEmailTargetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete signals email target params +func (o *DeleteSignalsEmailTargetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete signals email target params +func (o *DeleteSignalsEmailTargetParams) WithHTTPClient(client *http.Client) *DeleteSignalsEmailTargetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete signals email target params +func (o *DeleteSignalsEmailTargetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete signals email target params +func (o *DeleteSignalsEmailTargetParams) WithID(id string) *DeleteSignalsEmailTargetParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete signals email target params +func (o *DeleteSignalsEmailTargetParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSignalsEmailTargetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/delete_signals_email_target_responses.go b/client/signals/delete_signals_email_target_responses.go new file mode 100644 index 0000000..bc0944e --- /dev/null +++ b/client/signals/delete_signals_email_target_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteSignalsEmailTargetReader is a Reader for the DeleteSignalsEmailTarget structure. +type DeleteSignalsEmailTargetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSignalsEmailTargetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteSignalsEmailTargetNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteSignalsEmailTargetNoContent creates a DeleteSignalsEmailTargetNoContent with default headers values +func NewDeleteSignalsEmailTargetNoContent() *DeleteSignalsEmailTargetNoContent { + return &DeleteSignalsEmailTargetNoContent{} +} + +/* +DeleteSignalsEmailTargetNoContent describes a response with status code 204, with default header values. + +Delete a Signals email target by ID +*/ +type DeleteSignalsEmailTargetNoContent struct { +} + +// IsSuccess returns true when this delete signals email target no content response has a 2xx status code +func (o *DeleteSignalsEmailTargetNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete signals email target no content response has a 3xx status code +func (o *DeleteSignalsEmailTargetNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete signals email target no content response has a 4xx status code +func (o *DeleteSignalsEmailTargetNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete signals email target no content response has a 5xx status code +func (o *DeleteSignalsEmailTargetNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete signals email target no content response a status code equal to that given +func (o *DeleteSignalsEmailTargetNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteSignalsEmailTargetNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/signals/email_targets/{id}][%d] deleteSignalsEmailTargetNoContent ", 204) +} + +func (o *DeleteSignalsEmailTargetNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/signals/email_targets/{id}][%d] deleteSignalsEmailTargetNoContent ", 204) +} + +func (o *DeleteSignalsEmailTargetNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/delete_signals_webhook_target_parameters.go b/client/signals/delete_signals_webhook_target_parameters.go new file mode 100644 index 0000000..331705a --- /dev/null +++ b/client/signals/delete_signals_webhook_target_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteSignalsWebhookTargetParams creates a new DeleteSignalsWebhookTargetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteSignalsWebhookTargetParams() *DeleteSignalsWebhookTargetParams { + return &DeleteSignalsWebhookTargetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSignalsWebhookTargetParamsWithTimeout creates a new DeleteSignalsWebhookTargetParams object +// with the ability to set a timeout on a request. +func NewDeleteSignalsWebhookTargetParamsWithTimeout(timeout time.Duration) *DeleteSignalsWebhookTargetParams { + return &DeleteSignalsWebhookTargetParams{ + timeout: timeout, + } +} + +// NewDeleteSignalsWebhookTargetParamsWithContext creates a new DeleteSignalsWebhookTargetParams object +// with the ability to set a context for a request. +func NewDeleteSignalsWebhookTargetParamsWithContext(ctx context.Context) *DeleteSignalsWebhookTargetParams { + return &DeleteSignalsWebhookTargetParams{ + Context: ctx, + } +} + +// NewDeleteSignalsWebhookTargetParamsWithHTTPClient creates a new DeleteSignalsWebhookTargetParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteSignalsWebhookTargetParamsWithHTTPClient(client *http.Client) *DeleteSignalsWebhookTargetParams { + return &DeleteSignalsWebhookTargetParams{ + HTTPClient: client, + } +} + +/* +DeleteSignalsWebhookTargetParams contains all the parameters to send to the API endpoint + + for the delete signals webhook target operation. + + Typically these are written to a http.Request. +*/ +type DeleteSignalsWebhookTargetParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete signals webhook target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSignalsWebhookTargetParams) WithDefaults() *DeleteSignalsWebhookTargetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete signals webhook target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSignalsWebhookTargetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete signals webhook target params +func (o *DeleteSignalsWebhookTargetParams) WithTimeout(timeout time.Duration) *DeleteSignalsWebhookTargetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete signals webhook target params +func (o *DeleteSignalsWebhookTargetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete signals webhook target params +func (o *DeleteSignalsWebhookTargetParams) WithContext(ctx context.Context) *DeleteSignalsWebhookTargetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete signals webhook target params +func (o *DeleteSignalsWebhookTargetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete signals webhook target params +func (o *DeleteSignalsWebhookTargetParams) WithHTTPClient(client *http.Client) *DeleteSignalsWebhookTargetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete signals webhook target params +func (o *DeleteSignalsWebhookTargetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete signals webhook target params +func (o *DeleteSignalsWebhookTargetParams) WithID(id string) *DeleteSignalsWebhookTargetParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete signals webhook target params +func (o *DeleteSignalsWebhookTargetParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSignalsWebhookTargetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/delete_signals_webhook_target_responses.go b/client/signals/delete_signals_webhook_target_responses.go new file mode 100644 index 0000000..122841d --- /dev/null +++ b/client/signals/delete_signals_webhook_target_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteSignalsWebhookTargetReader is a Reader for the DeleteSignalsWebhookTarget structure. +type DeleteSignalsWebhookTargetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSignalsWebhookTargetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteSignalsWebhookTargetNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteSignalsWebhookTargetNoContent creates a DeleteSignalsWebhookTargetNoContent with default headers values +func NewDeleteSignalsWebhookTargetNoContent() *DeleteSignalsWebhookTargetNoContent { + return &DeleteSignalsWebhookTargetNoContent{} +} + +/* +DeleteSignalsWebhookTargetNoContent describes a response with status code 204, with default header values. + +Delete a Signals webhook target by ID +*/ +type DeleteSignalsWebhookTargetNoContent struct { +} + +// IsSuccess returns true when this delete signals webhook target no content response has a 2xx status code +func (o *DeleteSignalsWebhookTargetNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete signals webhook target no content response has a 3xx status code +func (o *DeleteSignalsWebhookTargetNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete signals webhook target no content response has a 4xx status code +func (o *DeleteSignalsWebhookTargetNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete signals webhook target no content response has a 5xx status code +func (o *DeleteSignalsWebhookTargetNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete signals webhook target no content response a status code equal to that given +func (o *DeleteSignalsWebhookTargetNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteSignalsWebhookTargetNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/signals/webhook_targets/{id}][%d] deleteSignalsWebhookTargetNoContent ", 204) +} + +func (o *DeleteSignalsWebhookTargetNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/signals/webhook_targets/{id}][%d] deleteSignalsWebhookTargetNoContent ", 204) +} + +func (o *DeleteSignalsWebhookTargetNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/delete_team_escalation_policy_parameters.go b/client/signals/delete_team_escalation_policy_parameters.go new file mode 100644 index 0000000..d5e1f46 --- /dev/null +++ b/client/signals/delete_team_escalation_policy_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTeamEscalationPolicyParams creates a new DeleteTeamEscalationPolicyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTeamEscalationPolicyParams() *DeleteTeamEscalationPolicyParams { + return &DeleteTeamEscalationPolicyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTeamEscalationPolicyParamsWithTimeout creates a new DeleteTeamEscalationPolicyParams object +// with the ability to set a timeout on a request. +func NewDeleteTeamEscalationPolicyParamsWithTimeout(timeout time.Duration) *DeleteTeamEscalationPolicyParams { + return &DeleteTeamEscalationPolicyParams{ + timeout: timeout, + } +} + +// NewDeleteTeamEscalationPolicyParamsWithContext creates a new DeleteTeamEscalationPolicyParams object +// with the ability to set a context for a request. +func NewDeleteTeamEscalationPolicyParamsWithContext(ctx context.Context) *DeleteTeamEscalationPolicyParams { + return &DeleteTeamEscalationPolicyParams{ + Context: ctx, + } +} + +// NewDeleteTeamEscalationPolicyParamsWithHTTPClient creates a new DeleteTeamEscalationPolicyParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTeamEscalationPolicyParamsWithHTTPClient(client *http.Client) *DeleteTeamEscalationPolicyParams { + return &DeleteTeamEscalationPolicyParams{ + HTTPClient: client, + } +} + +/* +DeleteTeamEscalationPolicyParams contains all the parameters to send to the API endpoint + + for the delete team escalation policy operation. + + Typically these are written to a http.Request. +*/ +type DeleteTeamEscalationPolicyParams struct { + + // ID. + ID string + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete team escalation policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTeamEscalationPolicyParams) WithDefaults() *DeleteTeamEscalationPolicyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete team escalation policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTeamEscalationPolicyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete team escalation policy params +func (o *DeleteTeamEscalationPolicyParams) WithTimeout(timeout time.Duration) *DeleteTeamEscalationPolicyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete team escalation policy params +func (o *DeleteTeamEscalationPolicyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete team escalation policy params +func (o *DeleteTeamEscalationPolicyParams) WithContext(ctx context.Context) *DeleteTeamEscalationPolicyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete team escalation policy params +func (o *DeleteTeamEscalationPolicyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete team escalation policy params +func (o *DeleteTeamEscalationPolicyParams) WithHTTPClient(client *http.Client) *DeleteTeamEscalationPolicyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete team escalation policy params +func (o *DeleteTeamEscalationPolicyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete team escalation policy params +func (o *DeleteTeamEscalationPolicyParams) WithID(id string) *DeleteTeamEscalationPolicyParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete team escalation policy params +func (o *DeleteTeamEscalationPolicyParams) SetID(id string) { + o.ID = id +} + +// WithTeamID adds the teamID to the delete team escalation policy params +func (o *DeleteTeamEscalationPolicyParams) WithTeamID(teamID string) *DeleteTeamEscalationPolicyParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the delete team escalation policy params +func (o *DeleteTeamEscalationPolicyParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTeamEscalationPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/delete_team_escalation_policy_responses.go b/client/signals/delete_team_escalation_policy_responses.go new file mode 100644 index 0000000..4758018 --- /dev/null +++ b/client/signals/delete_team_escalation_policy_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteTeamEscalationPolicyReader is a Reader for the DeleteTeamEscalationPolicy structure. +type DeleteTeamEscalationPolicyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTeamEscalationPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteTeamEscalationPolicyNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTeamEscalationPolicyNoContent creates a DeleteTeamEscalationPolicyNoContent with default headers values +func NewDeleteTeamEscalationPolicyNoContent() *DeleteTeamEscalationPolicyNoContent { + return &DeleteTeamEscalationPolicyNoContent{} +} + +/* +DeleteTeamEscalationPolicyNoContent describes a response with status code 204, with default header values. + +Delete a Signals escalation policy by ID +*/ +type DeleteTeamEscalationPolicyNoContent struct { +} + +// IsSuccess returns true when this delete team escalation policy no content response has a 2xx status code +func (o *DeleteTeamEscalationPolicyNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete team escalation policy no content response has a 3xx status code +func (o *DeleteTeamEscalationPolicyNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete team escalation policy no content response has a 4xx status code +func (o *DeleteTeamEscalationPolicyNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete team escalation policy no content response has a 5xx status code +func (o *DeleteTeamEscalationPolicyNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete team escalation policy no content response a status code equal to that given +func (o *DeleteTeamEscalationPolicyNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteTeamEscalationPolicyNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/teams/{team_id}/escalation_policies/{id}][%d] deleteTeamEscalationPolicyNoContent ", 204) +} + +func (o *DeleteTeamEscalationPolicyNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/teams/{team_id}/escalation_policies/{id}][%d] deleteTeamEscalationPolicyNoContent ", 204) +} + +func (o *DeleteTeamEscalationPolicyNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/delete_team_on_call_schedule_parameters.go b/client/signals/delete_team_on_call_schedule_parameters.go new file mode 100644 index 0000000..3b45cdb --- /dev/null +++ b/client/signals/delete_team_on_call_schedule_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTeamOnCallScheduleParams creates a new DeleteTeamOnCallScheduleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTeamOnCallScheduleParams() *DeleteTeamOnCallScheduleParams { + return &DeleteTeamOnCallScheduleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTeamOnCallScheduleParamsWithTimeout creates a new DeleteTeamOnCallScheduleParams object +// with the ability to set a timeout on a request. +func NewDeleteTeamOnCallScheduleParamsWithTimeout(timeout time.Duration) *DeleteTeamOnCallScheduleParams { + return &DeleteTeamOnCallScheduleParams{ + timeout: timeout, + } +} + +// NewDeleteTeamOnCallScheduleParamsWithContext creates a new DeleteTeamOnCallScheduleParams object +// with the ability to set a context for a request. +func NewDeleteTeamOnCallScheduleParamsWithContext(ctx context.Context) *DeleteTeamOnCallScheduleParams { + return &DeleteTeamOnCallScheduleParams{ + Context: ctx, + } +} + +// NewDeleteTeamOnCallScheduleParamsWithHTTPClient creates a new DeleteTeamOnCallScheduleParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTeamOnCallScheduleParamsWithHTTPClient(client *http.Client) *DeleteTeamOnCallScheduleParams { + return &DeleteTeamOnCallScheduleParams{ + HTTPClient: client, + } +} + +/* +DeleteTeamOnCallScheduleParams contains all the parameters to send to the API endpoint + + for the delete team on call schedule operation. + + Typically these are written to a http.Request. +*/ +type DeleteTeamOnCallScheduleParams struct { + + // ScheduleID. + ScheduleID string + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete team on call schedule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTeamOnCallScheduleParams) WithDefaults() *DeleteTeamOnCallScheduleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete team on call schedule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTeamOnCallScheduleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete team on call schedule params +func (o *DeleteTeamOnCallScheduleParams) WithTimeout(timeout time.Duration) *DeleteTeamOnCallScheduleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete team on call schedule params +func (o *DeleteTeamOnCallScheduleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete team on call schedule params +func (o *DeleteTeamOnCallScheduleParams) WithContext(ctx context.Context) *DeleteTeamOnCallScheduleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete team on call schedule params +func (o *DeleteTeamOnCallScheduleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete team on call schedule params +func (o *DeleteTeamOnCallScheduleParams) WithHTTPClient(client *http.Client) *DeleteTeamOnCallScheduleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete team on call schedule params +func (o *DeleteTeamOnCallScheduleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithScheduleID adds the scheduleID to the delete team on call schedule params +func (o *DeleteTeamOnCallScheduleParams) WithScheduleID(scheduleID string) *DeleteTeamOnCallScheduleParams { + o.SetScheduleID(scheduleID) + return o +} + +// SetScheduleID adds the scheduleId to the delete team on call schedule params +func (o *DeleteTeamOnCallScheduleParams) SetScheduleID(scheduleID string) { + o.ScheduleID = scheduleID +} + +// WithTeamID adds the teamID to the delete team on call schedule params +func (o *DeleteTeamOnCallScheduleParams) WithTeamID(teamID string) *DeleteTeamOnCallScheduleParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the delete team on call schedule params +func (o *DeleteTeamOnCallScheduleParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTeamOnCallScheduleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param schedule_id + if err := r.SetPathParam("schedule_id", o.ScheduleID); err != nil { + return err + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/delete_team_on_call_schedule_responses.go b/client/signals/delete_team_on_call_schedule_responses.go new file mode 100644 index 0000000..4572005 --- /dev/null +++ b/client/signals/delete_team_on_call_schedule_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteTeamOnCallScheduleReader is a Reader for the DeleteTeamOnCallSchedule structure. +type DeleteTeamOnCallScheduleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTeamOnCallScheduleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteTeamOnCallScheduleNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTeamOnCallScheduleNoContent creates a DeleteTeamOnCallScheduleNoContent with default headers values +func NewDeleteTeamOnCallScheduleNoContent() *DeleteTeamOnCallScheduleNoContent { + return &DeleteTeamOnCallScheduleNoContent{} +} + +/* +DeleteTeamOnCallScheduleNoContent describes a response with status code 204, with default header values. + +Delete a Signals on-call schedule by ID +*/ +type DeleteTeamOnCallScheduleNoContent struct { +} + +// IsSuccess returns true when this delete team on call schedule no content response has a 2xx status code +func (o *DeleteTeamOnCallScheduleNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete team on call schedule no content response has a 3xx status code +func (o *DeleteTeamOnCallScheduleNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete team on call schedule no content response has a 4xx status code +func (o *DeleteTeamOnCallScheduleNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete team on call schedule no content response has a 5xx status code +func (o *DeleteTeamOnCallScheduleNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete team on call schedule no content response a status code equal to that given +func (o *DeleteTeamOnCallScheduleNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteTeamOnCallScheduleNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/teams/{team_id}/on_call_schedules/{schedule_id}][%d] deleteTeamOnCallScheduleNoContent ", 204) +} + +func (o *DeleteTeamOnCallScheduleNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/teams/{team_id}/on_call_schedules/{schedule_id}][%d] deleteTeamOnCallScheduleNoContent ", 204) +} + +func (o *DeleteTeamOnCallScheduleNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/delete_team_signal_rule_parameters.go b/client/signals/delete_team_signal_rule_parameters.go new file mode 100644 index 0000000..f345e4b --- /dev/null +++ b/client/signals/delete_team_signal_rule_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTeamSignalRuleParams creates a new DeleteTeamSignalRuleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTeamSignalRuleParams() *DeleteTeamSignalRuleParams { + return &DeleteTeamSignalRuleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTeamSignalRuleParamsWithTimeout creates a new DeleteTeamSignalRuleParams object +// with the ability to set a timeout on a request. +func NewDeleteTeamSignalRuleParamsWithTimeout(timeout time.Duration) *DeleteTeamSignalRuleParams { + return &DeleteTeamSignalRuleParams{ + timeout: timeout, + } +} + +// NewDeleteTeamSignalRuleParamsWithContext creates a new DeleteTeamSignalRuleParams object +// with the ability to set a context for a request. +func NewDeleteTeamSignalRuleParamsWithContext(ctx context.Context) *DeleteTeamSignalRuleParams { + return &DeleteTeamSignalRuleParams{ + Context: ctx, + } +} + +// NewDeleteTeamSignalRuleParamsWithHTTPClient creates a new DeleteTeamSignalRuleParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTeamSignalRuleParamsWithHTTPClient(client *http.Client) *DeleteTeamSignalRuleParams { + return &DeleteTeamSignalRuleParams{ + HTTPClient: client, + } +} + +/* +DeleteTeamSignalRuleParams contains all the parameters to send to the API endpoint + + for the delete team signal rule operation. + + Typically these are written to a http.Request. +*/ +type DeleteTeamSignalRuleParams struct { + + // ID. + ID string + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete team signal rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTeamSignalRuleParams) WithDefaults() *DeleteTeamSignalRuleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete team signal rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTeamSignalRuleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete team signal rule params +func (o *DeleteTeamSignalRuleParams) WithTimeout(timeout time.Duration) *DeleteTeamSignalRuleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete team signal rule params +func (o *DeleteTeamSignalRuleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete team signal rule params +func (o *DeleteTeamSignalRuleParams) WithContext(ctx context.Context) *DeleteTeamSignalRuleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete team signal rule params +func (o *DeleteTeamSignalRuleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete team signal rule params +func (o *DeleteTeamSignalRuleParams) WithHTTPClient(client *http.Client) *DeleteTeamSignalRuleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete team signal rule params +func (o *DeleteTeamSignalRuleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete team signal rule params +func (o *DeleteTeamSignalRuleParams) WithID(id string) *DeleteTeamSignalRuleParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete team signal rule params +func (o *DeleteTeamSignalRuleParams) SetID(id string) { + o.ID = id +} + +// WithTeamID adds the teamID to the delete team signal rule params +func (o *DeleteTeamSignalRuleParams) WithTeamID(teamID string) *DeleteTeamSignalRuleParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the delete team signal rule params +func (o *DeleteTeamSignalRuleParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTeamSignalRuleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/delete_team_signal_rule_responses.go b/client/signals/delete_team_signal_rule_responses.go new file mode 100644 index 0000000..07d4a44 --- /dev/null +++ b/client/signals/delete_team_signal_rule_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteTeamSignalRuleReader is a Reader for the DeleteTeamSignalRule structure. +type DeleteTeamSignalRuleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTeamSignalRuleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteTeamSignalRuleNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTeamSignalRuleNoContent creates a DeleteTeamSignalRuleNoContent with default headers values +func NewDeleteTeamSignalRuleNoContent() *DeleteTeamSignalRuleNoContent { + return &DeleteTeamSignalRuleNoContent{} +} + +/* +DeleteTeamSignalRuleNoContent describes a response with status code 204, with default header values. + +Delete a Signals rule by ID +*/ +type DeleteTeamSignalRuleNoContent struct { +} + +// IsSuccess returns true when this delete team signal rule no content response has a 2xx status code +func (o *DeleteTeamSignalRuleNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete team signal rule no content response has a 3xx status code +func (o *DeleteTeamSignalRuleNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete team signal rule no content response has a 4xx status code +func (o *DeleteTeamSignalRuleNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete team signal rule no content response has a 5xx status code +func (o *DeleteTeamSignalRuleNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete team signal rule no content response a status code equal to that given +func (o *DeleteTeamSignalRuleNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteTeamSignalRuleNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/teams/{team_id}/signal_rules/{id}][%d] deleteTeamSignalRuleNoContent ", 204) +} + +func (o *DeleteTeamSignalRuleNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/teams/{team_id}/signal_rules/{id}][%d] deleteTeamSignalRuleNoContent ", 204) +} + +func (o *DeleteTeamSignalRuleNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/get_on_call_shift_parameters.go b/client/signals/get_on_call_shift_parameters.go new file mode 100644 index 0000000..b599901 --- /dev/null +++ b/client/signals/get_on_call_shift_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetOnCallShiftParams creates a new GetOnCallShiftParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetOnCallShiftParams() *GetOnCallShiftParams { + return &GetOnCallShiftParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetOnCallShiftParamsWithTimeout creates a new GetOnCallShiftParams object +// with the ability to set a timeout on a request. +func NewGetOnCallShiftParamsWithTimeout(timeout time.Duration) *GetOnCallShiftParams { + return &GetOnCallShiftParams{ + timeout: timeout, + } +} + +// NewGetOnCallShiftParamsWithContext creates a new GetOnCallShiftParams object +// with the ability to set a context for a request. +func NewGetOnCallShiftParamsWithContext(ctx context.Context) *GetOnCallShiftParams { + return &GetOnCallShiftParams{ + Context: ctx, + } +} + +// NewGetOnCallShiftParamsWithHTTPClient creates a new GetOnCallShiftParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetOnCallShiftParamsWithHTTPClient(client *http.Client) *GetOnCallShiftParams { + return &GetOnCallShiftParams{ + HTTPClient: client, + } +} + +/* +GetOnCallShiftParams contains all the parameters to send to the API endpoint + + for the get on call shift operation. + + Typically these are written to a http.Request. +*/ +type GetOnCallShiftParams struct { + + // ID. + ID string + + // ScheduleID. + ScheduleID string + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get on call shift params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOnCallShiftParams) WithDefaults() *GetOnCallShiftParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get on call shift params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOnCallShiftParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get on call shift params +func (o *GetOnCallShiftParams) WithTimeout(timeout time.Duration) *GetOnCallShiftParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get on call shift params +func (o *GetOnCallShiftParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get on call shift params +func (o *GetOnCallShiftParams) WithContext(ctx context.Context) *GetOnCallShiftParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get on call shift params +func (o *GetOnCallShiftParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get on call shift params +func (o *GetOnCallShiftParams) WithHTTPClient(client *http.Client) *GetOnCallShiftParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get on call shift params +func (o *GetOnCallShiftParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get on call shift params +func (o *GetOnCallShiftParams) WithID(id string) *GetOnCallShiftParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get on call shift params +func (o *GetOnCallShiftParams) SetID(id string) { + o.ID = id +} + +// WithScheduleID adds the scheduleID to the get on call shift params +func (o *GetOnCallShiftParams) WithScheduleID(scheduleID string) *GetOnCallShiftParams { + o.SetScheduleID(scheduleID) + return o +} + +// SetScheduleID adds the scheduleId to the get on call shift params +func (o *GetOnCallShiftParams) SetScheduleID(scheduleID string) { + o.ScheduleID = scheduleID +} + +// WithTeamID adds the teamID to the get on call shift params +func (o *GetOnCallShiftParams) WithTeamID(teamID string) *GetOnCallShiftParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the get on call shift params +func (o *GetOnCallShiftParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetOnCallShiftParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + // path param schedule_id + if err := r.SetPathParam("schedule_id", o.ScheduleID); err != nil { + return err + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/get_on_call_shift_responses.go b/client/signals/get_on_call_shift_responses.go new file mode 100644 index 0000000..0a91651 --- /dev/null +++ b/client/signals/get_on_call_shift_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetOnCallShiftReader is a Reader for the GetOnCallShift structure. +type GetOnCallShiftReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetOnCallShiftReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetOnCallShiftOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetOnCallShiftOK creates a GetOnCallShiftOK with default headers values +func NewGetOnCallShiftOK() *GetOnCallShiftOK { + return &GetOnCallShiftOK{} +} + +/* +GetOnCallShiftOK describes a response with status code 200, with default header values. + +Get a Signals on-call shift by ID +*/ +type GetOnCallShiftOK struct { +} + +// IsSuccess returns true when this get on call shift o k response has a 2xx status code +func (o *GetOnCallShiftOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get on call shift o k response has a 3xx status code +func (o *GetOnCallShiftOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get on call shift o k response has a 4xx status code +func (o *GetOnCallShiftOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get on call shift o k response has a 5xx status code +func (o *GetOnCallShiftOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get on call shift o k response a status code equal to that given +func (o *GetOnCallShiftOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetOnCallShiftOK) Error() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts/{id}][%d] getOnCallShiftOK ", 200) +} + +func (o *GetOnCallShiftOK) String() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts/{id}][%d] getOnCallShiftOK ", 200) +} + +func (o *GetOnCallShiftOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/get_signals_email_target_parameters.go b/client/signals/get_signals_email_target_parameters.go new file mode 100644 index 0000000..b6a5060 --- /dev/null +++ b/client/signals/get_signals_email_target_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSignalsEmailTargetParams creates a new GetSignalsEmailTargetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSignalsEmailTargetParams() *GetSignalsEmailTargetParams { + return &GetSignalsEmailTargetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSignalsEmailTargetParamsWithTimeout creates a new GetSignalsEmailTargetParams object +// with the ability to set a timeout on a request. +func NewGetSignalsEmailTargetParamsWithTimeout(timeout time.Duration) *GetSignalsEmailTargetParams { + return &GetSignalsEmailTargetParams{ + timeout: timeout, + } +} + +// NewGetSignalsEmailTargetParamsWithContext creates a new GetSignalsEmailTargetParams object +// with the ability to set a context for a request. +func NewGetSignalsEmailTargetParamsWithContext(ctx context.Context) *GetSignalsEmailTargetParams { + return &GetSignalsEmailTargetParams{ + Context: ctx, + } +} + +// NewGetSignalsEmailTargetParamsWithHTTPClient creates a new GetSignalsEmailTargetParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSignalsEmailTargetParamsWithHTTPClient(client *http.Client) *GetSignalsEmailTargetParams { + return &GetSignalsEmailTargetParams{ + HTTPClient: client, + } +} + +/* +GetSignalsEmailTargetParams contains all the parameters to send to the API endpoint + + for the get signals email target operation. + + Typically these are written to a http.Request. +*/ +type GetSignalsEmailTargetParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get signals email target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSignalsEmailTargetParams) WithDefaults() *GetSignalsEmailTargetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get signals email target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSignalsEmailTargetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get signals email target params +func (o *GetSignalsEmailTargetParams) WithTimeout(timeout time.Duration) *GetSignalsEmailTargetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get signals email target params +func (o *GetSignalsEmailTargetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get signals email target params +func (o *GetSignalsEmailTargetParams) WithContext(ctx context.Context) *GetSignalsEmailTargetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get signals email target params +func (o *GetSignalsEmailTargetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get signals email target params +func (o *GetSignalsEmailTargetParams) WithHTTPClient(client *http.Client) *GetSignalsEmailTargetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get signals email target params +func (o *GetSignalsEmailTargetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get signals email target params +func (o *GetSignalsEmailTargetParams) WithID(id string) *GetSignalsEmailTargetParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get signals email target params +func (o *GetSignalsEmailTargetParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSignalsEmailTargetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/get_signals_email_target_responses.go b/client/signals/get_signals_email_target_responses.go new file mode 100644 index 0000000..351caa8 --- /dev/null +++ b/client/signals/get_signals_email_target_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSignalsEmailTargetReader is a Reader for the GetSignalsEmailTarget structure. +type GetSignalsEmailTargetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSignalsEmailTargetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSignalsEmailTargetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSignalsEmailTargetOK creates a GetSignalsEmailTargetOK with default headers values +func NewGetSignalsEmailTargetOK() *GetSignalsEmailTargetOK { + return &GetSignalsEmailTargetOK{} +} + +/* +GetSignalsEmailTargetOK describes a response with status code 200, with default header values. + +Get a Signals email target by ID +*/ +type GetSignalsEmailTargetOK struct { +} + +// IsSuccess returns true when this get signals email target o k response has a 2xx status code +func (o *GetSignalsEmailTargetOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get signals email target o k response has a 3xx status code +func (o *GetSignalsEmailTargetOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get signals email target o k response has a 4xx status code +func (o *GetSignalsEmailTargetOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get signals email target o k response has a 5xx status code +func (o *GetSignalsEmailTargetOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get signals email target o k response a status code equal to that given +func (o *GetSignalsEmailTargetOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetSignalsEmailTargetOK) Error() string { + return fmt.Sprintf("[GET /v1/signals/email_targets/{id}][%d] getSignalsEmailTargetOK ", 200) +} + +func (o *GetSignalsEmailTargetOK) String() string { + return fmt.Sprintf("[GET /v1/signals/email_targets/{id}][%d] getSignalsEmailTargetOK ", 200) +} + +func (o *GetSignalsEmailTargetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/get_signals_ingest_url_parameters.go b/client/signals/get_signals_ingest_url_parameters.go new file mode 100644 index 0000000..03ae683 --- /dev/null +++ b/client/signals/get_signals_ingest_url_parameters.go @@ -0,0 +1,265 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSignalsIngestURLParams creates a new GetSignalsIngestURLParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSignalsIngestURLParams() *GetSignalsIngestURLParams { + return &GetSignalsIngestURLParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSignalsIngestURLParamsWithTimeout creates a new GetSignalsIngestURLParams object +// with the ability to set a timeout on a request. +func NewGetSignalsIngestURLParamsWithTimeout(timeout time.Duration) *GetSignalsIngestURLParams { + return &GetSignalsIngestURLParams{ + timeout: timeout, + } +} + +// NewGetSignalsIngestURLParamsWithContext creates a new GetSignalsIngestURLParams object +// with the ability to set a context for a request. +func NewGetSignalsIngestURLParamsWithContext(ctx context.Context) *GetSignalsIngestURLParams { + return &GetSignalsIngestURLParams{ + Context: ctx, + } +} + +// NewGetSignalsIngestURLParamsWithHTTPClient creates a new GetSignalsIngestURLParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSignalsIngestURLParamsWithHTTPClient(client *http.Client) *GetSignalsIngestURLParams { + return &GetSignalsIngestURLParams{ + HTTPClient: client, + } +} + +/* +GetSignalsIngestURLParams contains all the parameters to send to the API endpoint + + for the get signals ingest url operation. + + Typically these are written to a http.Request. +*/ +type GetSignalsIngestURLParams struct { + + /* EscalationPolicyID. + + Escalation policy ID to send signals to directly. `team_id` is required if this is provided. + */ + EscalationPolicyID *string + + /* OnCallScheduleID. + + On-call schedule ID to send signals to directly. `team_id` is required if this is provided. + */ + OnCallScheduleID *string + + /* TeamID. + + Team ID to send signals to directly + */ + TeamID *string + + /* UserID. + + User ID to send signals to directly + */ + UserID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get signals ingest url params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSignalsIngestURLParams) WithDefaults() *GetSignalsIngestURLParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get signals ingest url params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSignalsIngestURLParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get signals ingest url params +func (o *GetSignalsIngestURLParams) WithTimeout(timeout time.Duration) *GetSignalsIngestURLParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get signals ingest url params +func (o *GetSignalsIngestURLParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get signals ingest url params +func (o *GetSignalsIngestURLParams) WithContext(ctx context.Context) *GetSignalsIngestURLParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get signals ingest url params +func (o *GetSignalsIngestURLParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get signals ingest url params +func (o *GetSignalsIngestURLParams) WithHTTPClient(client *http.Client) *GetSignalsIngestURLParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get signals ingest url params +func (o *GetSignalsIngestURLParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEscalationPolicyID adds the escalationPolicyID to the get signals ingest url params +func (o *GetSignalsIngestURLParams) WithEscalationPolicyID(escalationPolicyID *string) *GetSignalsIngestURLParams { + o.SetEscalationPolicyID(escalationPolicyID) + return o +} + +// SetEscalationPolicyID adds the escalationPolicyId to the get signals ingest url params +func (o *GetSignalsIngestURLParams) SetEscalationPolicyID(escalationPolicyID *string) { + o.EscalationPolicyID = escalationPolicyID +} + +// WithOnCallScheduleID adds the onCallScheduleID to the get signals ingest url params +func (o *GetSignalsIngestURLParams) WithOnCallScheduleID(onCallScheduleID *string) *GetSignalsIngestURLParams { + o.SetOnCallScheduleID(onCallScheduleID) + return o +} + +// SetOnCallScheduleID adds the onCallScheduleId to the get signals ingest url params +func (o *GetSignalsIngestURLParams) SetOnCallScheduleID(onCallScheduleID *string) { + o.OnCallScheduleID = onCallScheduleID +} + +// WithTeamID adds the teamID to the get signals ingest url params +func (o *GetSignalsIngestURLParams) WithTeamID(teamID *string) *GetSignalsIngestURLParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the get signals ingest url params +func (o *GetSignalsIngestURLParams) SetTeamID(teamID *string) { + o.TeamID = teamID +} + +// WithUserID adds the userID to the get signals ingest url params +func (o *GetSignalsIngestURLParams) WithUserID(userID *string) *GetSignalsIngestURLParams { + o.SetUserID(userID) + return o +} + +// SetUserID adds the userId to the get signals ingest url params +func (o *GetSignalsIngestURLParams) SetUserID(userID *string) { + o.UserID = userID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSignalsIngestURLParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EscalationPolicyID != nil { + + // query param escalation_policy_id + var qrEscalationPolicyID string + + if o.EscalationPolicyID != nil { + qrEscalationPolicyID = *o.EscalationPolicyID + } + qEscalationPolicyID := qrEscalationPolicyID + if qEscalationPolicyID != "" { + + if err := r.SetQueryParam("escalation_policy_id", qEscalationPolicyID); err != nil { + return err + } + } + } + + if o.OnCallScheduleID != nil { + + // query param on_call_schedule_id + var qrOnCallScheduleID string + + if o.OnCallScheduleID != nil { + qrOnCallScheduleID = *o.OnCallScheduleID + } + qOnCallScheduleID := qrOnCallScheduleID + if qOnCallScheduleID != "" { + + if err := r.SetQueryParam("on_call_schedule_id", qOnCallScheduleID); err != nil { + return err + } + } + } + + if o.TeamID != nil { + + // query param team_id + var qrTeamID string + + if o.TeamID != nil { + qrTeamID = *o.TeamID + } + qTeamID := qrTeamID + if qTeamID != "" { + + if err := r.SetQueryParam("team_id", qTeamID); err != nil { + return err + } + } + } + + if o.UserID != nil { + + // query param user_id + var qrUserID string + + if o.UserID != nil { + qrUserID = *o.UserID + } + qUserID := qrUserID + if qUserID != "" { + + if err := r.SetQueryParam("user_id", qUserID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/get_signals_ingest_url_responses.go b/client/signals/get_signals_ingest_url_responses.go new file mode 100644 index 0000000..2adb04f --- /dev/null +++ b/client/signals/get_signals_ingest_url_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetSignalsIngestURLReader is a Reader for the GetSignalsIngestURL structure. +type GetSignalsIngestURLReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSignalsIngestURLReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSignalsIngestURLOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSignalsIngestURLOK creates a GetSignalsIngestURLOK with default headers values +func NewGetSignalsIngestURLOK() *GetSignalsIngestURLOK { + return &GetSignalsIngestURLOK{} +} + +/* +GetSignalsIngestURLOK describes a response with status code 200, with default header values. + +Retrieve the url for ingesting signals for your organization +*/ +type GetSignalsIngestURLOK struct { + Payload *models.SignalsAPIIngestKeyEntity +} + +// IsSuccess returns true when this get signals ingest Url o k response has a 2xx status code +func (o *GetSignalsIngestURLOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get signals ingest Url o k response has a 3xx status code +func (o *GetSignalsIngestURLOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get signals ingest Url o k response has a 4xx status code +func (o *GetSignalsIngestURLOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get signals ingest Url o k response has a 5xx status code +func (o *GetSignalsIngestURLOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get signals ingest Url o k response a status code equal to that given +func (o *GetSignalsIngestURLOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetSignalsIngestURLOK) Error() string { + return fmt.Sprintf("[GET /v1/signals/ingest_url][%d] getSignalsIngestUrlOK %+v", 200, o.Payload) +} + +func (o *GetSignalsIngestURLOK) String() string { + return fmt.Sprintf("[GET /v1/signals/ingest_url][%d] getSignalsIngestUrlOK %+v", 200, o.Payload) +} + +func (o *GetSignalsIngestURLOK) GetPayload() *models.SignalsAPIIngestKeyEntity { + return o.Payload +} + +func (o *GetSignalsIngestURLOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SignalsAPIIngestKeyEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/signals/get_signals_webhook_target_parameters.go b/client/signals/get_signals_webhook_target_parameters.go new file mode 100644 index 0000000..cff9e5d --- /dev/null +++ b/client/signals/get_signals_webhook_target_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSignalsWebhookTargetParams creates a new GetSignalsWebhookTargetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSignalsWebhookTargetParams() *GetSignalsWebhookTargetParams { + return &GetSignalsWebhookTargetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSignalsWebhookTargetParamsWithTimeout creates a new GetSignalsWebhookTargetParams object +// with the ability to set a timeout on a request. +func NewGetSignalsWebhookTargetParamsWithTimeout(timeout time.Duration) *GetSignalsWebhookTargetParams { + return &GetSignalsWebhookTargetParams{ + timeout: timeout, + } +} + +// NewGetSignalsWebhookTargetParamsWithContext creates a new GetSignalsWebhookTargetParams object +// with the ability to set a context for a request. +func NewGetSignalsWebhookTargetParamsWithContext(ctx context.Context) *GetSignalsWebhookTargetParams { + return &GetSignalsWebhookTargetParams{ + Context: ctx, + } +} + +// NewGetSignalsWebhookTargetParamsWithHTTPClient creates a new GetSignalsWebhookTargetParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSignalsWebhookTargetParamsWithHTTPClient(client *http.Client) *GetSignalsWebhookTargetParams { + return &GetSignalsWebhookTargetParams{ + HTTPClient: client, + } +} + +/* +GetSignalsWebhookTargetParams contains all the parameters to send to the API endpoint + + for the get signals webhook target operation. + + Typically these are written to a http.Request. +*/ +type GetSignalsWebhookTargetParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get signals webhook target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSignalsWebhookTargetParams) WithDefaults() *GetSignalsWebhookTargetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get signals webhook target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSignalsWebhookTargetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get signals webhook target params +func (o *GetSignalsWebhookTargetParams) WithTimeout(timeout time.Duration) *GetSignalsWebhookTargetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get signals webhook target params +func (o *GetSignalsWebhookTargetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get signals webhook target params +func (o *GetSignalsWebhookTargetParams) WithContext(ctx context.Context) *GetSignalsWebhookTargetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get signals webhook target params +func (o *GetSignalsWebhookTargetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get signals webhook target params +func (o *GetSignalsWebhookTargetParams) WithHTTPClient(client *http.Client) *GetSignalsWebhookTargetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get signals webhook target params +func (o *GetSignalsWebhookTargetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get signals webhook target params +func (o *GetSignalsWebhookTargetParams) WithID(id string) *GetSignalsWebhookTargetParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get signals webhook target params +func (o *GetSignalsWebhookTargetParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSignalsWebhookTargetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/get_signals_webhook_target_responses.go b/client/signals/get_signals_webhook_target_responses.go new file mode 100644 index 0000000..a6ecc50 --- /dev/null +++ b/client/signals/get_signals_webhook_target_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetSignalsWebhookTargetReader is a Reader for the GetSignalsWebhookTarget structure. +type GetSignalsWebhookTargetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSignalsWebhookTargetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSignalsWebhookTargetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSignalsWebhookTargetOK creates a GetSignalsWebhookTargetOK with default headers values +func NewGetSignalsWebhookTargetOK() *GetSignalsWebhookTargetOK { + return &GetSignalsWebhookTargetOK{} +} + +/* +GetSignalsWebhookTargetOK describes a response with status code 200, with default header values. + +Get a Signals webhook target by ID +*/ +type GetSignalsWebhookTargetOK struct { +} + +// IsSuccess returns true when this get signals webhook target o k response has a 2xx status code +func (o *GetSignalsWebhookTargetOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get signals webhook target o k response has a 3xx status code +func (o *GetSignalsWebhookTargetOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get signals webhook target o k response has a 4xx status code +func (o *GetSignalsWebhookTargetOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get signals webhook target o k response has a 5xx status code +func (o *GetSignalsWebhookTargetOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get signals webhook target o k response a status code equal to that given +func (o *GetSignalsWebhookTargetOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetSignalsWebhookTargetOK) Error() string { + return fmt.Sprintf("[GET /v1/signals/webhook_targets/{id}][%d] getSignalsWebhookTargetOK ", 200) +} + +func (o *GetSignalsWebhookTargetOK) String() string { + return fmt.Sprintf("[GET /v1/signals/webhook_targets/{id}][%d] getSignalsWebhookTargetOK ", 200) +} + +func (o *GetSignalsWebhookTargetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/get_team_escalation_policy_parameters.go b/client/signals/get_team_escalation_policy_parameters.go new file mode 100644 index 0000000..7f69926 --- /dev/null +++ b/client/signals/get_team_escalation_policy_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTeamEscalationPolicyParams creates a new GetTeamEscalationPolicyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTeamEscalationPolicyParams() *GetTeamEscalationPolicyParams { + return &GetTeamEscalationPolicyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTeamEscalationPolicyParamsWithTimeout creates a new GetTeamEscalationPolicyParams object +// with the ability to set a timeout on a request. +func NewGetTeamEscalationPolicyParamsWithTimeout(timeout time.Duration) *GetTeamEscalationPolicyParams { + return &GetTeamEscalationPolicyParams{ + timeout: timeout, + } +} + +// NewGetTeamEscalationPolicyParamsWithContext creates a new GetTeamEscalationPolicyParams object +// with the ability to set a context for a request. +func NewGetTeamEscalationPolicyParamsWithContext(ctx context.Context) *GetTeamEscalationPolicyParams { + return &GetTeamEscalationPolicyParams{ + Context: ctx, + } +} + +// NewGetTeamEscalationPolicyParamsWithHTTPClient creates a new GetTeamEscalationPolicyParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTeamEscalationPolicyParamsWithHTTPClient(client *http.Client) *GetTeamEscalationPolicyParams { + return &GetTeamEscalationPolicyParams{ + HTTPClient: client, + } +} + +/* +GetTeamEscalationPolicyParams contains all the parameters to send to the API endpoint + + for the get team escalation policy operation. + + Typically these are written to a http.Request. +*/ +type GetTeamEscalationPolicyParams struct { + + // ID. + ID string + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get team escalation policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTeamEscalationPolicyParams) WithDefaults() *GetTeamEscalationPolicyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get team escalation policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTeamEscalationPolicyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get team escalation policy params +func (o *GetTeamEscalationPolicyParams) WithTimeout(timeout time.Duration) *GetTeamEscalationPolicyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get team escalation policy params +func (o *GetTeamEscalationPolicyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get team escalation policy params +func (o *GetTeamEscalationPolicyParams) WithContext(ctx context.Context) *GetTeamEscalationPolicyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get team escalation policy params +func (o *GetTeamEscalationPolicyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get team escalation policy params +func (o *GetTeamEscalationPolicyParams) WithHTTPClient(client *http.Client) *GetTeamEscalationPolicyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get team escalation policy params +func (o *GetTeamEscalationPolicyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get team escalation policy params +func (o *GetTeamEscalationPolicyParams) WithID(id string) *GetTeamEscalationPolicyParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get team escalation policy params +func (o *GetTeamEscalationPolicyParams) SetID(id string) { + o.ID = id +} + +// WithTeamID adds the teamID to the get team escalation policy params +func (o *GetTeamEscalationPolicyParams) WithTeamID(teamID string) *GetTeamEscalationPolicyParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the get team escalation policy params +func (o *GetTeamEscalationPolicyParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTeamEscalationPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/get_team_escalation_policy_responses.go b/client/signals/get_team_escalation_policy_responses.go new file mode 100644 index 0000000..f074df8 --- /dev/null +++ b/client/signals/get_team_escalation_policy_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTeamEscalationPolicyReader is a Reader for the GetTeamEscalationPolicy structure. +type GetTeamEscalationPolicyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTeamEscalationPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTeamEscalationPolicyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTeamEscalationPolicyOK creates a GetTeamEscalationPolicyOK with default headers values +func NewGetTeamEscalationPolicyOK() *GetTeamEscalationPolicyOK { + return &GetTeamEscalationPolicyOK{} +} + +/* +GetTeamEscalationPolicyOK describes a response with status code 200, with default header values. + +Get a Signals escalation policy by ID +*/ +type GetTeamEscalationPolicyOK struct { +} + +// IsSuccess returns true when this get team escalation policy o k response has a 2xx status code +func (o *GetTeamEscalationPolicyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get team escalation policy o k response has a 3xx status code +func (o *GetTeamEscalationPolicyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get team escalation policy o k response has a 4xx status code +func (o *GetTeamEscalationPolicyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get team escalation policy o k response has a 5xx status code +func (o *GetTeamEscalationPolicyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get team escalation policy o k response a status code equal to that given +func (o *GetTeamEscalationPolicyOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetTeamEscalationPolicyOK) Error() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}/escalation_policies/{id}][%d] getTeamEscalationPolicyOK ", 200) +} + +func (o *GetTeamEscalationPolicyOK) String() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}/escalation_policies/{id}][%d] getTeamEscalationPolicyOK ", 200) +} + +func (o *GetTeamEscalationPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/get_team_on_call_schedule_parameters.go b/client/signals/get_team_on_call_schedule_parameters.go new file mode 100644 index 0000000..09cccef --- /dev/null +++ b/client/signals/get_team_on_call_schedule_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTeamOnCallScheduleParams creates a new GetTeamOnCallScheduleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTeamOnCallScheduleParams() *GetTeamOnCallScheduleParams { + return &GetTeamOnCallScheduleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTeamOnCallScheduleParamsWithTimeout creates a new GetTeamOnCallScheduleParams object +// with the ability to set a timeout on a request. +func NewGetTeamOnCallScheduleParamsWithTimeout(timeout time.Duration) *GetTeamOnCallScheduleParams { + return &GetTeamOnCallScheduleParams{ + timeout: timeout, + } +} + +// NewGetTeamOnCallScheduleParamsWithContext creates a new GetTeamOnCallScheduleParams object +// with the ability to set a context for a request. +func NewGetTeamOnCallScheduleParamsWithContext(ctx context.Context) *GetTeamOnCallScheduleParams { + return &GetTeamOnCallScheduleParams{ + Context: ctx, + } +} + +// NewGetTeamOnCallScheduleParamsWithHTTPClient creates a new GetTeamOnCallScheduleParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTeamOnCallScheduleParamsWithHTTPClient(client *http.Client) *GetTeamOnCallScheduleParams { + return &GetTeamOnCallScheduleParams{ + HTTPClient: client, + } +} + +/* +GetTeamOnCallScheduleParams contains all the parameters to send to the API endpoint + + for the get team on call schedule operation. + + Typically these are written to a http.Request. +*/ +type GetTeamOnCallScheduleParams struct { + + // ScheduleID. + ScheduleID string + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get team on call schedule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTeamOnCallScheduleParams) WithDefaults() *GetTeamOnCallScheduleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get team on call schedule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTeamOnCallScheduleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get team on call schedule params +func (o *GetTeamOnCallScheduleParams) WithTimeout(timeout time.Duration) *GetTeamOnCallScheduleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get team on call schedule params +func (o *GetTeamOnCallScheduleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get team on call schedule params +func (o *GetTeamOnCallScheduleParams) WithContext(ctx context.Context) *GetTeamOnCallScheduleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get team on call schedule params +func (o *GetTeamOnCallScheduleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get team on call schedule params +func (o *GetTeamOnCallScheduleParams) WithHTTPClient(client *http.Client) *GetTeamOnCallScheduleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get team on call schedule params +func (o *GetTeamOnCallScheduleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithScheduleID adds the scheduleID to the get team on call schedule params +func (o *GetTeamOnCallScheduleParams) WithScheduleID(scheduleID string) *GetTeamOnCallScheduleParams { + o.SetScheduleID(scheduleID) + return o +} + +// SetScheduleID adds the scheduleId to the get team on call schedule params +func (o *GetTeamOnCallScheduleParams) SetScheduleID(scheduleID string) { + o.ScheduleID = scheduleID +} + +// WithTeamID adds the teamID to the get team on call schedule params +func (o *GetTeamOnCallScheduleParams) WithTeamID(teamID string) *GetTeamOnCallScheduleParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the get team on call schedule params +func (o *GetTeamOnCallScheduleParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTeamOnCallScheduleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param schedule_id + if err := r.SetPathParam("schedule_id", o.ScheduleID); err != nil { + return err + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/get_team_on_call_schedule_responses.go b/client/signals/get_team_on_call_schedule_responses.go new file mode 100644 index 0000000..5b2077b --- /dev/null +++ b/client/signals/get_team_on_call_schedule_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTeamOnCallScheduleReader is a Reader for the GetTeamOnCallSchedule structure. +type GetTeamOnCallScheduleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTeamOnCallScheduleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTeamOnCallScheduleOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTeamOnCallScheduleOK creates a GetTeamOnCallScheduleOK with default headers values +func NewGetTeamOnCallScheduleOK() *GetTeamOnCallScheduleOK { + return &GetTeamOnCallScheduleOK{} +} + +/* +GetTeamOnCallScheduleOK describes a response with status code 200, with default header values. + +Get a Signals on-call schedule by ID +*/ +type GetTeamOnCallScheduleOK struct { +} + +// IsSuccess returns true when this get team on call schedule o k response has a 2xx status code +func (o *GetTeamOnCallScheduleOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get team on call schedule o k response has a 3xx status code +func (o *GetTeamOnCallScheduleOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get team on call schedule o k response has a 4xx status code +func (o *GetTeamOnCallScheduleOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get team on call schedule o k response has a 5xx status code +func (o *GetTeamOnCallScheduleOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get team on call schedule o k response a status code equal to that given +func (o *GetTeamOnCallScheduleOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetTeamOnCallScheduleOK) Error() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}/on_call_schedules/{schedule_id}][%d] getTeamOnCallScheduleOK ", 200) +} + +func (o *GetTeamOnCallScheduleOK) String() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}/on_call_schedules/{schedule_id}][%d] getTeamOnCallScheduleOK ", 200) +} + +func (o *GetTeamOnCallScheduleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/get_team_signal_rule_parameters.go b/client/signals/get_team_signal_rule_parameters.go new file mode 100644 index 0000000..b9d461f --- /dev/null +++ b/client/signals/get_team_signal_rule_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTeamSignalRuleParams creates a new GetTeamSignalRuleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTeamSignalRuleParams() *GetTeamSignalRuleParams { + return &GetTeamSignalRuleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTeamSignalRuleParamsWithTimeout creates a new GetTeamSignalRuleParams object +// with the ability to set a timeout on a request. +func NewGetTeamSignalRuleParamsWithTimeout(timeout time.Duration) *GetTeamSignalRuleParams { + return &GetTeamSignalRuleParams{ + timeout: timeout, + } +} + +// NewGetTeamSignalRuleParamsWithContext creates a new GetTeamSignalRuleParams object +// with the ability to set a context for a request. +func NewGetTeamSignalRuleParamsWithContext(ctx context.Context) *GetTeamSignalRuleParams { + return &GetTeamSignalRuleParams{ + Context: ctx, + } +} + +// NewGetTeamSignalRuleParamsWithHTTPClient creates a new GetTeamSignalRuleParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTeamSignalRuleParamsWithHTTPClient(client *http.Client) *GetTeamSignalRuleParams { + return &GetTeamSignalRuleParams{ + HTTPClient: client, + } +} + +/* +GetTeamSignalRuleParams contains all the parameters to send to the API endpoint + + for the get team signal rule operation. + + Typically these are written to a http.Request. +*/ +type GetTeamSignalRuleParams struct { + + // ID. + ID string + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get team signal rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTeamSignalRuleParams) WithDefaults() *GetTeamSignalRuleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get team signal rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTeamSignalRuleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get team signal rule params +func (o *GetTeamSignalRuleParams) WithTimeout(timeout time.Duration) *GetTeamSignalRuleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get team signal rule params +func (o *GetTeamSignalRuleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get team signal rule params +func (o *GetTeamSignalRuleParams) WithContext(ctx context.Context) *GetTeamSignalRuleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get team signal rule params +func (o *GetTeamSignalRuleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get team signal rule params +func (o *GetTeamSignalRuleParams) WithHTTPClient(client *http.Client) *GetTeamSignalRuleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get team signal rule params +func (o *GetTeamSignalRuleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get team signal rule params +func (o *GetTeamSignalRuleParams) WithID(id string) *GetTeamSignalRuleParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get team signal rule params +func (o *GetTeamSignalRuleParams) SetID(id string) { + o.ID = id +} + +// WithTeamID adds the teamID to the get team signal rule params +func (o *GetTeamSignalRuleParams) WithTeamID(teamID string) *GetTeamSignalRuleParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the get team signal rule params +func (o *GetTeamSignalRuleParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTeamSignalRuleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/get_team_signal_rule_responses.go b/client/signals/get_team_signal_rule_responses.go new file mode 100644 index 0000000..5c16ca8 --- /dev/null +++ b/client/signals/get_team_signal_rule_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetTeamSignalRuleReader is a Reader for the GetTeamSignalRule structure. +type GetTeamSignalRuleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTeamSignalRuleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTeamSignalRuleOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTeamSignalRuleOK creates a GetTeamSignalRuleOK with default headers values +func NewGetTeamSignalRuleOK() *GetTeamSignalRuleOK { + return &GetTeamSignalRuleOK{} +} + +/* +GetTeamSignalRuleOK describes a response with status code 200, with default header values. + +Get a Signals rule by ID. +*/ +type GetTeamSignalRuleOK struct { +} + +// IsSuccess returns true when this get team signal rule o k response has a 2xx status code +func (o *GetTeamSignalRuleOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get team signal rule o k response has a 3xx status code +func (o *GetTeamSignalRuleOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get team signal rule o k response has a 4xx status code +func (o *GetTeamSignalRuleOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get team signal rule o k response has a 5xx status code +func (o *GetTeamSignalRuleOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get team signal rule o k response a status code equal to that given +func (o *GetTeamSignalRuleOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetTeamSignalRuleOK) Error() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}/signal_rules/{id}][%d] getTeamSignalRuleOK ", 200) +} + +func (o *GetTeamSignalRuleOK) String() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}/signal_rules/{id}][%d] getTeamSignalRuleOK ", 200) +} + +func (o *GetTeamSignalRuleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/list_organization_on_call_schedules_parameters.go b/client/signals/list_organization_on_call_schedules_parameters.go new file mode 100644 index 0000000..1f0511d --- /dev/null +++ b/client/signals/list_organization_on_call_schedules_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListOrganizationOnCallSchedulesParams creates a new ListOrganizationOnCallSchedulesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListOrganizationOnCallSchedulesParams() *ListOrganizationOnCallSchedulesParams { + return &ListOrganizationOnCallSchedulesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListOrganizationOnCallSchedulesParamsWithTimeout creates a new ListOrganizationOnCallSchedulesParams object +// with the ability to set a timeout on a request. +func NewListOrganizationOnCallSchedulesParamsWithTimeout(timeout time.Duration) *ListOrganizationOnCallSchedulesParams { + return &ListOrganizationOnCallSchedulesParams{ + timeout: timeout, + } +} + +// NewListOrganizationOnCallSchedulesParamsWithContext creates a new ListOrganizationOnCallSchedulesParams object +// with the ability to set a context for a request. +func NewListOrganizationOnCallSchedulesParamsWithContext(ctx context.Context) *ListOrganizationOnCallSchedulesParams { + return &ListOrganizationOnCallSchedulesParams{ + Context: ctx, + } +} + +// NewListOrganizationOnCallSchedulesParamsWithHTTPClient creates a new ListOrganizationOnCallSchedulesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListOrganizationOnCallSchedulesParamsWithHTTPClient(client *http.Client) *ListOrganizationOnCallSchedulesParams { + return &ListOrganizationOnCallSchedulesParams{ + HTTPClient: client, + } +} + +/* +ListOrganizationOnCallSchedulesParams contains all the parameters to send to the API endpoint + + for the list organization on call schedules operation. + + Typically these are written to a http.Request. +*/ +type ListOrganizationOnCallSchedulesParams struct { + + /* TeamID. + + An optional comma separated list of team IDs to filter currently on-call users by + */ + TeamID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list organization on call schedules params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListOrganizationOnCallSchedulesParams) WithDefaults() *ListOrganizationOnCallSchedulesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list organization on call schedules params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListOrganizationOnCallSchedulesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list organization on call schedules params +func (o *ListOrganizationOnCallSchedulesParams) WithTimeout(timeout time.Duration) *ListOrganizationOnCallSchedulesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list organization on call schedules params +func (o *ListOrganizationOnCallSchedulesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list organization on call schedules params +func (o *ListOrganizationOnCallSchedulesParams) WithContext(ctx context.Context) *ListOrganizationOnCallSchedulesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list organization on call schedules params +func (o *ListOrganizationOnCallSchedulesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list organization on call schedules params +func (o *ListOrganizationOnCallSchedulesParams) WithHTTPClient(client *http.Client) *ListOrganizationOnCallSchedulesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list organization on call schedules params +func (o *ListOrganizationOnCallSchedulesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTeamID adds the teamID to the list organization on call schedules params +func (o *ListOrganizationOnCallSchedulesParams) WithTeamID(teamID *string) *ListOrganizationOnCallSchedulesParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the list organization on call schedules params +func (o *ListOrganizationOnCallSchedulesParams) SetTeamID(teamID *string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListOrganizationOnCallSchedulesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.TeamID != nil { + + // query param team_id + var qrTeamID string + + if o.TeamID != nil { + qrTeamID = *o.TeamID + } + qTeamID := qrTeamID + if qTeamID != "" { + + if err := r.SetQueryParam("team_id", qTeamID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/list_organization_on_call_schedules_responses.go b/client/signals/list_organization_on_call_schedules_responses.go new file mode 100644 index 0000000..299f933 --- /dev/null +++ b/client/signals/list_organization_on_call_schedules_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListOrganizationOnCallSchedulesReader is a Reader for the ListOrganizationOnCallSchedules structure. +type ListOrganizationOnCallSchedulesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListOrganizationOnCallSchedulesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListOrganizationOnCallSchedulesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListOrganizationOnCallSchedulesOK creates a ListOrganizationOnCallSchedulesOK with default headers values +func NewListOrganizationOnCallSchedulesOK() *ListOrganizationOnCallSchedulesOK { + return &ListOrganizationOnCallSchedulesOK{} +} + +/* +ListOrganizationOnCallSchedulesOK describes a response with status code 200, with default header values. + +List all Signals on-call schedules for the entire organization. +*/ +type ListOrganizationOnCallSchedulesOK struct { +} + +// IsSuccess returns true when this list organization on call schedules o k response has a 2xx status code +func (o *ListOrganizationOnCallSchedulesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list organization on call schedules o k response has a 3xx status code +func (o *ListOrganizationOnCallSchedulesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list organization on call schedules o k response has a 4xx status code +func (o *ListOrganizationOnCallSchedulesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list organization on call schedules o k response has a 5xx status code +func (o *ListOrganizationOnCallSchedulesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list organization on call schedules o k response a status code equal to that given +func (o *ListOrganizationOnCallSchedulesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListOrganizationOnCallSchedulesOK) Error() string { + return fmt.Sprintf("[GET /v1/signals_on_call][%d] listOrganizationOnCallSchedulesOK ", 200) +} + +func (o *ListOrganizationOnCallSchedulesOK) String() string { + return fmt.Sprintf("[GET /v1/signals_on_call][%d] listOrganizationOnCallSchedulesOK ", 200) +} + +func (o *ListOrganizationOnCallSchedulesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/list_signals_email_targets_parameters.go b/client/signals/list_signals_email_targets_parameters.go new file mode 100644 index 0000000..1fac7df --- /dev/null +++ b/client/signals/list_signals_email_targets_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListSignalsEmailTargetsParams creates a new ListSignalsEmailTargetsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSignalsEmailTargetsParams() *ListSignalsEmailTargetsParams { + return &ListSignalsEmailTargetsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSignalsEmailTargetsParamsWithTimeout creates a new ListSignalsEmailTargetsParams object +// with the ability to set a timeout on a request. +func NewListSignalsEmailTargetsParamsWithTimeout(timeout time.Duration) *ListSignalsEmailTargetsParams { + return &ListSignalsEmailTargetsParams{ + timeout: timeout, + } +} + +// NewListSignalsEmailTargetsParamsWithContext creates a new ListSignalsEmailTargetsParams object +// with the ability to set a context for a request. +func NewListSignalsEmailTargetsParamsWithContext(ctx context.Context) *ListSignalsEmailTargetsParams { + return &ListSignalsEmailTargetsParams{ + Context: ctx, + } +} + +// NewListSignalsEmailTargetsParamsWithHTTPClient creates a new ListSignalsEmailTargetsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSignalsEmailTargetsParamsWithHTTPClient(client *http.Client) *ListSignalsEmailTargetsParams { + return &ListSignalsEmailTargetsParams{ + HTTPClient: client, + } +} + +/* +ListSignalsEmailTargetsParams contains all the parameters to send to the API endpoint + + for the list signals email targets operation. + + Typically these are written to a http.Request. +*/ +type ListSignalsEmailTargetsParams struct { + + /* Query. + + A query string to search the list of targets by. + */ + Query *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list signals email targets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSignalsEmailTargetsParams) WithDefaults() *ListSignalsEmailTargetsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list signals email targets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSignalsEmailTargetsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list signals email targets params +func (o *ListSignalsEmailTargetsParams) WithTimeout(timeout time.Duration) *ListSignalsEmailTargetsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list signals email targets params +func (o *ListSignalsEmailTargetsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list signals email targets params +func (o *ListSignalsEmailTargetsParams) WithContext(ctx context.Context) *ListSignalsEmailTargetsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list signals email targets params +func (o *ListSignalsEmailTargetsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list signals email targets params +func (o *ListSignalsEmailTargetsParams) WithHTTPClient(client *http.Client) *ListSignalsEmailTargetsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list signals email targets params +func (o *ListSignalsEmailTargetsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithQuery adds the query to the list signals email targets params +func (o *ListSignalsEmailTargetsParams) WithQuery(query *string) *ListSignalsEmailTargetsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list signals email targets params +func (o *ListSignalsEmailTargetsParams) SetQuery(query *string) { + o.Query = query +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSignalsEmailTargetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/list_signals_email_targets_responses.go b/client/signals/list_signals_email_targets_responses.go new file mode 100644 index 0000000..714e102 --- /dev/null +++ b/client/signals/list_signals_email_targets_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListSignalsEmailTargetsReader is a Reader for the ListSignalsEmailTargets structure. +type ListSignalsEmailTargetsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSignalsEmailTargetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSignalsEmailTargetsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListSignalsEmailTargetsOK creates a ListSignalsEmailTargetsOK with default headers values +func NewListSignalsEmailTargetsOK() *ListSignalsEmailTargetsOK { + return &ListSignalsEmailTargetsOK{} +} + +/* +ListSignalsEmailTargetsOK describes a response with status code 200, with default header values. + +List all Signals email targets for a team. +*/ +type ListSignalsEmailTargetsOK struct { +} + +// IsSuccess returns true when this list signals email targets o k response has a 2xx status code +func (o *ListSignalsEmailTargetsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list signals email targets o k response has a 3xx status code +func (o *ListSignalsEmailTargetsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list signals email targets o k response has a 4xx status code +func (o *ListSignalsEmailTargetsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list signals email targets o k response has a 5xx status code +func (o *ListSignalsEmailTargetsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list signals email targets o k response a status code equal to that given +func (o *ListSignalsEmailTargetsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListSignalsEmailTargetsOK) Error() string { + return fmt.Sprintf("[GET /v1/signals/email_targets][%d] listSignalsEmailTargetsOK ", 200) +} + +func (o *ListSignalsEmailTargetsOK) String() string { + return fmt.Sprintf("[GET /v1/signals/email_targets][%d] listSignalsEmailTargetsOK ", 200) +} + +func (o *ListSignalsEmailTargetsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/list_signals_event_sources_parameters.go b/client/signals/list_signals_event_sources_parameters.go new file mode 100644 index 0000000..ebdf8cf --- /dev/null +++ b/client/signals/list_signals_event_sources_parameters.go @@ -0,0 +1,265 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListSignalsEventSourcesParams creates a new ListSignalsEventSourcesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSignalsEventSourcesParams() *ListSignalsEventSourcesParams { + return &ListSignalsEventSourcesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSignalsEventSourcesParamsWithTimeout creates a new ListSignalsEventSourcesParams object +// with the ability to set a timeout on a request. +func NewListSignalsEventSourcesParamsWithTimeout(timeout time.Duration) *ListSignalsEventSourcesParams { + return &ListSignalsEventSourcesParams{ + timeout: timeout, + } +} + +// NewListSignalsEventSourcesParamsWithContext creates a new ListSignalsEventSourcesParams object +// with the ability to set a context for a request. +func NewListSignalsEventSourcesParamsWithContext(ctx context.Context) *ListSignalsEventSourcesParams { + return &ListSignalsEventSourcesParams{ + Context: ctx, + } +} + +// NewListSignalsEventSourcesParamsWithHTTPClient creates a new ListSignalsEventSourcesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSignalsEventSourcesParamsWithHTTPClient(client *http.Client) *ListSignalsEventSourcesParams { + return &ListSignalsEventSourcesParams{ + HTTPClient: client, + } +} + +/* +ListSignalsEventSourcesParams contains all the parameters to send to the API endpoint + + for the list signals event sources operation. + + Typically these are written to a http.Request. +*/ +type ListSignalsEventSourcesParams struct { + + /* EscalationPolicyID. + + Escalation policy ID to send signals to directly. `team_id` is required if this is provided. + */ + EscalationPolicyID *string + + /* OnCallScheduleID. + + On-call schedule ID to send signals to directly. `team_id` is required if this is provided. + */ + OnCallScheduleID *string + + /* TeamID. + + Team ID to send signals to directly + */ + TeamID *string + + /* UserID. + + User ID to send signals to directly + */ + UserID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list signals event sources params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSignalsEventSourcesParams) WithDefaults() *ListSignalsEventSourcesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list signals event sources params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSignalsEventSourcesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list signals event sources params +func (o *ListSignalsEventSourcesParams) WithTimeout(timeout time.Duration) *ListSignalsEventSourcesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list signals event sources params +func (o *ListSignalsEventSourcesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list signals event sources params +func (o *ListSignalsEventSourcesParams) WithContext(ctx context.Context) *ListSignalsEventSourcesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list signals event sources params +func (o *ListSignalsEventSourcesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list signals event sources params +func (o *ListSignalsEventSourcesParams) WithHTTPClient(client *http.Client) *ListSignalsEventSourcesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list signals event sources params +func (o *ListSignalsEventSourcesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEscalationPolicyID adds the escalationPolicyID to the list signals event sources params +func (o *ListSignalsEventSourcesParams) WithEscalationPolicyID(escalationPolicyID *string) *ListSignalsEventSourcesParams { + o.SetEscalationPolicyID(escalationPolicyID) + return o +} + +// SetEscalationPolicyID adds the escalationPolicyId to the list signals event sources params +func (o *ListSignalsEventSourcesParams) SetEscalationPolicyID(escalationPolicyID *string) { + o.EscalationPolicyID = escalationPolicyID +} + +// WithOnCallScheduleID adds the onCallScheduleID to the list signals event sources params +func (o *ListSignalsEventSourcesParams) WithOnCallScheduleID(onCallScheduleID *string) *ListSignalsEventSourcesParams { + o.SetOnCallScheduleID(onCallScheduleID) + return o +} + +// SetOnCallScheduleID adds the onCallScheduleId to the list signals event sources params +func (o *ListSignalsEventSourcesParams) SetOnCallScheduleID(onCallScheduleID *string) { + o.OnCallScheduleID = onCallScheduleID +} + +// WithTeamID adds the teamID to the list signals event sources params +func (o *ListSignalsEventSourcesParams) WithTeamID(teamID *string) *ListSignalsEventSourcesParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the list signals event sources params +func (o *ListSignalsEventSourcesParams) SetTeamID(teamID *string) { + o.TeamID = teamID +} + +// WithUserID adds the userID to the list signals event sources params +func (o *ListSignalsEventSourcesParams) WithUserID(userID *string) *ListSignalsEventSourcesParams { + o.SetUserID(userID) + return o +} + +// SetUserID adds the userId to the list signals event sources params +func (o *ListSignalsEventSourcesParams) SetUserID(userID *string) { + o.UserID = userID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSignalsEventSourcesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EscalationPolicyID != nil { + + // query param escalation_policy_id + var qrEscalationPolicyID string + + if o.EscalationPolicyID != nil { + qrEscalationPolicyID = *o.EscalationPolicyID + } + qEscalationPolicyID := qrEscalationPolicyID + if qEscalationPolicyID != "" { + + if err := r.SetQueryParam("escalation_policy_id", qEscalationPolicyID); err != nil { + return err + } + } + } + + if o.OnCallScheduleID != nil { + + // query param on_call_schedule_id + var qrOnCallScheduleID string + + if o.OnCallScheduleID != nil { + qrOnCallScheduleID = *o.OnCallScheduleID + } + qOnCallScheduleID := qrOnCallScheduleID + if qOnCallScheduleID != "" { + + if err := r.SetQueryParam("on_call_schedule_id", qOnCallScheduleID); err != nil { + return err + } + } + } + + if o.TeamID != nil { + + // query param team_id + var qrTeamID string + + if o.TeamID != nil { + qrTeamID = *o.TeamID + } + qTeamID := qrTeamID + if qTeamID != "" { + + if err := r.SetQueryParam("team_id", qTeamID); err != nil { + return err + } + } + } + + if o.UserID != nil { + + // query param user_id + var qrUserID string + + if o.UserID != nil { + qrUserID = *o.UserID + } + qUserID := qrUserID + if qUserID != "" { + + if err := r.SetQueryParam("user_id", qUserID); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/list_signals_event_sources_responses.go b/client/signals/list_signals_event_sources_responses.go new file mode 100644 index 0000000..80ae0d9 --- /dev/null +++ b/client/signals/list_signals_event_sources_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListSignalsEventSourcesReader is a Reader for the ListSignalsEventSources structure. +type ListSignalsEventSourcesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSignalsEventSourcesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSignalsEventSourcesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListSignalsEventSourcesOK creates a ListSignalsEventSourcesOK with default headers values +func NewListSignalsEventSourcesOK() *ListSignalsEventSourcesOK { + return &ListSignalsEventSourcesOK{} +} + +/* +ListSignalsEventSourcesOK describes a response with status code 200, with default header values. + +List all Signals event sources for the authenticated user. +*/ +type ListSignalsEventSourcesOK struct { +} + +// IsSuccess returns true when this list signals event sources o k response has a 2xx status code +func (o *ListSignalsEventSourcesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list signals event sources o k response has a 3xx status code +func (o *ListSignalsEventSourcesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list signals event sources o k response has a 4xx status code +func (o *ListSignalsEventSourcesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list signals event sources o k response has a 5xx status code +func (o *ListSignalsEventSourcesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list signals event sources o k response a status code equal to that given +func (o *ListSignalsEventSourcesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListSignalsEventSourcesOK) Error() string { + return fmt.Sprintf("[GET /v1/signals/event_sources][%d] listSignalsEventSourcesOK ", 200) +} + +func (o *ListSignalsEventSourcesOK) String() string { + return fmt.Sprintf("[GET /v1/signals/event_sources][%d] listSignalsEventSourcesOK ", 200) +} + +func (o *ListSignalsEventSourcesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/list_signals_transposers_parameters.go b/client/signals/list_signals_transposers_parameters.go new file mode 100644 index 0000000..ae681ca --- /dev/null +++ b/client/signals/list_signals_transposers_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListSignalsTransposersParams creates a new ListSignalsTransposersParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSignalsTransposersParams() *ListSignalsTransposersParams { + return &ListSignalsTransposersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSignalsTransposersParamsWithTimeout creates a new ListSignalsTransposersParams object +// with the ability to set a timeout on a request. +func NewListSignalsTransposersParamsWithTimeout(timeout time.Duration) *ListSignalsTransposersParams { + return &ListSignalsTransposersParams{ + timeout: timeout, + } +} + +// NewListSignalsTransposersParamsWithContext creates a new ListSignalsTransposersParams object +// with the ability to set a context for a request. +func NewListSignalsTransposersParamsWithContext(ctx context.Context) *ListSignalsTransposersParams { + return &ListSignalsTransposersParams{ + Context: ctx, + } +} + +// NewListSignalsTransposersParamsWithHTTPClient creates a new ListSignalsTransposersParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSignalsTransposersParamsWithHTTPClient(client *http.Client) *ListSignalsTransposersParams { + return &ListSignalsTransposersParams{ + HTTPClient: client, + } +} + +/* +ListSignalsTransposersParams contains all the parameters to send to the API endpoint + + for the list signals transposers operation. + + Typically these are written to a http.Request. +*/ +type ListSignalsTransposersParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list signals transposers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSignalsTransposersParams) WithDefaults() *ListSignalsTransposersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list signals transposers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSignalsTransposersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list signals transposers params +func (o *ListSignalsTransposersParams) WithTimeout(timeout time.Duration) *ListSignalsTransposersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list signals transposers params +func (o *ListSignalsTransposersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list signals transposers params +func (o *ListSignalsTransposersParams) WithContext(ctx context.Context) *ListSignalsTransposersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list signals transposers params +func (o *ListSignalsTransposersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list signals transposers params +func (o *ListSignalsTransposersParams) WithHTTPClient(client *http.Client) *ListSignalsTransposersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list signals transposers params +func (o *ListSignalsTransposersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSignalsTransposersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/list_signals_transposers_responses.go b/client/signals/list_signals_transposers_responses.go new file mode 100644 index 0000000..2baba3e --- /dev/null +++ b/client/signals/list_signals_transposers_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListSignalsTransposersReader is a Reader for the ListSignalsTransposers structure. +type ListSignalsTransposersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSignalsTransposersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSignalsTransposersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListSignalsTransposersOK creates a ListSignalsTransposersOK with default headers values +func NewListSignalsTransposersOK() *ListSignalsTransposersOK { + return &ListSignalsTransposersOK{} +} + +/* +ListSignalsTransposersOK describes a response with status code 200, with default header values. + +List all transposers for your organization +*/ +type ListSignalsTransposersOK struct { + Payload *models.SignalsAPITransposerListEntity +} + +// IsSuccess returns true when this list signals transposers o k response has a 2xx status code +func (o *ListSignalsTransposersOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list signals transposers o k response has a 3xx status code +func (o *ListSignalsTransposersOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list signals transposers o k response has a 4xx status code +func (o *ListSignalsTransposersOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list signals transposers o k response has a 5xx status code +func (o *ListSignalsTransposersOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list signals transposers o k response a status code equal to that given +func (o *ListSignalsTransposersOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListSignalsTransposersOK) Error() string { + return fmt.Sprintf("[GET /v1/signals/transposers][%d] listSignalsTransposersOK %+v", 200, o.Payload) +} + +func (o *ListSignalsTransposersOK) String() string { + return fmt.Sprintf("[GET /v1/signals/transposers][%d] listSignalsTransposersOK %+v", 200, o.Payload) +} + +func (o *ListSignalsTransposersOK) GetPayload() *models.SignalsAPITransposerListEntity { + return o.Payload +} + +func (o *ListSignalsTransposersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SignalsAPITransposerListEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/signals/list_signals_webhook_targets_parameters.go b/client/signals/list_signals_webhook_targets_parameters.go new file mode 100644 index 0000000..03b8d9e --- /dev/null +++ b/client/signals/list_signals_webhook_targets_parameters.go @@ -0,0 +1,230 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListSignalsWebhookTargetsParams creates a new ListSignalsWebhookTargetsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSignalsWebhookTargetsParams() *ListSignalsWebhookTargetsParams { + return &ListSignalsWebhookTargetsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSignalsWebhookTargetsParamsWithTimeout creates a new ListSignalsWebhookTargetsParams object +// with the ability to set a timeout on a request. +func NewListSignalsWebhookTargetsParamsWithTimeout(timeout time.Duration) *ListSignalsWebhookTargetsParams { + return &ListSignalsWebhookTargetsParams{ + timeout: timeout, + } +} + +// NewListSignalsWebhookTargetsParamsWithContext creates a new ListSignalsWebhookTargetsParams object +// with the ability to set a context for a request. +func NewListSignalsWebhookTargetsParamsWithContext(ctx context.Context) *ListSignalsWebhookTargetsParams { + return &ListSignalsWebhookTargetsParams{ + Context: ctx, + } +} + +// NewListSignalsWebhookTargetsParamsWithHTTPClient creates a new ListSignalsWebhookTargetsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSignalsWebhookTargetsParamsWithHTTPClient(client *http.Client) *ListSignalsWebhookTargetsParams { + return &ListSignalsWebhookTargetsParams{ + HTTPClient: client, + } +} + +/* +ListSignalsWebhookTargetsParams contains all the parameters to send to the API endpoint + + for the list signals webhook targets operation. + + Typically these are written to a http.Request. +*/ +type ListSignalsWebhookTargetsParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + A query string for searching through the list of webhook targets. + */ + Query *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list signals webhook targets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSignalsWebhookTargetsParams) WithDefaults() *ListSignalsWebhookTargetsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list signals webhook targets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSignalsWebhookTargetsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list signals webhook targets params +func (o *ListSignalsWebhookTargetsParams) WithTimeout(timeout time.Duration) *ListSignalsWebhookTargetsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list signals webhook targets params +func (o *ListSignalsWebhookTargetsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list signals webhook targets params +func (o *ListSignalsWebhookTargetsParams) WithContext(ctx context.Context) *ListSignalsWebhookTargetsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list signals webhook targets params +func (o *ListSignalsWebhookTargetsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list signals webhook targets params +func (o *ListSignalsWebhookTargetsParams) WithHTTPClient(client *http.Client) *ListSignalsWebhookTargetsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list signals webhook targets params +func (o *ListSignalsWebhookTargetsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list signals webhook targets params +func (o *ListSignalsWebhookTargetsParams) WithPage(page *int32) *ListSignalsWebhookTargetsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list signals webhook targets params +func (o *ListSignalsWebhookTargetsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list signals webhook targets params +func (o *ListSignalsWebhookTargetsParams) WithPerPage(perPage *int32) *ListSignalsWebhookTargetsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list signals webhook targets params +func (o *ListSignalsWebhookTargetsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list signals webhook targets params +func (o *ListSignalsWebhookTargetsParams) WithQuery(query *string) *ListSignalsWebhookTargetsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list signals webhook targets params +func (o *ListSignalsWebhookTargetsParams) SetQuery(query *string) { + o.Query = query +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSignalsWebhookTargetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/list_signals_webhook_targets_responses.go b/client/signals/list_signals_webhook_targets_responses.go new file mode 100644 index 0000000..b18eaab --- /dev/null +++ b/client/signals/list_signals_webhook_targets_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListSignalsWebhookTargetsReader is a Reader for the ListSignalsWebhookTargets structure. +type ListSignalsWebhookTargetsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSignalsWebhookTargetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSignalsWebhookTargetsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListSignalsWebhookTargetsOK creates a ListSignalsWebhookTargetsOK with default headers values +func NewListSignalsWebhookTargetsOK() *ListSignalsWebhookTargetsOK { + return &ListSignalsWebhookTargetsOK{} +} + +/* +ListSignalsWebhookTargetsOK describes a response with status code 200, with default header values. + +List all Signals webhook targets. +*/ +type ListSignalsWebhookTargetsOK struct { +} + +// IsSuccess returns true when this list signals webhook targets o k response has a 2xx status code +func (o *ListSignalsWebhookTargetsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list signals webhook targets o k response has a 3xx status code +func (o *ListSignalsWebhookTargetsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list signals webhook targets o k response has a 4xx status code +func (o *ListSignalsWebhookTargetsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list signals webhook targets o k response has a 5xx status code +func (o *ListSignalsWebhookTargetsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list signals webhook targets o k response a status code equal to that given +func (o *ListSignalsWebhookTargetsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListSignalsWebhookTargetsOK) Error() string { + return fmt.Sprintf("[GET /v1/signals/webhook_targets][%d] listSignalsWebhookTargetsOK ", 200) +} + +func (o *ListSignalsWebhookTargetsOK) String() string { + return fmt.Sprintf("[GET /v1/signals/webhook_targets][%d] listSignalsWebhookTargetsOK ", 200) +} + +func (o *ListSignalsWebhookTargetsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/list_team_escalation_policies_parameters.go b/client/signals/list_team_escalation_policies_parameters.go new file mode 100644 index 0000000..f233f0e --- /dev/null +++ b/client/signals/list_team_escalation_policies_parameters.go @@ -0,0 +1,249 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListTeamEscalationPoliciesParams creates a new ListTeamEscalationPoliciesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListTeamEscalationPoliciesParams() *ListTeamEscalationPoliciesParams { + return &ListTeamEscalationPoliciesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListTeamEscalationPoliciesParamsWithTimeout creates a new ListTeamEscalationPoliciesParams object +// with the ability to set a timeout on a request. +func NewListTeamEscalationPoliciesParamsWithTimeout(timeout time.Duration) *ListTeamEscalationPoliciesParams { + return &ListTeamEscalationPoliciesParams{ + timeout: timeout, + } +} + +// NewListTeamEscalationPoliciesParamsWithContext creates a new ListTeamEscalationPoliciesParams object +// with the ability to set a context for a request. +func NewListTeamEscalationPoliciesParamsWithContext(ctx context.Context) *ListTeamEscalationPoliciesParams { + return &ListTeamEscalationPoliciesParams{ + Context: ctx, + } +} + +// NewListTeamEscalationPoliciesParamsWithHTTPClient creates a new ListTeamEscalationPoliciesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListTeamEscalationPoliciesParamsWithHTTPClient(client *http.Client) *ListTeamEscalationPoliciesParams { + return &ListTeamEscalationPoliciesParams{ + HTTPClient: client, + } +} + +/* +ListTeamEscalationPoliciesParams contains all the parameters to send to the API endpoint + + for the list team escalation policies operation. + + Typically these are written to a http.Request. +*/ +type ListTeamEscalationPoliciesParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + A query string for searching through the list of escalation policies. + */ + Query *string + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list team escalation policies params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTeamEscalationPoliciesParams) WithDefaults() *ListTeamEscalationPoliciesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list team escalation policies params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTeamEscalationPoliciesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list team escalation policies params +func (o *ListTeamEscalationPoliciesParams) WithTimeout(timeout time.Duration) *ListTeamEscalationPoliciesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list team escalation policies params +func (o *ListTeamEscalationPoliciesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list team escalation policies params +func (o *ListTeamEscalationPoliciesParams) WithContext(ctx context.Context) *ListTeamEscalationPoliciesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list team escalation policies params +func (o *ListTeamEscalationPoliciesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list team escalation policies params +func (o *ListTeamEscalationPoliciesParams) WithHTTPClient(client *http.Client) *ListTeamEscalationPoliciesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list team escalation policies params +func (o *ListTeamEscalationPoliciesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list team escalation policies params +func (o *ListTeamEscalationPoliciesParams) WithPage(page *int32) *ListTeamEscalationPoliciesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list team escalation policies params +func (o *ListTeamEscalationPoliciesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list team escalation policies params +func (o *ListTeamEscalationPoliciesParams) WithPerPage(perPage *int32) *ListTeamEscalationPoliciesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list team escalation policies params +func (o *ListTeamEscalationPoliciesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list team escalation policies params +func (o *ListTeamEscalationPoliciesParams) WithQuery(query *string) *ListTeamEscalationPoliciesParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list team escalation policies params +func (o *ListTeamEscalationPoliciesParams) SetQuery(query *string) { + o.Query = query +} + +// WithTeamID adds the teamID to the list team escalation policies params +func (o *ListTeamEscalationPoliciesParams) WithTeamID(teamID string) *ListTeamEscalationPoliciesParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the list team escalation policies params +func (o *ListTeamEscalationPoliciesParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListTeamEscalationPoliciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/list_team_escalation_policies_responses.go b/client/signals/list_team_escalation_policies_responses.go new file mode 100644 index 0000000..39b93e8 --- /dev/null +++ b/client/signals/list_team_escalation_policies_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListTeamEscalationPoliciesReader is a Reader for the ListTeamEscalationPolicies structure. +type ListTeamEscalationPoliciesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListTeamEscalationPoliciesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListTeamEscalationPoliciesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListTeamEscalationPoliciesOK creates a ListTeamEscalationPoliciesOK with default headers values +func NewListTeamEscalationPoliciesOK() *ListTeamEscalationPoliciesOK { + return &ListTeamEscalationPoliciesOK{} +} + +/* +ListTeamEscalationPoliciesOK describes a response with status code 200, with default header values. + +List all Signals escalation policies for a team. +*/ +type ListTeamEscalationPoliciesOK struct { +} + +// IsSuccess returns true when this list team escalation policies o k response has a 2xx status code +func (o *ListTeamEscalationPoliciesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list team escalation policies o k response has a 3xx status code +func (o *ListTeamEscalationPoliciesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list team escalation policies o k response has a 4xx status code +func (o *ListTeamEscalationPoliciesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list team escalation policies o k response has a 5xx status code +func (o *ListTeamEscalationPoliciesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list team escalation policies o k response a status code equal to that given +func (o *ListTeamEscalationPoliciesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListTeamEscalationPoliciesOK) Error() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}/escalation_policies][%d] listTeamEscalationPoliciesOK ", 200) +} + +func (o *ListTeamEscalationPoliciesOK) String() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}/escalation_policies][%d] listTeamEscalationPoliciesOK ", 200) +} + +func (o *ListTeamEscalationPoliciesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/list_team_on_call_schedules_parameters.go b/client/signals/list_team_on_call_schedules_parameters.go new file mode 100644 index 0000000..36dd785 --- /dev/null +++ b/client/signals/list_team_on_call_schedules_parameters.go @@ -0,0 +1,249 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListTeamOnCallSchedulesParams creates a new ListTeamOnCallSchedulesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListTeamOnCallSchedulesParams() *ListTeamOnCallSchedulesParams { + return &ListTeamOnCallSchedulesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListTeamOnCallSchedulesParamsWithTimeout creates a new ListTeamOnCallSchedulesParams object +// with the ability to set a timeout on a request. +func NewListTeamOnCallSchedulesParamsWithTimeout(timeout time.Duration) *ListTeamOnCallSchedulesParams { + return &ListTeamOnCallSchedulesParams{ + timeout: timeout, + } +} + +// NewListTeamOnCallSchedulesParamsWithContext creates a new ListTeamOnCallSchedulesParams object +// with the ability to set a context for a request. +func NewListTeamOnCallSchedulesParamsWithContext(ctx context.Context) *ListTeamOnCallSchedulesParams { + return &ListTeamOnCallSchedulesParams{ + Context: ctx, + } +} + +// NewListTeamOnCallSchedulesParamsWithHTTPClient creates a new ListTeamOnCallSchedulesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListTeamOnCallSchedulesParamsWithHTTPClient(client *http.Client) *ListTeamOnCallSchedulesParams { + return &ListTeamOnCallSchedulesParams{ + HTTPClient: client, + } +} + +/* +ListTeamOnCallSchedulesParams contains all the parameters to send to the API endpoint + + for the list team on call schedules operation. + + Typically these are written to a http.Request. +*/ +type ListTeamOnCallSchedulesParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + A query string for searching through the list of on-call schedules. + */ + Query *string + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list team on call schedules params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTeamOnCallSchedulesParams) WithDefaults() *ListTeamOnCallSchedulesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list team on call schedules params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTeamOnCallSchedulesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list team on call schedules params +func (o *ListTeamOnCallSchedulesParams) WithTimeout(timeout time.Duration) *ListTeamOnCallSchedulesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list team on call schedules params +func (o *ListTeamOnCallSchedulesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list team on call schedules params +func (o *ListTeamOnCallSchedulesParams) WithContext(ctx context.Context) *ListTeamOnCallSchedulesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list team on call schedules params +func (o *ListTeamOnCallSchedulesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list team on call schedules params +func (o *ListTeamOnCallSchedulesParams) WithHTTPClient(client *http.Client) *ListTeamOnCallSchedulesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list team on call schedules params +func (o *ListTeamOnCallSchedulesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list team on call schedules params +func (o *ListTeamOnCallSchedulesParams) WithPage(page *int32) *ListTeamOnCallSchedulesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list team on call schedules params +func (o *ListTeamOnCallSchedulesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list team on call schedules params +func (o *ListTeamOnCallSchedulesParams) WithPerPage(perPage *int32) *ListTeamOnCallSchedulesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list team on call schedules params +func (o *ListTeamOnCallSchedulesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list team on call schedules params +func (o *ListTeamOnCallSchedulesParams) WithQuery(query *string) *ListTeamOnCallSchedulesParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list team on call schedules params +func (o *ListTeamOnCallSchedulesParams) SetQuery(query *string) { + o.Query = query +} + +// WithTeamID adds the teamID to the list team on call schedules params +func (o *ListTeamOnCallSchedulesParams) WithTeamID(teamID string) *ListTeamOnCallSchedulesParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the list team on call schedules params +func (o *ListTeamOnCallSchedulesParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListTeamOnCallSchedulesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/list_team_on_call_schedules_responses.go b/client/signals/list_team_on_call_schedules_responses.go new file mode 100644 index 0000000..e306a1c --- /dev/null +++ b/client/signals/list_team_on_call_schedules_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListTeamOnCallSchedulesReader is a Reader for the ListTeamOnCallSchedules structure. +type ListTeamOnCallSchedulesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListTeamOnCallSchedulesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListTeamOnCallSchedulesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListTeamOnCallSchedulesOK creates a ListTeamOnCallSchedulesOK with default headers values +func NewListTeamOnCallSchedulesOK() *ListTeamOnCallSchedulesOK { + return &ListTeamOnCallSchedulesOK{} +} + +/* +ListTeamOnCallSchedulesOK describes a response with status code 200, with default header values. + +List all Signals on-call schedules for a team. +*/ +type ListTeamOnCallSchedulesOK struct { +} + +// IsSuccess returns true when this list team on call schedules o k response has a 2xx status code +func (o *ListTeamOnCallSchedulesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list team on call schedules o k response has a 3xx status code +func (o *ListTeamOnCallSchedulesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list team on call schedules o k response has a 4xx status code +func (o *ListTeamOnCallSchedulesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list team on call schedules o k response has a 5xx status code +func (o *ListTeamOnCallSchedulesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list team on call schedules o k response a status code equal to that given +func (o *ListTeamOnCallSchedulesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListTeamOnCallSchedulesOK) Error() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}/on_call_schedules][%d] listTeamOnCallSchedulesOK ", 200) +} + +func (o *ListTeamOnCallSchedulesOK) String() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}/on_call_schedules][%d] listTeamOnCallSchedulesOK ", 200) +} + +func (o *ListTeamOnCallSchedulesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/list_team_signal_rules_parameters.go b/client/signals/list_team_signal_rules_parameters.go new file mode 100644 index 0000000..41ede84 --- /dev/null +++ b/client/signals/list_team_signal_rules_parameters.go @@ -0,0 +1,249 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListTeamSignalRulesParams creates a new ListTeamSignalRulesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListTeamSignalRulesParams() *ListTeamSignalRulesParams { + return &ListTeamSignalRulesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListTeamSignalRulesParamsWithTimeout creates a new ListTeamSignalRulesParams object +// with the ability to set a timeout on a request. +func NewListTeamSignalRulesParamsWithTimeout(timeout time.Duration) *ListTeamSignalRulesParams { + return &ListTeamSignalRulesParams{ + timeout: timeout, + } +} + +// NewListTeamSignalRulesParamsWithContext creates a new ListTeamSignalRulesParams object +// with the ability to set a context for a request. +func NewListTeamSignalRulesParamsWithContext(ctx context.Context) *ListTeamSignalRulesParams { + return &ListTeamSignalRulesParams{ + Context: ctx, + } +} + +// NewListTeamSignalRulesParamsWithHTTPClient creates a new ListTeamSignalRulesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListTeamSignalRulesParamsWithHTTPClient(client *http.Client) *ListTeamSignalRulesParams { + return &ListTeamSignalRulesParams{ + HTTPClient: client, + } +} + +/* +ListTeamSignalRulesParams contains all the parameters to send to the API endpoint + + for the list team signal rules operation. + + Typically these are written to a http.Request. +*/ +type ListTeamSignalRulesParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + A query string for searching through the list of alerting rules. + */ + Query *string + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list team signal rules params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTeamSignalRulesParams) WithDefaults() *ListTeamSignalRulesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list team signal rules params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTeamSignalRulesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list team signal rules params +func (o *ListTeamSignalRulesParams) WithTimeout(timeout time.Duration) *ListTeamSignalRulesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list team signal rules params +func (o *ListTeamSignalRulesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list team signal rules params +func (o *ListTeamSignalRulesParams) WithContext(ctx context.Context) *ListTeamSignalRulesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list team signal rules params +func (o *ListTeamSignalRulesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list team signal rules params +func (o *ListTeamSignalRulesParams) WithHTTPClient(client *http.Client) *ListTeamSignalRulesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list team signal rules params +func (o *ListTeamSignalRulesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list team signal rules params +func (o *ListTeamSignalRulesParams) WithPage(page *int32) *ListTeamSignalRulesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list team signal rules params +func (o *ListTeamSignalRulesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list team signal rules params +func (o *ListTeamSignalRulesParams) WithPerPage(perPage *int32) *ListTeamSignalRulesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list team signal rules params +func (o *ListTeamSignalRulesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list team signal rules params +func (o *ListTeamSignalRulesParams) WithQuery(query *string) *ListTeamSignalRulesParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list team signal rules params +func (o *ListTeamSignalRulesParams) SetQuery(query *string) { + o.Query = query +} + +// WithTeamID adds the teamID to the list team signal rules params +func (o *ListTeamSignalRulesParams) WithTeamID(teamID string) *ListTeamSignalRulesParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the list team signal rules params +func (o *ListTeamSignalRulesParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListTeamSignalRulesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/list_team_signal_rules_responses.go b/client/signals/list_team_signal_rules_responses.go new file mode 100644 index 0000000..4fa5d73 --- /dev/null +++ b/client/signals/list_team_signal_rules_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListTeamSignalRulesReader is a Reader for the ListTeamSignalRules structure. +type ListTeamSignalRulesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListTeamSignalRulesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListTeamSignalRulesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListTeamSignalRulesOK creates a ListTeamSignalRulesOK with default headers values +func NewListTeamSignalRulesOK() *ListTeamSignalRulesOK { + return &ListTeamSignalRulesOK{} +} + +/* +ListTeamSignalRulesOK describes a response with status code 200, with default header values. + +List all Signals rules for a team. +*/ +type ListTeamSignalRulesOK struct { +} + +// IsSuccess returns true when this list team signal rules o k response has a 2xx status code +func (o *ListTeamSignalRulesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list team signal rules o k response has a 3xx status code +func (o *ListTeamSignalRulesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list team signal rules o k response has a 4xx status code +func (o *ListTeamSignalRulesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list team signal rules o k response has a 5xx status code +func (o *ListTeamSignalRulesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list team signal rules o k response a status code equal to that given +func (o *ListTeamSignalRulesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListTeamSignalRulesOK) Error() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}/signal_rules][%d] listTeamSignalRulesOK ", 200) +} + +func (o *ListTeamSignalRulesOK) String() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}/signal_rules][%d] listTeamSignalRulesOK ", 200) +} + +func (o *ListTeamSignalRulesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/signals_client.go b/client/signals/signals_client.go index cf805c4..1c355fb 100644 --- a/client/signals/signals_client.go +++ b/client/signals/signals_client.go @@ -30,96 +30,96 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1SignalsEmailTargetsID(params *DeleteV1SignalsEmailTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SignalsEmailTargetsIDNoContent, error) + CreateOnCallShift(params *CreateOnCallShiftParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOnCallShiftCreated, error) - DeleteV1SignalsWebhookTargetsID(params *DeleteV1SignalsWebhookTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SignalsWebhookTargetsIDNoContent, error) + CreateSignalsEmailTarget(params *CreateSignalsEmailTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSignalsEmailTargetCreated, error) - DeleteV1TeamsTeamIDEscalationPoliciesID(params *DeleteV1TeamsTeamIDEscalationPoliciesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TeamsTeamIDEscalationPoliciesIDNoContent, error) + CreateSignalsWebhookTarget(params *CreateSignalsWebhookTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSignalsWebhookTargetCreated, error) - DeleteV1TeamsTeamIDOnCallSchedulesScheduleID(params *DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDNoContent, error) + CreateTeamEscalationPolicy(params *CreateTeamEscalationPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTeamEscalationPolicyCreated, error) - DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID(params *DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDNoContent, error) + CreateTeamOnCallSchedule(params *CreateTeamOnCallScheduleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTeamOnCallScheduleCreated, error) - DeleteV1TeamsTeamIDSignalRulesID(params *DeleteV1TeamsTeamIDSignalRulesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TeamsTeamIDSignalRulesIDNoContent, error) + CreateTeamSignalRule(params *CreateTeamSignalRuleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTeamSignalRuleCreated, error) - GetV1SignalsEmailTargets(params *GetV1SignalsEmailTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsEmailTargetsOK, error) + DebugSignalsExpression(params *DebugSignalsExpressionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DebugSignalsExpressionCreated, error) - GetV1SignalsEmailTargetsID(params *GetV1SignalsEmailTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsEmailTargetsIDOK, error) + DeleteOnCallShift(params *DeleteOnCallShiftParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOnCallShiftNoContent, error) - GetV1SignalsEventSources(params *GetV1SignalsEventSourcesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsEventSourcesOK, error) + DeleteSignalsEmailTarget(params *DeleteSignalsEmailTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSignalsEmailTargetNoContent, error) - GetV1SignalsIngestURL(params *GetV1SignalsIngestURLParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsIngestURLOK, error) + DeleteSignalsWebhookTarget(params *DeleteSignalsWebhookTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSignalsWebhookTargetNoContent, error) - GetV1SignalsOnCall(params *GetV1SignalsOnCallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsOnCallOK, error) + DeleteTeamEscalationPolicy(params *DeleteTeamEscalationPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTeamEscalationPolicyNoContent, error) - GetV1SignalsTransposers(params *GetV1SignalsTransposersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsTransposersOK, error) + DeleteTeamOnCallSchedule(params *DeleteTeamOnCallScheduleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTeamOnCallScheduleNoContent, error) - GetV1SignalsWebhookTargets(params *GetV1SignalsWebhookTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsWebhookTargetsOK, error) + DeleteTeamSignalRule(params *DeleteTeamSignalRuleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTeamSignalRuleNoContent, error) - GetV1SignalsWebhookTargetsID(params *GetV1SignalsWebhookTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsWebhookTargetsIDOK, error) + GetOnCallShift(params *GetOnCallShiftParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOnCallShiftOK, error) - GetV1TeamsTeamIDEscalationPolicies(params *GetV1TeamsTeamIDEscalationPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDEscalationPoliciesOK, error) + GetSignalsEmailTarget(params *GetSignalsEmailTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSignalsEmailTargetOK, error) - GetV1TeamsTeamIDEscalationPoliciesID(params *GetV1TeamsTeamIDEscalationPoliciesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDEscalationPoliciesIDOK, error) + GetSignalsIngestURL(params *GetSignalsIngestURLParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSignalsIngestURLOK, error) - GetV1TeamsTeamIDOnCallSchedules(params *GetV1TeamsTeamIDOnCallSchedulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDOnCallSchedulesOK, error) + GetSignalsWebhookTarget(params *GetSignalsWebhookTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSignalsWebhookTargetOK, error) - GetV1TeamsTeamIDOnCallSchedulesScheduleID(params *GetV1TeamsTeamIDOnCallSchedulesScheduleIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDOnCallSchedulesScheduleIDOK, error) + GetTeamEscalationPolicy(params *GetTeamEscalationPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTeamEscalationPolicyOK, error) - GetV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID(params *GetV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDOK, error) + GetTeamOnCallSchedule(params *GetTeamOnCallScheduleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTeamOnCallScheduleOK, error) - GetV1TeamsTeamIDSignalRules(params *GetV1TeamsTeamIDSignalRulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDSignalRulesOK, error) + GetTeamSignalRule(params *GetTeamSignalRuleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTeamSignalRuleOK, error) - GetV1TeamsTeamIDSignalRulesID(params *GetV1TeamsTeamIDSignalRulesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDSignalRulesIDOK, error) + ListOrganizationOnCallSchedules(params *ListOrganizationOnCallSchedulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListOrganizationOnCallSchedulesOK, error) - PatchV1SignalsEmailTargetsID(params *PatchV1SignalsEmailTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SignalsEmailTargetsIDOK, error) + ListSignalsEmailTargets(params *ListSignalsEmailTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSignalsEmailTargetsOK, error) - PatchV1SignalsWebhookTargetsID(params *PatchV1SignalsWebhookTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SignalsWebhookTargetsIDOK, error) + ListSignalsEventSources(params *ListSignalsEventSourcesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSignalsEventSourcesOK, error) - PatchV1TeamsTeamIDEscalationPoliciesID(params *PatchV1TeamsTeamIDEscalationPoliciesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TeamsTeamIDEscalationPoliciesIDOK, error) + ListSignalsTransposers(params *ListSignalsTransposersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSignalsTransposersOK, error) - PatchV1TeamsTeamIDOnCallSchedulesScheduleID(params *PatchV1TeamsTeamIDOnCallSchedulesScheduleIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TeamsTeamIDOnCallSchedulesScheduleIDOK, error) + ListSignalsWebhookTargets(params *ListSignalsWebhookTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSignalsWebhookTargetsOK, error) - PatchV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID(params *PatchV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDOK, error) + ListTeamEscalationPolicies(params *ListTeamEscalationPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTeamEscalationPoliciesOK, error) - PatchV1TeamsTeamIDSignalRulesID(params *PatchV1TeamsTeamIDSignalRulesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TeamsTeamIDSignalRulesIDOK, error) + ListTeamOnCallSchedules(params *ListTeamOnCallSchedulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTeamOnCallSchedulesOK, error) - PostV1SignalsDebugger(params *PostV1SignalsDebuggerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SignalsDebuggerCreated, error) + ListTeamSignalRules(params *ListTeamSignalRulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTeamSignalRulesOK, error) - PostV1SignalsEmailTargets(params *PostV1SignalsEmailTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SignalsEmailTargetsCreated, error) + UpdateOnCallShift(params *UpdateOnCallShiftParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateOnCallShiftOK, error) - PostV1SignalsWebhookTargets(params *PostV1SignalsWebhookTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SignalsWebhookTargetsCreated, error) + UpdateSignalsEmailTarget(params *UpdateSignalsEmailTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSignalsEmailTargetOK, error) - PostV1TeamsTeamIDEscalationPolicies(params *PostV1TeamsTeamIDEscalationPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TeamsTeamIDEscalationPoliciesCreated, error) + UpdateSignalsWebhookTarget(params *UpdateSignalsWebhookTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSignalsWebhookTargetOK, error) - PostV1TeamsTeamIDOnCallSchedules(params *PostV1TeamsTeamIDOnCallSchedulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TeamsTeamIDOnCallSchedulesCreated, error) + UpdateTeamEscalationPolicy(params *UpdateTeamEscalationPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTeamEscalationPolicyOK, error) - PostV1TeamsTeamIDOnCallSchedulesScheduleIDShifts(params *PostV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsCreated, error) + UpdateTeamOnCallSchedule(params *UpdateTeamOnCallScheduleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTeamOnCallScheduleOK, error) - PostV1TeamsTeamIDSignalRules(params *PostV1TeamsTeamIDSignalRulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TeamsTeamIDSignalRulesCreated, error) + UpdateTeamSignalRule(params *UpdateTeamSignalRuleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTeamSignalRuleOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1SignalsEmailTargetsID deletes a signal email target +CreateOnCallShift creates a shift for an on call schedule -Delete a Signals email target by ID +Create a Signals on-call shift in a schedule. */ -func (a *Client) DeleteV1SignalsEmailTargetsID(params *DeleteV1SignalsEmailTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SignalsEmailTargetsIDNoContent, error) { +func (a *Client) CreateOnCallShift(params *CreateOnCallShiftParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOnCallShiftCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1SignalsEmailTargetsIDParams() + params = NewCreateOnCallShiftParams() } op := &runtime.ClientOperation{ - ID: "deleteV1SignalsEmailTargetsId", - Method: "DELETE", - PathPattern: "/v1/signals/email_targets/{id}", + ID: "create_on_call_shift", + Method: "POST", + PathPattern: "/v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1SignalsEmailTargetsIDReader{formats: a.formats}, + Reader: &CreateOnCallShiftReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -132,35 +132,35 @@ func (a *Client) DeleteV1SignalsEmailTargetsID(params *DeleteV1SignalsEmailTarge if err != nil { return nil, err } - success, ok := result.(*DeleteV1SignalsEmailTargetsIDNoContent) + success, ok := result.(*CreateOnCallShiftCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1SignalsEmailTargetsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_on_call_shift: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1SignalsWebhookTargetsID deletes a webhook target +CreateSignalsEmailTarget creates an email target for signals -Delete a Signals webhook target by ID +Create a Signals email target for a team. */ -func (a *Client) DeleteV1SignalsWebhookTargetsID(params *DeleteV1SignalsWebhookTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1SignalsWebhookTargetsIDNoContent, error) { +func (a *Client) CreateSignalsEmailTarget(params *CreateSignalsEmailTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSignalsEmailTargetCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1SignalsWebhookTargetsIDParams() + params = NewCreateSignalsEmailTargetParams() } op := &runtime.ClientOperation{ - ID: "deleteV1SignalsWebhookTargetsId", - Method: "DELETE", - PathPattern: "/v1/signals/webhook_targets/{id}", + ID: "create_signals_email_target", + Method: "POST", + PathPattern: "/v1/signals/email_targets", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1SignalsWebhookTargetsIDReader{formats: a.formats}, + Reader: &CreateSignalsEmailTargetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -173,35 +173,35 @@ func (a *Client) DeleteV1SignalsWebhookTargetsID(params *DeleteV1SignalsWebhookT if err != nil { return nil, err } - success, ok := result.(*DeleteV1SignalsWebhookTargetsIDNoContent) + success, ok := result.(*CreateSignalsEmailTargetCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1SignalsWebhookTargetsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_signals_email_target: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1TeamsTeamIDEscalationPoliciesID deletes an escalation policy for a team +CreateSignalsWebhookTarget creates a webhook target -Delete a Signals escalation policy by ID +Create a Signals webhook target. */ -func (a *Client) DeleteV1TeamsTeamIDEscalationPoliciesID(params *DeleteV1TeamsTeamIDEscalationPoliciesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TeamsTeamIDEscalationPoliciesIDNoContent, error) { +func (a *Client) CreateSignalsWebhookTarget(params *CreateSignalsWebhookTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSignalsWebhookTargetCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1TeamsTeamIDEscalationPoliciesIDParams() + params = NewCreateSignalsWebhookTargetParams() } op := &runtime.ClientOperation{ - ID: "deleteV1TeamsTeamIdEscalationPoliciesId", - Method: "DELETE", - PathPattern: "/v1/teams/{team_id}/escalation_policies/{id}", + ID: "create_signals_webhook_target", + Method: "POST", + PathPattern: "/v1/signals/webhook_targets", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1TeamsTeamIDEscalationPoliciesIDReader{formats: a.formats}, + Reader: &CreateSignalsWebhookTargetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -214,35 +214,35 @@ func (a *Client) DeleteV1TeamsTeamIDEscalationPoliciesID(params *DeleteV1TeamsTe if err != nil { return nil, err } - success, ok := result.(*DeleteV1TeamsTeamIDEscalationPoliciesIDNoContent) + success, ok := result.(*CreateSignalsWebhookTargetCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1TeamsTeamIdEscalationPoliciesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_signals_webhook_target: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1TeamsTeamIDOnCallSchedulesScheduleID deletes an on call schedule for a team +CreateTeamEscalationPolicy creates an escalation policy for a team -Delete a Signals on-call schedule by ID +Create a Signals escalation policy for a team. */ -func (a *Client) DeleteV1TeamsTeamIDOnCallSchedulesScheduleID(params *DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDNoContent, error) { +func (a *Client) CreateTeamEscalationPolicy(params *CreateTeamEscalationPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTeamEscalationPolicyCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1TeamsTeamIDOnCallSchedulesScheduleIDParams() + params = NewCreateTeamEscalationPolicyParams() } op := &runtime.ClientOperation{ - ID: "deleteV1TeamsTeamIdOnCallSchedulesScheduleId", - Method: "DELETE", - PathPattern: "/v1/teams/{team_id}/on_call_schedules/{schedule_id}", + ID: "create_team_escalation_policy", + Method: "POST", + PathPattern: "/v1/teams/{team_id}/escalation_policies", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDReader{formats: a.formats}, + Reader: &CreateTeamEscalationPolicyReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -255,35 +255,35 @@ func (a *Client) DeleteV1TeamsTeamIDOnCallSchedulesScheduleID(params *DeleteV1Te if err != nil { return nil, err } - success, ok := result.(*DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDNoContent) + success, ok := result.(*CreateTeamEscalationPolicyCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1TeamsTeamIdOnCallSchedulesScheduleId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_team_escalation_policy: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID deletes an on call shift from a team schedule +CreateTeamOnCallSchedule creates an on call schedule for a team -Delete a Signals on-call shift by ID +Create a Signals on-call schedule for a team. */ -func (a *Client) DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID(params *DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDNoContent, error) { +func (a *Client) CreateTeamOnCallSchedule(params *CreateTeamOnCallScheduleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTeamOnCallScheduleCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDParams() + params = NewCreateTeamOnCallScheduleParams() } op := &runtime.ClientOperation{ - ID: "deleteV1TeamsTeamIdOnCallSchedulesScheduleIdShiftsId", - Method: "DELETE", - PathPattern: "/v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts/{id}", + ID: "create_team_on_call_schedule", + Method: "POST", + PathPattern: "/v1/teams/{team_id}/on_call_schedules", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDReader{formats: a.formats}, + Reader: &CreateTeamOnCallScheduleReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -296,35 +296,35 @@ func (a *Client) DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID(params *De if err != nil { return nil, err } - success, ok := result.(*DeleteV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDNoContent) + success, ok := result.(*CreateTeamOnCallScheduleCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1TeamsTeamIdOnCallSchedulesScheduleIdShiftsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_team_on_call_schedule: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1TeamsTeamIDSignalRulesID deletes a signals rule +CreateTeamSignalRule creates a signals rule -Delete a Signals rule by ID +Create a Signals rule for a team. */ -func (a *Client) DeleteV1TeamsTeamIDSignalRulesID(params *DeleteV1TeamsTeamIDSignalRulesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TeamsTeamIDSignalRulesIDNoContent, error) { +func (a *Client) CreateTeamSignalRule(params *CreateTeamSignalRuleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTeamSignalRuleCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1TeamsTeamIDSignalRulesIDParams() + params = NewCreateTeamSignalRuleParams() } op := &runtime.ClientOperation{ - ID: "deleteV1TeamsTeamIdSignalRulesId", - Method: "DELETE", - PathPattern: "/v1/teams/{team_id}/signal_rules/{id}", + ID: "create_team_signal_rule", + Method: "POST", + PathPattern: "/v1/teams/{team_id}/signal_rules", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1TeamsTeamIDSignalRulesIDReader{formats: a.formats}, + Reader: &CreateTeamSignalRuleReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -337,35 +337,35 @@ func (a *Client) DeleteV1TeamsTeamIDSignalRulesID(params *DeleteV1TeamsTeamIDSig if err != nil { return nil, err } - success, ok := result.(*DeleteV1TeamsTeamIDSignalRulesIDNoContent) + success, ok := result.(*CreateTeamSignalRuleCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1TeamsTeamIdSignalRulesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_team_signal_rule: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SignalsEmailTargets lists email targets for signals +DebugSignalsExpression debugs signals expressions -List all Signals email targets for a team. +Debug Signals expressions */ -func (a *Client) GetV1SignalsEmailTargets(params *GetV1SignalsEmailTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsEmailTargetsOK, error) { +func (a *Client) DebugSignalsExpression(params *DebugSignalsExpressionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DebugSignalsExpressionCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SignalsEmailTargetsParams() + params = NewDebugSignalsExpressionParams() } op := &runtime.ClientOperation{ - ID: "getV1SignalsEmailTargets", - Method: "GET", - PathPattern: "/v1/signals/email_targets", + ID: "debug_signals_expression", + Method: "POST", + PathPattern: "/v1/signals/debugger", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SignalsEmailTargetsReader{formats: a.formats}, + Reader: &DebugSignalsExpressionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -378,35 +378,35 @@ func (a *Client) GetV1SignalsEmailTargets(params *GetV1SignalsEmailTargetsParams if err != nil { return nil, err } - success, ok := result.(*GetV1SignalsEmailTargetsOK) + success, ok := result.(*DebugSignalsExpressionCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SignalsEmailTargets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for debug_signals_expression: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SignalsEmailTargetsID gets a signal email target +DeleteOnCallShift deletes an on call shift from a team schedule -Get a Signals email target by ID +Delete a Signals on-call shift by ID */ -func (a *Client) GetV1SignalsEmailTargetsID(params *GetV1SignalsEmailTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsEmailTargetsIDOK, error) { +func (a *Client) DeleteOnCallShift(params *DeleteOnCallShiftParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOnCallShiftNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SignalsEmailTargetsIDParams() + params = NewDeleteOnCallShiftParams() } op := &runtime.ClientOperation{ - ID: "getV1SignalsEmailTargetsId", - Method: "GET", - PathPattern: "/v1/signals/email_targets/{id}", + ID: "delete_on_call_shift", + Method: "DELETE", + PathPattern: "/v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SignalsEmailTargetsIDReader{formats: a.formats}, + Reader: &DeleteOnCallShiftReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -419,35 +419,35 @@ func (a *Client) GetV1SignalsEmailTargetsID(params *GetV1SignalsEmailTargetsIDPa if err != nil { return nil, err } - success, ok := result.(*GetV1SignalsEmailTargetsIDOK) + success, ok := result.(*DeleteOnCallShiftNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SignalsEmailTargetsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_on_call_shift: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SignalsEventSources lists event sources for signals +DeleteSignalsEmailTarget deletes a signal email target -List all Signals event sources for the authenticated user. +Delete a Signals email target by ID */ -func (a *Client) GetV1SignalsEventSources(params *GetV1SignalsEventSourcesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsEventSourcesOK, error) { +func (a *Client) DeleteSignalsEmailTarget(params *DeleteSignalsEmailTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSignalsEmailTargetNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SignalsEventSourcesParams() + params = NewDeleteSignalsEmailTargetParams() } op := &runtime.ClientOperation{ - ID: "getV1SignalsEventSources", - Method: "GET", - PathPattern: "/v1/signals/event_sources", + ID: "delete_signals_email_target", + Method: "DELETE", + PathPattern: "/v1/signals/email_targets/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SignalsEventSourcesReader{formats: a.formats}, + Reader: &DeleteSignalsEmailTargetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -460,35 +460,35 @@ func (a *Client) GetV1SignalsEventSources(params *GetV1SignalsEventSourcesParams if err != nil { return nil, err } - success, ok := result.(*GetV1SignalsEventSourcesOK) + success, ok := result.(*DeleteSignalsEmailTargetNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SignalsEventSources: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_signals_email_target: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SignalsIngestURL gets the signals ingestion URL +DeleteSignalsWebhookTarget deletes a webhook target -Retrieve the url for ingesting signals for your organization +Delete a Signals webhook target by ID */ -func (a *Client) GetV1SignalsIngestURL(params *GetV1SignalsIngestURLParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsIngestURLOK, error) { +func (a *Client) DeleteSignalsWebhookTarget(params *DeleteSignalsWebhookTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSignalsWebhookTargetNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SignalsIngestURLParams() + params = NewDeleteSignalsWebhookTargetParams() } op := &runtime.ClientOperation{ - ID: "getV1SignalsIngestUrl", - Method: "GET", - PathPattern: "/v1/signals/ingest_url", + ID: "delete_signals_webhook_target", + Method: "DELETE", + PathPattern: "/v1/signals/webhook_targets/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SignalsIngestURLReader{formats: a.formats}, + Reader: &DeleteSignalsWebhookTargetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -501,35 +501,35 @@ func (a *Client) GetV1SignalsIngestURL(params *GetV1SignalsIngestURLParams, auth if err != nil { return nil, err } - success, ok := result.(*GetV1SignalsIngestURLOK) + success, ok := result.(*DeleteSignalsWebhookTargetNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SignalsIngestUrl: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_signals_webhook_target: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SignalsOnCall lists on call schedules +DeleteTeamEscalationPolicy deletes an escalation policy for a team -List all Signals on-call schedules for the entire organization. +Delete a Signals escalation policy by ID */ -func (a *Client) GetV1SignalsOnCall(params *GetV1SignalsOnCallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsOnCallOK, error) { +func (a *Client) DeleteTeamEscalationPolicy(params *DeleteTeamEscalationPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTeamEscalationPolicyNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SignalsOnCallParams() + params = NewDeleteTeamEscalationPolicyParams() } op := &runtime.ClientOperation{ - ID: "getV1SignalsOnCall", - Method: "GET", - PathPattern: "/v1/signals_on_call", + ID: "delete_team_escalation_policy", + Method: "DELETE", + PathPattern: "/v1/teams/{team_id}/escalation_policies/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SignalsOnCallReader{formats: a.formats}, + Reader: &DeleteTeamEscalationPolicyReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -542,35 +542,35 @@ func (a *Client) GetV1SignalsOnCall(params *GetV1SignalsOnCallParams, authInfo r if err != nil { return nil, err } - success, ok := result.(*GetV1SignalsOnCallOK) + success, ok := result.(*DeleteTeamEscalationPolicyNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SignalsOnCall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_team_escalation_policy: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SignalsTransposers lists signal transposers +DeleteTeamOnCallSchedule deletes an on call schedule for a team -List all transposers for your organization +Delete a Signals on-call schedule by ID */ -func (a *Client) GetV1SignalsTransposers(params *GetV1SignalsTransposersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsTransposersOK, error) { +func (a *Client) DeleteTeamOnCallSchedule(params *DeleteTeamOnCallScheduleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTeamOnCallScheduleNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SignalsTransposersParams() + params = NewDeleteTeamOnCallScheduleParams() } op := &runtime.ClientOperation{ - ID: "getV1SignalsTransposers", - Method: "GET", - PathPattern: "/v1/signals/transposers", + ID: "delete_team_on_call_schedule", + Method: "DELETE", + PathPattern: "/v1/teams/{team_id}/on_call_schedules/{schedule_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SignalsTransposersReader{formats: a.formats}, + Reader: &DeleteTeamOnCallScheduleReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -583,35 +583,35 @@ func (a *Client) GetV1SignalsTransposers(params *GetV1SignalsTransposersParams, if err != nil { return nil, err } - success, ok := result.(*GetV1SignalsTransposersOK) + success, ok := result.(*DeleteTeamOnCallScheduleNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SignalsTransposers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_team_on_call_schedule: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SignalsWebhookTargets lists webhook targets +DeleteTeamSignalRule deletes a signals rule -List all Signals webhook targets. +Delete a Signals rule by ID */ -func (a *Client) GetV1SignalsWebhookTargets(params *GetV1SignalsWebhookTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsWebhookTargetsOK, error) { +func (a *Client) DeleteTeamSignalRule(params *DeleteTeamSignalRuleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTeamSignalRuleNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SignalsWebhookTargetsParams() + params = NewDeleteTeamSignalRuleParams() } op := &runtime.ClientOperation{ - ID: "getV1SignalsWebhookTargets", - Method: "GET", - PathPattern: "/v1/signals/webhook_targets", + ID: "delete_team_signal_rule", + Method: "DELETE", + PathPattern: "/v1/teams/{team_id}/signal_rules/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SignalsWebhookTargetsReader{formats: a.formats}, + Reader: &DeleteTeamSignalRuleReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -624,35 +624,35 @@ func (a *Client) GetV1SignalsWebhookTargets(params *GetV1SignalsWebhookTargetsPa if err != nil { return nil, err } - success, ok := result.(*GetV1SignalsWebhookTargetsOK) + success, ok := result.(*DeleteTeamSignalRuleNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SignalsWebhookTargets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_team_signal_rule: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1SignalsWebhookTargetsID gets a webhook target +GetOnCallShift gets an on call shift for a team schedule -Get a Signals webhook target by ID +Get a Signals on-call shift by ID */ -func (a *Client) GetV1SignalsWebhookTargetsID(params *GetV1SignalsWebhookTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SignalsWebhookTargetsIDOK, error) { +func (a *Client) GetOnCallShift(params *GetOnCallShiftParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOnCallShiftOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SignalsWebhookTargetsIDParams() + params = NewGetOnCallShiftParams() } op := &runtime.ClientOperation{ - ID: "getV1SignalsWebhookTargetsId", + ID: "get_on_call_shift", Method: "GET", - PathPattern: "/v1/signals/webhook_targets/{id}", + PathPattern: "/v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SignalsWebhookTargetsIDReader{formats: a.formats}, + Reader: &GetOnCallShiftReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -665,35 +665,35 @@ func (a *Client) GetV1SignalsWebhookTargetsID(params *GetV1SignalsWebhookTargets if err != nil { return nil, err } - success, ok := result.(*GetV1SignalsWebhookTargetsIDOK) + success, ok := result.(*GetOnCallShiftOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1SignalsWebhookTargetsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_on_call_shift: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TeamsTeamIDEscalationPolicies lists escalation policies for a team +GetSignalsEmailTarget gets a signal email target -List all Signals escalation policies for a team. +Get a Signals email target by ID */ -func (a *Client) GetV1TeamsTeamIDEscalationPolicies(params *GetV1TeamsTeamIDEscalationPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDEscalationPoliciesOK, error) { +func (a *Client) GetSignalsEmailTarget(params *GetSignalsEmailTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSignalsEmailTargetOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TeamsTeamIDEscalationPoliciesParams() + params = NewGetSignalsEmailTargetParams() } op := &runtime.ClientOperation{ - ID: "getV1TeamsTeamIdEscalationPolicies", + ID: "get_signals_email_target", Method: "GET", - PathPattern: "/v1/teams/{team_id}/escalation_policies", + PathPattern: "/v1/signals/email_targets/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TeamsTeamIDEscalationPoliciesReader{formats: a.formats}, + Reader: &GetSignalsEmailTargetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -706,35 +706,35 @@ func (a *Client) GetV1TeamsTeamIDEscalationPolicies(params *GetV1TeamsTeamIDEsca if err != nil { return nil, err } - success, ok := result.(*GetV1TeamsTeamIDEscalationPoliciesOK) + success, ok := result.(*GetSignalsEmailTargetOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TeamsTeamIdEscalationPolicies: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_signals_email_target: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TeamsTeamIDEscalationPoliciesID gets an escalation policy for a team +GetSignalsIngestURL gets the signals ingestion URL -Get a Signals escalation policy by ID +Retrieve the url for ingesting signals for your organization */ -func (a *Client) GetV1TeamsTeamIDEscalationPoliciesID(params *GetV1TeamsTeamIDEscalationPoliciesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDEscalationPoliciesIDOK, error) { +func (a *Client) GetSignalsIngestURL(params *GetSignalsIngestURLParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSignalsIngestURLOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TeamsTeamIDEscalationPoliciesIDParams() + params = NewGetSignalsIngestURLParams() } op := &runtime.ClientOperation{ - ID: "getV1TeamsTeamIdEscalationPoliciesId", + ID: "get_signals_ingest_url", Method: "GET", - PathPattern: "/v1/teams/{team_id}/escalation_policies/{id}", + PathPattern: "/v1/signals/ingest_url", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TeamsTeamIDEscalationPoliciesIDReader{formats: a.formats}, + Reader: &GetSignalsIngestURLReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -747,35 +747,35 @@ func (a *Client) GetV1TeamsTeamIDEscalationPoliciesID(params *GetV1TeamsTeamIDEs if err != nil { return nil, err } - success, ok := result.(*GetV1TeamsTeamIDEscalationPoliciesIDOK) + success, ok := result.(*GetSignalsIngestURLOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TeamsTeamIdEscalationPoliciesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_signals_ingest_url: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TeamsTeamIDOnCallSchedules lists on call schedules for a team +GetSignalsWebhookTarget gets a webhook target -List all Signals on-call schedules for a team. +Get a Signals webhook target by ID */ -func (a *Client) GetV1TeamsTeamIDOnCallSchedules(params *GetV1TeamsTeamIDOnCallSchedulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDOnCallSchedulesOK, error) { +func (a *Client) GetSignalsWebhookTarget(params *GetSignalsWebhookTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSignalsWebhookTargetOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TeamsTeamIDOnCallSchedulesParams() + params = NewGetSignalsWebhookTargetParams() } op := &runtime.ClientOperation{ - ID: "getV1TeamsTeamIdOnCallSchedules", + ID: "get_signals_webhook_target", Method: "GET", - PathPattern: "/v1/teams/{team_id}/on_call_schedules", + PathPattern: "/v1/signals/webhook_targets/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TeamsTeamIDOnCallSchedulesReader{formats: a.formats}, + Reader: &GetSignalsWebhookTargetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -788,35 +788,35 @@ func (a *Client) GetV1TeamsTeamIDOnCallSchedules(params *GetV1TeamsTeamIDOnCallS if err != nil { return nil, err } - success, ok := result.(*GetV1TeamsTeamIDOnCallSchedulesOK) + success, ok := result.(*GetSignalsWebhookTargetOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TeamsTeamIdOnCallSchedules: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_signals_webhook_target: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TeamsTeamIDOnCallSchedulesScheduleID gets an on call schedule for a team +GetTeamEscalationPolicy gets an escalation policy for a team -Get a Signals on-call schedule by ID +Get a Signals escalation policy by ID */ -func (a *Client) GetV1TeamsTeamIDOnCallSchedulesScheduleID(params *GetV1TeamsTeamIDOnCallSchedulesScheduleIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDOnCallSchedulesScheduleIDOK, error) { +func (a *Client) GetTeamEscalationPolicy(params *GetTeamEscalationPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTeamEscalationPolicyOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TeamsTeamIDOnCallSchedulesScheduleIDParams() + params = NewGetTeamEscalationPolicyParams() } op := &runtime.ClientOperation{ - ID: "getV1TeamsTeamIdOnCallSchedulesScheduleId", + ID: "get_team_escalation_policy", Method: "GET", - PathPattern: "/v1/teams/{team_id}/on_call_schedules/{schedule_id}", + PathPattern: "/v1/teams/{team_id}/escalation_policies/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TeamsTeamIDOnCallSchedulesScheduleIDReader{formats: a.formats}, + Reader: &GetTeamEscalationPolicyReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -829,35 +829,35 @@ func (a *Client) GetV1TeamsTeamIDOnCallSchedulesScheduleID(params *GetV1TeamsTea if err != nil { return nil, err } - success, ok := result.(*GetV1TeamsTeamIDOnCallSchedulesScheduleIDOK) + success, ok := result.(*GetTeamEscalationPolicyOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TeamsTeamIdOnCallSchedulesScheduleId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_team_escalation_policy: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID gets an on call shift for a team schedule +GetTeamOnCallSchedule gets an on call schedule for a team -Get a Signals on-call shift by ID +Get a Signals on-call schedule by ID */ -func (a *Client) GetV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID(params *GetV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDOK, error) { +func (a *Client) GetTeamOnCallSchedule(params *GetTeamOnCallScheduleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTeamOnCallScheduleOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDParams() + params = NewGetTeamOnCallScheduleParams() } op := &runtime.ClientOperation{ - ID: "getV1TeamsTeamIdOnCallSchedulesScheduleIdShiftsId", + ID: "get_team_on_call_schedule", Method: "GET", - PathPattern: "/v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts/{id}", + PathPattern: "/v1/teams/{team_id}/on_call_schedules/{schedule_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDReader{formats: a.formats}, + Reader: &GetTeamOnCallScheduleReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -870,35 +870,35 @@ func (a *Client) GetV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID(params *GetV1 if err != nil { return nil, err } - success, ok := result.(*GetV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDOK) + success, ok := result.(*GetTeamOnCallScheduleOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TeamsTeamIdOnCallSchedulesScheduleIdShiftsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_team_on_call_schedule: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TeamsTeamIDSignalRules lists signals rules +GetTeamSignalRule gets a signals rule -List all Signals rules for a team. +Get a Signals rule by ID. */ -func (a *Client) GetV1TeamsTeamIDSignalRules(params *GetV1TeamsTeamIDSignalRulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDSignalRulesOK, error) { +func (a *Client) GetTeamSignalRule(params *GetTeamSignalRuleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTeamSignalRuleOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TeamsTeamIDSignalRulesParams() + params = NewGetTeamSignalRuleParams() } op := &runtime.ClientOperation{ - ID: "getV1TeamsTeamIdSignalRules", + ID: "get_team_signal_rule", Method: "GET", - PathPattern: "/v1/teams/{team_id}/signal_rules", + PathPattern: "/v1/teams/{team_id}/signal_rules/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TeamsTeamIDSignalRulesReader{formats: a.formats}, + Reader: &GetTeamSignalRuleReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -911,35 +911,35 @@ func (a *Client) GetV1TeamsTeamIDSignalRules(params *GetV1TeamsTeamIDSignalRules if err != nil { return nil, err } - success, ok := result.(*GetV1TeamsTeamIDSignalRulesOK) + success, ok := result.(*GetTeamSignalRuleOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TeamsTeamIdSignalRules: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_team_signal_rule: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TeamsTeamIDSignalRulesID gets a signals rule +ListOrganizationOnCallSchedules lists on call schedules -Get a Signals rule by ID. +List all Signals on-call schedules for the entire organization. */ -func (a *Client) GetV1TeamsTeamIDSignalRulesID(params *GetV1TeamsTeamIDSignalRulesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDSignalRulesIDOK, error) { +func (a *Client) ListOrganizationOnCallSchedules(params *ListOrganizationOnCallSchedulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListOrganizationOnCallSchedulesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TeamsTeamIDSignalRulesIDParams() + params = NewListOrganizationOnCallSchedulesParams() } op := &runtime.ClientOperation{ - ID: "getV1TeamsTeamIdSignalRulesId", + ID: "list_organization_on_call_schedules", Method: "GET", - PathPattern: "/v1/teams/{team_id}/signal_rules/{id}", + PathPattern: "/v1/signals_on_call", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TeamsTeamIDSignalRulesIDReader{formats: a.formats}, + Reader: &ListOrganizationOnCallSchedulesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -952,35 +952,35 @@ func (a *Client) GetV1TeamsTeamIDSignalRulesID(params *GetV1TeamsTeamIDSignalRul if err != nil { return nil, err } - success, ok := result.(*GetV1TeamsTeamIDSignalRulesIDOK) + success, ok := result.(*ListOrganizationOnCallSchedulesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TeamsTeamIdSignalRulesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_organization_on_call_schedules: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1SignalsEmailTargetsID updates an email target +ListSignalsEmailTargets lists email targets for signals -Update a Signals email target by ID +List all Signals email targets for a team. */ -func (a *Client) PatchV1SignalsEmailTargetsID(params *PatchV1SignalsEmailTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SignalsEmailTargetsIDOK, error) { +func (a *Client) ListSignalsEmailTargets(params *ListSignalsEmailTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSignalsEmailTargetsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1SignalsEmailTargetsIDParams() + params = NewListSignalsEmailTargetsParams() } op := &runtime.ClientOperation{ - ID: "patchV1SignalsEmailTargetsId", - Method: "PATCH", - PathPattern: "/v1/signals/email_targets/{id}", + ID: "list_signals_email_targets", + Method: "GET", + PathPattern: "/v1/signals/email_targets", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1SignalsEmailTargetsIDReader{formats: a.formats}, + Reader: &ListSignalsEmailTargetsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -993,35 +993,35 @@ func (a *Client) PatchV1SignalsEmailTargetsID(params *PatchV1SignalsEmailTargets if err != nil { return nil, err } - success, ok := result.(*PatchV1SignalsEmailTargetsIDOK) + success, ok := result.(*ListSignalsEmailTargetsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1SignalsEmailTargetsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_signals_email_targets: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1SignalsWebhookTargetsID updates a webhook target +ListSignalsEventSources lists event sources for signals -Update a Signals webhook target by ID +List all Signals event sources for the authenticated user. */ -func (a *Client) PatchV1SignalsWebhookTargetsID(params *PatchV1SignalsWebhookTargetsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1SignalsWebhookTargetsIDOK, error) { +func (a *Client) ListSignalsEventSources(params *ListSignalsEventSourcesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSignalsEventSourcesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1SignalsWebhookTargetsIDParams() + params = NewListSignalsEventSourcesParams() } op := &runtime.ClientOperation{ - ID: "patchV1SignalsWebhookTargetsId", - Method: "PATCH", - PathPattern: "/v1/signals/webhook_targets/{id}", + ID: "list_signals_event_sources", + Method: "GET", + PathPattern: "/v1/signals/event_sources", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1SignalsWebhookTargetsIDReader{formats: a.formats}, + Reader: &ListSignalsEventSourcesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1034,35 +1034,35 @@ func (a *Client) PatchV1SignalsWebhookTargetsID(params *PatchV1SignalsWebhookTar if err != nil { return nil, err } - success, ok := result.(*PatchV1SignalsWebhookTargetsIDOK) + success, ok := result.(*ListSignalsEventSourcesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1SignalsWebhookTargetsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_signals_event_sources: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1TeamsTeamIDEscalationPoliciesID updates an escalation policy for a team +ListSignalsTransposers lists signal transposers -Update a Signals escalation policy by ID +List all transposers for your organization */ -func (a *Client) PatchV1TeamsTeamIDEscalationPoliciesID(params *PatchV1TeamsTeamIDEscalationPoliciesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TeamsTeamIDEscalationPoliciesIDOK, error) { +func (a *Client) ListSignalsTransposers(params *ListSignalsTransposersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSignalsTransposersOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1TeamsTeamIDEscalationPoliciesIDParams() + params = NewListSignalsTransposersParams() } op := &runtime.ClientOperation{ - ID: "patchV1TeamsTeamIdEscalationPoliciesId", - Method: "PATCH", - PathPattern: "/v1/teams/{team_id}/escalation_policies/{id}", + ID: "list_signals_transposers", + Method: "GET", + PathPattern: "/v1/signals/transposers", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1TeamsTeamIDEscalationPoliciesIDReader{formats: a.formats}, + Reader: &ListSignalsTransposersReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1075,35 +1075,35 @@ func (a *Client) PatchV1TeamsTeamIDEscalationPoliciesID(params *PatchV1TeamsTeam if err != nil { return nil, err } - success, ok := result.(*PatchV1TeamsTeamIDEscalationPoliciesIDOK) + success, ok := result.(*ListSignalsTransposersOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1TeamsTeamIdEscalationPoliciesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_signals_transposers: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1TeamsTeamIDOnCallSchedulesScheduleID updates an on call schedule for a team +ListSignalsWebhookTargets lists webhook targets -Update a Signals on-call schedule by ID +List all Signals webhook targets. */ -func (a *Client) PatchV1TeamsTeamIDOnCallSchedulesScheduleID(params *PatchV1TeamsTeamIDOnCallSchedulesScheduleIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TeamsTeamIDOnCallSchedulesScheduleIDOK, error) { +func (a *Client) ListSignalsWebhookTargets(params *ListSignalsWebhookTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSignalsWebhookTargetsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1TeamsTeamIDOnCallSchedulesScheduleIDParams() + params = NewListSignalsWebhookTargetsParams() } op := &runtime.ClientOperation{ - ID: "patchV1TeamsTeamIdOnCallSchedulesScheduleId", - Method: "PATCH", - PathPattern: "/v1/teams/{team_id}/on_call_schedules/{schedule_id}", + ID: "list_signals_webhook_targets", + Method: "GET", + PathPattern: "/v1/signals/webhook_targets", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1TeamsTeamIDOnCallSchedulesScheduleIDReader{formats: a.formats}, + Reader: &ListSignalsWebhookTargetsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1116,35 +1116,35 @@ func (a *Client) PatchV1TeamsTeamIDOnCallSchedulesScheduleID(params *PatchV1Team if err != nil { return nil, err } - success, ok := result.(*PatchV1TeamsTeamIDOnCallSchedulesScheduleIDOK) + success, ok := result.(*ListSignalsWebhookTargetsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1TeamsTeamIdOnCallSchedulesScheduleId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_signals_webhook_targets: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID updates an on call shift for a team schedule +ListTeamEscalationPolicies lists escalation policies for a team -Update a Signals on-call shift by ID +List all Signals escalation policies for a team. */ -func (a *Client) PatchV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID(params *PatchV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDOK, error) { +func (a *Client) ListTeamEscalationPolicies(params *ListTeamEscalationPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTeamEscalationPoliciesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDParams() + params = NewListTeamEscalationPoliciesParams() } op := &runtime.ClientOperation{ - ID: "patchV1TeamsTeamIdOnCallSchedulesScheduleIdShiftsId", - Method: "PATCH", - PathPattern: "/v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts/{id}", + ID: "list_team_escalation_policies", + Method: "GET", + PathPattern: "/v1/teams/{team_id}/escalation_policies", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDReader{formats: a.formats}, + Reader: &ListTeamEscalationPoliciesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1157,35 +1157,35 @@ func (a *Client) PatchV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsID(params *Pat if err != nil { return nil, err } - success, ok := result.(*PatchV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsIDOK) + success, ok := result.(*ListTeamEscalationPoliciesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1TeamsTeamIdOnCallSchedulesScheduleIdShiftsId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_team_escalation_policies: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1TeamsTeamIDSignalRulesID updates a signals rule +ListTeamOnCallSchedules lists on call schedules for a team -Update a Signals rule by ID +List all Signals on-call schedules for a team. */ -func (a *Client) PatchV1TeamsTeamIDSignalRulesID(params *PatchV1TeamsTeamIDSignalRulesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TeamsTeamIDSignalRulesIDOK, error) { +func (a *Client) ListTeamOnCallSchedules(params *ListTeamOnCallSchedulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTeamOnCallSchedulesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1TeamsTeamIDSignalRulesIDParams() + params = NewListTeamOnCallSchedulesParams() } op := &runtime.ClientOperation{ - ID: "patchV1TeamsTeamIdSignalRulesId", - Method: "PATCH", - PathPattern: "/v1/teams/{team_id}/signal_rules/{id}", + ID: "list_team_on_call_schedules", + Method: "GET", + PathPattern: "/v1/teams/{team_id}/on_call_schedules", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1TeamsTeamIDSignalRulesIDReader{formats: a.formats}, + Reader: &ListTeamOnCallSchedulesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1198,35 +1198,35 @@ func (a *Client) PatchV1TeamsTeamIDSignalRulesID(params *PatchV1TeamsTeamIDSigna if err != nil { return nil, err } - success, ok := result.(*PatchV1TeamsTeamIDSignalRulesIDOK) + success, ok := result.(*ListTeamOnCallSchedulesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1TeamsTeamIdSignalRulesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_team_on_call_schedules: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1SignalsDebugger debugs signals expressions +ListTeamSignalRules lists signals rules -Debug Signals expressions +List all Signals rules for a team. */ -func (a *Client) PostV1SignalsDebugger(params *PostV1SignalsDebuggerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SignalsDebuggerCreated, error) { +func (a *Client) ListTeamSignalRules(params *ListTeamSignalRulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTeamSignalRulesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1SignalsDebuggerParams() + params = NewListTeamSignalRulesParams() } op := &runtime.ClientOperation{ - ID: "postV1SignalsDebugger", - Method: "POST", - PathPattern: "/v1/signals/debugger", + ID: "list_team_signal_rules", + Method: "GET", + PathPattern: "/v1/teams/{team_id}/signal_rules", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1SignalsDebuggerReader{formats: a.formats}, + Reader: &ListTeamSignalRulesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1239,35 +1239,35 @@ func (a *Client) PostV1SignalsDebugger(params *PostV1SignalsDebuggerParams, auth if err != nil { return nil, err } - success, ok := result.(*PostV1SignalsDebuggerCreated) + success, ok := result.(*ListTeamSignalRulesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1SignalsDebugger: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_team_signal_rules: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1SignalsEmailTargets creates an email target for signals +UpdateOnCallShift updates an on call shift for a team schedule -Create a Signals email target for a team. +Update a Signals on-call shift by ID */ -func (a *Client) PostV1SignalsEmailTargets(params *PostV1SignalsEmailTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SignalsEmailTargetsCreated, error) { +func (a *Client) UpdateOnCallShift(params *UpdateOnCallShiftParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateOnCallShiftOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1SignalsEmailTargetsParams() + params = NewUpdateOnCallShiftParams() } op := &runtime.ClientOperation{ - ID: "postV1SignalsEmailTargets", - Method: "POST", - PathPattern: "/v1/signals/email_targets", + ID: "update_on_call_shift", + Method: "PATCH", + PathPattern: "/v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1SignalsEmailTargetsReader{formats: a.formats}, + Reader: &UpdateOnCallShiftReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1280,35 +1280,35 @@ func (a *Client) PostV1SignalsEmailTargets(params *PostV1SignalsEmailTargetsPara if err != nil { return nil, err } - success, ok := result.(*PostV1SignalsEmailTargetsCreated) + success, ok := result.(*UpdateOnCallShiftOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1SignalsEmailTargets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_on_call_shift: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1SignalsWebhookTargets creates a webhook target +UpdateSignalsEmailTarget updates an email target -Create a Signals webhook target. +Update a Signals email target by ID */ -func (a *Client) PostV1SignalsWebhookTargets(params *PostV1SignalsWebhookTargetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1SignalsWebhookTargetsCreated, error) { +func (a *Client) UpdateSignalsEmailTarget(params *UpdateSignalsEmailTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSignalsEmailTargetOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1SignalsWebhookTargetsParams() + params = NewUpdateSignalsEmailTargetParams() } op := &runtime.ClientOperation{ - ID: "postV1SignalsWebhookTargets", - Method: "POST", - PathPattern: "/v1/signals/webhook_targets", + ID: "update_signals_email_target", + Method: "PATCH", + PathPattern: "/v1/signals/email_targets/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1SignalsWebhookTargetsReader{formats: a.formats}, + Reader: &UpdateSignalsEmailTargetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1321,35 +1321,35 @@ func (a *Client) PostV1SignalsWebhookTargets(params *PostV1SignalsWebhookTargets if err != nil { return nil, err } - success, ok := result.(*PostV1SignalsWebhookTargetsCreated) + success, ok := result.(*UpdateSignalsEmailTargetOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1SignalsWebhookTargets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_signals_email_target: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1TeamsTeamIDEscalationPolicies creates an escalation policy for a team +UpdateSignalsWebhookTarget updates a webhook target -Create a Signals escalation policy for a team. +Update a Signals webhook target by ID */ -func (a *Client) PostV1TeamsTeamIDEscalationPolicies(params *PostV1TeamsTeamIDEscalationPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TeamsTeamIDEscalationPoliciesCreated, error) { +func (a *Client) UpdateSignalsWebhookTarget(params *UpdateSignalsWebhookTargetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateSignalsWebhookTargetOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1TeamsTeamIDEscalationPoliciesParams() + params = NewUpdateSignalsWebhookTargetParams() } op := &runtime.ClientOperation{ - ID: "postV1TeamsTeamIdEscalationPolicies", - Method: "POST", - PathPattern: "/v1/teams/{team_id}/escalation_policies", + ID: "update_signals_webhook_target", + Method: "PATCH", + PathPattern: "/v1/signals/webhook_targets/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1TeamsTeamIDEscalationPoliciesReader{formats: a.formats}, + Reader: &UpdateSignalsWebhookTargetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1362,35 +1362,35 @@ func (a *Client) PostV1TeamsTeamIDEscalationPolicies(params *PostV1TeamsTeamIDEs if err != nil { return nil, err } - success, ok := result.(*PostV1TeamsTeamIDEscalationPoliciesCreated) + success, ok := result.(*UpdateSignalsWebhookTargetOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1TeamsTeamIdEscalationPolicies: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_signals_webhook_target: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1TeamsTeamIDOnCallSchedules creates an on call schedule for a team +UpdateTeamEscalationPolicy updates an escalation policy for a team -Create a Signals on-call schedule for a team. +Update a Signals escalation policy by ID */ -func (a *Client) PostV1TeamsTeamIDOnCallSchedules(params *PostV1TeamsTeamIDOnCallSchedulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TeamsTeamIDOnCallSchedulesCreated, error) { +func (a *Client) UpdateTeamEscalationPolicy(params *UpdateTeamEscalationPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTeamEscalationPolicyOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1TeamsTeamIDOnCallSchedulesParams() + params = NewUpdateTeamEscalationPolicyParams() } op := &runtime.ClientOperation{ - ID: "postV1TeamsTeamIdOnCallSchedules", - Method: "POST", - PathPattern: "/v1/teams/{team_id}/on_call_schedules", + ID: "update_team_escalation_policy", + Method: "PATCH", + PathPattern: "/v1/teams/{team_id}/escalation_policies/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1TeamsTeamIDOnCallSchedulesReader{formats: a.formats}, + Reader: &UpdateTeamEscalationPolicyReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1403,35 +1403,35 @@ func (a *Client) PostV1TeamsTeamIDOnCallSchedules(params *PostV1TeamsTeamIDOnCal if err != nil { return nil, err } - success, ok := result.(*PostV1TeamsTeamIDOnCallSchedulesCreated) + success, ok := result.(*UpdateTeamEscalationPolicyOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1TeamsTeamIdOnCallSchedules: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_team_escalation_policy: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1TeamsTeamIDOnCallSchedulesScheduleIDShifts creates a shift for an on call schedule +UpdateTeamOnCallSchedule updates an on call schedule for a team -Create a Signals on-call shift in a schedule. +Update a Signals on-call schedule by ID */ -func (a *Client) PostV1TeamsTeamIDOnCallSchedulesScheduleIDShifts(params *PostV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsCreated, error) { +func (a *Client) UpdateTeamOnCallSchedule(params *UpdateTeamOnCallScheduleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTeamOnCallScheduleOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsParams() + params = NewUpdateTeamOnCallScheduleParams() } op := &runtime.ClientOperation{ - ID: "postV1TeamsTeamIdOnCallSchedulesScheduleIdShifts", - Method: "POST", - PathPattern: "/v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts", + ID: "update_team_on_call_schedule", + Method: "PATCH", + PathPattern: "/v1/teams/{team_id}/on_call_schedules/{schedule_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsReader{formats: a.formats}, + Reader: &UpdateTeamOnCallScheduleReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1444,35 +1444,35 @@ func (a *Client) PostV1TeamsTeamIDOnCallSchedulesScheduleIDShifts(params *PostV1 if err != nil { return nil, err } - success, ok := result.(*PostV1TeamsTeamIDOnCallSchedulesScheduleIDShiftsCreated) + success, ok := result.(*UpdateTeamOnCallScheduleOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1TeamsTeamIdOnCallSchedulesScheduleIdShifts: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_team_on_call_schedule: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1TeamsTeamIDSignalRules creates a signals rule +UpdateTeamSignalRule updates a signals rule -Create a Signals rule for a team. +Update a Signals rule by ID */ -func (a *Client) PostV1TeamsTeamIDSignalRules(params *PostV1TeamsTeamIDSignalRulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TeamsTeamIDSignalRulesCreated, error) { +func (a *Client) UpdateTeamSignalRule(params *UpdateTeamSignalRuleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTeamSignalRuleOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1TeamsTeamIDSignalRulesParams() + params = NewUpdateTeamSignalRuleParams() } op := &runtime.ClientOperation{ - ID: "postV1TeamsTeamIdSignalRules", - Method: "POST", - PathPattern: "/v1/teams/{team_id}/signal_rules", + ID: "update_team_signal_rule", + Method: "PATCH", + PathPattern: "/v1/teams/{team_id}/signal_rules/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1TeamsTeamIDSignalRulesReader{formats: a.formats}, + Reader: &UpdateTeamSignalRuleReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1485,13 +1485,13 @@ func (a *Client) PostV1TeamsTeamIDSignalRules(params *PostV1TeamsTeamIDSignalRul if err != nil { return nil, err } - success, ok := result.(*PostV1TeamsTeamIDSignalRulesCreated) + success, ok := result.(*UpdateTeamSignalRuleOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1TeamsTeamIdSignalRules: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_team_signal_rule: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/signals/update_on_call_shift_parameters.go b/client/signals/update_on_call_shift_parameters.go new file mode 100644 index 0000000..02bbb88 --- /dev/null +++ b/client/signals/update_on_call_shift_parameters.go @@ -0,0 +1,207 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateOnCallShiftParams creates a new UpdateOnCallShiftParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateOnCallShiftParams() *UpdateOnCallShiftParams { + return &UpdateOnCallShiftParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateOnCallShiftParamsWithTimeout creates a new UpdateOnCallShiftParams object +// with the ability to set a timeout on a request. +func NewUpdateOnCallShiftParamsWithTimeout(timeout time.Duration) *UpdateOnCallShiftParams { + return &UpdateOnCallShiftParams{ + timeout: timeout, + } +} + +// NewUpdateOnCallShiftParamsWithContext creates a new UpdateOnCallShiftParams object +// with the ability to set a context for a request. +func NewUpdateOnCallShiftParamsWithContext(ctx context.Context) *UpdateOnCallShiftParams { + return &UpdateOnCallShiftParams{ + Context: ctx, + } +} + +// NewUpdateOnCallShiftParamsWithHTTPClient creates a new UpdateOnCallShiftParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateOnCallShiftParamsWithHTTPClient(client *http.Client) *UpdateOnCallShiftParams { + return &UpdateOnCallShiftParams{ + HTTPClient: client, + } +} + +/* +UpdateOnCallShiftParams contains all the parameters to send to the API endpoint + + for the update on call shift operation. + + Typically these are written to a http.Request. +*/ +type UpdateOnCallShiftParams struct { + + // ID. + ID string + + // ScheduleID. + ScheduleID string + + // TeamID. + TeamID string + + // UpdateOnCallShift. + UpdateOnCallShift *models.UpdateOnCallShift + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update on call shift params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateOnCallShiftParams) WithDefaults() *UpdateOnCallShiftParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update on call shift params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateOnCallShiftParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update on call shift params +func (o *UpdateOnCallShiftParams) WithTimeout(timeout time.Duration) *UpdateOnCallShiftParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update on call shift params +func (o *UpdateOnCallShiftParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update on call shift params +func (o *UpdateOnCallShiftParams) WithContext(ctx context.Context) *UpdateOnCallShiftParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update on call shift params +func (o *UpdateOnCallShiftParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update on call shift params +func (o *UpdateOnCallShiftParams) WithHTTPClient(client *http.Client) *UpdateOnCallShiftParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update on call shift params +func (o *UpdateOnCallShiftParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the update on call shift params +func (o *UpdateOnCallShiftParams) WithID(id string) *UpdateOnCallShiftParams { + o.SetID(id) + return o +} + +// SetID adds the id to the update on call shift params +func (o *UpdateOnCallShiftParams) SetID(id string) { + o.ID = id +} + +// WithScheduleID adds the scheduleID to the update on call shift params +func (o *UpdateOnCallShiftParams) WithScheduleID(scheduleID string) *UpdateOnCallShiftParams { + o.SetScheduleID(scheduleID) + return o +} + +// SetScheduleID adds the scheduleId to the update on call shift params +func (o *UpdateOnCallShiftParams) SetScheduleID(scheduleID string) { + o.ScheduleID = scheduleID +} + +// WithTeamID adds the teamID to the update on call shift params +func (o *UpdateOnCallShiftParams) WithTeamID(teamID string) *UpdateOnCallShiftParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the update on call shift params +func (o *UpdateOnCallShiftParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WithUpdateOnCallShift adds the updateOnCallShift to the update on call shift params +func (o *UpdateOnCallShiftParams) WithUpdateOnCallShift(updateOnCallShift *models.UpdateOnCallShift) *UpdateOnCallShiftParams { + o.SetUpdateOnCallShift(updateOnCallShift) + return o +} + +// SetUpdateOnCallShift adds the updateOnCallShift to the update on call shift params +func (o *UpdateOnCallShiftParams) SetUpdateOnCallShift(updateOnCallShift *models.UpdateOnCallShift) { + o.UpdateOnCallShift = updateOnCallShift +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateOnCallShiftParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + // path param schedule_id + if err := r.SetPathParam("schedule_id", o.ScheduleID); err != nil { + return err + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + if o.UpdateOnCallShift != nil { + if err := r.SetBodyParam(o.UpdateOnCallShift); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/update_on_call_shift_responses.go b/client/signals/update_on_call_shift_responses.go new file mode 100644 index 0000000..1cf17e6 --- /dev/null +++ b/client/signals/update_on_call_shift_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateOnCallShiftReader is a Reader for the UpdateOnCallShift structure. +type UpdateOnCallShiftReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateOnCallShiftReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateOnCallShiftOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateOnCallShiftOK creates a UpdateOnCallShiftOK with default headers values +func NewUpdateOnCallShiftOK() *UpdateOnCallShiftOK { + return &UpdateOnCallShiftOK{} +} + +/* +UpdateOnCallShiftOK describes a response with status code 200, with default header values. + +Update a Signals on-call shift by ID +*/ +type UpdateOnCallShiftOK struct { +} + +// IsSuccess returns true when this update on call shift o k response has a 2xx status code +func (o *UpdateOnCallShiftOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update on call shift o k response has a 3xx status code +func (o *UpdateOnCallShiftOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update on call shift o k response has a 4xx status code +func (o *UpdateOnCallShiftOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update on call shift o k response has a 5xx status code +func (o *UpdateOnCallShiftOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update on call shift o k response a status code equal to that given +func (o *UpdateOnCallShiftOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateOnCallShiftOK) Error() string { + return fmt.Sprintf("[PATCH /v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts/{id}][%d] updateOnCallShiftOK ", 200) +} + +func (o *UpdateOnCallShiftOK) String() string { + return fmt.Sprintf("[PATCH /v1/teams/{team_id}/on_call_schedules/{schedule_id}/shifts/{id}][%d] updateOnCallShiftOK ", 200) +} + +func (o *UpdateOnCallShiftOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/update_signals_email_target_parameters.go b/client/signals/update_signals_email_target_parameters.go new file mode 100644 index 0000000..0b31061 --- /dev/null +++ b/client/signals/update_signals_email_target_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateSignalsEmailTargetParams creates a new UpdateSignalsEmailTargetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateSignalsEmailTargetParams() *UpdateSignalsEmailTargetParams { + return &UpdateSignalsEmailTargetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateSignalsEmailTargetParamsWithTimeout creates a new UpdateSignalsEmailTargetParams object +// with the ability to set a timeout on a request. +func NewUpdateSignalsEmailTargetParamsWithTimeout(timeout time.Duration) *UpdateSignalsEmailTargetParams { + return &UpdateSignalsEmailTargetParams{ + timeout: timeout, + } +} + +// NewUpdateSignalsEmailTargetParamsWithContext creates a new UpdateSignalsEmailTargetParams object +// with the ability to set a context for a request. +func NewUpdateSignalsEmailTargetParamsWithContext(ctx context.Context) *UpdateSignalsEmailTargetParams { + return &UpdateSignalsEmailTargetParams{ + Context: ctx, + } +} + +// NewUpdateSignalsEmailTargetParamsWithHTTPClient creates a new UpdateSignalsEmailTargetParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateSignalsEmailTargetParamsWithHTTPClient(client *http.Client) *UpdateSignalsEmailTargetParams { + return &UpdateSignalsEmailTargetParams{ + HTTPClient: client, + } +} + +/* +UpdateSignalsEmailTargetParams contains all the parameters to send to the API endpoint + + for the update signals email target operation. + + Typically these are written to a http.Request. +*/ +type UpdateSignalsEmailTargetParams struct { + + // ID. + ID string + + // UpdateSignalsEmailTarget. + UpdateSignalsEmailTarget *models.UpdateSignalsEmailTarget + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update signals email target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSignalsEmailTargetParams) WithDefaults() *UpdateSignalsEmailTargetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update signals email target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSignalsEmailTargetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update signals email target params +func (o *UpdateSignalsEmailTargetParams) WithTimeout(timeout time.Duration) *UpdateSignalsEmailTargetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update signals email target params +func (o *UpdateSignalsEmailTargetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update signals email target params +func (o *UpdateSignalsEmailTargetParams) WithContext(ctx context.Context) *UpdateSignalsEmailTargetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update signals email target params +func (o *UpdateSignalsEmailTargetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update signals email target params +func (o *UpdateSignalsEmailTargetParams) WithHTTPClient(client *http.Client) *UpdateSignalsEmailTargetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update signals email target params +func (o *UpdateSignalsEmailTargetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the update signals email target params +func (o *UpdateSignalsEmailTargetParams) WithID(id string) *UpdateSignalsEmailTargetParams { + o.SetID(id) + return o +} + +// SetID adds the id to the update signals email target params +func (o *UpdateSignalsEmailTargetParams) SetID(id string) { + o.ID = id +} + +// WithUpdateSignalsEmailTarget adds the updateSignalsEmailTarget to the update signals email target params +func (o *UpdateSignalsEmailTargetParams) WithUpdateSignalsEmailTarget(updateSignalsEmailTarget *models.UpdateSignalsEmailTarget) *UpdateSignalsEmailTargetParams { + o.SetUpdateSignalsEmailTarget(updateSignalsEmailTarget) + return o +} + +// SetUpdateSignalsEmailTarget adds the updateSignalsEmailTarget to the update signals email target params +func (o *UpdateSignalsEmailTargetParams) SetUpdateSignalsEmailTarget(updateSignalsEmailTarget *models.UpdateSignalsEmailTarget) { + o.UpdateSignalsEmailTarget = updateSignalsEmailTarget +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateSignalsEmailTargetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + if o.UpdateSignalsEmailTarget != nil { + if err := r.SetBodyParam(o.UpdateSignalsEmailTarget); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/update_signals_email_target_responses.go b/client/signals/update_signals_email_target_responses.go new file mode 100644 index 0000000..16ab169 --- /dev/null +++ b/client/signals/update_signals_email_target_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateSignalsEmailTargetReader is a Reader for the UpdateSignalsEmailTarget structure. +type UpdateSignalsEmailTargetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateSignalsEmailTargetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateSignalsEmailTargetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateSignalsEmailTargetOK creates a UpdateSignalsEmailTargetOK with default headers values +func NewUpdateSignalsEmailTargetOK() *UpdateSignalsEmailTargetOK { + return &UpdateSignalsEmailTargetOK{} +} + +/* +UpdateSignalsEmailTargetOK describes a response with status code 200, with default header values. + +Update a Signals email target by ID +*/ +type UpdateSignalsEmailTargetOK struct { +} + +// IsSuccess returns true when this update signals email target o k response has a 2xx status code +func (o *UpdateSignalsEmailTargetOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update signals email target o k response has a 3xx status code +func (o *UpdateSignalsEmailTargetOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update signals email target o k response has a 4xx status code +func (o *UpdateSignalsEmailTargetOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update signals email target o k response has a 5xx status code +func (o *UpdateSignalsEmailTargetOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update signals email target o k response a status code equal to that given +func (o *UpdateSignalsEmailTargetOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateSignalsEmailTargetOK) Error() string { + return fmt.Sprintf("[PATCH /v1/signals/email_targets/{id}][%d] updateSignalsEmailTargetOK ", 200) +} + +func (o *UpdateSignalsEmailTargetOK) String() string { + return fmt.Sprintf("[PATCH /v1/signals/email_targets/{id}][%d] updateSignalsEmailTargetOK ", 200) +} + +func (o *UpdateSignalsEmailTargetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/update_signals_webhook_target_parameters.go b/client/signals/update_signals_webhook_target_parameters.go new file mode 100644 index 0000000..f2050bf --- /dev/null +++ b/client/signals/update_signals_webhook_target_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateSignalsWebhookTargetParams creates a new UpdateSignalsWebhookTargetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateSignalsWebhookTargetParams() *UpdateSignalsWebhookTargetParams { + return &UpdateSignalsWebhookTargetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateSignalsWebhookTargetParamsWithTimeout creates a new UpdateSignalsWebhookTargetParams object +// with the ability to set a timeout on a request. +func NewUpdateSignalsWebhookTargetParamsWithTimeout(timeout time.Duration) *UpdateSignalsWebhookTargetParams { + return &UpdateSignalsWebhookTargetParams{ + timeout: timeout, + } +} + +// NewUpdateSignalsWebhookTargetParamsWithContext creates a new UpdateSignalsWebhookTargetParams object +// with the ability to set a context for a request. +func NewUpdateSignalsWebhookTargetParamsWithContext(ctx context.Context) *UpdateSignalsWebhookTargetParams { + return &UpdateSignalsWebhookTargetParams{ + Context: ctx, + } +} + +// NewUpdateSignalsWebhookTargetParamsWithHTTPClient creates a new UpdateSignalsWebhookTargetParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateSignalsWebhookTargetParamsWithHTTPClient(client *http.Client) *UpdateSignalsWebhookTargetParams { + return &UpdateSignalsWebhookTargetParams{ + HTTPClient: client, + } +} + +/* +UpdateSignalsWebhookTargetParams contains all the parameters to send to the API endpoint + + for the update signals webhook target operation. + + Typically these are written to a http.Request. +*/ +type UpdateSignalsWebhookTargetParams struct { + + // ID. + ID string + + // UpdateSignalsWebhookTarget. + UpdateSignalsWebhookTarget *models.UpdateSignalsWebhookTarget + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update signals webhook target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSignalsWebhookTargetParams) WithDefaults() *UpdateSignalsWebhookTargetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update signals webhook target params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSignalsWebhookTargetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update signals webhook target params +func (o *UpdateSignalsWebhookTargetParams) WithTimeout(timeout time.Duration) *UpdateSignalsWebhookTargetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update signals webhook target params +func (o *UpdateSignalsWebhookTargetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update signals webhook target params +func (o *UpdateSignalsWebhookTargetParams) WithContext(ctx context.Context) *UpdateSignalsWebhookTargetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update signals webhook target params +func (o *UpdateSignalsWebhookTargetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update signals webhook target params +func (o *UpdateSignalsWebhookTargetParams) WithHTTPClient(client *http.Client) *UpdateSignalsWebhookTargetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update signals webhook target params +func (o *UpdateSignalsWebhookTargetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the update signals webhook target params +func (o *UpdateSignalsWebhookTargetParams) WithID(id string) *UpdateSignalsWebhookTargetParams { + o.SetID(id) + return o +} + +// SetID adds the id to the update signals webhook target params +func (o *UpdateSignalsWebhookTargetParams) SetID(id string) { + o.ID = id +} + +// WithUpdateSignalsWebhookTarget adds the updateSignalsWebhookTarget to the update signals webhook target params +func (o *UpdateSignalsWebhookTargetParams) WithUpdateSignalsWebhookTarget(updateSignalsWebhookTarget *models.UpdateSignalsWebhookTarget) *UpdateSignalsWebhookTargetParams { + o.SetUpdateSignalsWebhookTarget(updateSignalsWebhookTarget) + return o +} + +// SetUpdateSignalsWebhookTarget adds the updateSignalsWebhookTarget to the update signals webhook target params +func (o *UpdateSignalsWebhookTargetParams) SetUpdateSignalsWebhookTarget(updateSignalsWebhookTarget *models.UpdateSignalsWebhookTarget) { + o.UpdateSignalsWebhookTarget = updateSignalsWebhookTarget +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateSignalsWebhookTargetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + if o.UpdateSignalsWebhookTarget != nil { + if err := r.SetBodyParam(o.UpdateSignalsWebhookTarget); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/update_signals_webhook_target_responses.go b/client/signals/update_signals_webhook_target_responses.go new file mode 100644 index 0000000..c104547 --- /dev/null +++ b/client/signals/update_signals_webhook_target_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateSignalsWebhookTargetReader is a Reader for the UpdateSignalsWebhookTarget structure. +type UpdateSignalsWebhookTargetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateSignalsWebhookTargetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateSignalsWebhookTargetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateSignalsWebhookTargetOK creates a UpdateSignalsWebhookTargetOK with default headers values +func NewUpdateSignalsWebhookTargetOK() *UpdateSignalsWebhookTargetOK { + return &UpdateSignalsWebhookTargetOK{} +} + +/* +UpdateSignalsWebhookTargetOK describes a response with status code 200, with default header values. + +Update a Signals webhook target by ID +*/ +type UpdateSignalsWebhookTargetOK struct { +} + +// IsSuccess returns true when this update signals webhook target o k response has a 2xx status code +func (o *UpdateSignalsWebhookTargetOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update signals webhook target o k response has a 3xx status code +func (o *UpdateSignalsWebhookTargetOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update signals webhook target o k response has a 4xx status code +func (o *UpdateSignalsWebhookTargetOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update signals webhook target o k response has a 5xx status code +func (o *UpdateSignalsWebhookTargetOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update signals webhook target o k response a status code equal to that given +func (o *UpdateSignalsWebhookTargetOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateSignalsWebhookTargetOK) Error() string { + return fmt.Sprintf("[PATCH /v1/signals/webhook_targets/{id}][%d] updateSignalsWebhookTargetOK ", 200) +} + +func (o *UpdateSignalsWebhookTargetOK) String() string { + return fmt.Sprintf("[PATCH /v1/signals/webhook_targets/{id}][%d] updateSignalsWebhookTargetOK ", 200) +} + +func (o *UpdateSignalsWebhookTargetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/update_team_escalation_policy_parameters.go b/client/signals/update_team_escalation_policy_parameters.go new file mode 100644 index 0000000..11455e6 --- /dev/null +++ b/client/signals/update_team_escalation_policy_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateTeamEscalationPolicyParams creates a new UpdateTeamEscalationPolicyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateTeamEscalationPolicyParams() *UpdateTeamEscalationPolicyParams { + return &UpdateTeamEscalationPolicyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateTeamEscalationPolicyParamsWithTimeout creates a new UpdateTeamEscalationPolicyParams object +// with the ability to set a timeout on a request. +func NewUpdateTeamEscalationPolicyParamsWithTimeout(timeout time.Duration) *UpdateTeamEscalationPolicyParams { + return &UpdateTeamEscalationPolicyParams{ + timeout: timeout, + } +} + +// NewUpdateTeamEscalationPolicyParamsWithContext creates a new UpdateTeamEscalationPolicyParams object +// with the ability to set a context for a request. +func NewUpdateTeamEscalationPolicyParamsWithContext(ctx context.Context) *UpdateTeamEscalationPolicyParams { + return &UpdateTeamEscalationPolicyParams{ + Context: ctx, + } +} + +// NewUpdateTeamEscalationPolicyParamsWithHTTPClient creates a new UpdateTeamEscalationPolicyParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateTeamEscalationPolicyParamsWithHTTPClient(client *http.Client) *UpdateTeamEscalationPolicyParams { + return &UpdateTeamEscalationPolicyParams{ + HTTPClient: client, + } +} + +/* +UpdateTeamEscalationPolicyParams contains all the parameters to send to the API endpoint + + for the update team escalation policy operation. + + Typically these are written to a http.Request. +*/ +type UpdateTeamEscalationPolicyParams struct { + + // ID. + ID string + + // TeamID. + TeamID string + + // UpdateTeamEscalationPolicy. + UpdateTeamEscalationPolicy *models.UpdateTeamEscalationPolicy + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update team escalation policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTeamEscalationPolicyParams) WithDefaults() *UpdateTeamEscalationPolicyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update team escalation policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTeamEscalationPolicyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update team escalation policy params +func (o *UpdateTeamEscalationPolicyParams) WithTimeout(timeout time.Duration) *UpdateTeamEscalationPolicyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update team escalation policy params +func (o *UpdateTeamEscalationPolicyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update team escalation policy params +func (o *UpdateTeamEscalationPolicyParams) WithContext(ctx context.Context) *UpdateTeamEscalationPolicyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update team escalation policy params +func (o *UpdateTeamEscalationPolicyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update team escalation policy params +func (o *UpdateTeamEscalationPolicyParams) WithHTTPClient(client *http.Client) *UpdateTeamEscalationPolicyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update team escalation policy params +func (o *UpdateTeamEscalationPolicyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the update team escalation policy params +func (o *UpdateTeamEscalationPolicyParams) WithID(id string) *UpdateTeamEscalationPolicyParams { + o.SetID(id) + return o +} + +// SetID adds the id to the update team escalation policy params +func (o *UpdateTeamEscalationPolicyParams) SetID(id string) { + o.ID = id +} + +// WithTeamID adds the teamID to the update team escalation policy params +func (o *UpdateTeamEscalationPolicyParams) WithTeamID(teamID string) *UpdateTeamEscalationPolicyParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the update team escalation policy params +func (o *UpdateTeamEscalationPolicyParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WithUpdateTeamEscalationPolicy adds the updateTeamEscalationPolicy to the update team escalation policy params +func (o *UpdateTeamEscalationPolicyParams) WithUpdateTeamEscalationPolicy(updateTeamEscalationPolicy *models.UpdateTeamEscalationPolicy) *UpdateTeamEscalationPolicyParams { + o.SetUpdateTeamEscalationPolicy(updateTeamEscalationPolicy) + return o +} + +// SetUpdateTeamEscalationPolicy adds the updateTeamEscalationPolicy to the update team escalation policy params +func (o *UpdateTeamEscalationPolicyParams) SetUpdateTeamEscalationPolicy(updateTeamEscalationPolicy *models.UpdateTeamEscalationPolicy) { + o.UpdateTeamEscalationPolicy = updateTeamEscalationPolicy +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateTeamEscalationPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + if o.UpdateTeamEscalationPolicy != nil { + if err := r.SetBodyParam(o.UpdateTeamEscalationPolicy); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/update_team_escalation_policy_responses.go b/client/signals/update_team_escalation_policy_responses.go new file mode 100644 index 0000000..5770754 --- /dev/null +++ b/client/signals/update_team_escalation_policy_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateTeamEscalationPolicyReader is a Reader for the UpdateTeamEscalationPolicy structure. +type UpdateTeamEscalationPolicyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateTeamEscalationPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateTeamEscalationPolicyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateTeamEscalationPolicyOK creates a UpdateTeamEscalationPolicyOK with default headers values +func NewUpdateTeamEscalationPolicyOK() *UpdateTeamEscalationPolicyOK { + return &UpdateTeamEscalationPolicyOK{} +} + +/* +UpdateTeamEscalationPolicyOK describes a response with status code 200, with default header values. + +Update a Signals escalation policy by ID +*/ +type UpdateTeamEscalationPolicyOK struct { +} + +// IsSuccess returns true when this update team escalation policy o k response has a 2xx status code +func (o *UpdateTeamEscalationPolicyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update team escalation policy o k response has a 3xx status code +func (o *UpdateTeamEscalationPolicyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update team escalation policy o k response has a 4xx status code +func (o *UpdateTeamEscalationPolicyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update team escalation policy o k response has a 5xx status code +func (o *UpdateTeamEscalationPolicyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update team escalation policy o k response a status code equal to that given +func (o *UpdateTeamEscalationPolicyOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateTeamEscalationPolicyOK) Error() string { + return fmt.Sprintf("[PATCH /v1/teams/{team_id}/escalation_policies/{id}][%d] updateTeamEscalationPolicyOK ", 200) +} + +func (o *UpdateTeamEscalationPolicyOK) String() string { + return fmt.Sprintf("[PATCH /v1/teams/{team_id}/escalation_policies/{id}][%d] updateTeamEscalationPolicyOK ", 200) +} + +func (o *UpdateTeamEscalationPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/update_team_on_call_schedule_parameters.go b/client/signals/update_team_on_call_schedule_parameters.go new file mode 100644 index 0000000..67ea612 --- /dev/null +++ b/client/signals/update_team_on_call_schedule_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateTeamOnCallScheduleParams creates a new UpdateTeamOnCallScheduleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateTeamOnCallScheduleParams() *UpdateTeamOnCallScheduleParams { + return &UpdateTeamOnCallScheduleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateTeamOnCallScheduleParamsWithTimeout creates a new UpdateTeamOnCallScheduleParams object +// with the ability to set a timeout on a request. +func NewUpdateTeamOnCallScheduleParamsWithTimeout(timeout time.Duration) *UpdateTeamOnCallScheduleParams { + return &UpdateTeamOnCallScheduleParams{ + timeout: timeout, + } +} + +// NewUpdateTeamOnCallScheduleParamsWithContext creates a new UpdateTeamOnCallScheduleParams object +// with the ability to set a context for a request. +func NewUpdateTeamOnCallScheduleParamsWithContext(ctx context.Context) *UpdateTeamOnCallScheduleParams { + return &UpdateTeamOnCallScheduleParams{ + Context: ctx, + } +} + +// NewUpdateTeamOnCallScheduleParamsWithHTTPClient creates a new UpdateTeamOnCallScheduleParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateTeamOnCallScheduleParamsWithHTTPClient(client *http.Client) *UpdateTeamOnCallScheduleParams { + return &UpdateTeamOnCallScheduleParams{ + HTTPClient: client, + } +} + +/* +UpdateTeamOnCallScheduleParams contains all the parameters to send to the API endpoint + + for the update team on call schedule operation. + + Typically these are written to a http.Request. +*/ +type UpdateTeamOnCallScheduleParams struct { + + // ScheduleID. + ScheduleID string + + // TeamID. + TeamID string + + // UpdateTeamOnCallSchedule. + UpdateTeamOnCallSchedule *models.UpdateTeamOnCallSchedule + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update team on call schedule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTeamOnCallScheduleParams) WithDefaults() *UpdateTeamOnCallScheduleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update team on call schedule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTeamOnCallScheduleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update team on call schedule params +func (o *UpdateTeamOnCallScheduleParams) WithTimeout(timeout time.Duration) *UpdateTeamOnCallScheduleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update team on call schedule params +func (o *UpdateTeamOnCallScheduleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update team on call schedule params +func (o *UpdateTeamOnCallScheduleParams) WithContext(ctx context.Context) *UpdateTeamOnCallScheduleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update team on call schedule params +func (o *UpdateTeamOnCallScheduleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update team on call schedule params +func (o *UpdateTeamOnCallScheduleParams) WithHTTPClient(client *http.Client) *UpdateTeamOnCallScheduleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update team on call schedule params +func (o *UpdateTeamOnCallScheduleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithScheduleID adds the scheduleID to the update team on call schedule params +func (o *UpdateTeamOnCallScheduleParams) WithScheduleID(scheduleID string) *UpdateTeamOnCallScheduleParams { + o.SetScheduleID(scheduleID) + return o +} + +// SetScheduleID adds the scheduleId to the update team on call schedule params +func (o *UpdateTeamOnCallScheduleParams) SetScheduleID(scheduleID string) { + o.ScheduleID = scheduleID +} + +// WithTeamID adds the teamID to the update team on call schedule params +func (o *UpdateTeamOnCallScheduleParams) WithTeamID(teamID string) *UpdateTeamOnCallScheduleParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the update team on call schedule params +func (o *UpdateTeamOnCallScheduleParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WithUpdateTeamOnCallSchedule adds the updateTeamOnCallSchedule to the update team on call schedule params +func (o *UpdateTeamOnCallScheduleParams) WithUpdateTeamOnCallSchedule(updateTeamOnCallSchedule *models.UpdateTeamOnCallSchedule) *UpdateTeamOnCallScheduleParams { + o.SetUpdateTeamOnCallSchedule(updateTeamOnCallSchedule) + return o +} + +// SetUpdateTeamOnCallSchedule adds the updateTeamOnCallSchedule to the update team on call schedule params +func (o *UpdateTeamOnCallScheduleParams) SetUpdateTeamOnCallSchedule(updateTeamOnCallSchedule *models.UpdateTeamOnCallSchedule) { + o.UpdateTeamOnCallSchedule = updateTeamOnCallSchedule +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateTeamOnCallScheduleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param schedule_id + if err := r.SetPathParam("schedule_id", o.ScheduleID); err != nil { + return err + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + if o.UpdateTeamOnCallSchedule != nil { + if err := r.SetBodyParam(o.UpdateTeamOnCallSchedule); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/update_team_on_call_schedule_responses.go b/client/signals/update_team_on_call_schedule_responses.go new file mode 100644 index 0000000..9db9a06 --- /dev/null +++ b/client/signals/update_team_on_call_schedule_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateTeamOnCallScheduleReader is a Reader for the UpdateTeamOnCallSchedule structure. +type UpdateTeamOnCallScheduleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateTeamOnCallScheduleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateTeamOnCallScheduleOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateTeamOnCallScheduleOK creates a UpdateTeamOnCallScheduleOK with default headers values +func NewUpdateTeamOnCallScheduleOK() *UpdateTeamOnCallScheduleOK { + return &UpdateTeamOnCallScheduleOK{} +} + +/* +UpdateTeamOnCallScheduleOK describes a response with status code 200, with default header values. + +Update a Signals on-call schedule by ID +*/ +type UpdateTeamOnCallScheduleOK struct { +} + +// IsSuccess returns true when this update team on call schedule o k response has a 2xx status code +func (o *UpdateTeamOnCallScheduleOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update team on call schedule o k response has a 3xx status code +func (o *UpdateTeamOnCallScheduleOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update team on call schedule o k response has a 4xx status code +func (o *UpdateTeamOnCallScheduleOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update team on call schedule o k response has a 5xx status code +func (o *UpdateTeamOnCallScheduleOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update team on call schedule o k response a status code equal to that given +func (o *UpdateTeamOnCallScheduleOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateTeamOnCallScheduleOK) Error() string { + return fmt.Sprintf("[PATCH /v1/teams/{team_id}/on_call_schedules/{schedule_id}][%d] updateTeamOnCallScheduleOK ", 200) +} + +func (o *UpdateTeamOnCallScheduleOK) String() string { + return fmt.Sprintf("[PATCH /v1/teams/{team_id}/on_call_schedules/{schedule_id}][%d] updateTeamOnCallScheduleOK ", 200) +} + +func (o *UpdateTeamOnCallScheduleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/signals/update_team_signal_rule_parameters.go b/client/signals/update_team_signal_rule_parameters.go new file mode 100644 index 0000000..c726ef2 --- /dev/null +++ b/client/signals/update_team_signal_rule_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateTeamSignalRuleParams creates a new UpdateTeamSignalRuleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateTeamSignalRuleParams() *UpdateTeamSignalRuleParams { + return &UpdateTeamSignalRuleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateTeamSignalRuleParamsWithTimeout creates a new UpdateTeamSignalRuleParams object +// with the ability to set a timeout on a request. +func NewUpdateTeamSignalRuleParamsWithTimeout(timeout time.Duration) *UpdateTeamSignalRuleParams { + return &UpdateTeamSignalRuleParams{ + timeout: timeout, + } +} + +// NewUpdateTeamSignalRuleParamsWithContext creates a new UpdateTeamSignalRuleParams object +// with the ability to set a context for a request. +func NewUpdateTeamSignalRuleParamsWithContext(ctx context.Context) *UpdateTeamSignalRuleParams { + return &UpdateTeamSignalRuleParams{ + Context: ctx, + } +} + +// NewUpdateTeamSignalRuleParamsWithHTTPClient creates a new UpdateTeamSignalRuleParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateTeamSignalRuleParamsWithHTTPClient(client *http.Client) *UpdateTeamSignalRuleParams { + return &UpdateTeamSignalRuleParams{ + HTTPClient: client, + } +} + +/* +UpdateTeamSignalRuleParams contains all the parameters to send to the API endpoint + + for the update team signal rule operation. + + Typically these are written to a http.Request. +*/ +type UpdateTeamSignalRuleParams struct { + + // ID. + ID string + + // TeamID. + TeamID string + + // UpdateTeamSignalRule. + UpdateTeamSignalRule *models.UpdateTeamSignalRule + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update team signal rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTeamSignalRuleParams) WithDefaults() *UpdateTeamSignalRuleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update team signal rule params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTeamSignalRuleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update team signal rule params +func (o *UpdateTeamSignalRuleParams) WithTimeout(timeout time.Duration) *UpdateTeamSignalRuleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update team signal rule params +func (o *UpdateTeamSignalRuleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update team signal rule params +func (o *UpdateTeamSignalRuleParams) WithContext(ctx context.Context) *UpdateTeamSignalRuleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update team signal rule params +func (o *UpdateTeamSignalRuleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update team signal rule params +func (o *UpdateTeamSignalRuleParams) WithHTTPClient(client *http.Client) *UpdateTeamSignalRuleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update team signal rule params +func (o *UpdateTeamSignalRuleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the update team signal rule params +func (o *UpdateTeamSignalRuleParams) WithID(id string) *UpdateTeamSignalRuleParams { + o.SetID(id) + return o +} + +// SetID adds the id to the update team signal rule params +func (o *UpdateTeamSignalRuleParams) SetID(id string) { + o.ID = id +} + +// WithTeamID adds the teamID to the update team signal rule params +func (o *UpdateTeamSignalRuleParams) WithTeamID(teamID string) *UpdateTeamSignalRuleParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the update team signal rule params +func (o *UpdateTeamSignalRuleParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WithUpdateTeamSignalRule adds the updateTeamSignalRule to the update team signal rule params +func (o *UpdateTeamSignalRuleParams) WithUpdateTeamSignalRule(updateTeamSignalRule *models.UpdateTeamSignalRule) *UpdateTeamSignalRuleParams { + o.SetUpdateTeamSignalRule(updateTeamSignalRule) + return o +} + +// SetUpdateTeamSignalRule adds the updateTeamSignalRule to the update team signal rule params +func (o *UpdateTeamSignalRuleParams) SetUpdateTeamSignalRule(updateTeamSignalRule *models.UpdateTeamSignalRule) { + o.UpdateTeamSignalRule = updateTeamSignalRule +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateTeamSignalRuleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + if o.UpdateTeamSignalRule != nil { + if err := r.SetBodyParam(o.UpdateTeamSignalRule); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/signals/update_team_signal_rule_responses.go b/client/signals/update_team_signal_rule_responses.go new file mode 100644 index 0000000..77b2a22 --- /dev/null +++ b/client/signals/update_team_signal_rule_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package signals + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateTeamSignalRuleReader is a Reader for the UpdateTeamSignalRule structure. +type UpdateTeamSignalRuleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateTeamSignalRuleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateTeamSignalRuleOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateTeamSignalRuleOK creates a UpdateTeamSignalRuleOK with default headers values +func NewUpdateTeamSignalRuleOK() *UpdateTeamSignalRuleOK { + return &UpdateTeamSignalRuleOK{} +} + +/* +UpdateTeamSignalRuleOK describes a response with status code 200, with default header values. + +Update a Signals rule by ID +*/ +type UpdateTeamSignalRuleOK struct { +} + +// IsSuccess returns true when this update team signal rule o k response has a 2xx status code +func (o *UpdateTeamSignalRuleOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update team signal rule o k response has a 3xx status code +func (o *UpdateTeamSignalRuleOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update team signal rule o k response has a 4xx status code +func (o *UpdateTeamSignalRuleOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update team signal rule o k response has a 5xx status code +func (o *UpdateTeamSignalRuleOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update team signal rule o k response a status code equal to that given +func (o *UpdateTeamSignalRuleOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateTeamSignalRuleOK) Error() string { + return fmt.Sprintf("[PATCH /v1/teams/{team_id}/signal_rules/{id}][%d] updateTeamSignalRuleOK ", 200) +} + +func (o *UpdateTeamSignalRuleOK) String() string { + return fmt.Sprintf("[PATCH /v1/teams/{team_id}/signal_rules/{id}][%d] updateTeamSignalRuleOK ", 200) +} + +func (o *UpdateTeamSignalRuleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/status_pages/create_email_subscriber_parameters.go b/client/status_pages/create_email_subscriber_parameters.go new file mode 100644 index 0000000..8e51525 --- /dev/null +++ b/client/status_pages/create_email_subscriber_parameters.go @@ -0,0 +1,174 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateEmailSubscriberParams creates a new CreateEmailSubscriberParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateEmailSubscriberParams() *CreateEmailSubscriberParams { + return &CreateEmailSubscriberParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateEmailSubscriberParamsWithTimeout creates a new CreateEmailSubscriberParams object +// with the ability to set a timeout on a request. +func NewCreateEmailSubscriberParamsWithTimeout(timeout time.Duration) *CreateEmailSubscriberParams { + return &CreateEmailSubscriberParams{ + timeout: timeout, + } +} + +// NewCreateEmailSubscriberParamsWithContext creates a new CreateEmailSubscriberParams object +// with the ability to set a context for a request. +func NewCreateEmailSubscriberParamsWithContext(ctx context.Context) *CreateEmailSubscriberParams { + return &CreateEmailSubscriberParams{ + Context: ctx, + } +} + +// NewCreateEmailSubscriberParamsWithHTTPClient creates a new CreateEmailSubscriberParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateEmailSubscriberParamsWithHTTPClient(client *http.Client) *CreateEmailSubscriberParams { + return &CreateEmailSubscriberParams{ + HTTPClient: client, + } +} + +/* +CreateEmailSubscriberParams contains all the parameters to send to the API endpoint + + for the create email subscriber operation. + + Typically these are written to a http.Request. +*/ +type CreateEmailSubscriberParams struct { + + /* Emails. + + A comma-separated list of emails to subscribe. + */ + Emails string + + // NuncConnectionID. + NuncConnectionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create email subscriber params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateEmailSubscriberParams) WithDefaults() *CreateEmailSubscriberParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create email subscriber params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateEmailSubscriberParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create email subscriber params +func (o *CreateEmailSubscriberParams) WithTimeout(timeout time.Duration) *CreateEmailSubscriberParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create email subscriber params +func (o *CreateEmailSubscriberParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create email subscriber params +func (o *CreateEmailSubscriberParams) WithContext(ctx context.Context) *CreateEmailSubscriberParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create email subscriber params +func (o *CreateEmailSubscriberParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create email subscriber params +func (o *CreateEmailSubscriberParams) WithHTTPClient(client *http.Client) *CreateEmailSubscriberParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create email subscriber params +func (o *CreateEmailSubscriberParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEmails adds the emails to the create email subscriber params +func (o *CreateEmailSubscriberParams) WithEmails(emails string) *CreateEmailSubscriberParams { + o.SetEmails(emails) + return o +} + +// SetEmails adds the emails to the create email subscriber params +func (o *CreateEmailSubscriberParams) SetEmails(emails string) { + o.Emails = emails +} + +// WithNuncConnectionID adds the nuncConnectionID to the create email subscriber params +func (o *CreateEmailSubscriberParams) WithNuncConnectionID(nuncConnectionID string) *CreateEmailSubscriberParams { + o.SetNuncConnectionID(nuncConnectionID) + return o +} + +// SetNuncConnectionID adds the nuncConnectionId to the create email subscriber params +func (o *CreateEmailSubscriberParams) SetNuncConnectionID(nuncConnectionID string) { + o.NuncConnectionID = nuncConnectionID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateEmailSubscriberParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // form param emails + frEmails := o.Emails + fEmails := frEmails + if fEmails != "" { + if err := r.SetFormParam("emails", fEmails); err != nil { + return err + } + } + + // path param nunc_connection_id + if err := r.SetPathParam("nunc_connection_id", o.NuncConnectionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/create_email_subscriber_responses.go b/client/status_pages/create_email_subscriber_responses.go new file mode 100644 index 0000000..aa66d6c --- /dev/null +++ b/client/status_pages/create_email_subscriber_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateEmailSubscriberReader is a Reader for the CreateEmailSubscriber structure. +type CreateEmailSubscriberReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateEmailSubscriberReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateEmailSubscriberCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateEmailSubscriberCreated creates a CreateEmailSubscriberCreated with default headers values +func NewCreateEmailSubscriberCreated() *CreateEmailSubscriberCreated { + return &CreateEmailSubscriberCreated{} +} + +/* +CreateEmailSubscriberCreated describes a response with status code 201, with default header values. + +Subscribes a comma-separated string of emails to status page updates +*/ +type CreateEmailSubscriberCreated struct { + Payload *models.NuncEmailSubscribersEntity +} + +// IsSuccess returns true when this create email subscriber created response has a 2xx status code +func (o *CreateEmailSubscriberCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create email subscriber created response has a 3xx status code +func (o *CreateEmailSubscriberCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create email subscriber created response has a 4xx status code +func (o *CreateEmailSubscriberCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create email subscriber created response has a 5xx status code +func (o *CreateEmailSubscriberCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create email subscriber created response a status code equal to that given +func (o *CreateEmailSubscriberCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateEmailSubscriberCreated) Error() string { + return fmt.Sprintf("[POST /v1/nunc_connections/{nunc_connection_id}/subscribers][%d] createEmailSubscriberCreated %+v", 201, o.Payload) +} + +func (o *CreateEmailSubscriberCreated) String() string { + return fmt.Sprintf("[POST /v1/nunc_connections/{nunc_connection_id}/subscribers][%d] createEmailSubscriberCreated %+v", 201, o.Payload) +} + +func (o *CreateEmailSubscriberCreated) GetPayload() *models.NuncEmailSubscribersEntity { + return o.Payload +} + +func (o *CreateEmailSubscriberCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NuncEmailSubscribersEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/status_pages/create_nunc_component_group_parameters.go b/client/status_pages/create_nunc_component_group_parameters.go new file mode 100644 index 0000000..9a91a4f --- /dev/null +++ b/client/status_pages/create_nunc_component_group_parameters.go @@ -0,0 +1,232 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCreateNuncComponentGroupParams creates a new CreateNuncComponentGroupParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateNuncComponentGroupParams() *CreateNuncComponentGroupParams { + return &CreateNuncComponentGroupParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateNuncComponentGroupParamsWithTimeout creates a new CreateNuncComponentGroupParams object +// with the ability to set a timeout on a request. +func NewCreateNuncComponentGroupParamsWithTimeout(timeout time.Duration) *CreateNuncComponentGroupParams { + return &CreateNuncComponentGroupParams{ + timeout: timeout, + } +} + +// NewCreateNuncComponentGroupParamsWithContext creates a new CreateNuncComponentGroupParams object +// with the ability to set a context for a request. +func NewCreateNuncComponentGroupParamsWithContext(ctx context.Context) *CreateNuncComponentGroupParams { + return &CreateNuncComponentGroupParams{ + Context: ctx, + } +} + +// NewCreateNuncComponentGroupParamsWithHTTPClient creates a new CreateNuncComponentGroupParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateNuncComponentGroupParamsWithHTTPClient(client *http.Client) *CreateNuncComponentGroupParams { + return &CreateNuncComponentGroupParams{ + HTTPClient: client, + } +} + +/* +CreateNuncComponentGroupParams contains all the parameters to send to the API endpoint + + for the create nunc component group operation. + + Typically these are written to a http.Request. +*/ +type CreateNuncComponentGroupParams struct { + + // ComponentGroupID. + ComponentGroupID *string + + // Name. + Name string + + // NuncConnectionID. + NuncConnectionID string + + // Position. + // + // Format: int32 + Position *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create nunc component group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNuncComponentGroupParams) WithDefaults() *CreateNuncComponentGroupParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create nunc component group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNuncComponentGroupParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create nunc component group params +func (o *CreateNuncComponentGroupParams) WithTimeout(timeout time.Duration) *CreateNuncComponentGroupParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create nunc component group params +func (o *CreateNuncComponentGroupParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create nunc component group params +func (o *CreateNuncComponentGroupParams) WithContext(ctx context.Context) *CreateNuncComponentGroupParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create nunc component group params +func (o *CreateNuncComponentGroupParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create nunc component group params +func (o *CreateNuncComponentGroupParams) WithHTTPClient(client *http.Client) *CreateNuncComponentGroupParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create nunc component group params +func (o *CreateNuncComponentGroupParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithComponentGroupID adds the componentGroupID to the create nunc component group params +func (o *CreateNuncComponentGroupParams) WithComponentGroupID(componentGroupID *string) *CreateNuncComponentGroupParams { + o.SetComponentGroupID(componentGroupID) + return o +} + +// SetComponentGroupID adds the componentGroupId to the create nunc component group params +func (o *CreateNuncComponentGroupParams) SetComponentGroupID(componentGroupID *string) { + o.ComponentGroupID = componentGroupID +} + +// WithName adds the name to the create nunc component group params +func (o *CreateNuncComponentGroupParams) WithName(name string) *CreateNuncComponentGroupParams { + o.SetName(name) + return o +} + +// SetName adds the name to the create nunc component group params +func (o *CreateNuncComponentGroupParams) SetName(name string) { + o.Name = name +} + +// WithNuncConnectionID adds the nuncConnectionID to the create nunc component group params +func (o *CreateNuncComponentGroupParams) WithNuncConnectionID(nuncConnectionID string) *CreateNuncComponentGroupParams { + o.SetNuncConnectionID(nuncConnectionID) + return o +} + +// SetNuncConnectionID adds the nuncConnectionId to the create nunc component group params +func (o *CreateNuncComponentGroupParams) SetNuncConnectionID(nuncConnectionID string) { + o.NuncConnectionID = nuncConnectionID +} + +// WithPosition adds the position to the create nunc component group params +func (o *CreateNuncComponentGroupParams) WithPosition(position *int32) *CreateNuncComponentGroupParams { + o.SetPosition(position) + return o +} + +// SetPosition adds the position to the create nunc component group params +func (o *CreateNuncComponentGroupParams) SetPosition(position *int32) { + o.Position = position +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateNuncComponentGroupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ComponentGroupID != nil { + + // form param component_group_id + var frComponentGroupID string + if o.ComponentGroupID != nil { + frComponentGroupID = *o.ComponentGroupID + } + fComponentGroupID := frComponentGroupID + if fComponentGroupID != "" { + if err := r.SetFormParam("component_group_id", fComponentGroupID); err != nil { + return err + } + } + } + + // form param name + frName := o.Name + fName := frName + if fName != "" { + if err := r.SetFormParam("name", fName); err != nil { + return err + } + } + + // path param nunc_connection_id + if err := r.SetPathParam("nunc_connection_id", o.NuncConnectionID); err != nil { + return err + } + + if o.Position != nil { + + // form param position + var frPosition int32 + if o.Position != nil { + frPosition = *o.Position + } + fPosition := swag.FormatInt32(frPosition) + if fPosition != "" { + if err := r.SetFormParam("position", fPosition); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/create_nunc_component_group_responses.go b/client/status_pages/create_nunc_component_group_responses.go new file mode 100644 index 0000000..c5c6801 --- /dev/null +++ b/client/status_pages/create_nunc_component_group_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateNuncComponentGroupReader is a Reader for the CreateNuncComponentGroup structure. +type CreateNuncComponentGroupReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateNuncComponentGroupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateNuncComponentGroupCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateNuncComponentGroupCreated creates a CreateNuncComponentGroupCreated with default headers values +func NewCreateNuncComponentGroupCreated() *CreateNuncComponentGroupCreated { + return &CreateNuncComponentGroupCreated{} +} + +/* +CreateNuncComponentGroupCreated describes a response with status code 201, with default header values. + +Add a component group to be displayed on a FireHydrant status page +*/ +type CreateNuncComponentGroupCreated struct { + Payload *models.NuncConnectionEntity +} + +// IsSuccess returns true when this create nunc component group created response has a 2xx status code +func (o *CreateNuncComponentGroupCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create nunc component group created response has a 3xx status code +func (o *CreateNuncComponentGroupCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create nunc component group created response has a 4xx status code +func (o *CreateNuncComponentGroupCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create nunc component group created response has a 5xx status code +func (o *CreateNuncComponentGroupCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create nunc component group created response a status code equal to that given +func (o *CreateNuncComponentGroupCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateNuncComponentGroupCreated) Error() string { + return fmt.Sprintf("[POST /v1/nunc_connections/{nunc_connection_id}/component_groups][%d] createNuncComponentGroupCreated %+v", 201, o.Payload) +} + +func (o *CreateNuncComponentGroupCreated) String() string { + return fmt.Sprintf("[POST /v1/nunc_connections/{nunc_connection_id}/component_groups][%d] createNuncComponentGroupCreated %+v", 201, o.Payload) +} + +func (o *CreateNuncComponentGroupCreated) GetPayload() *models.NuncConnectionEntity { + return o.Payload +} + +func (o *CreateNuncComponentGroupCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NuncConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/status_pages/create_nunc_connection_parameters.go b/client/status_pages/create_nunc_connection_parameters.go new file mode 100644 index 0000000..103b209 --- /dev/null +++ b/client/status_pages/create_nunc_connection_parameters.go @@ -0,0 +1,690 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCreateNuncConnectionParams creates a new CreateNuncConnectionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateNuncConnectionParams() *CreateNuncConnectionParams { + return &CreateNuncConnectionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateNuncConnectionParamsWithTimeout creates a new CreateNuncConnectionParams object +// with the ability to set a timeout on a request. +func NewCreateNuncConnectionParamsWithTimeout(timeout time.Duration) *CreateNuncConnectionParams { + return &CreateNuncConnectionParams{ + timeout: timeout, + } +} + +// NewCreateNuncConnectionParamsWithContext creates a new CreateNuncConnectionParams object +// with the ability to set a context for a request. +func NewCreateNuncConnectionParamsWithContext(ctx context.Context) *CreateNuncConnectionParams { + return &CreateNuncConnectionParams{ + Context: ctx, + } +} + +// NewCreateNuncConnectionParamsWithHTTPClient creates a new CreateNuncConnectionParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateNuncConnectionParamsWithHTTPClient(client *http.Client) *CreateNuncConnectionParams { + return &CreateNuncConnectionParams{ + HTTPClient: client, + } +} + +/* +CreateNuncConnectionParams contains all the parameters to send to the API endpoint + + for the create nunc connection operation. + + Typically these are written to a http.Request. +*/ +type CreateNuncConnectionParams struct { + + // CompanyName. + CompanyName *string + + // CompanyTosURL. + CompanyTosURL *string + + // CompanyWebsite. + CompanyWebsite *string + + // ComponentsInfrastructureID. + ComponentsInfrastructureID []string + + // ComponentsInfrastructureType. + ComponentsInfrastructureType []string + + /* ConditionsConditionID. + + Severity matrix condition id + */ + ConditionsConditionID []string + + /* ConditionsNuncCondition. + + Status page condition to map your severity matrix condition to + */ + ConditionsNuncCondition []string + + // Domain. + Domain string + + // EnableHistogram. + EnableHistogram *bool + + // ExposedFields. + ExposedFields []string + + // GreetingBody. + GreetingBody *string + + // GreetingTitle. + GreetingTitle *string + + // OperationalMessage. + OperationalMessage *string + + // PrimaryColor. + PrimaryColor *string + + // SecondaryColor. + SecondaryColor *string + + // Title. + Title *string + + // UIVersion. + // + // Format: int32 + UIVersion *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create nunc connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNuncConnectionParams) WithDefaults() *CreateNuncConnectionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create nunc connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNuncConnectionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create nunc connection params +func (o *CreateNuncConnectionParams) WithTimeout(timeout time.Duration) *CreateNuncConnectionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create nunc connection params +func (o *CreateNuncConnectionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create nunc connection params +func (o *CreateNuncConnectionParams) WithContext(ctx context.Context) *CreateNuncConnectionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create nunc connection params +func (o *CreateNuncConnectionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create nunc connection params +func (o *CreateNuncConnectionParams) WithHTTPClient(client *http.Client) *CreateNuncConnectionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create nunc connection params +func (o *CreateNuncConnectionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompanyName adds the companyName to the create nunc connection params +func (o *CreateNuncConnectionParams) WithCompanyName(companyName *string) *CreateNuncConnectionParams { + o.SetCompanyName(companyName) + return o +} + +// SetCompanyName adds the companyName to the create nunc connection params +func (o *CreateNuncConnectionParams) SetCompanyName(companyName *string) { + o.CompanyName = companyName +} + +// WithCompanyTosURL adds the companyTosURL to the create nunc connection params +func (o *CreateNuncConnectionParams) WithCompanyTosURL(companyTosURL *string) *CreateNuncConnectionParams { + o.SetCompanyTosURL(companyTosURL) + return o +} + +// SetCompanyTosURL adds the companyTosUrl to the create nunc connection params +func (o *CreateNuncConnectionParams) SetCompanyTosURL(companyTosURL *string) { + o.CompanyTosURL = companyTosURL +} + +// WithCompanyWebsite adds the companyWebsite to the create nunc connection params +func (o *CreateNuncConnectionParams) WithCompanyWebsite(companyWebsite *string) *CreateNuncConnectionParams { + o.SetCompanyWebsite(companyWebsite) + return o +} + +// SetCompanyWebsite adds the companyWebsite to the create nunc connection params +func (o *CreateNuncConnectionParams) SetCompanyWebsite(companyWebsite *string) { + o.CompanyWebsite = companyWebsite +} + +// WithComponentsInfrastructureID adds the componentsInfrastructureID to the create nunc connection params +func (o *CreateNuncConnectionParams) WithComponentsInfrastructureID(componentsInfrastructureID []string) *CreateNuncConnectionParams { + o.SetComponentsInfrastructureID(componentsInfrastructureID) + return o +} + +// SetComponentsInfrastructureID adds the componentsInfrastructureId to the create nunc connection params +func (o *CreateNuncConnectionParams) SetComponentsInfrastructureID(componentsInfrastructureID []string) { + o.ComponentsInfrastructureID = componentsInfrastructureID +} + +// WithComponentsInfrastructureType adds the componentsInfrastructureType to the create nunc connection params +func (o *CreateNuncConnectionParams) WithComponentsInfrastructureType(componentsInfrastructureType []string) *CreateNuncConnectionParams { + o.SetComponentsInfrastructureType(componentsInfrastructureType) + return o +} + +// SetComponentsInfrastructureType adds the componentsInfrastructureType to the create nunc connection params +func (o *CreateNuncConnectionParams) SetComponentsInfrastructureType(componentsInfrastructureType []string) { + o.ComponentsInfrastructureType = componentsInfrastructureType +} + +// WithConditionsConditionID adds the conditionsConditionID to the create nunc connection params +func (o *CreateNuncConnectionParams) WithConditionsConditionID(conditionsConditionID []string) *CreateNuncConnectionParams { + o.SetConditionsConditionID(conditionsConditionID) + return o +} + +// SetConditionsConditionID adds the conditionsConditionId to the create nunc connection params +func (o *CreateNuncConnectionParams) SetConditionsConditionID(conditionsConditionID []string) { + o.ConditionsConditionID = conditionsConditionID +} + +// WithConditionsNuncCondition adds the conditionsNuncCondition to the create nunc connection params +func (o *CreateNuncConnectionParams) WithConditionsNuncCondition(conditionsNuncCondition []string) *CreateNuncConnectionParams { + o.SetConditionsNuncCondition(conditionsNuncCondition) + return o +} + +// SetConditionsNuncCondition adds the conditionsNuncCondition to the create nunc connection params +func (o *CreateNuncConnectionParams) SetConditionsNuncCondition(conditionsNuncCondition []string) { + o.ConditionsNuncCondition = conditionsNuncCondition +} + +// WithDomain adds the domain to the create nunc connection params +func (o *CreateNuncConnectionParams) WithDomain(domain string) *CreateNuncConnectionParams { + o.SetDomain(domain) + return o +} + +// SetDomain adds the domain to the create nunc connection params +func (o *CreateNuncConnectionParams) SetDomain(domain string) { + o.Domain = domain +} + +// WithEnableHistogram adds the enableHistogram to the create nunc connection params +func (o *CreateNuncConnectionParams) WithEnableHistogram(enableHistogram *bool) *CreateNuncConnectionParams { + o.SetEnableHistogram(enableHistogram) + return o +} + +// SetEnableHistogram adds the enableHistogram to the create nunc connection params +func (o *CreateNuncConnectionParams) SetEnableHistogram(enableHistogram *bool) { + o.EnableHistogram = enableHistogram +} + +// WithExposedFields adds the exposedFields to the create nunc connection params +func (o *CreateNuncConnectionParams) WithExposedFields(exposedFields []string) *CreateNuncConnectionParams { + o.SetExposedFields(exposedFields) + return o +} + +// SetExposedFields adds the exposedFields to the create nunc connection params +func (o *CreateNuncConnectionParams) SetExposedFields(exposedFields []string) { + o.ExposedFields = exposedFields +} + +// WithGreetingBody adds the greetingBody to the create nunc connection params +func (o *CreateNuncConnectionParams) WithGreetingBody(greetingBody *string) *CreateNuncConnectionParams { + o.SetGreetingBody(greetingBody) + return o +} + +// SetGreetingBody adds the greetingBody to the create nunc connection params +func (o *CreateNuncConnectionParams) SetGreetingBody(greetingBody *string) { + o.GreetingBody = greetingBody +} + +// WithGreetingTitle adds the greetingTitle to the create nunc connection params +func (o *CreateNuncConnectionParams) WithGreetingTitle(greetingTitle *string) *CreateNuncConnectionParams { + o.SetGreetingTitle(greetingTitle) + return o +} + +// SetGreetingTitle adds the greetingTitle to the create nunc connection params +func (o *CreateNuncConnectionParams) SetGreetingTitle(greetingTitle *string) { + o.GreetingTitle = greetingTitle +} + +// WithOperationalMessage adds the operationalMessage to the create nunc connection params +func (o *CreateNuncConnectionParams) WithOperationalMessage(operationalMessage *string) *CreateNuncConnectionParams { + o.SetOperationalMessage(operationalMessage) + return o +} + +// SetOperationalMessage adds the operationalMessage to the create nunc connection params +func (o *CreateNuncConnectionParams) SetOperationalMessage(operationalMessage *string) { + o.OperationalMessage = operationalMessage +} + +// WithPrimaryColor adds the primaryColor to the create nunc connection params +func (o *CreateNuncConnectionParams) WithPrimaryColor(primaryColor *string) *CreateNuncConnectionParams { + o.SetPrimaryColor(primaryColor) + return o +} + +// SetPrimaryColor adds the primaryColor to the create nunc connection params +func (o *CreateNuncConnectionParams) SetPrimaryColor(primaryColor *string) { + o.PrimaryColor = primaryColor +} + +// WithSecondaryColor adds the secondaryColor to the create nunc connection params +func (o *CreateNuncConnectionParams) WithSecondaryColor(secondaryColor *string) *CreateNuncConnectionParams { + o.SetSecondaryColor(secondaryColor) + return o +} + +// SetSecondaryColor adds the secondaryColor to the create nunc connection params +func (o *CreateNuncConnectionParams) SetSecondaryColor(secondaryColor *string) { + o.SecondaryColor = secondaryColor +} + +// WithTitle adds the title to the create nunc connection params +func (o *CreateNuncConnectionParams) WithTitle(title *string) *CreateNuncConnectionParams { + o.SetTitle(title) + return o +} + +// SetTitle adds the title to the create nunc connection params +func (o *CreateNuncConnectionParams) SetTitle(title *string) { + o.Title = title +} + +// WithUIVersion adds the uIVersion to the create nunc connection params +func (o *CreateNuncConnectionParams) WithUIVersion(uIVersion *int32) *CreateNuncConnectionParams { + o.SetUIVersion(uIVersion) + return o +} + +// SetUIVersion adds the uiVersion to the create nunc connection params +func (o *CreateNuncConnectionParams) SetUIVersion(uIVersion *int32) { + o.UIVersion = uIVersion +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateNuncConnectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CompanyName != nil { + + // form param company_name + var frCompanyName string + if o.CompanyName != nil { + frCompanyName = *o.CompanyName + } + fCompanyName := frCompanyName + if fCompanyName != "" { + if err := r.SetFormParam("company_name", fCompanyName); err != nil { + return err + } + } + } + + if o.CompanyTosURL != nil { + + // form param company_tos_url + var frCompanyTosURL string + if o.CompanyTosURL != nil { + frCompanyTosURL = *o.CompanyTosURL + } + fCompanyTosURL := frCompanyTosURL + if fCompanyTosURL != "" { + if err := r.SetFormParam("company_tos_url", fCompanyTosURL); err != nil { + return err + } + } + } + + if o.CompanyWebsite != nil { + + // form param company_website + var frCompanyWebsite string + if o.CompanyWebsite != nil { + frCompanyWebsite = *o.CompanyWebsite + } + fCompanyWebsite := frCompanyWebsite + if fCompanyWebsite != "" { + if err := r.SetFormParam("company_website", fCompanyWebsite); err != nil { + return err + } + } + } + + if o.ComponentsInfrastructureID != nil { + + // binding items for components[infrastructure_id] + joinedComponentsInfrastructureID := o.bindParamComponentsInfrastructureID(reg) + + // form array param components[infrastructure_id] + if err := r.SetFormParam("components[infrastructure_id]", joinedComponentsInfrastructureID...); err != nil { + return err + } + } + + if o.ComponentsInfrastructureType != nil { + + // binding items for components[infrastructure_type] + joinedComponentsInfrastructureType := o.bindParamComponentsInfrastructureType(reg) + + // form array param components[infrastructure_type] + if err := r.SetFormParam("components[infrastructure_type]", joinedComponentsInfrastructureType...); err != nil { + return err + } + } + + if o.ConditionsConditionID != nil { + + // binding items for conditions[condition_id] + joinedConditionsConditionID := o.bindParamConditionsConditionID(reg) + + // form array param conditions[condition_id] + if err := r.SetFormParam("conditions[condition_id]", joinedConditionsConditionID...); err != nil { + return err + } + } + + if o.ConditionsNuncCondition != nil { + + // binding items for conditions[nunc_condition] + joinedConditionsNuncCondition := o.bindParamConditionsNuncCondition(reg) + + // form array param conditions[nunc_condition] + if err := r.SetFormParam("conditions[nunc_condition]", joinedConditionsNuncCondition...); err != nil { + return err + } + } + + // form param domain + frDomain := o.Domain + fDomain := frDomain + if fDomain != "" { + if err := r.SetFormParam("domain", fDomain); err != nil { + return err + } + } + + if o.EnableHistogram != nil { + + // form param enable_histogram + var frEnableHistogram bool + if o.EnableHistogram != nil { + frEnableHistogram = *o.EnableHistogram + } + fEnableHistogram := swag.FormatBool(frEnableHistogram) + if fEnableHistogram != "" { + if err := r.SetFormParam("enable_histogram", fEnableHistogram); err != nil { + return err + } + } + } + + if o.ExposedFields != nil { + + // binding items for exposed_fields + joinedExposedFields := o.bindParamExposedFields(reg) + + // form array param exposed_fields + if err := r.SetFormParam("exposed_fields", joinedExposedFields...); err != nil { + return err + } + } + + if o.GreetingBody != nil { + + // form param greeting_body + var frGreetingBody string + if o.GreetingBody != nil { + frGreetingBody = *o.GreetingBody + } + fGreetingBody := frGreetingBody + if fGreetingBody != "" { + if err := r.SetFormParam("greeting_body", fGreetingBody); err != nil { + return err + } + } + } + + if o.GreetingTitle != nil { + + // form param greeting_title + var frGreetingTitle string + if o.GreetingTitle != nil { + frGreetingTitle = *o.GreetingTitle + } + fGreetingTitle := frGreetingTitle + if fGreetingTitle != "" { + if err := r.SetFormParam("greeting_title", fGreetingTitle); err != nil { + return err + } + } + } + + if o.OperationalMessage != nil { + + // form param operational_message + var frOperationalMessage string + if o.OperationalMessage != nil { + frOperationalMessage = *o.OperationalMessage + } + fOperationalMessage := frOperationalMessage + if fOperationalMessage != "" { + if err := r.SetFormParam("operational_message", fOperationalMessage); err != nil { + return err + } + } + } + + if o.PrimaryColor != nil { + + // form param primary_color + var frPrimaryColor string + if o.PrimaryColor != nil { + frPrimaryColor = *o.PrimaryColor + } + fPrimaryColor := frPrimaryColor + if fPrimaryColor != "" { + if err := r.SetFormParam("primary_color", fPrimaryColor); err != nil { + return err + } + } + } + + if o.SecondaryColor != nil { + + // form param secondary_color + var frSecondaryColor string + if o.SecondaryColor != nil { + frSecondaryColor = *o.SecondaryColor + } + fSecondaryColor := frSecondaryColor + if fSecondaryColor != "" { + if err := r.SetFormParam("secondary_color", fSecondaryColor); err != nil { + return err + } + } + } + + if o.Title != nil { + + // form param title + var frTitle string + if o.Title != nil { + frTitle = *o.Title + } + fTitle := frTitle + if fTitle != "" { + if err := r.SetFormParam("title", fTitle); err != nil { + return err + } + } + } + + if o.UIVersion != nil { + + // form param ui_version + var frUIVersion int32 + if o.UIVersion != nil { + frUIVersion = *o.UIVersion + } + fUIVersion := swag.FormatInt32(frUIVersion) + if fUIVersion != "" { + if err := r.SetFormParam("ui_version", fUIVersion); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamCreateNuncConnection binds the parameter components[infrastructure_id] +func (o *CreateNuncConnectionParams) bindParamComponentsInfrastructureID(formats strfmt.Registry) []string { + componentsInfrastructureIDIR := o.ComponentsInfrastructureID + + var componentsInfrastructureIDIC []string + for _, componentsInfrastructureIDIIR := range componentsInfrastructureIDIR { // explode []string + + componentsInfrastructureIDIIV := componentsInfrastructureIDIIR // string as string + componentsInfrastructureIDIC = append(componentsInfrastructureIDIC, componentsInfrastructureIDIIV) + } + + // items.CollectionFormat: "" + componentsInfrastructureIDIS := swag.JoinByFormat(componentsInfrastructureIDIC, "") + + return componentsInfrastructureIDIS +} + +// bindParamCreateNuncConnection binds the parameter components[infrastructure_type] +func (o *CreateNuncConnectionParams) bindParamComponentsInfrastructureType(formats strfmt.Registry) []string { + componentsInfrastructureTypeIR := o.ComponentsInfrastructureType + + var componentsInfrastructureTypeIC []string + for _, componentsInfrastructureTypeIIR := range componentsInfrastructureTypeIR { // explode []string + + componentsInfrastructureTypeIIV := componentsInfrastructureTypeIIR // string as string + componentsInfrastructureTypeIC = append(componentsInfrastructureTypeIC, componentsInfrastructureTypeIIV) + } + + // items.CollectionFormat: "" + componentsInfrastructureTypeIS := swag.JoinByFormat(componentsInfrastructureTypeIC, "") + + return componentsInfrastructureTypeIS +} + +// bindParamCreateNuncConnection binds the parameter conditions[condition_id] +func (o *CreateNuncConnectionParams) bindParamConditionsConditionID(formats strfmt.Registry) []string { + conditionsConditionIDIR := o.ConditionsConditionID + + var conditionsConditionIDIC []string + for _, conditionsConditionIDIIR := range conditionsConditionIDIR { // explode []string + + conditionsConditionIDIIV := conditionsConditionIDIIR // string as string + conditionsConditionIDIC = append(conditionsConditionIDIC, conditionsConditionIDIIV) + } + + // items.CollectionFormat: "" + conditionsConditionIDIS := swag.JoinByFormat(conditionsConditionIDIC, "") + + return conditionsConditionIDIS +} + +// bindParamCreateNuncConnection binds the parameter conditions[nunc_condition] +func (o *CreateNuncConnectionParams) bindParamConditionsNuncCondition(formats strfmt.Registry) []string { + conditionsNuncConditionIR := o.ConditionsNuncCondition + + var conditionsNuncConditionIC []string + for _, conditionsNuncConditionIIR := range conditionsNuncConditionIR { // explode []string + + conditionsNuncConditionIIV := conditionsNuncConditionIIR // string as string + conditionsNuncConditionIC = append(conditionsNuncConditionIC, conditionsNuncConditionIIV) + } + + // items.CollectionFormat: "" + conditionsNuncConditionIS := swag.JoinByFormat(conditionsNuncConditionIC, "") + + return conditionsNuncConditionIS +} + +// bindParamCreateNuncConnection binds the parameter exposed_fields +func (o *CreateNuncConnectionParams) bindParamExposedFields(formats strfmt.Registry) []string { + exposedFieldsIR := o.ExposedFields + + var exposedFieldsIC []string + for _, exposedFieldsIIR := range exposedFieldsIR { // explode []string + + exposedFieldsIIV := exposedFieldsIIR // string as string + exposedFieldsIC = append(exposedFieldsIC, exposedFieldsIIV) + } + + // items.CollectionFormat: "" + exposedFieldsIS := swag.JoinByFormat(exposedFieldsIC, "") + + return exposedFieldsIS +} diff --git a/client/status_pages/create_nunc_connection_responses.go b/client/status_pages/create_nunc_connection_responses.go new file mode 100644 index 0000000..1bbb1be --- /dev/null +++ b/client/status_pages/create_nunc_connection_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateNuncConnectionReader is a Reader for the CreateNuncConnection structure. +type CreateNuncConnectionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateNuncConnectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateNuncConnectionCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateNuncConnectionCreated creates a CreateNuncConnectionCreated with default headers values +func NewCreateNuncConnectionCreated() *CreateNuncConnectionCreated { + return &CreateNuncConnectionCreated{} +} + +/* +CreateNuncConnectionCreated describes a response with status code 201, with default header values. + +Create a new FireHydrant hosted status page for customer facing statuses. +*/ +type CreateNuncConnectionCreated struct { + Payload *models.NuncConnectionEntity +} + +// IsSuccess returns true when this create nunc connection created response has a 2xx status code +func (o *CreateNuncConnectionCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create nunc connection created response has a 3xx status code +func (o *CreateNuncConnectionCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create nunc connection created response has a 4xx status code +func (o *CreateNuncConnectionCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create nunc connection created response has a 5xx status code +func (o *CreateNuncConnectionCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create nunc connection created response a status code equal to that given +func (o *CreateNuncConnectionCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateNuncConnectionCreated) Error() string { + return fmt.Sprintf("[POST /v1/nunc_connections][%d] createNuncConnectionCreated %+v", 201, o.Payload) +} + +func (o *CreateNuncConnectionCreated) String() string { + return fmt.Sprintf("[POST /v1/nunc_connections][%d] createNuncConnectionCreated %+v", 201, o.Payload) +} + +func (o *CreateNuncConnectionCreated) GetPayload() *models.NuncConnectionEntity { + return o.Payload +} + +func (o *CreateNuncConnectionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NuncConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/status_pages/create_nunc_link_parameters.go b/client/status_pages/create_nunc_link_parameters.go new file mode 100644 index 0000000..fa1ffc6 --- /dev/null +++ b/client/status_pages/create_nunc_link_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateNuncLinkParams creates a new CreateNuncLinkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateNuncLinkParams() *CreateNuncLinkParams { + return &CreateNuncLinkParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateNuncLinkParamsWithTimeout creates a new CreateNuncLinkParams object +// with the ability to set a timeout on a request. +func NewCreateNuncLinkParamsWithTimeout(timeout time.Duration) *CreateNuncLinkParams { + return &CreateNuncLinkParams{ + timeout: timeout, + } +} + +// NewCreateNuncLinkParamsWithContext creates a new CreateNuncLinkParams object +// with the ability to set a context for a request. +func NewCreateNuncLinkParamsWithContext(ctx context.Context) *CreateNuncLinkParams { + return &CreateNuncLinkParams{ + Context: ctx, + } +} + +// NewCreateNuncLinkParamsWithHTTPClient creates a new CreateNuncLinkParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateNuncLinkParamsWithHTTPClient(client *http.Client) *CreateNuncLinkParams { + return &CreateNuncLinkParams{ + HTTPClient: client, + } +} + +/* +CreateNuncLinkParams contains all the parameters to send to the API endpoint + + for the create nunc link operation. + + Typically these are written to a http.Request. +*/ +type CreateNuncLinkParams struct { + + // NuncConnectionID. + NuncConnectionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create nunc link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNuncLinkParams) WithDefaults() *CreateNuncLinkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create nunc link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNuncLinkParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create nunc link params +func (o *CreateNuncLinkParams) WithTimeout(timeout time.Duration) *CreateNuncLinkParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create nunc link params +func (o *CreateNuncLinkParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create nunc link params +func (o *CreateNuncLinkParams) WithContext(ctx context.Context) *CreateNuncLinkParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create nunc link params +func (o *CreateNuncLinkParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create nunc link params +func (o *CreateNuncLinkParams) WithHTTPClient(client *http.Client) *CreateNuncLinkParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create nunc link params +func (o *CreateNuncLinkParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNuncConnectionID adds the nuncConnectionID to the create nunc link params +func (o *CreateNuncLinkParams) WithNuncConnectionID(nuncConnectionID string) *CreateNuncLinkParams { + o.SetNuncConnectionID(nuncConnectionID) + return o +} + +// SetNuncConnectionID adds the nuncConnectionId to the create nunc link params +func (o *CreateNuncLinkParams) SetNuncConnectionID(nuncConnectionID string) { + o.NuncConnectionID = nuncConnectionID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateNuncLinkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param nunc_connection_id + if err := r.SetPathParam("nunc_connection_id", o.NuncConnectionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/create_nunc_link_responses.go b/client/status_pages/create_nunc_link_responses.go new file mode 100644 index 0000000..2edc560 --- /dev/null +++ b/client/status_pages/create_nunc_link_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateNuncLinkReader is a Reader for the CreateNuncLink structure. +type CreateNuncLinkReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateNuncLinkReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateNuncLinkCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateNuncLinkCreated creates a CreateNuncLinkCreated with default headers values +func NewCreateNuncLinkCreated() *CreateNuncLinkCreated { + return &CreateNuncLinkCreated{} +} + +/* +CreateNuncLinkCreated describes a response with status code 201, with default header values. + +Add a link to be displayed on a FireHydrant status page +*/ +type CreateNuncLinkCreated struct { + Payload *models.NuncConnectionEntity +} + +// IsSuccess returns true when this create nunc link created response has a 2xx status code +func (o *CreateNuncLinkCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create nunc link created response has a 3xx status code +func (o *CreateNuncLinkCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create nunc link created response has a 4xx status code +func (o *CreateNuncLinkCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create nunc link created response has a 5xx status code +func (o *CreateNuncLinkCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create nunc link created response a status code equal to that given +func (o *CreateNuncLinkCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateNuncLinkCreated) Error() string { + return fmt.Sprintf("[POST /v1/nunc_connections/{nunc_connection_id}/links][%d] createNuncLinkCreated %+v", 201, o.Payload) +} + +func (o *CreateNuncLinkCreated) String() string { + return fmt.Sprintf("[POST /v1/nunc_connections/{nunc_connection_id}/links][%d] createNuncLinkCreated %+v", 201, o.Payload) +} + +func (o *CreateNuncLinkCreated) GetPayload() *models.NuncConnectionEntity { + return o.Payload +} + +func (o *CreateNuncLinkCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NuncConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/status_pages/create_nunc_subscription_parameters.go b/client/status_pages/create_nunc_subscription_parameters.go new file mode 100644 index 0000000..7975d2f --- /dev/null +++ b/client/status_pages/create_nunc_subscription_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateNuncSubscriptionParams creates a new CreateNuncSubscriptionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateNuncSubscriptionParams() *CreateNuncSubscriptionParams { + return &CreateNuncSubscriptionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateNuncSubscriptionParamsWithTimeout creates a new CreateNuncSubscriptionParams object +// with the ability to set a timeout on a request. +func NewCreateNuncSubscriptionParamsWithTimeout(timeout time.Duration) *CreateNuncSubscriptionParams { + return &CreateNuncSubscriptionParams{ + timeout: timeout, + } +} + +// NewCreateNuncSubscriptionParamsWithContext creates a new CreateNuncSubscriptionParams object +// with the ability to set a context for a request. +func NewCreateNuncSubscriptionParamsWithContext(ctx context.Context) *CreateNuncSubscriptionParams { + return &CreateNuncSubscriptionParams{ + Context: ctx, + } +} + +// NewCreateNuncSubscriptionParamsWithHTTPClient creates a new CreateNuncSubscriptionParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateNuncSubscriptionParamsWithHTTPClient(client *http.Client) *CreateNuncSubscriptionParams { + return &CreateNuncSubscriptionParams{ + HTTPClient: client, + } +} + +/* +CreateNuncSubscriptionParams contains all the parameters to send to the API endpoint + + for the create nunc subscription operation. + + Typically these are written to a http.Request. +*/ +type CreateNuncSubscriptionParams struct { + + // CreateNuncSubscription. + CreateNuncSubscription *models.CreateNuncSubscription + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create nunc subscription params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNuncSubscriptionParams) WithDefaults() *CreateNuncSubscriptionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create nunc subscription params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNuncSubscriptionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create nunc subscription params +func (o *CreateNuncSubscriptionParams) WithTimeout(timeout time.Duration) *CreateNuncSubscriptionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create nunc subscription params +func (o *CreateNuncSubscriptionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create nunc subscription params +func (o *CreateNuncSubscriptionParams) WithContext(ctx context.Context) *CreateNuncSubscriptionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create nunc subscription params +func (o *CreateNuncSubscriptionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create nunc subscription params +func (o *CreateNuncSubscriptionParams) WithHTTPClient(client *http.Client) *CreateNuncSubscriptionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create nunc subscription params +func (o *CreateNuncSubscriptionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateNuncSubscription adds the createNuncSubscription to the create nunc subscription params +func (o *CreateNuncSubscriptionParams) WithCreateNuncSubscription(createNuncSubscription *models.CreateNuncSubscription) *CreateNuncSubscriptionParams { + o.SetCreateNuncSubscription(createNuncSubscription) + return o +} + +// SetCreateNuncSubscription adds the createNuncSubscription to the create nunc subscription params +func (o *CreateNuncSubscriptionParams) SetCreateNuncSubscription(createNuncSubscription *models.CreateNuncSubscription) { + o.CreateNuncSubscription = createNuncSubscription +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateNuncSubscriptionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateNuncSubscription != nil { + if err := r.SetBodyParam(o.CreateNuncSubscription); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/create_nunc_subscription_responses.go b/client/status_pages/create_nunc_subscription_responses.go new file mode 100644 index 0000000..77cb3ac --- /dev/null +++ b/client/status_pages/create_nunc_subscription_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateNuncSubscriptionReader is a Reader for the CreateNuncSubscription structure. +type CreateNuncSubscriptionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateNuncSubscriptionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateNuncSubscriptionCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateNuncSubscriptionCreated creates a CreateNuncSubscriptionCreated with default headers values +func NewCreateNuncSubscriptionCreated() *CreateNuncSubscriptionCreated { + return &CreateNuncSubscriptionCreated{} +} + +/* +CreateNuncSubscriptionCreated describes a response with status code 201, with default header values. + +Subscribe to status page updates +*/ +type CreateNuncSubscriptionCreated struct { + Payload *models.NuncNuncSubscription +} + +// IsSuccess returns true when this create nunc subscription created response has a 2xx status code +func (o *CreateNuncSubscriptionCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create nunc subscription created response has a 3xx status code +func (o *CreateNuncSubscriptionCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create nunc subscription created response has a 4xx status code +func (o *CreateNuncSubscriptionCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create nunc subscription created response has a 5xx status code +func (o *CreateNuncSubscriptionCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create nunc subscription created response a status code equal to that given +func (o *CreateNuncSubscriptionCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateNuncSubscriptionCreated) Error() string { + return fmt.Sprintf("[POST /v1/nunc/subscriptions][%d] createNuncSubscriptionCreated %+v", 201, o.Payload) +} + +func (o *CreateNuncSubscriptionCreated) String() string { + return fmt.Sprintf("[POST /v1/nunc/subscriptions][%d] createNuncSubscriptionCreated %+v", 201, o.Payload) +} + +func (o *CreateNuncSubscriptionCreated) GetPayload() *models.NuncNuncSubscription { + return o.Payload +} + +func (o *CreateNuncSubscriptionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NuncNuncSubscription) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/status_pages/delete_email_subscriber_parameters.go b/client/status_pages/delete_email_subscriber_parameters.go new file mode 100644 index 0000000..6a222d2 --- /dev/null +++ b/client/status_pages/delete_email_subscriber_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteEmailSubscriberParams creates a new DeleteEmailSubscriberParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteEmailSubscriberParams() *DeleteEmailSubscriberParams { + return &DeleteEmailSubscriberParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteEmailSubscriberParamsWithTimeout creates a new DeleteEmailSubscriberParams object +// with the ability to set a timeout on a request. +func NewDeleteEmailSubscriberParamsWithTimeout(timeout time.Duration) *DeleteEmailSubscriberParams { + return &DeleteEmailSubscriberParams{ + timeout: timeout, + } +} + +// NewDeleteEmailSubscriberParamsWithContext creates a new DeleteEmailSubscriberParams object +// with the ability to set a context for a request. +func NewDeleteEmailSubscriberParamsWithContext(ctx context.Context) *DeleteEmailSubscriberParams { + return &DeleteEmailSubscriberParams{ + Context: ctx, + } +} + +// NewDeleteEmailSubscriberParamsWithHTTPClient creates a new DeleteEmailSubscriberParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteEmailSubscriberParamsWithHTTPClient(client *http.Client) *DeleteEmailSubscriberParams { + return &DeleteEmailSubscriberParams{ + HTTPClient: client, + } +} + +/* +DeleteEmailSubscriberParams contains all the parameters to send to the API endpoint + + for the delete email subscriber operation. + + Typically these are written to a http.Request. +*/ +type DeleteEmailSubscriberParams struct { + + // NuncConnectionID. + NuncConnectionID string + + /* SubscriberIds. + + A list of subscriber IDs to unsubscribe. + */ + SubscriberIds string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete email subscriber params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteEmailSubscriberParams) WithDefaults() *DeleteEmailSubscriberParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete email subscriber params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteEmailSubscriberParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete email subscriber params +func (o *DeleteEmailSubscriberParams) WithTimeout(timeout time.Duration) *DeleteEmailSubscriberParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete email subscriber params +func (o *DeleteEmailSubscriberParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete email subscriber params +func (o *DeleteEmailSubscriberParams) WithContext(ctx context.Context) *DeleteEmailSubscriberParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete email subscriber params +func (o *DeleteEmailSubscriberParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete email subscriber params +func (o *DeleteEmailSubscriberParams) WithHTTPClient(client *http.Client) *DeleteEmailSubscriberParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete email subscriber params +func (o *DeleteEmailSubscriberParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNuncConnectionID adds the nuncConnectionID to the delete email subscriber params +func (o *DeleteEmailSubscriberParams) WithNuncConnectionID(nuncConnectionID string) *DeleteEmailSubscriberParams { + o.SetNuncConnectionID(nuncConnectionID) + return o +} + +// SetNuncConnectionID adds the nuncConnectionId to the delete email subscriber params +func (o *DeleteEmailSubscriberParams) SetNuncConnectionID(nuncConnectionID string) { + o.NuncConnectionID = nuncConnectionID +} + +// WithSubscriberIds adds the subscriberIds to the delete email subscriber params +func (o *DeleteEmailSubscriberParams) WithSubscriberIds(subscriberIds string) *DeleteEmailSubscriberParams { + o.SetSubscriberIds(subscriberIds) + return o +} + +// SetSubscriberIds adds the subscriberIds to the delete email subscriber params +func (o *DeleteEmailSubscriberParams) SetSubscriberIds(subscriberIds string) { + o.SubscriberIds = subscriberIds +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteEmailSubscriberParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param nunc_connection_id + if err := r.SetPathParam("nunc_connection_id", o.NuncConnectionID); err != nil { + return err + } + + // query param subscriber_ids + qrSubscriberIds := o.SubscriberIds + qSubscriberIds := qrSubscriberIds + if qSubscriberIds != "" { + + if err := r.SetQueryParam("subscriber_ids", qSubscriberIds); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/delete_email_subscriber_responses.go b/client/status_pages/delete_email_subscriber_responses.go new file mode 100644 index 0000000..c50b7a4 --- /dev/null +++ b/client/status_pages/delete_email_subscriber_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteEmailSubscriberReader is a Reader for the DeleteEmailSubscriber structure. +type DeleteEmailSubscriberReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteEmailSubscriberReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteEmailSubscriberOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteEmailSubscriberOK creates a DeleteEmailSubscriberOK with default headers values +func NewDeleteEmailSubscriberOK() *DeleteEmailSubscriberOK { + return &DeleteEmailSubscriberOK{} +} + +/* +DeleteEmailSubscriberOK describes a response with status code 200, with default header values. + +Unsubscribes one or more status page subscribers. +*/ +type DeleteEmailSubscriberOK struct { + Payload *models.NuncEmailSubscribersEntity +} + +// IsSuccess returns true when this delete email subscriber o k response has a 2xx status code +func (o *DeleteEmailSubscriberOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete email subscriber o k response has a 3xx status code +func (o *DeleteEmailSubscriberOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete email subscriber o k response has a 4xx status code +func (o *DeleteEmailSubscriberOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete email subscriber o k response has a 5xx status code +func (o *DeleteEmailSubscriberOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete email subscriber o k response a status code equal to that given +func (o *DeleteEmailSubscriberOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteEmailSubscriberOK) Error() string { + return fmt.Sprintf("[DELETE /v1/nunc_connections/{nunc_connection_id}/subscribers][%d] deleteEmailSubscriberOK %+v", 200, o.Payload) +} + +func (o *DeleteEmailSubscriberOK) String() string { + return fmt.Sprintf("[DELETE /v1/nunc_connections/{nunc_connection_id}/subscribers][%d] deleteEmailSubscriberOK %+v", 200, o.Payload) +} + +func (o *DeleteEmailSubscriberOK) GetPayload() *models.NuncEmailSubscribersEntity { + return o.Payload +} + +func (o *DeleteEmailSubscriberOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NuncEmailSubscribersEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/status_pages/delete_incident_status_page_parameters.go b/client/status_pages/delete_incident_status_page_parameters.go new file mode 100644 index 0000000..5c28300 --- /dev/null +++ b/client/status_pages/delete_incident_status_page_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteIncidentStatusPageParams creates a new DeleteIncidentStatusPageParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteIncidentStatusPageParams() *DeleteIncidentStatusPageParams { + return &DeleteIncidentStatusPageParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteIncidentStatusPageParamsWithTimeout creates a new DeleteIncidentStatusPageParams object +// with the ability to set a timeout on a request. +func NewDeleteIncidentStatusPageParamsWithTimeout(timeout time.Duration) *DeleteIncidentStatusPageParams { + return &DeleteIncidentStatusPageParams{ + timeout: timeout, + } +} + +// NewDeleteIncidentStatusPageParamsWithContext creates a new DeleteIncidentStatusPageParams object +// with the ability to set a context for a request. +func NewDeleteIncidentStatusPageParamsWithContext(ctx context.Context) *DeleteIncidentStatusPageParams { + return &DeleteIncidentStatusPageParams{ + Context: ctx, + } +} + +// NewDeleteIncidentStatusPageParamsWithHTTPClient creates a new DeleteIncidentStatusPageParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteIncidentStatusPageParamsWithHTTPClient(client *http.Client) *DeleteIncidentStatusPageParams { + return &DeleteIncidentStatusPageParams{ + HTTPClient: client, + } +} + +/* +DeleteIncidentStatusPageParams contains all the parameters to send to the API endpoint + + for the delete incident status page operation. + + Typically these are written to a http.Request. +*/ +type DeleteIncidentStatusPageParams struct { + + // IncidentID. + IncidentID string + + // StatusPageID. + StatusPageID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete incident status page params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentStatusPageParams) WithDefaults() *DeleteIncidentStatusPageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete incident status page params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentStatusPageParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete incident status page params +func (o *DeleteIncidentStatusPageParams) WithTimeout(timeout time.Duration) *DeleteIncidentStatusPageParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete incident status page params +func (o *DeleteIncidentStatusPageParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete incident status page params +func (o *DeleteIncidentStatusPageParams) WithContext(ctx context.Context) *DeleteIncidentStatusPageParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete incident status page params +func (o *DeleteIncidentStatusPageParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete incident status page params +func (o *DeleteIncidentStatusPageParams) WithHTTPClient(client *http.Client) *DeleteIncidentStatusPageParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete incident status page params +func (o *DeleteIncidentStatusPageParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the delete incident status page params +func (o *DeleteIncidentStatusPageParams) WithIncidentID(incidentID string) *DeleteIncidentStatusPageParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the delete incident status page params +func (o *DeleteIncidentStatusPageParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithStatusPageID adds the statusPageID to the delete incident status page params +func (o *DeleteIncidentStatusPageParams) WithStatusPageID(statusPageID string) *DeleteIncidentStatusPageParams { + o.SetStatusPageID(statusPageID) + return o +} + +// SetStatusPageID adds the statusPageId to the delete incident status page params +func (o *DeleteIncidentStatusPageParams) SetStatusPageID(statusPageID string) { + o.StatusPageID = statusPageID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteIncidentStatusPageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param status_page_id + if err := r.SetPathParam("status_page_id", o.StatusPageID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/delete_incident_status_page_responses.go b/client/status_pages/delete_incident_status_page_responses.go new file mode 100644 index 0000000..c06c21e --- /dev/null +++ b/client/status_pages/delete_incident_status_page_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteIncidentStatusPageReader is a Reader for the DeleteIncidentStatusPage structure. +type DeleteIncidentStatusPageReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteIncidentStatusPageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteIncidentStatusPageNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteIncidentStatusPageNoContent creates a DeleteIncidentStatusPageNoContent with default headers values +func NewDeleteIncidentStatusPageNoContent() *DeleteIncidentStatusPageNoContent { + return &DeleteIncidentStatusPageNoContent{} +} + +/* +DeleteIncidentStatusPageNoContent describes a response with status code 204, with default header values. + +Remove a status page incident attached to an incident +*/ +type DeleteIncidentStatusPageNoContent struct { +} + +// IsSuccess returns true when this delete incident status page no content response has a 2xx status code +func (o *DeleteIncidentStatusPageNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete incident status page no content response has a 3xx status code +func (o *DeleteIncidentStatusPageNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete incident status page no content response has a 4xx status code +func (o *DeleteIncidentStatusPageNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete incident status page no content response has a 5xx status code +func (o *DeleteIncidentStatusPageNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete incident status page no content response a status code equal to that given +func (o *DeleteIncidentStatusPageNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteIncidentStatusPageNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/status_pages/{status_page_id}][%d] deleteIncidentStatusPageNoContent ", 204) +} + +func (o *DeleteIncidentStatusPageNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/status_pages/{status_page_id}][%d] deleteIncidentStatusPageNoContent ", 204) +} + +func (o *DeleteIncidentStatusPageNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/status_pages/delete_nunc_component_group_parameters.go b/client/status_pages/delete_nunc_component_group_parameters.go new file mode 100644 index 0000000..a6683ff --- /dev/null +++ b/client/status_pages/delete_nunc_component_group_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteNuncComponentGroupParams creates a new DeleteNuncComponentGroupParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteNuncComponentGroupParams() *DeleteNuncComponentGroupParams { + return &DeleteNuncComponentGroupParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteNuncComponentGroupParamsWithTimeout creates a new DeleteNuncComponentGroupParams object +// with the ability to set a timeout on a request. +func NewDeleteNuncComponentGroupParamsWithTimeout(timeout time.Duration) *DeleteNuncComponentGroupParams { + return &DeleteNuncComponentGroupParams{ + timeout: timeout, + } +} + +// NewDeleteNuncComponentGroupParamsWithContext creates a new DeleteNuncComponentGroupParams object +// with the ability to set a context for a request. +func NewDeleteNuncComponentGroupParamsWithContext(ctx context.Context) *DeleteNuncComponentGroupParams { + return &DeleteNuncComponentGroupParams{ + Context: ctx, + } +} + +// NewDeleteNuncComponentGroupParamsWithHTTPClient creates a new DeleteNuncComponentGroupParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteNuncComponentGroupParamsWithHTTPClient(client *http.Client) *DeleteNuncComponentGroupParams { + return &DeleteNuncComponentGroupParams{ + HTTPClient: client, + } +} + +/* +DeleteNuncComponentGroupParams contains all the parameters to send to the API endpoint + + for the delete nunc component group operation. + + Typically these are written to a http.Request. +*/ +type DeleteNuncComponentGroupParams struct { + + // GroupID. + GroupID string + + // NuncConnectionID. + NuncConnectionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete nunc component group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteNuncComponentGroupParams) WithDefaults() *DeleteNuncComponentGroupParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete nunc component group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteNuncComponentGroupParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete nunc component group params +func (o *DeleteNuncComponentGroupParams) WithTimeout(timeout time.Duration) *DeleteNuncComponentGroupParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete nunc component group params +func (o *DeleteNuncComponentGroupParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete nunc component group params +func (o *DeleteNuncComponentGroupParams) WithContext(ctx context.Context) *DeleteNuncComponentGroupParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete nunc component group params +func (o *DeleteNuncComponentGroupParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete nunc component group params +func (o *DeleteNuncComponentGroupParams) WithHTTPClient(client *http.Client) *DeleteNuncComponentGroupParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete nunc component group params +func (o *DeleteNuncComponentGroupParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGroupID adds the groupID to the delete nunc component group params +func (o *DeleteNuncComponentGroupParams) WithGroupID(groupID string) *DeleteNuncComponentGroupParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the delete nunc component group params +func (o *DeleteNuncComponentGroupParams) SetGroupID(groupID string) { + o.GroupID = groupID +} + +// WithNuncConnectionID adds the nuncConnectionID to the delete nunc component group params +func (o *DeleteNuncComponentGroupParams) WithNuncConnectionID(nuncConnectionID string) *DeleteNuncComponentGroupParams { + o.SetNuncConnectionID(nuncConnectionID) + return o +} + +// SetNuncConnectionID adds the nuncConnectionId to the delete nunc component group params +func (o *DeleteNuncComponentGroupParams) SetNuncConnectionID(nuncConnectionID string) { + o.NuncConnectionID = nuncConnectionID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteNuncComponentGroupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param group_id + if err := r.SetPathParam("group_id", o.GroupID); err != nil { + return err + } + + // path param nunc_connection_id + if err := r.SetPathParam("nunc_connection_id", o.NuncConnectionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/delete_nunc_component_group_responses.go b/client/status_pages/delete_nunc_component_group_responses.go new file mode 100644 index 0000000..82771b4 --- /dev/null +++ b/client/status_pages/delete_nunc_component_group_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteNuncComponentGroupReader is a Reader for the DeleteNuncComponentGroup structure. +type DeleteNuncComponentGroupReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteNuncComponentGroupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteNuncComponentGroupNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteNuncComponentGroupNoContent creates a DeleteNuncComponentGroupNoContent with default headers values +func NewDeleteNuncComponentGroupNoContent() *DeleteNuncComponentGroupNoContent { + return &DeleteNuncComponentGroupNoContent{} +} + +/* +DeleteNuncComponentGroupNoContent describes a response with status code 204, with default header values. + +Delete a component group displayed on a FireHydrant status page +*/ +type DeleteNuncComponentGroupNoContent struct { +} + +// IsSuccess returns true when this delete nunc component group no content response has a 2xx status code +func (o *DeleteNuncComponentGroupNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete nunc component group no content response has a 3xx status code +func (o *DeleteNuncComponentGroupNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete nunc component group no content response has a 4xx status code +func (o *DeleteNuncComponentGroupNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete nunc component group no content response has a 5xx status code +func (o *DeleteNuncComponentGroupNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete nunc component group no content response a status code equal to that given +func (o *DeleteNuncComponentGroupNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteNuncComponentGroupNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/nunc_connections/{nunc_connection_id}/component_groups/{group_id}][%d] deleteNuncComponentGroupNoContent ", 204) +} + +func (o *DeleteNuncComponentGroupNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/nunc_connections/{nunc_connection_id}/component_groups/{group_id}][%d] deleteNuncComponentGroupNoContent ", 204) +} + +func (o *DeleteNuncComponentGroupNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/status_pages/delete_nunc_connection_parameters.go b/client/status_pages/delete_nunc_connection_parameters.go new file mode 100644 index 0000000..737d6f9 --- /dev/null +++ b/client/status_pages/delete_nunc_connection_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteNuncConnectionParams creates a new DeleteNuncConnectionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteNuncConnectionParams() *DeleteNuncConnectionParams { + return &DeleteNuncConnectionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteNuncConnectionParamsWithTimeout creates a new DeleteNuncConnectionParams object +// with the ability to set a timeout on a request. +func NewDeleteNuncConnectionParamsWithTimeout(timeout time.Duration) *DeleteNuncConnectionParams { + return &DeleteNuncConnectionParams{ + timeout: timeout, + } +} + +// NewDeleteNuncConnectionParamsWithContext creates a new DeleteNuncConnectionParams object +// with the ability to set a context for a request. +func NewDeleteNuncConnectionParamsWithContext(ctx context.Context) *DeleteNuncConnectionParams { + return &DeleteNuncConnectionParams{ + Context: ctx, + } +} + +// NewDeleteNuncConnectionParamsWithHTTPClient creates a new DeleteNuncConnectionParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteNuncConnectionParamsWithHTTPClient(client *http.Client) *DeleteNuncConnectionParams { + return &DeleteNuncConnectionParams{ + HTTPClient: client, + } +} + +/* +DeleteNuncConnectionParams contains all the parameters to send to the API endpoint + + for the delete nunc connection operation. + + Typically these are written to a http.Request. +*/ +type DeleteNuncConnectionParams struct { + + // NuncConnectionID. + NuncConnectionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete nunc connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteNuncConnectionParams) WithDefaults() *DeleteNuncConnectionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete nunc connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteNuncConnectionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete nunc connection params +func (o *DeleteNuncConnectionParams) WithTimeout(timeout time.Duration) *DeleteNuncConnectionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete nunc connection params +func (o *DeleteNuncConnectionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete nunc connection params +func (o *DeleteNuncConnectionParams) WithContext(ctx context.Context) *DeleteNuncConnectionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete nunc connection params +func (o *DeleteNuncConnectionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete nunc connection params +func (o *DeleteNuncConnectionParams) WithHTTPClient(client *http.Client) *DeleteNuncConnectionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete nunc connection params +func (o *DeleteNuncConnectionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNuncConnectionID adds the nuncConnectionID to the delete nunc connection params +func (o *DeleteNuncConnectionParams) WithNuncConnectionID(nuncConnectionID string) *DeleteNuncConnectionParams { + o.SetNuncConnectionID(nuncConnectionID) + return o +} + +// SetNuncConnectionID adds the nuncConnectionId to the delete nunc connection params +func (o *DeleteNuncConnectionParams) SetNuncConnectionID(nuncConnectionID string) { + o.NuncConnectionID = nuncConnectionID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteNuncConnectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param nunc_connection_id + if err := r.SetPathParam("nunc_connection_id", o.NuncConnectionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/delete_nunc_connection_responses.go b/client/status_pages/delete_nunc_connection_responses.go new file mode 100644 index 0000000..84db416 --- /dev/null +++ b/client/status_pages/delete_nunc_connection_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteNuncConnectionReader is a Reader for the DeleteNuncConnection structure. +type DeleteNuncConnectionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteNuncConnectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteNuncConnectionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteNuncConnectionOK creates a DeleteNuncConnectionOK with default headers values +func NewDeleteNuncConnectionOK() *DeleteNuncConnectionOK { + return &DeleteNuncConnectionOK{} +} + +/* +DeleteNuncConnectionOK describes a response with status code 200, with default header values. + +Delete a FireHydrant hosted status page, stopping updates of your incidents to it. +*/ +type DeleteNuncConnectionOK struct { + Payload *models.NuncConnectionEntity +} + +// IsSuccess returns true when this delete nunc connection o k response has a 2xx status code +func (o *DeleteNuncConnectionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete nunc connection o k response has a 3xx status code +func (o *DeleteNuncConnectionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete nunc connection o k response has a 4xx status code +func (o *DeleteNuncConnectionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete nunc connection o k response has a 5xx status code +func (o *DeleteNuncConnectionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete nunc connection o k response a status code equal to that given +func (o *DeleteNuncConnectionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteNuncConnectionOK) Error() string { + return fmt.Sprintf("[DELETE /v1/nunc_connections/{nunc_connection_id}][%d] deleteNuncConnectionOK %+v", 200, o.Payload) +} + +func (o *DeleteNuncConnectionOK) String() string { + return fmt.Sprintf("[DELETE /v1/nunc_connections/{nunc_connection_id}][%d] deleteNuncConnectionOK %+v", 200, o.Payload) +} + +func (o *DeleteNuncConnectionOK) GetPayload() *models.NuncConnectionEntity { + return o.Payload +} + +func (o *DeleteNuncConnectionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NuncConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/status_pages/delete_nunc_image_parameters.go b/client/status_pages/delete_nunc_image_parameters.go new file mode 100644 index 0000000..1afdd4d --- /dev/null +++ b/client/status_pages/delete_nunc_image_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteNuncImageParams creates a new DeleteNuncImageParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteNuncImageParams() *DeleteNuncImageParams { + return &DeleteNuncImageParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteNuncImageParamsWithTimeout creates a new DeleteNuncImageParams object +// with the ability to set a timeout on a request. +func NewDeleteNuncImageParamsWithTimeout(timeout time.Duration) *DeleteNuncImageParams { + return &DeleteNuncImageParams{ + timeout: timeout, + } +} + +// NewDeleteNuncImageParamsWithContext creates a new DeleteNuncImageParams object +// with the ability to set a context for a request. +func NewDeleteNuncImageParamsWithContext(ctx context.Context) *DeleteNuncImageParams { + return &DeleteNuncImageParams{ + Context: ctx, + } +} + +// NewDeleteNuncImageParamsWithHTTPClient creates a new DeleteNuncImageParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteNuncImageParamsWithHTTPClient(client *http.Client) *DeleteNuncImageParams { + return &DeleteNuncImageParams{ + HTTPClient: client, + } +} + +/* +DeleteNuncImageParams contains all the parameters to send to the API endpoint + + for the delete nunc image operation. + + Typically these are written to a http.Request. +*/ +type DeleteNuncImageParams struct { + + // NuncConnectionID. + NuncConnectionID string + + // Type. + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete nunc image params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteNuncImageParams) WithDefaults() *DeleteNuncImageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete nunc image params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteNuncImageParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete nunc image params +func (o *DeleteNuncImageParams) WithTimeout(timeout time.Duration) *DeleteNuncImageParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete nunc image params +func (o *DeleteNuncImageParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete nunc image params +func (o *DeleteNuncImageParams) WithContext(ctx context.Context) *DeleteNuncImageParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete nunc image params +func (o *DeleteNuncImageParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete nunc image params +func (o *DeleteNuncImageParams) WithHTTPClient(client *http.Client) *DeleteNuncImageParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete nunc image params +func (o *DeleteNuncImageParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNuncConnectionID adds the nuncConnectionID to the delete nunc image params +func (o *DeleteNuncImageParams) WithNuncConnectionID(nuncConnectionID string) *DeleteNuncImageParams { + o.SetNuncConnectionID(nuncConnectionID) + return o +} + +// SetNuncConnectionID adds the nuncConnectionId to the delete nunc image params +func (o *DeleteNuncImageParams) SetNuncConnectionID(nuncConnectionID string) { + o.NuncConnectionID = nuncConnectionID +} + +// WithType adds the typeVar to the delete nunc image params +func (o *DeleteNuncImageParams) WithType(typeVar string) *DeleteNuncImageParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the delete nunc image params +func (o *DeleteNuncImageParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteNuncImageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param nunc_connection_id + if err := r.SetPathParam("nunc_connection_id", o.NuncConnectionID); err != nil { + return err + } + + // path param type + if err := r.SetPathParam("type", o.Type); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/delete_nunc_image_responses.go b/client/status_pages/delete_nunc_image_responses.go new file mode 100644 index 0000000..4b47aca --- /dev/null +++ b/client/status_pages/delete_nunc_image_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteNuncImageReader is a Reader for the DeleteNuncImage structure. +type DeleteNuncImageReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteNuncImageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteNuncImageOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteNuncImageOK creates a DeleteNuncImageOK with default headers values +func NewDeleteNuncImageOK() *DeleteNuncImageOK { + return &DeleteNuncImageOK{} +} + +/* +DeleteNuncImageOK describes a response with status code 200, with default header values. + +Delete an image attached to a FireHydrant status page +*/ +type DeleteNuncImageOK struct { + Payload *models.NuncConnectionEntity +} + +// IsSuccess returns true when this delete nunc image o k response has a 2xx status code +func (o *DeleteNuncImageOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete nunc image o k response has a 3xx status code +func (o *DeleteNuncImageOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete nunc image o k response has a 4xx status code +func (o *DeleteNuncImageOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete nunc image o k response has a 5xx status code +func (o *DeleteNuncImageOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete nunc image o k response a status code equal to that given +func (o *DeleteNuncImageOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteNuncImageOK) Error() string { + return fmt.Sprintf("[DELETE /v1/nunc_connections/{nunc_connection_id}/images/{type}][%d] deleteNuncImageOK %+v", 200, o.Payload) +} + +func (o *DeleteNuncImageOK) String() string { + return fmt.Sprintf("[DELETE /v1/nunc_connections/{nunc_connection_id}/images/{type}][%d] deleteNuncImageOK %+v", 200, o.Payload) +} + +func (o *DeleteNuncImageOK) GetPayload() *models.NuncConnectionEntity { + return o.Payload +} + +func (o *DeleteNuncImageOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NuncConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/status_pages/delete_nunc_link_parameters.go b/client/status_pages/delete_nunc_link_parameters.go new file mode 100644 index 0000000..7984439 --- /dev/null +++ b/client/status_pages/delete_nunc_link_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteNuncLinkParams creates a new DeleteNuncLinkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteNuncLinkParams() *DeleteNuncLinkParams { + return &DeleteNuncLinkParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteNuncLinkParamsWithTimeout creates a new DeleteNuncLinkParams object +// with the ability to set a timeout on a request. +func NewDeleteNuncLinkParamsWithTimeout(timeout time.Duration) *DeleteNuncLinkParams { + return &DeleteNuncLinkParams{ + timeout: timeout, + } +} + +// NewDeleteNuncLinkParamsWithContext creates a new DeleteNuncLinkParams object +// with the ability to set a context for a request. +func NewDeleteNuncLinkParamsWithContext(ctx context.Context) *DeleteNuncLinkParams { + return &DeleteNuncLinkParams{ + Context: ctx, + } +} + +// NewDeleteNuncLinkParamsWithHTTPClient creates a new DeleteNuncLinkParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteNuncLinkParamsWithHTTPClient(client *http.Client) *DeleteNuncLinkParams { + return &DeleteNuncLinkParams{ + HTTPClient: client, + } +} + +/* +DeleteNuncLinkParams contains all the parameters to send to the API endpoint + + for the delete nunc link operation. + + Typically these are written to a http.Request. +*/ +type DeleteNuncLinkParams struct { + + // LinkID. + LinkID string + + // NuncConnectionID. + NuncConnectionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete nunc link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteNuncLinkParams) WithDefaults() *DeleteNuncLinkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete nunc link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteNuncLinkParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete nunc link params +func (o *DeleteNuncLinkParams) WithTimeout(timeout time.Duration) *DeleteNuncLinkParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete nunc link params +func (o *DeleteNuncLinkParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete nunc link params +func (o *DeleteNuncLinkParams) WithContext(ctx context.Context) *DeleteNuncLinkParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete nunc link params +func (o *DeleteNuncLinkParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete nunc link params +func (o *DeleteNuncLinkParams) WithHTTPClient(client *http.Client) *DeleteNuncLinkParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete nunc link params +func (o *DeleteNuncLinkParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLinkID adds the linkID to the delete nunc link params +func (o *DeleteNuncLinkParams) WithLinkID(linkID string) *DeleteNuncLinkParams { + o.SetLinkID(linkID) + return o +} + +// SetLinkID adds the linkId to the delete nunc link params +func (o *DeleteNuncLinkParams) SetLinkID(linkID string) { + o.LinkID = linkID +} + +// WithNuncConnectionID adds the nuncConnectionID to the delete nunc link params +func (o *DeleteNuncLinkParams) WithNuncConnectionID(nuncConnectionID string) *DeleteNuncLinkParams { + o.SetNuncConnectionID(nuncConnectionID) + return o +} + +// SetNuncConnectionID adds the nuncConnectionId to the delete nunc link params +func (o *DeleteNuncLinkParams) SetNuncConnectionID(nuncConnectionID string) { + o.NuncConnectionID = nuncConnectionID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteNuncLinkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param link_id + if err := r.SetPathParam("link_id", o.LinkID); err != nil { + return err + } + + // path param nunc_connection_id + if err := r.SetPathParam("nunc_connection_id", o.NuncConnectionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/delete_nunc_link_responses.go b/client/status_pages/delete_nunc_link_responses.go new file mode 100644 index 0000000..c9a731b --- /dev/null +++ b/client/status_pages/delete_nunc_link_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteNuncLinkReader is a Reader for the DeleteNuncLink structure. +type DeleteNuncLinkReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteNuncLinkReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteNuncLinkNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteNuncLinkNoContent creates a DeleteNuncLinkNoContent with default headers values +func NewDeleteNuncLinkNoContent() *DeleteNuncLinkNoContent { + return &DeleteNuncLinkNoContent{} +} + +/* +DeleteNuncLinkNoContent describes a response with status code 204, with default header values. + +Delete a link displayed on a FireHydrant status page +*/ +type DeleteNuncLinkNoContent struct { +} + +// IsSuccess returns true when this delete nunc link no content response has a 2xx status code +func (o *DeleteNuncLinkNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete nunc link no content response has a 3xx status code +func (o *DeleteNuncLinkNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete nunc link no content response has a 4xx status code +func (o *DeleteNuncLinkNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete nunc link no content response has a 5xx status code +func (o *DeleteNuncLinkNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete nunc link no content response a status code equal to that given +func (o *DeleteNuncLinkNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteNuncLinkNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/nunc_connections/{nunc_connection_id}/links/{link_id}][%d] deleteNuncLinkNoContent ", 204) +} + +func (o *DeleteNuncLinkNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/nunc_connections/{nunc_connection_id}/links/{link_id}][%d] deleteNuncLinkNoContent ", 204) +} + +func (o *DeleteNuncLinkNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/status_pages/delete_nunc_subscription_parameters.go b/client/status_pages/delete_nunc_subscription_parameters.go new file mode 100644 index 0000000..66aeab3 --- /dev/null +++ b/client/status_pages/delete_nunc_subscription_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteNuncSubscriptionParams creates a new DeleteNuncSubscriptionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteNuncSubscriptionParams() *DeleteNuncSubscriptionParams { + return &DeleteNuncSubscriptionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteNuncSubscriptionParamsWithTimeout creates a new DeleteNuncSubscriptionParams object +// with the ability to set a timeout on a request. +func NewDeleteNuncSubscriptionParamsWithTimeout(timeout time.Duration) *DeleteNuncSubscriptionParams { + return &DeleteNuncSubscriptionParams{ + timeout: timeout, + } +} + +// NewDeleteNuncSubscriptionParamsWithContext creates a new DeleteNuncSubscriptionParams object +// with the ability to set a context for a request. +func NewDeleteNuncSubscriptionParamsWithContext(ctx context.Context) *DeleteNuncSubscriptionParams { + return &DeleteNuncSubscriptionParams{ + Context: ctx, + } +} + +// NewDeleteNuncSubscriptionParamsWithHTTPClient creates a new DeleteNuncSubscriptionParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteNuncSubscriptionParamsWithHTTPClient(client *http.Client) *DeleteNuncSubscriptionParams { + return &DeleteNuncSubscriptionParams{ + HTTPClient: client, + } +} + +/* +DeleteNuncSubscriptionParams contains all the parameters to send to the API endpoint + + for the delete nunc subscription operation. + + Typically these are written to a http.Request. +*/ +type DeleteNuncSubscriptionParams struct { + + // UnsubscribeToken. + UnsubscribeToken string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete nunc subscription params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteNuncSubscriptionParams) WithDefaults() *DeleteNuncSubscriptionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete nunc subscription params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteNuncSubscriptionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete nunc subscription params +func (o *DeleteNuncSubscriptionParams) WithTimeout(timeout time.Duration) *DeleteNuncSubscriptionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete nunc subscription params +func (o *DeleteNuncSubscriptionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete nunc subscription params +func (o *DeleteNuncSubscriptionParams) WithContext(ctx context.Context) *DeleteNuncSubscriptionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete nunc subscription params +func (o *DeleteNuncSubscriptionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete nunc subscription params +func (o *DeleteNuncSubscriptionParams) WithHTTPClient(client *http.Client) *DeleteNuncSubscriptionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete nunc subscription params +func (o *DeleteNuncSubscriptionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithUnsubscribeToken adds the unsubscribeToken to the delete nunc subscription params +func (o *DeleteNuncSubscriptionParams) WithUnsubscribeToken(unsubscribeToken string) *DeleteNuncSubscriptionParams { + o.SetUnsubscribeToken(unsubscribeToken) + return o +} + +// SetUnsubscribeToken adds the unsubscribeToken to the delete nunc subscription params +func (o *DeleteNuncSubscriptionParams) SetUnsubscribeToken(unsubscribeToken string) { + o.UnsubscribeToken = unsubscribeToken +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteNuncSubscriptionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param unsubscribe_token + if err := r.SetPathParam("unsubscribe_token", o.UnsubscribeToken); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/delete_nunc_subscription_responses.go b/client/status_pages/delete_nunc_subscription_responses.go new file mode 100644 index 0000000..7f9d670 --- /dev/null +++ b/client/status_pages/delete_nunc_subscription_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteNuncSubscriptionReader is a Reader for the DeleteNuncSubscription structure. +type DeleteNuncSubscriptionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteNuncSubscriptionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteNuncSubscriptionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteNuncSubscriptionOK creates a DeleteNuncSubscriptionOK with default headers values +func NewDeleteNuncSubscriptionOK() *DeleteNuncSubscriptionOK { + return &DeleteNuncSubscriptionOK{} +} + +/* +DeleteNuncSubscriptionOK describes a response with status code 200, with default header values. + +Unsubscribe from status page updates +*/ +type DeleteNuncSubscriptionOK struct { + Payload *models.NuncNuncSubscription +} + +// IsSuccess returns true when this delete nunc subscription o k response has a 2xx status code +func (o *DeleteNuncSubscriptionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete nunc subscription o k response has a 3xx status code +func (o *DeleteNuncSubscriptionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete nunc subscription o k response has a 4xx status code +func (o *DeleteNuncSubscriptionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete nunc subscription o k response has a 5xx status code +func (o *DeleteNuncSubscriptionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete nunc subscription o k response a status code equal to that given +func (o *DeleteNuncSubscriptionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteNuncSubscriptionOK) Error() string { + return fmt.Sprintf("[DELETE /v1/nunc/subscriptions/{unsubscribe_token}][%d] deleteNuncSubscriptionOK %+v", 200, o.Payload) +} + +func (o *DeleteNuncSubscriptionOK) String() string { + return fmt.Sprintf("[DELETE /v1/nunc/subscriptions/{unsubscribe_token}][%d] deleteNuncSubscriptionOK %+v", 200, o.Payload) +} + +func (o *DeleteNuncSubscriptionOK) GetPayload() *models.NuncNuncSubscription { + return o.Payload +} + +func (o *DeleteNuncSubscriptionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NuncNuncSubscription) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/status_pages/get_nunc_connection_parameters.go b/client/status_pages/get_nunc_connection_parameters.go new file mode 100644 index 0000000..0b1a61d --- /dev/null +++ b/client/status_pages/get_nunc_connection_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetNuncConnectionParams creates a new GetNuncConnectionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetNuncConnectionParams() *GetNuncConnectionParams { + return &GetNuncConnectionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetNuncConnectionParamsWithTimeout creates a new GetNuncConnectionParams object +// with the ability to set a timeout on a request. +func NewGetNuncConnectionParamsWithTimeout(timeout time.Duration) *GetNuncConnectionParams { + return &GetNuncConnectionParams{ + timeout: timeout, + } +} + +// NewGetNuncConnectionParamsWithContext creates a new GetNuncConnectionParams object +// with the ability to set a context for a request. +func NewGetNuncConnectionParamsWithContext(ctx context.Context) *GetNuncConnectionParams { + return &GetNuncConnectionParams{ + Context: ctx, + } +} + +// NewGetNuncConnectionParamsWithHTTPClient creates a new GetNuncConnectionParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetNuncConnectionParamsWithHTTPClient(client *http.Client) *GetNuncConnectionParams { + return &GetNuncConnectionParams{ + HTTPClient: client, + } +} + +/* +GetNuncConnectionParams contains all the parameters to send to the API endpoint + + for the get nunc connection operation. + + Typically these are written to a http.Request. +*/ +type GetNuncConnectionParams struct { + + // NuncConnectionID. + NuncConnectionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get nunc connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNuncConnectionParams) WithDefaults() *GetNuncConnectionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get nunc connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetNuncConnectionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get nunc connection params +func (o *GetNuncConnectionParams) WithTimeout(timeout time.Duration) *GetNuncConnectionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get nunc connection params +func (o *GetNuncConnectionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get nunc connection params +func (o *GetNuncConnectionParams) WithContext(ctx context.Context) *GetNuncConnectionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get nunc connection params +func (o *GetNuncConnectionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get nunc connection params +func (o *GetNuncConnectionParams) WithHTTPClient(client *http.Client) *GetNuncConnectionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get nunc connection params +func (o *GetNuncConnectionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNuncConnectionID adds the nuncConnectionID to the get nunc connection params +func (o *GetNuncConnectionParams) WithNuncConnectionID(nuncConnectionID string) *GetNuncConnectionParams { + o.SetNuncConnectionID(nuncConnectionID) + return o +} + +// SetNuncConnectionID adds the nuncConnectionId to the get nunc connection params +func (o *GetNuncConnectionParams) SetNuncConnectionID(nuncConnectionID string) { + o.NuncConnectionID = nuncConnectionID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetNuncConnectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param nunc_connection_id + if err := r.SetPathParam("nunc_connection_id", o.NuncConnectionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/get_nunc_connection_responses.go b/client/status_pages/get_nunc_connection_responses.go new file mode 100644 index 0000000..b71b043 --- /dev/null +++ b/client/status_pages/get_nunc_connection_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetNuncConnectionReader is a Reader for the GetNuncConnection structure. +type GetNuncConnectionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetNuncConnectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetNuncConnectionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetNuncConnectionOK creates a GetNuncConnectionOK with default headers values +func NewGetNuncConnectionOK() *GetNuncConnectionOK { + return &GetNuncConnectionOK{} +} + +/* +GetNuncConnectionOK describes a response with status code 200, with default header values. + +Retrieve the information displayed as part of your FireHydrant hosted status page. +*/ +type GetNuncConnectionOK struct { + Payload *models.NuncConnectionEntity +} + +// IsSuccess returns true when this get nunc connection o k response has a 2xx status code +func (o *GetNuncConnectionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get nunc connection o k response has a 3xx status code +func (o *GetNuncConnectionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get nunc connection o k response has a 4xx status code +func (o *GetNuncConnectionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get nunc connection o k response has a 5xx status code +func (o *GetNuncConnectionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get nunc connection o k response a status code equal to that given +func (o *GetNuncConnectionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetNuncConnectionOK) Error() string { + return fmt.Sprintf("[GET /v1/nunc_connections/{nunc_connection_id}][%d] getNuncConnectionOK %+v", 200, o.Payload) +} + +func (o *GetNuncConnectionOK) String() string { + return fmt.Sprintf("[GET /v1/nunc_connections/{nunc_connection_id}][%d] getNuncConnectionOK %+v", 200, o.Payload) +} + +func (o *GetNuncConnectionOK) GetPayload() *models.NuncConnectionEntity { + return o.Payload +} + +func (o *GetNuncConnectionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NuncConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/status_pages/list_email_subscribers_parameters.go b/client/status_pages/list_email_subscribers_parameters.go new file mode 100644 index 0000000..7002673 --- /dev/null +++ b/client/status_pages/list_email_subscribers_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListEmailSubscribersParams creates a new ListEmailSubscribersParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListEmailSubscribersParams() *ListEmailSubscribersParams { + return &ListEmailSubscribersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListEmailSubscribersParamsWithTimeout creates a new ListEmailSubscribersParams object +// with the ability to set a timeout on a request. +func NewListEmailSubscribersParamsWithTimeout(timeout time.Duration) *ListEmailSubscribersParams { + return &ListEmailSubscribersParams{ + timeout: timeout, + } +} + +// NewListEmailSubscribersParamsWithContext creates a new ListEmailSubscribersParams object +// with the ability to set a context for a request. +func NewListEmailSubscribersParamsWithContext(ctx context.Context) *ListEmailSubscribersParams { + return &ListEmailSubscribersParams{ + Context: ctx, + } +} + +// NewListEmailSubscribersParamsWithHTTPClient creates a new ListEmailSubscribersParams object +// with the ability to set a custom HTTPClient for a request. +func NewListEmailSubscribersParamsWithHTTPClient(client *http.Client) *ListEmailSubscribersParams { + return &ListEmailSubscribersParams{ + HTTPClient: client, + } +} + +/* +ListEmailSubscribersParams contains all the parameters to send to the API endpoint + + for the list email subscribers operation. + + Typically these are written to a http.Request. +*/ +type ListEmailSubscribersParams struct { + + // NuncConnectionID. + NuncConnectionID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list email subscribers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListEmailSubscribersParams) WithDefaults() *ListEmailSubscribersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list email subscribers params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListEmailSubscribersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list email subscribers params +func (o *ListEmailSubscribersParams) WithTimeout(timeout time.Duration) *ListEmailSubscribersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list email subscribers params +func (o *ListEmailSubscribersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list email subscribers params +func (o *ListEmailSubscribersParams) WithContext(ctx context.Context) *ListEmailSubscribersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list email subscribers params +func (o *ListEmailSubscribersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list email subscribers params +func (o *ListEmailSubscribersParams) WithHTTPClient(client *http.Client) *ListEmailSubscribersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list email subscribers params +func (o *ListEmailSubscribersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNuncConnectionID adds the nuncConnectionID to the list email subscribers params +func (o *ListEmailSubscribersParams) WithNuncConnectionID(nuncConnectionID string) *ListEmailSubscribersParams { + o.SetNuncConnectionID(nuncConnectionID) + return o +} + +// SetNuncConnectionID adds the nuncConnectionId to the list email subscribers params +func (o *ListEmailSubscribersParams) SetNuncConnectionID(nuncConnectionID string) { + o.NuncConnectionID = nuncConnectionID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListEmailSubscribersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param nunc_connection_id + if err := r.SetPathParam("nunc_connection_id", o.NuncConnectionID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/list_email_subscribers_responses.go b/client/status_pages/list_email_subscribers_responses.go new file mode 100644 index 0000000..dbc6168 --- /dev/null +++ b/client/status_pages/list_email_subscribers_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListEmailSubscribersReader is a Reader for the ListEmailSubscribers structure. +type ListEmailSubscribersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListEmailSubscribersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListEmailSubscribersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListEmailSubscribersOK creates a ListEmailSubscribersOK with default headers values +func NewListEmailSubscribersOK() *ListEmailSubscribersOK { + return &ListEmailSubscribersOK{} +} + +/* +ListEmailSubscribersOK describes a response with status code 200, with default header values. + +Retrieves the list of subscribers for a status page. +*/ +type ListEmailSubscribersOK struct { + Payload *models.NuncEmailSubscribersEntity +} + +// IsSuccess returns true when this list email subscribers o k response has a 2xx status code +func (o *ListEmailSubscribersOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list email subscribers o k response has a 3xx status code +func (o *ListEmailSubscribersOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list email subscribers o k response has a 4xx status code +func (o *ListEmailSubscribersOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list email subscribers o k response has a 5xx status code +func (o *ListEmailSubscribersOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list email subscribers o k response a status code equal to that given +func (o *ListEmailSubscribersOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListEmailSubscribersOK) Error() string { + return fmt.Sprintf("[GET /v1/nunc_connections/{nunc_connection_id}/subscribers][%d] listEmailSubscribersOK %+v", 200, o.Payload) +} + +func (o *ListEmailSubscribersOK) String() string { + return fmt.Sprintf("[GET /v1/nunc_connections/{nunc_connection_id}/subscribers][%d] listEmailSubscribersOK %+v", 200, o.Payload) +} + +func (o *ListEmailSubscribersOK) GetPayload() *models.NuncEmailSubscribersEntity { + return o.Payload +} + +func (o *ListEmailSubscribersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NuncEmailSubscribersEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/status_pages/list_nunc_connections_parameters.go b/client/status_pages/list_nunc_connections_parameters.go new file mode 100644 index 0000000..07dee01 --- /dev/null +++ b/client/status_pages/list_nunc_connections_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListNuncConnectionsParams creates a new ListNuncConnectionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListNuncConnectionsParams() *ListNuncConnectionsParams { + return &ListNuncConnectionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListNuncConnectionsParamsWithTimeout creates a new ListNuncConnectionsParams object +// with the ability to set a timeout on a request. +func NewListNuncConnectionsParamsWithTimeout(timeout time.Duration) *ListNuncConnectionsParams { + return &ListNuncConnectionsParams{ + timeout: timeout, + } +} + +// NewListNuncConnectionsParamsWithContext creates a new ListNuncConnectionsParams object +// with the ability to set a context for a request. +func NewListNuncConnectionsParamsWithContext(ctx context.Context) *ListNuncConnectionsParams { + return &ListNuncConnectionsParams{ + Context: ctx, + } +} + +// NewListNuncConnectionsParamsWithHTTPClient creates a new ListNuncConnectionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListNuncConnectionsParamsWithHTTPClient(client *http.Client) *ListNuncConnectionsParams { + return &ListNuncConnectionsParams{ + HTTPClient: client, + } +} + +/* +ListNuncConnectionsParams contains all the parameters to send to the API endpoint + + for the list nunc connections operation. + + Typically these are written to a http.Request. +*/ +type ListNuncConnectionsParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list nunc connections params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListNuncConnectionsParams) WithDefaults() *ListNuncConnectionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list nunc connections params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListNuncConnectionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list nunc connections params +func (o *ListNuncConnectionsParams) WithTimeout(timeout time.Duration) *ListNuncConnectionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list nunc connections params +func (o *ListNuncConnectionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list nunc connections params +func (o *ListNuncConnectionsParams) WithContext(ctx context.Context) *ListNuncConnectionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list nunc connections params +func (o *ListNuncConnectionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list nunc connections params +func (o *ListNuncConnectionsParams) WithHTTPClient(client *http.Client) *ListNuncConnectionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list nunc connections params +func (o *ListNuncConnectionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListNuncConnectionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/list_nunc_connections_responses.go b/client/status_pages/list_nunc_connections_responses.go new file mode 100644 index 0000000..cb83b46 --- /dev/null +++ b/client/status_pages/list_nunc_connections_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListNuncConnectionsReader is a Reader for the ListNuncConnections structure. +type ListNuncConnectionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListNuncConnectionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListNuncConnectionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListNuncConnectionsOK creates a ListNuncConnectionsOK with default headers values +func NewListNuncConnectionsOK() *ListNuncConnectionsOK { + return &ListNuncConnectionsOK{} +} + +/* +ListNuncConnectionsOK describes a response with status code 200, with default header values. + +Lists the information displayed as part of your FireHydrant hosted status pages. +*/ +type ListNuncConnectionsOK struct { + Payload *models.NuncConnectionEntityPaginated +} + +// IsSuccess returns true when this list nunc connections o k response has a 2xx status code +func (o *ListNuncConnectionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list nunc connections o k response has a 3xx status code +func (o *ListNuncConnectionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list nunc connections o k response has a 4xx status code +func (o *ListNuncConnectionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list nunc connections o k response has a 5xx status code +func (o *ListNuncConnectionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list nunc connections o k response a status code equal to that given +func (o *ListNuncConnectionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListNuncConnectionsOK) Error() string { + return fmt.Sprintf("[GET /v1/nunc_connections][%d] listNuncConnectionsOK %+v", 200, o.Payload) +} + +func (o *ListNuncConnectionsOK) String() string { + return fmt.Sprintf("[GET /v1/nunc_connections][%d] listNuncConnectionsOK %+v", 200, o.Payload) +} + +func (o *ListNuncConnectionsOK) GetPayload() *models.NuncConnectionEntityPaginated { + return o.Payload +} + +func (o *ListNuncConnectionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NuncConnectionEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/status_pages/status_pages_client.go b/client/status_pages/status_pages_client.go index f94513c..0d2aa43 100644 --- a/client/status_pages/status_pages_client.go +++ b/client/status_pages/status_pages_client.go @@ -30,66 +30,66 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1IncidentsIncidentIDStatusPagesStatusPageID(params *DeleteV1IncidentsIncidentIDStatusPagesStatusPageIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDStatusPagesStatusPageIDNoContent, error) + CreateEmailSubscriber(params *CreateEmailSubscriberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEmailSubscriberCreated, error) - DeleteV1NuncConnectionsNuncConnectionID(params *DeleteV1NuncConnectionsNuncConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1NuncConnectionsNuncConnectionIDOK, error) + CreateNuncComponentGroup(params *CreateNuncComponentGroupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateNuncComponentGroupCreated, error) - DeleteV1NuncConnectionsNuncConnectionIDComponentGroupsGroupID(params *DeleteV1NuncConnectionsNuncConnectionIDComponentGroupsGroupIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1NuncConnectionsNuncConnectionIDComponentGroupsGroupIDNoContent, error) + CreateNuncConnection(params *CreateNuncConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateNuncConnectionCreated, error) - DeleteV1NuncConnectionsNuncConnectionIDImagesType(params *DeleteV1NuncConnectionsNuncConnectionIDImagesTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1NuncConnectionsNuncConnectionIDImagesTypeOK, error) + CreateNuncLink(params *CreateNuncLinkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateNuncLinkCreated, error) - DeleteV1NuncConnectionsNuncConnectionIDLinksLinkID(params *DeleteV1NuncConnectionsNuncConnectionIDLinksLinkIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1NuncConnectionsNuncConnectionIDLinksLinkIDNoContent, error) + CreateNuncSubscription(params *CreateNuncSubscriptionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateNuncSubscriptionCreated, error) - DeleteV1NuncConnectionsNuncConnectionIDSubscribers(params *DeleteV1NuncConnectionsNuncConnectionIDSubscribersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1NuncConnectionsNuncConnectionIDSubscribersOK, error) + DeleteEmailSubscriber(params *DeleteEmailSubscriberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEmailSubscriberOK, error) - DeleteV1NuncSubscriptionsUnsubscribeToken(params *DeleteV1NuncSubscriptionsUnsubscribeTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1NuncSubscriptionsUnsubscribeTokenOK, error) + DeleteIncidentStatusPage(params *DeleteIncidentStatusPageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentStatusPageNoContent, error) - GetV1NuncConnections(params *GetV1NuncConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1NuncConnectionsOK, error) + DeleteNuncComponentGroup(params *DeleteNuncComponentGroupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteNuncComponentGroupNoContent, error) - GetV1NuncConnectionsNuncConnectionID(params *GetV1NuncConnectionsNuncConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1NuncConnectionsNuncConnectionIDOK, error) + DeleteNuncConnection(params *DeleteNuncConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteNuncConnectionOK, error) - GetV1NuncConnectionsNuncConnectionIDSubscribers(params *GetV1NuncConnectionsNuncConnectionIDSubscribersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1NuncConnectionsNuncConnectionIDSubscribersOK, error) + DeleteNuncImage(params *DeleteNuncImageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteNuncImageOK, error) - PatchV1NuncConnectionsNuncConnectionIDComponentGroupsGroupID(params *PatchV1NuncConnectionsNuncConnectionIDComponentGroupsGroupIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1NuncConnectionsNuncConnectionIDComponentGroupsGroupIDOK, error) + DeleteNuncLink(params *DeleteNuncLinkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteNuncLinkNoContent, error) - PatchV1NuncConnectionsNuncConnectionIDLinksLinkID(params *PatchV1NuncConnectionsNuncConnectionIDLinksLinkIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1NuncConnectionsNuncConnectionIDLinksLinkIDOK, error) + DeleteNuncSubscription(params *DeleteNuncSubscriptionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteNuncSubscriptionOK, error) - PostV1NuncConnections(params *PostV1NuncConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1NuncConnectionsCreated, error) + GetNuncConnection(params *GetNuncConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetNuncConnectionOK, error) - PostV1NuncConnectionsNuncConnectionIDComponentGroups(params *PostV1NuncConnectionsNuncConnectionIDComponentGroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1NuncConnectionsNuncConnectionIDComponentGroupsCreated, error) + ListEmailSubscribers(params *ListEmailSubscribersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEmailSubscribersOK, error) - PostV1NuncConnectionsNuncConnectionIDLinks(params *PostV1NuncConnectionsNuncConnectionIDLinksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1NuncConnectionsNuncConnectionIDLinksCreated, error) + ListNuncConnections(params *ListNuncConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListNuncConnectionsOK, error) - PostV1NuncConnectionsNuncConnectionIDSubscribers(params *PostV1NuncConnectionsNuncConnectionIDSubscribersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1NuncConnectionsNuncConnectionIDSubscribersCreated, error) + UpdateNuncComponentGroup(params *UpdateNuncComponentGroupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateNuncComponentGroupOK, error) - PostV1NuncSubscriptions(params *PostV1NuncSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1NuncSubscriptionsCreated, error) + UpdateNuncConnection(params *UpdateNuncConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateNuncConnectionOK, error) - PutV1NuncConnectionsNuncConnectionID(params *PutV1NuncConnectionsNuncConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1NuncConnectionsNuncConnectionIDOK, error) + UpdateNuncImage(params *UpdateNuncImageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateNuncImageOK, error) - PutV1NuncConnectionsNuncConnectionIDImagesType(params *PutV1NuncConnectionsNuncConnectionIDImagesTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1NuncConnectionsNuncConnectionIDImagesTypeOK, error) + UpdateNuncLink(params *UpdateNuncLinkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateNuncLinkOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1IncidentsIncidentIDStatusPagesStatusPageID removes a status page from an incident +CreateEmailSubscriber adds subscribers to a status page -Remove a status page incident attached to an incident +Subscribes a comma-separated string of emails to status page updates */ -func (a *Client) DeleteV1IncidentsIncidentIDStatusPagesStatusPageID(params *DeleteV1IncidentsIncidentIDStatusPagesStatusPageIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDStatusPagesStatusPageIDNoContent, error) { +func (a *Client) CreateEmailSubscriber(params *CreateEmailSubscriberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEmailSubscriberCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IncidentsIncidentIDStatusPagesStatusPageIDParams() + params = NewCreateEmailSubscriberParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IncidentsIncidentIdStatusPagesStatusPageId", - Method: "DELETE", - PathPattern: "/v1/incidents/{incident_id}/status_pages/{status_page_id}", + ID: "create_email_subscriber", + Method: "POST", + PathPattern: "/v1/nunc_connections/{nunc_connection_id}/subscribers", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IncidentsIncidentIDStatusPagesStatusPageIDReader{formats: a.formats}, + Reader: &CreateEmailSubscriberReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -102,35 +102,35 @@ func (a *Client) DeleteV1IncidentsIncidentIDStatusPagesStatusPageID(params *Dele if err != nil { return nil, err } - success, ok := result.(*DeleteV1IncidentsIncidentIDStatusPagesStatusPageIDNoContent) + success, ok := result.(*CreateEmailSubscriberCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IncidentsIncidentIdStatusPagesStatusPageId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_email_subscriber: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1NuncConnectionsNuncConnectionID deletes a status page +CreateNuncComponentGroup creates a component group for a status page -Delete a FireHydrant hosted status page, stopping updates of your incidents to it. +Add a component group to be displayed on a FireHydrant status page */ -func (a *Client) DeleteV1NuncConnectionsNuncConnectionID(params *DeleteV1NuncConnectionsNuncConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1NuncConnectionsNuncConnectionIDOK, error) { +func (a *Client) CreateNuncComponentGroup(params *CreateNuncComponentGroupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateNuncComponentGroupCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1NuncConnectionsNuncConnectionIDParams() + params = NewCreateNuncComponentGroupParams() } op := &runtime.ClientOperation{ - ID: "deleteV1NuncConnectionsNuncConnectionId", - Method: "DELETE", - PathPattern: "/v1/nunc_connections/{nunc_connection_id}", + ID: "create_nunc_component_group", + Method: "POST", + PathPattern: "/v1/nunc_connections/{nunc_connection_id}/component_groups", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1NuncConnectionsNuncConnectionIDReader{formats: a.formats}, + Reader: &CreateNuncComponentGroupReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -143,35 +143,35 @@ func (a *Client) DeleteV1NuncConnectionsNuncConnectionID(params *DeleteV1NuncCon if err != nil { return nil, err } - success, ok := result.(*DeleteV1NuncConnectionsNuncConnectionIDOK) + success, ok := result.(*CreateNuncComponentGroupCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1NuncConnectionsNuncConnectionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_nunc_component_group: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1NuncConnectionsNuncConnectionIDComponentGroupsGroupID deletes a status page component group +CreateNuncConnection creates a status page -Delete a component group displayed on a FireHydrant status page +Create a new FireHydrant hosted status page for customer facing statuses. */ -func (a *Client) DeleteV1NuncConnectionsNuncConnectionIDComponentGroupsGroupID(params *DeleteV1NuncConnectionsNuncConnectionIDComponentGroupsGroupIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1NuncConnectionsNuncConnectionIDComponentGroupsGroupIDNoContent, error) { +func (a *Client) CreateNuncConnection(params *CreateNuncConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateNuncConnectionCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1NuncConnectionsNuncConnectionIDComponentGroupsGroupIDParams() + params = NewCreateNuncConnectionParams() } op := &runtime.ClientOperation{ - ID: "deleteV1NuncConnectionsNuncConnectionIdComponentGroupsGroupId", - Method: "DELETE", - PathPattern: "/v1/nunc_connections/{nunc_connection_id}/component_groups/{group_id}", + ID: "create_nunc_connection", + Method: "POST", + PathPattern: "/v1/nunc_connections", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1NuncConnectionsNuncConnectionIDComponentGroupsGroupIDReader{formats: a.formats}, + Reader: &CreateNuncConnectionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -184,35 +184,35 @@ func (a *Client) DeleteV1NuncConnectionsNuncConnectionIDComponentGroupsGroupID(p if err != nil { return nil, err } - success, ok := result.(*DeleteV1NuncConnectionsNuncConnectionIDComponentGroupsGroupIDNoContent) + success, ok := result.(*CreateNuncConnectionCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1NuncConnectionsNuncConnectionIdComponentGroupsGroupId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_nunc_connection: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1NuncConnectionsNuncConnectionIDImagesType deletes an image from a status page +CreateNuncLink adds link to a status page -Delete an image attached to a FireHydrant status page +Add a link to be displayed on a FireHydrant status page */ -func (a *Client) DeleteV1NuncConnectionsNuncConnectionIDImagesType(params *DeleteV1NuncConnectionsNuncConnectionIDImagesTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1NuncConnectionsNuncConnectionIDImagesTypeOK, error) { +func (a *Client) CreateNuncLink(params *CreateNuncLinkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateNuncLinkCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1NuncConnectionsNuncConnectionIDImagesTypeParams() + params = NewCreateNuncLinkParams() } op := &runtime.ClientOperation{ - ID: "deleteV1NuncConnectionsNuncConnectionIdImagesType", - Method: "DELETE", - PathPattern: "/v1/nunc_connections/{nunc_connection_id}/images/{type}", + ID: "create_nunc_link", + Method: "POST", + PathPattern: "/v1/nunc_connections/{nunc_connection_id}/links", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1NuncConnectionsNuncConnectionIDImagesTypeReader{formats: a.formats}, + Reader: &CreateNuncLinkReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -225,35 +225,35 @@ func (a *Client) DeleteV1NuncConnectionsNuncConnectionIDImagesType(params *Delet if err != nil { return nil, err } - success, ok := result.(*DeleteV1NuncConnectionsNuncConnectionIDImagesTypeOK) + success, ok := result.(*CreateNuncLinkCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1NuncConnectionsNuncConnectionIdImagesType: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_nunc_link: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1NuncConnectionsNuncConnectionIDLinksLinkID deletes a status page link +CreateNuncSubscription creates a status page subscription -Delete a link displayed on a FireHydrant status page +Subscribe to status page updates */ -func (a *Client) DeleteV1NuncConnectionsNuncConnectionIDLinksLinkID(params *DeleteV1NuncConnectionsNuncConnectionIDLinksLinkIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1NuncConnectionsNuncConnectionIDLinksLinkIDNoContent, error) { +func (a *Client) CreateNuncSubscription(params *CreateNuncSubscriptionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateNuncSubscriptionCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1NuncConnectionsNuncConnectionIDLinksLinkIDParams() + params = NewCreateNuncSubscriptionParams() } op := &runtime.ClientOperation{ - ID: "deleteV1NuncConnectionsNuncConnectionIdLinksLinkId", - Method: "DELETE", - PathPattern: "/v1/nunc_connections/{nunc_connection_id}/links/{link_id}", + ID: "create_nunc_subscription", + Method: "POST", + PathPattern: "/v1/nunc/subscriptions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1NuncConnectionsNuncConnectionIDLinksLinkIDReader{formats: a.formats}, + Reader: &CreateNuncSubscriptionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -266,35 +266,35 @@ func (a *Client) DeleteV1NuncConnectionsNuncConnectionIDLinksLinkID(params *Dele if err != nil { return nil, err } - success, ok := result.(*DeleteV1NuncConnectionsNuncConnectionIDLinksLinkIDNoContent) + success, ok := result.(*CreateNuncSubscriptionCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1NuncConnectionsNuncConnectionIdLinksLinkId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_nunc_subscription: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1NuncConnectionsNuncConnectionIDSubscribers removes subscribers from a status page +DeleteEmailSubscriber removes subscribers from a status page Unsubscribes one or more status page subscribers. */ -func (a *Client) DeleteV1NuncConnectionsNuncConnectionIDSubscribers(params *DeleteV1NuncConnectionsNuncConnectionIDSubscribersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1NuncConnectionsNuncConnectionIDSubscribersOK, error) { +func (a *Client) DeleteEmailSubscriber(params *DeleteEmailSubscriberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEmailSubscriberOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1NuncConnectionsNuncConnectionIDSubscribersParams() + params = NewDeleteEmailSubscriberParams() } op := &runtime.ClientOperation{ - ID: "deleteV1NuncConnectionsNuncConnectionIdSubscribers", + ID: "delete_email_subscriber", Method: "DELETE", PathPattern: "/v1/nunc_connections/{nunc_connection_id}/subscribers", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1NuncConnectionsNuncConnectionIDSubscribersReader{formats: a.formats}, + Reader: &DeleteEmailSubscriberReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -307,35 +307,35 @@ func (a *Client) DeleteV1NuncConnectionsNuncConnectionIDSubscribers(params *Dele if err != nil { return nil, err } - success, ok := result.(*DeleteV1NuncConnectionsNuncConnectionIDSubscribersOK) + success, ok := result.(*DeleteEmailSubscriberOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1NuncConnectionsNuncConnectionIdSubscribers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_email_subscriber: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1NuncSubscriptionsUnsubscribeToken unsubscribes from status page notifications +DeleteIncidentStatusPage removes a status page from an incident -Unsubscribe from status page updates +Remove a status page incident attached to an incident */ -func (a *Client) DeleteV1NuncSubscriptionsUnsubscribeToken(params *DeleteV1NuncSubscriptionsUnsubscribeTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1NuncSubscriptionsUnsubscribeTokenOK, error) { +func (a *Client) DeleteIncidentStatusPage(params *DeleteIncidentStatusPageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentStatusPageNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1NuncSubscriptionsUnsubscribeTokenParams() + params = NewDeleteIncidentStatusPageParams() } op := &runtime.ClientOperation{ - ID: "deleteV1NuncSubscriptionsUnsubscribeToken", + ID: "delete_incident_status_page", Method: "DELETE", - PathPattern: "/v1/nunc/subscriptions/{unsubscribe_token}", + PathPattern: "/v1/incidents/{incident_id}/status_pages/{status_page_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1NuncSubscriptionsUnsubscribeTokenReader{formats: a.formats}, + Reader: &DeleteIncidentStatusPageReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -348,35 +348,35 @@ func (a *Client) DeleteV1NuncSubscriptionsUnsubscribeToken(params *DeleteV1NuncS if err != nil { return nil, err } - success, ok := result.(*DeleteV1NuncSubscriptionsUnsubscribeTokenOK) + success, ok := result.(*DeleteIncidentStatusPageNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1NuncSubscriptionsUnsubscribeToken: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_incident_status_page: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1NuncConnections lists status pages +DeleteNuncComponentGroup deletes a status page component group -Lists the information displayed as part of your FireHydrant hosted status pages. +Delete a component group displayed on a FireHydrant status page */ -func (a *Client) GetV1NuncConnections(params *GetV1NuncConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1NuncConnectionsOK, error) { +func (a *Client) DeleteNuncComponentGroup(params *DeleteNuncComponentGroupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteNuncComponentGroupNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1NuncConnectionsParams() + params = NewDeleteNuncComponentGroupParams() } op := &runtime.ClientOperation{ - ID: "getV1NuncConnections", - Method: "GET", - PathPattern: "/v1/nunc_connections", + ID: "delete_nunc_component_group", + Method: "DELETE", + PathPattern: "/v1/nunc_connections/{nunc_connection_id}/component_groups/{group_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1NuncConnectionsReader{formats: a.formats}, + Reader: &DeleteNuncComponentGroupReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -389,35 +389,35 @@ func (a *Client) GetV1NuncConnections(params *GetV1NuncConnectionsParams, authIn if err != nil { return nil, err } - success, ok := result.(*GetV1NuncConnectionsOK) + success, ok := result.(*DeleteNuncComponentGroupNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1NuncConnections: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_nunc_component_group: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1NuncConnectionsNuncConnectionID gets a status page +DeleteNuncConnection deletes a status page -Retrieve the information displayed as part of your FireHydrant hosted status page. +Delete a FireHydrant hosted status page, stopping updates of your incidents to it. */ -func (a *Client) GetV1NuncConnectionsNuncConnectionID(params *GetV1NuncConnectionsNuncConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1NuncConnectionsNuncConnectionIDOK, error) { +func (a *Client) DeleteNuncConnection(params *DeleteNuncConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteNuncConnectionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1NuncConnectionsNuncConnectionIDParams() + params = NewDeleteNuncConnectionParams() } op := &runtime.ClientOperation{ - ID: "getV1NuncConnectionsNuncConnectionId", - Method: "GET", + ID: "delete_nunc_connection", + Method: "DELETE", PathPattern: "/v1/nunc_connections/{nunc_connection_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1NuncConnectionsNuncConnectionIDReader{formats: a.formats}, + Reader: &DeleteNuncConnectionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -430,35 +430,35 @@ func (a *Client) GetV1NuncConnectionsNuncConnectionID(params *GetV1NuncConnectio if err != nil { return nil, err } - success, ok := result.(*GetV1NuncConnectionsNuncConnectionIDOK) + success, ok := result.(*DeleteNuncConnectionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1NuncConnectionsNuncConnectionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_nunc_connection: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1NuncConnectionsNuncConnectionIDSubscribers lists status page subscribers +DeleteNuncImage deletes an image from a status page -Retrieves the list of subscribers for a status page. +Delete an image attached to a FireHydrant status page */ -func (a *Client) GetV1NuncConnectionsNuncConnectionIDSubscribers(params *GetV1NuncConnectionsNuncConnectionIDSubscribersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1NuncConnectionsNuncConnectionIDSubscribersOK, error) { +func (a *Client) DeleteNuncImage(params *DeleteNuncImageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteNuncImageOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1NuncConnectionsNuncConnectionIDSubscribersParams() + params = NewDeleteNuncImageParams() } op := &runtime.ClientOperation{ - ID: "getV1NuncConnectionsNuncConnectionIdSubscribers", - Method: "GET", - PathPattern: "/v1/nunc_connections/{nunc_connection_id}/subscribers", + ID: "delete_nunc_image", + Method: "DELETE", + PathPattern: "/v1/nunc_connections/{nunc_connection_id}/images/{type}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1NuncConnectionsNuncConnectionIDSubscribersReader{formats: a.formats}, + Reader: &DeleteNuncImageReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -471,35 +471,35 @@ func (a *Client) GetV1NuncConnectionsNuncConnectionIDSubscribers(params *GetV1Nu if err != nil { return nil, err } - success, ok := result.(*GetV1NuncConnectionsNuncConnectionIDSubscribersOK) + success, ok := result.(*DeleteNuncImageOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1NuncConnectionsNuncConnectionIdSubscribers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_nunc_image: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1NuncConnectionsNuncConnectionIDComponentGroupsGroupID updates a status page component group +DeleteNuncLink deletes a status page link -Update a component group to be displayed on a FireHydrant status page +Delete a link displayed on a FireHydrant status page */ -func (a *Client) PatchV1NuncConnectionsNuncConnectionIDComponentGroupsGroupID(params *PatchV1NuncConnectionsNuncConnectionIDComponentGroupsGroupIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1NuncConnectionsNuncConnectionIDComponentGroupsGroupIDOK, error) { +func (a *Client) DeleteNuncLink(params *DeleteNuncLinkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteNuncLinkNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1NuncConnectionsNuncConnectionIDComponentGroupsGroupIDParams() + params = NewDeleteNuncLinkParams() } op := &runtime.ClientOperation{ - ID: "patchV1NuncConnectionsNuncConnectionIdComponentGroupsGroupId", - Method: "PATCH", - PathPattern: "/v1/nunc_connections/{nunc_connection_id}/component_groups/{group_id}", + ID: "delete_nunc_link", + Method: "DELETE", + PathPattern: "/v1/nunc_connections/{nunc_connection_id}/links/{link_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1NuncConnectionsNuncConnectionIDComponentGroupsGroupIDReader{formats: a.formats}, + Reader: &DeleteNuncLinkReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -512,35 +512,35 @@ func (a *Client) PatchV1NuncConnectionsNuncConnectionIDComponentGroupsGroupID(pa if err != nil { return nil, err } - success, ok := result.(*PatchV1NuncConnectionsNuncConnectionIDComponentGroupsGroupIDOK) + success, ok := result.(*DeleteNuncLinkNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1NuncConnectionsNuncConnectionIdComponentGroupsGroupId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_nunc_link: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1NuncConnectionsNuncConnectionIDLinksLinkID updates a status page link +DeleteNuncSubscription unsubscribes from status page notifications -Update a link to be displayed on a FireHydrant status page +Unsubscribe from status page updates */ -func (a *Client) PatchV1NuncConnectionsNuncConnectionIDLinksLinkID(params *PatchV1NuncConnectionsNuncConnectionIDLinksLinkIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1NuncConnectionsNuncConnectionIDLinksLinkIDOK, error) { +func (a *Client) DeleteNuncSubscription(params *DeleteNuncSubscriptionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteNuncSubscriptionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1NuncConnectionsNuncConnectionIDLinksLinkIDParams() + params = NewDeleteNuncSubscriptionParams() } op := &runtime.ClientOperation{ - ID: "patchV1NuncConnectionsNuncConnectionIdLinksLinkId", - Method: "PATCH", - PathPattern: "/v1/nunc_connections/{nunc_connection_id}/links/{link_id}", + ID: "delete_nunc_subscription", + Method: "DELETE", + PathPattern: "/v1/nunc/subscriptions/{unsubscribe_token}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1NuncConnectionsNuncConnectionIDLinksLinkIDReader{formats: a.formats}, + Reader: &DeleteNuncSubscriptionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -553,35 +553,35 @@ func (a *Client) PatchV1NuncConnectionsNuncConnectionIDLinksLinkID(params *Patch if err != nil { return nil, err } - success, ok := result.(*PatchV1NuncConnectionsNuncConnectionIDLinksLinkIDOK) + success, ok := result.(*DeleteNuncSubscriptionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1NuncConnectionsNuncConnectionIdLinksLinkId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_nunc_subscription: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1NuncConnections creates a status page +GetNuncConnection gets a status page -Create a new FireHydrant hosted status page for customer facing statuses. +Retrieve the information displayed as part of your FireHydrant hosted status page. */ -func (a *Client) PostV1NuncConnections(params *PostV1NuncConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1NuncConnectionsCreated, error) { +func (a *Client) GetNuncConnection(params *GetNuncConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetNuncConnectionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1NuncConnectionsParams() + params = NewGetNuncConnectionParams() } op := &runtime.ClientOperation{ - ID: "postV1NuncConnections", - Method: "POST", - PathPattern: "/v1/nunc_connections", + ID: "get_nunc_connection", + Method: "GET", + PathPattern: "/v1/nunc_connections/{nunc_connection_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1NuncConnectionsReader{formats: a.formats}, + Reader: &GetNuncConnectionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -594,35 +594,35 @@ func (a *Client) PostV1NuncConnections(params *PostV1NuncConnectionsParams, auth if err != nil { return nil, err } - success, ok := result.(*PostV1NuncConnectionsCreated) + success, ok := result.(*GetNuncConnectionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1NuncConnections: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_nunc_connection: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1NuncConnectionsNuncConnectionIDComponentGroups creates a component group for a status page +ListEmailSubscribers lists status page subscribers -Add a component group to be displayed on a FireHydrant status page +Retrieves the list of subscribers for a status page. */ -func (a *Client) PostV1NuncConnectionsNuncConnectionIDComponentGroups(params *PostV1NuncConnectionsNuncConnectionIDComponentGroupsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1NuncConnectionsNuncConnectionIDComponentGroupsCreated, error) { +func (a *Client) ListEmailSubscribers(params *ListEmailSubscribersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEmailSubscribersOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1NuncConnectionsNuncConnectionIDComponentGroupsParams() + params = NewListEmailSubscribersParams() } op := &runtime.ClientOperation{ - ID: "postV1NuncConnectionsNuncConnectionIdComponentGroups", - Method: "POST", - PathPattern: "/v1/nunc_connections/{nunc_connection_id}/component_groups", + ID: "list_email_subscribers", + Method: "GET", + PathPattern: "/v1/nunc_connections/{nunc_connection_id}/subscribers", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1NuncConnectionsNuncConnectionIDComponentGroupsReader{formats: a.formats}, + Reader: &ListEmailSubscribersReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -635,35 +635,35 @@ func (a *Client) PostV1NuncConnectionsNuncConnectionIDComponentGroups(params *Po if err != nil { return nil, err } - success, ok := result.(*PostV1NuncConnectionsNuncConnectionIDComponentGroupsCreated) + success, ok := result.(*ListEmailSubscribersOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1NuncConnectionsNuncConnectionIdComponentGroups: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_email_subscribers: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1NuncConnectionsNuncConnectionIDLinks adds link to a status page +ListNuncConnections lists status pages -Add a link to be displayed on a FireHydrant status page +Lists the information displayed as part of your FireHydrant hosted status pages. */ -func (a *Client) PostV1NuncConnectionsNuncConnectionIDLinks(params *PostV1NuncConnectionsNuncConnectionIDLinksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1NuncConnectionsNuncConnectionIDLinksCreated, error) { +func (a *Client) ListNuncConnections(params *ListNuncConnectionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListNuncConnectionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1NuncConnectionsNuncConnectionIDLinksParams() + params = NewListNuncConnectionsParams() } op := &runtime.ClientOperation{ - ID: "postV1NuncConnectionsNuncConnectionIdLinks", - Method: "POST", - PathPattern: "/v1/nunc_connections/{nunc_connection_id}/links", + ID: "list_nunc_connections", + Method: "GET", + PathPattern: "/v1/nunc_connections", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1NuncConnectionsNuncConnectionIDLinksReader{formats: a.formats}, + Reader: &ListNuncConnectionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -676,35 +676,35 @@ func (a *Client) PostV1NuncConnectionsNuncConnectionIDLinks(params *PostV1NuncCo if err != nil { return nil, err } - success, ok := result.(*PostV1NuncConnectionsNuncConnectionIDLinksCreated) + success, ok := result.(*ListNuncConnectionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1NuncConnectionsNuncConnectionIdLinks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_nunc_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1NuncConnectionsNuncConnectionIDSubscribers adds subscribers to a status page +UpdateNuncComponentGroup updates a status page component group -Subscribes a comma-separated string of emails to status page updates +Update a component group to be displayed on a FireHydrant status page */ -func (a *Client) PostV1NuncConnectionsNuncConnectionIDSubscribers(params *PostV1NuncConnectionsNuncConnectionIDSubscribersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1NuncConnectionsNuncConnectionIDSubscribersCreated, error) { +func (a *Client) UpdateNuncComponentGroup(params *UpdateNuncComponentGroupParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateNuncComponentGroupOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1NuncConnectionsNuncConnectionIDSubscribersParams() + params = NewUpdateNuncComponentGroupParams() } op := &runtime.ClientOperation{ - ID: "postV1NuncConnectionsNuncConnectionIdSubscribers", - Method: "POST", - PathPattern: "/v1/nunc_connections/{nunc_connection_id}/subscribers", + ID: "update_nunc_component_group", + Method: "PATCH", + PathPattern: "/v1/nunc_connections/{nunc_connection_id}/component_groups/{group_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1NuncConnectionsNuncConnectionIDSubscribersReader{formats: a.formats}, + Reader: &UpdateNuncComponentGroupReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -717,35 +717,35 @@ func (a *Client) PostV1NuncConnectionsNuncConnectionIDSubscribers(params *PostV1 if err != nil { return nil, err } - success, ok := result.(*PostV1NuncConnectionsNuncConnectionIDSubscribersCreated) + success, ok := result.(*UpdateNuncComponentGroupOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1NuncConnectionsNuncConnectionIdSubscribers: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_nunc_component_group: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1NuncSubscriptions creates a status page subscription +UpdateNuncConnection updates a status page -Subscribe to status page updates +Update your company's information and other components in the specified FireHydrant hosted status page. */ -func (a *Client) PostV1NuncSubscriptions(params *PostV1NuncSubscriptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1NuncSubscriptionsCreated, error) { +func (a *Client) UpdateNuncConnection(params *UpdateNuncConnectionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateNuncConnectionOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1NuncSubscriptionsParams() + params = NewUpdateNuncConnectionParams() } op := &runtime.ClientOperation{ - ID: "postV1NuncSubscriptions", - Method: "POST", - PathPattern: "/v1/nunc/subscriptions", + ID: "update_nunc_connection", + Method: "PUT", + PathPattern: "/v1/nunc_connections/{nunc_connection_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1NuncSubscriptionsReader{formats: a.formats}, + Reader: &UpdateNuncConnectionReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -758,35 +758,35 @@ func (a *Client) PostV1NuncSubscriptions(params *PostV1NuncSubscriptionsParams, if err != nil { return nil, err } - success, ok := result.(*PostV1NuncSubscriptionsCreated) + success, ok := result.(*UpdateNuncConnectionOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1NuncSubscriptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_nunc_connection: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1NuncConnectionsNuncConnectionID updates a status page +UpdateNuncImage uploads an image for a status page -Update your company's information and other components in the specified FireHydrant hosted status page. +Add or replace an image attached to a FireHydrant status page */ -func (a *Client) PutV1NuncConnectionsNuncConnectionID(params *PutV1NuncConnectionsNuncConnectionIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1NuncConnectionsNuncConnectionIDOK, error) { +func (a *Client) UpdateNuncImage(params *UpdateNuncImageParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateNuncImageOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1NuncConnectionsNuncConnectionIDParams() + params = NewUpdateNuncImageParams() } op := &runtime.ClientOperation{ - ID: "putV1NuncConnectionsNuncConnectionId", + ID: "update_nunc_image", Method: "PUT", - PathPattern: "/v1/nunc_connections/{nunc_connection_id}", + PathPattern: "/v1/nunc_connections/{nunc_connection_id}/images/{type}", ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"multipart/form-data"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1NuncConnectionsNuncConnectionIDReader{formats: a.formats}, + Reader: &UpdateNuncImageReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -799,35 +799,35 @@ func (a *Client) PutV1NuncConnectionsNuncConnectionID(params *PutV1NuncConnectio if err != nil { return nil, err } - success, ok := result.(*PutV1NuncConnectionsNuncConnectionIDOK) + success, ok := result.(*UpdateNuncImageOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1NuncConnectionsNuncConnectionId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_nunc_image: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1NuncConnectionsNuncConnectionIDImagesType uploads an image for a status page +UpdateNuncLink updates a status page link -Add or replace an image attached to a FireHydrant status page +Update a link to be displayed on a FireHydrant status page */ -func (a *Client) PutV1NuncConnectionsNuncConnectionIDImagesType(params *PutV1NuncConnectionsNuncConnectionIDImagesTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1NuncConnectionsNuncConnectionIDImagesTypeOK, error) { +func (a *Client) UpdateNuncLink(params *UpdateNuncLinkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateNuncLinkOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1NuncConnectionsNuncConnectionIDImagesTypeParams() + params = NewUpdateNuncLinkParams() } op := &runtime.ClientOperation{ - ID: "putV1NuncConnectionsNuncConnectionIdImagesType", - Method: "PUT", - PathPattern: "/v1/nunc_connections/{nunc_connection_id}/images/{type}", + ID: "update_nunc_link", + Method: "PATCH", + PathPattern: "/v1/nunc_connections/{nunc_connection_id}/links/{link_id}", ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"multipart/form-data"}, + ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1NuncConnectionsNuncConnectionIDImagesTypeReader{formats: a.formats}, + Reader: &UpdateNuncLinkReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -840,13 +840,13 @@ func (a *Client) PutV1NuncConnectionsNuncConnectionIDImagesType(params *PutV1Nun if err != nil { return nil, err } - success, ok := result.(*PutV1NuncConnectionsNuncConnectionIDImagesTypeOK) + success, ok := result.(*UpdateNuncLinkOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1NuncConnectionsNuncConnectionIdImagesType: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_nunc_link: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/status_pages/update_nunc_component_group_parameters.go b/client/status_pages/update_nunc_component_group_parameters.go new file mode 100644 index 0000000..15fb436 --- /dev/null +++ b/client/status_pages/update_nunc_component_group_parameters.go @@ -0,0 +1,257 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewUpdateNuncComponentGroupParams creates a new UpdateNuncComponentGroupParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateNuncComponentGroupParams() *UpdateNuncComponentGroupParams { + return &UpdateNuncComponentGroupParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateNuncComponentGroupParamsWithTimeout creates a new UpdateNuncComponentGroupParams object +// with the ability to set a timeout on a request. +func NewUpdateNuncComponentGroupParamsWithTimeout(timeout time.Duration) *UpdateNuncComponentGroupParams { + return &UpdateNuncComponentGroupParams{ + timeout: timeout, + } +} + +// NewUpdateNuncComponentGroupParamsWithContext creates a new UpdateNuncComponentGroupParams object +// with the ability to set a context for a request. +func NewUpdateNuncComponentGroupParamsWithContext(ctx context.Context) *UpdateNuncComponentGroupParams { + return &UpdateNuncComponentGroupParams{ + Context: ctx, + } +} + +// NewUpdateNuncComponentGroupParamsWithHTTPClient creates a new UpdateNuncComponentGroupParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateNuncComponentGroupParamsWithHTTPClient(client *http.Client) *UpdateNuncComponentGroupParams { + return &UpdateNuncComponentGroupParams{ + HTTPClient: client, + } +} + +/* +UpdateNuncComponentGroupParams contains all the parameters to send to the API endpoint + + for the update nunc component group operation. + + Typically these are written to a http.Request. +*/ +type UpdateNuncComponentGroupParams struct { + + // ComponentGroupID. + ComponentGroupID *string + + // GroupID. + GroupID string + + // Name. + Name *string + + // NuncConnectionID. + NuncConnectionID string + + // Position. + // + // Format: int32 + Position *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update nunc component group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateNuncComponentGroupParams) WithDefaults() *UpdateNuncComponentGroupParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update nunc component group params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateNuncComponentGroupParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) WithTimeout(timeout time.Duration) *UpdateNuncComponentGroupParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) WithContext(ctx context.Context) *UpdateNuncComponentGroupParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) WithHTTPClient(client *http.Client) *UpdateNuncComponentGroupParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithComponentGroupID adds the componentGroupID to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) WithComponentGroupID(componentGroupID *string) *UpdateNuncComponentGroupParams { + o.SetComponentGroupID(componentGroupID) + return o +} + +// SetComponentGroupID adds the componentGroupId to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) SetComponentGroupID(componentGroupID *string) { + o.ComponentGroupID = componentGroupID +} + +// WithGroupID adds the groupID to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) WithGroupID(groupID string) *UpdateNuncComponentGroupParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) SetGroupID(groupID string) { + o.GroupID = groupID +} + +// WithName adds the name to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) WithName(name *string) *UpdateNuncComponentGroupParams { + o.SetName(name) + return o +} + +// SetName adds the name to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) SetName(name *string) { + o.Name = name +} + +// WithNuncConnectionID adds the nuncConnectionID to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) WithNuncConnectionID(nuncConnectionID string) *UpdateNuncComponentGroupParams { + o.SetNuncConnectionID(nuncConnectionID) + return o +} + +// SetNuncConnectionID adds the nuncConnectionId to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) SetNuncConnectionID(nuncConnectionID string) { + o.NuncConnectionID = nuncConnectionID +} + +// WithPosition adds the position to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) WithPosition(position *int32) *UpdateNuncComponentGroupParams { + o.SetPosition(position) + return o +} + +// SetPosition adds the position to the update nunc component group params +func (o *UpdateNuncComponentGroupParams) SetPosition(position *int32) { + o.Position = position +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateNuncComponentGroupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ComponentGroupID != nil { + + // form param component_group_id + var frComponentGroupID string + if o.ComponentGroupID != nil { + frComponentGroupID = *o.ComponentGroupID + } + fComponentGroupID := frComponentGroupID + if fComponentGroupID != "" { + if err := r.SetFormParam("component_group_id", fComponentGroupID); err != nil { + return err + } + } + } + + // path param group_id + if err := r.SetPathParam("group_id", o.GroupID); err != nil { + return err + } + + if o.Name != nil { + + // form param name + var frName string + if o.Name != nil { + frName = *o.Name + } + fName := frName + if fName != "" { + if err := r.SetFormParam("name", fName); err != nil { + return err + } + } + } + + // path param nunc_connection_id + if err := r.SetPathParam("nunc_connection_id", o.NuncConnectionID); err != nil { + return err + } + + if o.Position != nil { + + // form param position + var frPosition int32 + if o.Position != nil { + frPosition = *o.Position + } + fPosition := swag.FormatInt32(frPosition) + if fPosition != "" { + if err := r.SetFormParam("position", fPosition); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/update_nunc_component_group_responses.go b/client/status_pages/update_nunc_component_group_responses.go new file mode 100644 index 0000000..8f5194a --- /dev/null +++ b/client/status_pages/update_nunc_component_group_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateNuncComponentGroupReader is a Reader for the UpdateNuncComponentGroup structure. +type UpdateNuncComponentGroupReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateNuncComponentGroupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateNuncComponentGroupOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateNuncComponentGroupOK creates a UpdateNuncComponentGroupOK with default headers values +func NewUpdateNuncComponentGroupOK() *UpdateNuncComponentGroupOK { + return &UpdateNuncComponentGroupOK{} +} + +/* +UpdateNuncComponentGroupOK describes a response with status code 200, with default header values. + +Update a component group to be displayed on a FireHydrant status page +*/ +type UpdateNuncComponentGroupOK struct { +} + +// IsSuccess returns true when this update nunc component group o k response has a 2xx status code +func (o *UpdateNuncComponentGroupOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update nunc component group o k response has a 3xx status code +func (o *UpdateNuncComponentGroupOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update nunc component group o k response has a 4xx status code +func (o *UpdateNuncComponentGroupOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update nunc component group o k response has a 5xx status code +func (o *UpdateNuncComponentGroupOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update nunc component group o k response a status code equal to that given +func (o *UpdateNuncComponentGroupOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateNuncComponentGroupOK) Error() string { + return fmt.Sprintf("[PATCH /v1/nunc_connections/{nunc_connection_id}/component_groups/{group_id}][%d] updateNuncComponentGroupOK ", 200) +} + +func (o *UpdateNuncComponentGroupOK) String() string { + return fmt.Sprintf("[PATCH /v1/nunc_connections/{nunc_connection_id}/component_groups/{group_id}][%d] updateNuncComponentGroupOK ", 200) +} + +func (o *UpdateNuncComponentGroupOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/status_pages/update_nunc_connection_parameters.go b/client/status_pages/update_nunc_connection_parameters.go new file mode 100644 index 0000000..9baa107 --- /dev/null +++ b/client/status_pages/update_nunc_connection_parameters.go @@ -0,0 +1,686 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewUpdateNuncConnectionParams creates a new UpdateNuncConnectionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateNuncConnectionParams() *UpdateNuncConnectionParams { + return &UpdateNuncConnectionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateNuncConnectionParamsWithTimeout creates a new UpdateNuncConnectionParams object +// with the ability to set a timeout on a request. +func NewUpdateNuncConnectionParamsWithTimeout(timeout time.Duration) *UpdateNuncConnectionParams { + return &UpdateNuncConnectionParams{ + timeout: timeout, + } +} + +// NewUpdateNuncConnectionParamsWithContext creates a new UpdateNuncConnectionParams object +// with the ability to set a context for a request. +func NewUpdateNuncConnectionParamsWithContext(ctx context.Context) *UpdateNuncConnectionParams { + return &UpdateNuncConnectionParams{ + Context: ctx, + } +} + +// NewUpdateNuncConnectionParamsWithHTTPClient creates a new UpdateNuncConnectionParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateNuncConnectionParamsWithHTTPClient(client *http.Client) *UpdateNuncConnectionParams { + return &UpdateNuncConnectionParams{ + HTTPClient: client, + } +} + +/* +UpdateNuncConnectionParams contains all the parameters to send to the API endpoint + + for the update nunc connection operation. + + Typically these are written to a http.Request. +*/ +type UpdateNuncConnectionParams struct { + + // CompanyName. + CompanyName *string + + // CompanyTosURL. + CompanyTosURL *string + + // CompanyWebsite. + CompanyWebsite *string + + // ComponentsInfrastructureID. + ComponentsInfrastructureID []string + + // ComponentsInfrastructureType. + ComponentsInfrastructureType []string + + /* ConditionsConditionID. + + Severity matrix condition id + */ + ConditionsConditionID []string + + /* ConditionsNuncCondition. + + Status page condition to map your severity matrix condition to + */ + ConditionsNuncCondition []string + + // EnableHistogram. + EnableHistogram *bool + + // ExposedFields. + ExposedFields []string + + // GreetingBody. + GreetingBody *string + + // GreetingTitle. + GreetingTitle *string + + // NuncConnectionID. + NuncConnectionID string + + // OperationalMessage. + OperationalMessage *string + + // PrimaryColor. + PrimaryColor *string + + // SecondaryColor. + SecondaryColor *string + + // Title. + Title *string + + // UIVersion. + // + // Format: int32 + UIVersion *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update nunc connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateNuncConnectionParams) WithDefaults() *UpdateNuncConnectionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update nunc connection params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateNuncConnectionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithTimeout(timeout time.Duration) *UpdateNuncConnectionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithContext(ctx context.Context) *UpdateNuncConnectionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithHTTPClient(client *http.Client) *UpdateNuncConnectionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCompanyName adds the companyName to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithCompanyName(companyName *string) *UpdateNuncConnectionParams { + o.SetCompanyName(companyName) + return o +} + +// SetCompanyName adds the companyName to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetCompanyName(companyName *string) { + o.CompanyName = companyName +} + +// WithCompanyTosURL adds the companyTosURL to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithCompanyTosURL(companyTosURL *string) *UpdateNuncConnectionParams { + o.SetCompanyTosURL(companyTosURL) + return o +} + +// SetCompanyTosURL adds the companyTosUrl to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetCompanyTosURL(companyTosURL *string) { + o.CompanyTosURL = companyTosURL +} + +// WithCompanyWebsite adds the companyWebsite to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithCompanyWebsite(companyWebsite *string) *UpdateNuncConnectionParams { + o.SetCompanyWebsite(companyWebsite) + return o +} + +// SetCompanyWebsite adds the companyWebsite to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetCompanyWebsite(companyWebsite *string) { + o.CompanyWebsite = companyWebsite +} + +// WithComponentsInfrastructureID adds the componentsInfrastructureID to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithComponentsInfrastructureID(componentsInfrastructureID []string) *UpdateNuncConnectionParams { + o.SetComponentsInfrastructureID(componentsInfrastructureID) + return o +} + +// SetComponentsInfrastructureID adds the componentsInfrastructureId to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetComponentsInfrastructureID(componentsInfrastructureID []string) { + o.ComponentsInfrastructureID = componentsInfrastructureID +} + +// WithComponentsInfrastructureType adds the componentsInfrastructureType to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithComponentsInfrastructureType(componentsInfrastructureType []string) *UpdateNuncConnectionParams { + o.SetComponentsInfrastructureType(componentsInfrastructureType) + return o +} + +// SetComponentsInfrastructureType adds the componentsInfrastructureType to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetComponentsInfrastructureType(componentsInfrastructureType []string) { + o.ComponentsInfrastructureType = componentsInfrastructureType +} + +// WithConditionsConditionID adds the conditionsConditionID to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithConditionsConditionID(conditionsConditionID []string) *UpdateNuncConnectionParams { + o.SetConditionsConditionID(conditionsConditionID) + return o +} + +// SetConditionsConditionID adds the conditionsConditionId to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetConditionsConditionID(conditionsConditionID []string) { + o.ConditionsConditionID = conditionsConditionID +} + +// WithConditionsNuncCondition adds the conditionsNuncCondition to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithConditionsNuncCondition(conditionsNuncCondition []string) *UpdateNuncConnectionParams { + o.SetConditionsNuncCondition(conditionsNuncCondition) + return o +} + +// SetConditionsNuncCondition adds the conditionsNuncCondition to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetConditionsNuncCondition(conditionsNuncCondition []string) { + o.ConditionsNuncCondition = conditionsNuncCondition +} + +// WithEnableHistogram adds the enableHistogram to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithEnableHistogram(enableHistogram *bool) *UpdateNuncConnectionParams { + o.SetEnableHistogram(enableHistogram) + return o +} + +// SetEnableHistogram adds the enableHistogram to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetEnableHistogram(enableHistogram *bool) { + o.EnableHistogram = enableHistogram +} + +// WithExposedFields adds the exposedFields to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithExposedFields(exposedFields []string) *UpdateNuncConnectionParams { + o.SetExposedFields(exposedFields) + return o +} + +// SetExposedFields adds the exposedFields to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetExposedFields(exposedFields []string) { + o.ExposedFields = exposedFields +} + +// WithGreetingBody adds the greetingBody to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithGreetingBody(greetingBody *string) *UpdateNuncConnectionParams { + o.SetGreetingBody(greetingBody) + return o +} + +// SetGreetingBody adds the greetingBody to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetGreetingBody(greetingBody *string) { + o.GreetingBody = greetingBody +} + +// WithGreetingTitle adds the greetingTitle to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithGreetingTitle(greetingTitle *string) *UpdateNuncConnectionParams { + o.SetGreetingTitle(greetingTitle) + return o +} + +// SetGreetingTitle adds the greetingTitle to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetGreetingTitle(greetingTitle *string) { + o.GreetingTitle = greetingTitle +} + +// WithNuncConnectionID adds the nuncConnectionID to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithNuncConnectionID(nuncConnectionID string) *UpdateNuncConnectionParams { + o.SetNuncConnectionID(nuncConnectionID) + return o +} + +// SetNuncConnectionID adds the nuncConnectionId to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetNuncConnectionID(nuncConnectionID string) { + o.NuncConnectionID = nuncConnectionID +} + +// WithOperationalMessage adds the operationalMessage to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithOperationalMessage(operationalMessage *string) *UpdateNuncConnectionParams { + o.SetOperationalMessage(operationalMessage) + return o +} + +// SetOperationalMessage adds the operationalMessage to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetOperationalMessage(operationalMessage *string) { + o.OperationalMessage = operationalMessage +} + +// WithPrimaryColor adds the primaryColor to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithPrimaryColor(primaryColor *string) *UpdateNuncConnectionParams { + o.SetPrimaryColor(primaryColor) + return o +} + +// SetPrimaryColor adds the primaryColor to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetPrimaryColor(primaryColor *string) { + o.PrimaryColor = primaryColor +} + +// WithSecondaryColor adds the secondaryColor to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithSecondaryColor(secondaryColor *string) *UpdateNuncConnectionParams { + o.SetSecondaryColor(secondaryColor) + return o +} + +// SetSecondaryColor adds the secondaryColor to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetSecondaryColor(secondaryColor *string) { + o.SecondaryColor = secondaryColor +} + +// WithTitle adds the title to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithTitle(title *string) *UpdateNuncConnectionParams { + o.SetTitle(title) + return o +} + +// SetTitle adds the title to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetTitle(title *string) { + o.Title = title +} + +// WithUIVersion adds the uIVersion to the update nunc connection params +func (o *UpdateNuncConnectionParams) WithUIVersion(uIVersion *int32) *UpdateNuncConnectionParams { + o.SetUIVersion(uIVersion) + return o +} + +// SetUIVersion adds the uiVersion to the update nunc connection params +func (o *UpdateNuncConnectionParams) SetUIVersion(uIVersion *int32) { + o.UIVersion = uIVersion +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateNuncConnectionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CompanyName != nil { + + // form param company_name + var frCompanyName string + if o.CompanyName != nil { + frCompanyName = *o.CompanyName + } + fCompanyName := frCompanyName + if fCompanyName != "" { + if err := r.SetFormParam("company_name", fCompanyName); err != nil { + return err + } + } + } + + if o.CompanyTosURL != nil { + + // form param company_tos_url + var frCompanyTosURL string + if o.CompanyTosURL != nil { + frCompanyTosURL = *o.CompanyTosURL + } + fCompanyTosURL := frCompanyTosURL + if fCompanyTosURL != "" { + if err := r.SetFormParam("company_tos_url", fCompanyTosURL); err != nil { + return err + } + } + } + + if o.CompanyWebsite != nil { + + // form param company_website + var frCompanyWebsite string + if o.CompanyWebsite != nil { + frCompanyWebsite = *o.CompanyWebsite + } + fCompanyWebsite := frCompanyWebsite + if fCompanyWebsite != "" { + if err := r.SetFormParam("company_website", fCompanyWebsite); err != nil { + return err + } + } + } + + if o.ComponentsInfrastructureID != nil { + + // binding items for components[infrastructure_id] + joinedComponentsInfrastructureID := o.bindParamComponentsInfrastructureID(reg) + + // form array param components[infrastructure_id] + if err := r.SetFormParam("components[infrastructure_id]", joinedComponentsInfrastructureID...); err != nil { + return err + } + } + + if o.ComponentsInfrastructureType != nil { + + // binding items for components[infrastructure_type] + joinedComponentsInfrastructureType := o.bindParamComponentsInfrastructureType(reg) + + // form array param components[infrastructure_type] + if err := r.SetFormParam("components[infrastructure_type]", joinedComponentsInfrastructureType...); err != nil { + return err + } + } + + if o.ConditionsConditionID != nil { + + // binding items for conditions[condition_id] + joinedConditionsConditionID := o.bindParamConditionsConditionID(reg) + + // form array param conditions[condition_id] + if err := r.SetFormParam("conditions[condition_id]", joinedConditionsConditionID...); err != nil { + return err + } + } + + if o.ConditionsNuncCondition != nil { + + // binding items for conditions[nunc_condition] + joinedConditionsNuncCondition := o.bindParamConditionsNuncCondition(reg) + + // form array param conditions[nunc_condition] + if err := r.SetFormParam("conditions[nunc_condition]", joinedConditionsNuncCondition...); err != nil { + return err + } + } + + if o.EnableHistogram != nil { + + // form param enable_histogram + var frEnableHistogram bool + if o.EnableHistogram != nil { + frEnableHistogram = *o.EnableHistogram + } + fEnableHistogram := swag.FormatBool(frEnableHistogram) + if fEnableHistogram != "" { + if err := r.SetFormParam("enable_histogram", fEnableHistogram); err != nil { + return err + } + } + } + + if o.ExposedFields != nil { + + // binding items for exposed_fields + joinedExposedFields := o.bindParamExposedFields(reg) + + // form array param exposed_fields + if err := r.SetFormParam("exposed_fields", joinedExposedFields...); err != nil { + return err + } + } + + if o.GreetingBody != nil { + + // form param greeting_body + var frGreetingBody string + if o.GreetingBody != nil { + frGreetingBody = *o.GreetingBody + } + fGreetingBody := frGreetingBody + if fGreetingBody != "" { + if err := r.SetFormParam("greeting_body", fGreetingBody); err != nil { + return err + } + } + } + + if o.GreetingTitle != nil { + + // form param greeting_title + var frGreetingTitle string + if o.GreetingTitle != nil { + frGreetingTitle = *o.GreetingTitle + } + fGreetingTitle := frGreetingTitle + if fGreetingTitle != "" { + if err := r.SetFormParam("greeting_title", fGreetingTitle); err != nil { + return err + } + } + } + + // path param nunc_connection_id + if err := r.SetPathParam("nunc_connection_id", o.NuncConnectionID); err != nil { + return err + } + + if o.OperationalMessage != nil { + + // form param operational_message + var frOperationalMessage string + if o.OperationalMessage != nil { + frOperationalMessage = *o.OperationalMessage + } + fOperationalMessage := frOperationalMessage + if fOperationalMessage != "" { + if err := r.SetFormParam("operational_message", fOperationalMessage); err != nil { + return err + } + } + } + + if o.PrimaryColor != nil { + + // form param primary_color + var frPrimaryColor string + if o.PrimaryColor != nil { + frPrimaryColor = *o.PrimaryColor + } + fPrimaryColor := frPrimaryColor + if fPrimaryColor != "" { + if err := r.SetFormParam("primary_color", fPrimaryColor); err != nil { + return err + } + } + } + + if o.SecondaryColor != nil { + + // form param secondary_color + var frSecondaryColor string + if o.SecondaryColor != nil { + frSecondaryColor = *o.SecondaryColor + } + fSecondaryColor := frSecondaryColor + if fSecondaryColor != "" { + if err := r.SetFormParam("secondary_color", fSecondaryColor); err != nil { + return err + } + } + } + + if o.Title != nil { + + // form param title + var frTitle string + if o.Title != nil { + frTitle = *o.Title + } + fTitle := frTitle + if fTitle != "" { + if err := r.SetFormParam("title", fTitle); err != nil { + return err + } + } + } + + if o.UIVersion != nil { + + // form param ui_version + var frUIVersion int32 + if o.UIVersion != nil { + frUIVersion = *o.UIVersion + } + fUIVersion := swag.FormatInt32(frUIVersion) + if fUIVersion != "" { + if err := r.SetFormParam("ui_version", fUIVersion); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParamUpdateNuncConnection binds the parameter components[infrastructure_id] +func (o *UpdateNuncConnectionParams) bindParamComponentsInfrastructureID(formats strfmt.Registry) []string { + componentsInfrastructureIDIR := o.ComponentsInfrastructureID + + var componentsInfrastructureIDIC []string + for _, componentsInfrastructureIDIIR := range componentsInfrastructureIDIR { // explode []string + + componentsInfrastructureIDIIV := componentsInfrastructureIDIIR // string as string + componentsInfrastructureIDIC = append(componentsInfrastructureIDIC, componentsInfrastructureIDIIV) + } + + // items.CollectionFormat: "" + componentsInfrastructureIDIS := swag.JoinByFormat(componentsInfrastructureIDIC, "") + + return componentsInfrastructureIDIS +} + +// bindParamUpdateNuncConnection binds the parameter components[infrastructure_type] +func (o *UpdateNuncConnectionParams) bindParamComponentsInfrastructureType(formats strfmt.Registry) []string { + componentsInfrastructureTypeIR := o.ComponentsInfrastructureType + + var componentsInfrastructureTypeIC []string + for _, componentsInfrastructureTypeIIR := range componentsInfrastructureTypeIR { // explode []string + + componentsInfrastructureTypeIIV := componentsInfrastructureTypeIIR // string as string + componentsInfrastructureTypeIC = append(componentsInfrastructureTypeIC, componentsInfrastructureTypeIIV) + } + + // items.CollectionFormat: "" + componentsInfrastructureTypeIS := swag.JoinByFormat(componentsInfrastructureTypeIC, "") + + return componentsInfrastructureTypeIS +} + +// bindParamUpdateNuncConnection binds the parameter conditions[condition_id] +func (o *UpdateNuncConnectionParams) bindParamConditionsConditionID(formats strfmt.Registry) []string { + conditionsConditionIDIR := o.ConditionsConditionID + + var conditionsConditionIDIC []string + for _, conditionsConditionIDIIR := range conditionsConditionIDIR { // explode []string + + conditionsConditionIDIIV := conditionsConditionIDIIR // string as string + conditionsConditionIDIC = append(conditionsConditionIDIC, conditionsConditionIDIIV) + } + + // items.CollectionFormat: "" + conditionsConditionIDIS := swag.JoinByFormat(conditionsConditionIDIC, "") + + return conditionsConditionIDIS +} + +// bindParamUpdateNuncConnection binds the parameter conditions[nunc_condition] +func (o *UpdateNuncConnectionParams) bindParamConditionsNuncCondition(formats strfmt.Registry) []string { + conditionsNuncConditionIR := o.ConditionsNuncCondition + + var conditionsNuncConditionIC []string + for _, conditionsNuncConditionIIR := range conditionsNuncConditionIR { // explode []string + + conditionsNuncConditionIIV := conditionsNuncConditionIIR // string as string + conditionsNuncConditionIC = append(conditionsNuncConditionIC, conditionsNuncConditionIIV) + } + + // items.CollectionFormat: "" + conditionsNuncConditionIS := swag.JoinByFormat(conditionsNuncConditionIC, "") + + return conditionsNuncConditionIS +} + +// bindParamUpdateNuncConnection binds the parameter exposed_fields +func (o *UpdateNuncConnectionParams) bindParamExposedFields(formats strfmt.Registry) []string { + exposedFieldsIR := o.ExposedFields + + var exposedFieldsIC []string + for _, exposedFieldsIIR := range exposedFieldsIR { // explode []string + + exposedFieldsIIV := exposedFieldsIIR // string as string + exposedFieldsIC = append(exposedFieldsIC, exposedFieldsIIV) + } + + // items.CollectionFormat: "" + exposedFieldsIS := swag.JoinByFormat(exposedFieldsIC, "") + + return exposedFieldsIS +} diff --git a/client/status_pages/update_nunc_connection_responses.go b/client/status_pages/update_nunc_connection_responses.go new file mode 100644 index 0000000..cccaf1d --- /dev/null +++ b/client/status_pages/update_nunc_connection_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateNuncConnectionReader is a Reader for the UpdateNuncConnection structure. +type UpdateNuncConnectionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateNuncConnectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateNuncConnectionOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateNuncConnectionOK creates a UpdateNuncConnectionOK with default headers values +func NewUpdateNuncConnectionOK() *UpdateNuncConnectionOK { + return &UpdateNuncConnectionOK{} +} + +/* +UpdateNuncConnectionOK describes a response with status code 200, with default header values. + +Update your company's information and other components in the specified FireHydrant hosted status page. +*/ +type UpdateNuncConnectionOK struct { + Payload *models.NuncConnectionEntity +} + +// IsSuccess returns true when this update nunc connection o k response has a 2xx status code +func (o *UpdateNuncConnectionOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update nunc connection o k response has a 3xx status code +func (o *UpdateNuncConnectionOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update nunc connection o k response has a 4xx status code +func (o *UpdateNuncConnectionOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update nunc connection o k response has a 5xx status code +func (o *UpdateNuncConnectionOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update nunc connection o k response a status code equal to that given +func (o *UpdateNuncConnectionOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateNuncConnectionOK) Error() string { + return fmt.Sprintf("[PUT /v1/nunc_connections/{nunc_connection_id}][%d] updateNuncConnectionOK %+v", 200, o.Payload) +} + +func (o *UpdateNuncConnectionOK) String() string { + return fmt.Sprintf("[PUT /v1/nunc_connections/{nunc_connection_id}][%d] updateNuncConnectionOK %+v", 200, o.Payload) +} + +func (o *UpdateNuncConnectionOK) GetPayload() *models.NuncConnectionEntity { + return o.Payload +} + +func (o *UpdateNuncConnectionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NuncConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/status_pages/update_nunc_image_parameters.go b/client/status_pages/update_nunc_image_parameters.go new file mode 100644 index 0000000..a08aac2 --- /dev/null +++ b/client/status_pages/update_nunc_image_parameters.go @@ -0,0 +1,191 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateNuncImageParams creates a new UpdateNuncImageParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateNuncImageParams() *UpdateNuncImageParams { + return &UpdateNuncImageParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateNuncImageParamsWithTimeout creates a new UpdateNuncImageParams object +// with the ability to set a timeout on a request. +func NewUpdateNuncImageParamsWithTimeout(timeout time.Duration) *UpdateNuncImageParams { + return &UpdateNuncImageParams{ + timeout: timeout, + } +} + +// NewUpdateNuncImageParamsWithContext creates a new UpdateNuncImageParams object +// with the ability to set a context for a request. +func NewUpdateNuncImageParamsWithContext(ctx context.Context) *UpdateNuncImageParams { + return &UpdateNuncImageParams{ + Context: ctx, + } +} + +// NewUpdateNuncImageParamsWithHTTPClient creates a new UpdateNuncImageParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateNuncImageParamsWithHTTPClient(client *http.Client) *UpdateNuncImageParams { + return &UpdateNuncImageParams{ + HTTPClient: client, + } +} + +/* +UpdateNuncImageParams contains all the parameters to send to the API endpoint + + for the update nunc image operation. + + Typically these are written to a http.Request. +*/ +type UpdateNuncImageParams struct { + + // File. + File runtime.NamedReadCloser + + // NuncConnectionID. + NuncConnectionID string + + // Type. + Type string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update nunc image params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateNuncImageParams) WithDefaults() *UpdateNuncImageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update nunc image params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateNuncImageParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update nunc image params +func (o *UpdateNuncImageParams) WithTimeout(timeout time.Duration) *UpdateNuncImageParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update nunc image params +func (o *UpdateNuncImageParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update nunc image params +func (o *UpdateNuncImageParams) WithContext(ctx context.Context) *UpdateNuncImageParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update nunc image params +func (o *UpdateNuncImageParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update nunc image params +func (o *UpdateNuncImageParams) WithHTTPClient(client *http.Client) *UpdateNuncImageParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update nunc image params +func (o *UpdateNuncImageParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFile adds the file to the update nunc image params +func (o *UpdateNuncImageParams) WithFile(file runtime.NamedReadCloser) *UpdateNuncImageParams { + o.SetFile(file) + return o +} + +// SetFile adds the file to the update nunc image params +func (o *UpdateNuncImageParams) SetFile(file runtime.NamedReadCloser) { + o.File = file +} + +// WithNuncConnectionID adds the nuncConnectionID to the update nunc image params +func (o *UpdateNuncImageParams) WithNuncConnectionID(nuncConnectionID string) *UpdateNuncImageParams { + o.SetNuncConnectionID(nuncConnectionID) + return o +} + +// SetNuncConnectionID adds the nuncConnectionId to the update nunc image params +func (o *UpdateNuncImageParams) SetNuncConnectionID(nuncConnectionID string) { + o.NuncConnectionID = nuncConnectionID +} + +// WithType adds the typeVar to the update nunc image params +func (o *UpdateNuncImageParams) WithType(typeVar string) *UpdateNuncImageParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the update nunc image params +func (o *UpdateNuncImageParams) SetType(typeVar string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateNuncImageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.File != nil { + + if o.File != nil { + // form file param file + if err := r.SetFileParam("file", o.File); err != nil { + return err + } + } + } + + // path param nunc_connection_id + if err := r.SetPathParam("nunc_connection_id", o.NuncConnectionID); err != nil { + return err + } + + // path param type + if err := r.SetPathParam("type", o.Type); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/update_nunc_image_responses.go b/client/status_pages/update_nunc_image_responses.go new file mode 100644 index 0000000..6d42dc2 --- /dev/null +++ b/client/status_pages/update_nunc_image_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateNuncImageReader is a Reader for the UpdateNuncImage structure. +type UpdateNuncImageReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateNuncImageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateNuncImageOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateNuncImageOK creates a UpdateNuncImageOK with default headers values +func NewUpdateNuncImageOK() *UpdateNuncImageOK { + return &UpdateNuncImageOK{} +} + +/* +UpdateNuncImageOK describes a response with status code 200, with default header values. + +Add or replace an image attached to a FireHydrant status page +*/ +type UpdateNuncImageOK struct { + Payload *models.NuncConnectionEntity +} + +// IsSuccess returns true when this update nunc image o k response has a 2xx status code +func (o *UpdateNuncImageOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update nunc image o k response has a 3xx status code +func (o *UpdateNuncImageOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update nunc image o k response has a 4xx status code +func (o *UpdateNuncImageOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update nunc image o k response has a 5xx status code +func (o *UpdateNuncImageOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update nunc image o k response a status code equal to that given +func (o *UpdateNuncImageOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateNuncImageOK) Error() string { + return fmt.Sprintf("[PUT /v1/nunc_connections/{nunc_connection_id}/images/{type}][%d] updateNuncImageOK %+v", 200, o.Payload) +} + +func (o *UpdateNuncImageOK) String() string { + return fmt.Sprintf("[PUT /v1/nunc_connections/{nunc_connection_id}/images/{type}][%d] updateNuncImageOK %+v", 200, o.Payload) +} + +func (o *UpdateNuncImageOK) GetPayload() *models.NuncConnectionEntity { + return o.Payload +} + +func (o *UpdateNuncImageOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NuncConnectionEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/status_pages/update_nunc_link_parameters.go b/client/status_pages/update_nunc_link_parameters.go new file mode 100644 index 0000000..5290f72 --- /dev/null +++ b/client/status_pages/update_nunc_link_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateNuncLinkParams creates a new UpdateNuncLinkParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateNuncLinkParams() *UpdateNuncLinkParams { + return &UpdateNuncLinkParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateNuncLinkParamsWithTimeout creates a new UpdateNuncLinkParams object +// with the ability to set a timeout on a request. +func NewUpdateNuncLinkParamsWithTimeout(timeout time.Duration) *UpdateNuncLinkParams { + return &UpdateNuncLinkParams{ + timeout: timeout, + } +} + +// NewUpdateNuncLinkParamsWithContext creates a new UpdateNuncLinkParams object +// with the ability to set a context for a request. +func NewUpdateNuncLinkParamsWithContext(ctx context.Context) *UpdateNuncLinkParams { + return &UpdateNuncLinkParams{ + Context: ctx, + } +} + +// NewUpdateNuncLinkParamsWithHTTPClient creates a new UpdateNuncLinkParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateNuncLinkParamsWithHTTPClient(client *http.Client) *UpdateNuncLinkParams { + return &UpdateNuncLinkParams{ + HTTPClient: client, + } +} + +/* +UpdateNuncLinkParams contains all the parameters to send to the API endpoint + + for the update nunc link operation. + + Typically these are written to a http.Request. +*/ +type UpdateNuncLinkParams struct { + + // LinkID. + LinkID string + + // NuncConnectionID. + NuncConnectionID string + + // UpdateNuncLink. + UpdateNuncLink *models.UpdateNuncLink + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update nunc link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateNuncLinkParams) WithDefaults() *UpdateNuncLinkParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update nunc link params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateNuncLinkParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update nunc link params +func (o *UpdateNuncLinkParams) WithTimeout(timeout time.Duration) *UpdateNuncLinkParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update nunc link params +func (o *UpdateNuncLinkParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update nunc link params +func (o *UpdateNuncLinkParams) WithContext(ctx context.Context) *UpdateNuncLinkParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update nunc link params +func (o *UpdateNuncLinkParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update nunc link params +func (o *UpdateNuncLinkParams) WithHTTPClient(client *http.Client) *UpdateNuncLinkParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update nunc link params +func (o *UpdateNuncLinkParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLinkID adds the linkID to the update nunc link params +func (o *UpdateNuncLinkParams) WithLinkID(linkID string) *UpdateNuncLinkParams { + o.SetLinkID(linkID) + return o +} + +// SetLinkID adds the linkId to the update nunc link params +func (o *UpdateNuncLinkParams) SetLinkID(linkID string) { + o.LinkID = linkID +} + +// WithNuncConnectionID adds the nuncConnectionID to the update nunc link params +func (o *UpdateNuncLinkParams) WithNuncConnectionID(nuncConnectionID string) *UpdateNuncLinkParams { + o.SetNuncConnectionID(nuncConnectionID) + return o +} + +// SetNuncConnectionID adds the nuncConnectionId to the update nunc link params +func (o *UpdateNuncLinkParams) SetNuncConnectionID(nuncConnectionID string) { + o.NuncConnectionID = nuncConnectionID +} + +// WithUpdateNuncLink adds the updateNuncLink to the update nunc link params +func (o *UpdateNuncLinkParams) WithUpdateNuncLink(updateNuncLink *models.UpdateNuncLink) *UpdateNuncLinkParams { + o.SetUpdateNuncLink(updateNuncLink) + return o +} + +// SetUpdateNuncLink adds the updateNuncLink to the update nunc link params +func (o *UpdateNuncLinkParams) SetUpdateNuncLink(updateNuncLink *models.UpdateNuncLink) { + o.UpdateNuncLink = updateNuncLink +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateNuncLinkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param link_id + if err := r.SetPathParam("link_id", o.LinkID); err != nil { + return err + } + + // path param nunc_connection_id + if err := r.SetPathParam("nunc_connection_id", o.NuncConnectionID); err != nil { + return err + } + if o.UpdateNuncLink != nil { + if err := r.SetBodyParam(o.UpdateNuncLink); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/status_pages/update_nunc_link_responses.go b/client/status_pages/update_nunc_link_responses.go new file mode 100644 index 0000000..4fdc6c6 --- /dev/null +++ b/client/status_pages/update_nunc_link_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package status_pages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateNuncLinkReader is a Reader for the UpdateNuncLink structure. +type UpdateNuncLinkReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateNuncLinkReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateNuncLinkOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateNuncLinkOK creates a UpdateNuncLinkOK with default headers values +func NewUpdateNuncLinkOK() *UpdateNuncLinkOK { + return &UpdateNuncLinkOK{} +} + +/* +UpdateNuncLinkOK describes a response with status code 200, with default header values. + +Update a link to be displayed on a FireHydrant status page +*/ +type UpdateNuncLinkOK struct { +} + +// IsSuccess returns true when this update nunc link o k response has a 2xx status code +func (o *UpdateNuncLinkOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update nunc link o k response has a 3xx status code +func (o *UpdateNuncLinkOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update nunc link o k response has a 4xx status code +func (o *UpdateNuncLinkOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update nunc link o k response has a 5xx status code +func (o *UpdateNuncLinkOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update nunc link o k response a status code equal to that given +func (o *UpdateNuncLinkOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateNuncLinkOK) Error() string { + return fmt.Sprintf("[PATCH /v1/nunc_connections/{nunc_connection_id}/links/{link_id}][%d] updateNuncLinkOK ", 200) +} + +func (o *UpdateNuncLinkOK) String() string { + return fmt.Sprintf("[PATCH /v1/nunc_connections/{nunc_connection_id}/links/{link_id}][%d] updateNuncLinkOK ", 200) +} + +func (o *UpdateNuncLinkOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/tasks/convert_incident_task_parameters.go b/client/tasks/convert_incident_task_parameters.go new file mode 100644 index 0000000..7df51dd --- /dev/null +++ b/client/tasks/convert_incident_task_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewConvertIncidentTaskParams creates a new ConvertIncidentTaskParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewConvertIncidentTaskParams() *ConvertIncidentTaskParams { + return &ConvertIncidentTaskParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewConvertIncidentTaskParamsWithTimeout creates a new ConvertIncidentTaskParams object +// with the ability to set a timeout on a request. +func NewConvertIncidentTaskParamsWithTimeout(timeout time.Duration) *ConvertIncidentTaskParams { + return &ConvertIncidentTaskParams{ + timeout: timeout, + } +} + +// NewConvertIncidentTaskParamsWithContext creates a new ConvertIncidentTaskParams object +// with the ability to set a context for a request. +func NewConvertIncidentTaskParamsWithContext(ctx context.Context) *ConvertIncidentTaskParams { + return &ConvertIncidentTaskParams{ + Context: ctx, + } +} + +// NewConvertIncidentTaskParamsWithHTTPClient creates a new ConvertIncidentTaskParams object +// with the ability to set a custom HTTPClient for a request. +func NewConvertIncidentTaskParamsWithHTTPClient(client *http.Client) *ConvertIncidentTaskParams { + return &ConvertIncidentTaskParams{ + HTTPClient: client, + } +} + +/* +ConvertIncidentTaskParams contains all the parameters to send to the API endpoint + + for the convert incident task operation. + + Typically these are written to a http.Request. +*/ +type ConvertIncidentTaskParams struct { + + // ConvertIncidentTask. + ConvertIncidentTask *models.ConvertIncidentTask + + // IncidentID. + IncidentID string + + // TaskID. + TaskID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the convert incident task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ConvertIncidentTaskParams) WithDefaults() *ConvertIncidentTaskParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the convert incident task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ConvertIncidentTaskParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the convert incident task params +func (o *ConvertIncidentTaskParams) WithTimeout(timeout time.Duration) *ConvertIncidentTaskParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the convert incident task params +func (o *ConvertIncidentTaskParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the convert incident task params +func (o *ConvertIncidentTaskParams) WithContext(ctx context.Context) *ConvertIncidentTaskParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the convert incident task params +func (o *ConvertIncidentTaskParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the convert incident task params +func (o *ConvertIncidentTaskParams) WithHTTPClient(client *http.Client) *ConvertIncidentTaskParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the convert incident task params +func (o *ConvertIncidentTaskParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConvertIncidentTask adds the convertIncidentTask to the convert incident task params +func (o *ConvertIncidentTaskParams) WithConvertIncidentTask(convertIncidentTask *models.ConvertIncidentTask) *ConvertIncidentTaskParams { + o.SetConvertIncidentTask(convertIncidentTask) + return o +} + +// SetConvertIncidentTask adds the convertIncidentTask to the convert incident task params +func (o *ConvertIncidentTaskParams) SetConvertIncidentTask(convertIncidentTask *models.ConvertIncidentTask) { + o.ConvertIncidentTask = convertIncidentTask +} + +// WithIncidentID adds the incidentID to the convert incident task params +func (o *ConvertIncidentTaskParams) WithIncidentID(incidentID string) *ConvertIncidentTaskParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the convert incident task params +func (o *ConvertIncidentTaskParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithTaskID adds the taskID to the convert incident task params +func (o *ConvertIncidentTaskParams) WithTaskID(taskID string) *ConvertIncidentTaskParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the convert incident task params +func (o *ConvertIncidentTaskParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WriteToRequest writes these params to a swagger request +func (o *ConvertIncidentTaskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.ConvertIncidentTask != nil { + if err := r.SetBodyParam(o.ConvertIncidentTask); err != nil { + return err + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/convert_incident_task_responses.go b/client/tasks/convert_incident_task_responses.go new file mode 100644 index 0000000..17e5759 --- /dev/null +++ b/client/tasks/convert_incident_task_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ConvertIncidentTaskReader is a Reader for the ConvertIncidentTask structure. +type ConvertIncidentTaskReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ConvertIncidentTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewConvertIncidentTaskCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewConvertIncidentTaskCreated creates a ConvertIncidentTaskCreated with default headers values +func NewConvertIncidentTaskCreated() *ConvertIncidentTaskCreated { + return &ConvertIncidentTaskCreated{} +} + +/* +ConvertIncidentTaskCreated describes a response with status code 201, with default header values. + +Convert a task to a follow-up +*/ +type ConvertIncidentTaskCreated struct { + Payload *models.TaskEntityPaginated +} + +// IsSuccess returns true when this convert incident task created response has a 2xx status code +func (o *ConvertIncidentTaskCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this convert incident task created response has a 3xx status code +func (o *ConvertIncidentTaskCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this convert incident task created response has a 4xx status code +func (o *ConvertIncidentTaskCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this convert incident task created response has a 5xx status code +func (o *ConvertIncidentTaskCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this convert incident task created response a status code equal to that given +func (o *ConvertIncidentTaskCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *ConvertIncidentTaskCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/tasks/{task_id}/convert][%d] convertIncidentTaskCreated %+v", 201, o.Payload) +} + +func (o *ConvertIncidentTaskCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/tasks/{task_id}/convert][%d] convertIncidentTaskCreated %+v", 201, o.Payload) +} + +func (o *ConvertIncidentTaskCreated) GetPayload() *models.TaskEntityPaginated { + return o.Payload +} + +func (o *ConvertIncidentTaskCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/tasks/create_checklist_template_parameters.go b/client/tasks/create_checklist_template_parameters.go new file mode 100644 index 0000000..8c9027d --- /dev/null +++ b/client/tasks/create_checklist_template_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateChecklistTemplateParams creates a new CreateChecklistTemplateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateChecklistTemplateParams() *CreateChecklistTemplateParams { + return &CreateChecklistTemplateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateChecklistTemplateParamsWithTimeout creates a new CreateChecklistTemplateParams object +// with the ability to set a timeout on a request. +func NewCreateChecklistTemplateParamsWithTimeout(timeout time.Duration) *CreateChecklistTemplateParams { + return &CreateChecklistTemplateParams{ + timeout: timeout, + } +} + +// NewCreateChecklistTemplateParamsWithContext creates a new CreateChecklistTemplateParams object +// with the ability to set a context for a request. +func NewCreateChecklistTemplateParamsWithContext(ctx context.Context) *CreateChecklistTemplateParams { + return &CreateChecklistTemplateParams{ + Context: ctx, + } +} + +// NewCreateChecklistTemplateParamsWithHTTPClient creates a new CreateChecklistTemplateParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateChecklistTemplateParamsWithHTTPClient(client *http.Client) *CreateChecklistTemplateParams { + return &CreateChecklistTemplateParams{ + HTTPClient: client, + } +} + +/* +CreateChecklistTemplateParams contains all the parameters to send to the API endpoint + + for the create checklist template operation. + + Typically these are written to a http.Request. +*/ +type CreateChecklistTemplateParams struct { + + // CreateChecklistTemplate. + CreateChecklistTemplate *models.CreateChecklistTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create checklist template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateChecklistTemplateParams) WithDefaults() *CreateChecklistTemplateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create checklist template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateChecklistTemplateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create checklist template params +func (o *CreateChecklistTemplateParams) WithTimeout(timeout time.Duration) *CreateChecklistTemplateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create checklist template params +func (o *CreateChecklistTemplateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create checklist template params +func (o *CreateChecklistTemplateParams) WithContext(ctx context.Context) *CreateChecklistTemplateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create checklist template params +func (o *CreateChecklistTemplateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create checklist template params +func (o *CreateChecklistTemplateParams) WithHTTPClient(client *http.Client) *CreateChecklistTemplateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create checklist template params +func (o *CreateChecklistTemplateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateChecklistTemplate adds the createChecklistTemplate to the create checklist template params +func (o *CreateChecklistTemplateParams) WithCreateChecklistTemplate(createChecklistTemplate *models.CreateChecklistTemplate) *CreateChecklistTemplateParams { + o.SetCreateChecklistTemplate(createChecklistTemplate) + return o +} + +// SetCreateChecklistTemplate adds the createChecklistTemplate to the create checklist template params +func (o *CreateChecklistTemplateParams) SetCreateChecklistTemplate(createChecklistTemplate *models.CreateChecklistTemplate) { + o.CreateChecklistTemplate = createChecklistTemplate +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateChecklistTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateChecklistTemplate != nil { + if err := r.SetBodyParam(o.CreateChecklistTemplate); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/create_checklist_template_responses.go b/client/tasks/create_checklist_template_responses.go new file mode 100644 index 0000000..6d14d6e --- /dev/null +++ b/client/tasks/create_checklist_template_responses.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateChecklistTemplateReader is a Reader for the CreateChecklistTemplate structure. +type CreateChecklistTemplateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateChecklistTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateChecklistTemplateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateChecklistTemplateBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateChecklistTemplateCreated creates a CreateChecklistTemplateCreated with default headers values +func NewCreateChecklistTemplateCreated() *CreateChecklistTemplateCreated { + return &CreateChecklistTemplateCreated{} +} + +/* +CreateChecklistTemplateCreated describes a response with status code 201, with default header values. + +Creates a checklist template for the organization +*/ +type CreateChecklistTemplateCreated struct { + Payload *models.ChecklistTemplateEntity +} + +// IsSuccess returns true when this create checklist template created response has a 2xx status code +func (o *CreateChecklistTemplateCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create checklist template created response has a 3xx status code +func (o *CreateChecklistTemplateCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create checklist template created response has a 4xx status code +func (o *CreateChecklistTemplateCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create checklist template created response has a 5xx status code +func (o *CreateChecklistTemplateCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create checklist template created response a status code equal to that given +func (o *CreateChecklistTemplateCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateChecklistTemplateCreated) Error() string { + return fmt.Sprintf("[POST /v1/checklist_templates][%d] createChecklistTemplateCreated %+v", 201, o.Payload) +} + +func (o *CreateChecklistTemplateCreated) String() string { + return fmt.Sprintf("[POST /v1/checklist_templates][%d] createChecklistTemplateCreated %+v", 201, o.Payload) +} + +func (o *CreateChecklistTemplateCreated) GetPayload() *models.ChecklistTemplateEntity { + return o.Payload +} + +func (o *CreateChecklistTemplateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChecklistTemplateEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateChecklistTemplateBadRequest creates a CreateChecklistTemplateBadRequest with default headers values +func NewCreateChecklistTemplateBadRequest() *CreateChecklistTemplateBadRequest { + return &CreateChecklistTemplateBadRequest{} +} + +/* +CreateChecklistTemplateBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type CreateChecklistTemplateBadRequest struct { + Payload *models.ErrorEntity +} + +// IsSuccess returns true when this create checklist template bad request response has a 2xx status code +func (o *CreateChecklistTemplateBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create checklist template bad request response has a 3xx status code +func (o *CreateChecklistTemplateBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create checklist template bad request response has a 4xx status code +func (o *CreateChecklistTemplateBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create checklist template bad request response has a 5xx status code +func (o *CreateChecklistTemplateBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create checklist template bad request response a status code equal to that given +func (o *CreateChecklistTemplateBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *CreateChecklistTemplateBadRequest) Error() string { + return fmt.Sprintf("[POST /v1/checklist_templates][%d] createChecklistTemplateBadRequest %+v", 400, o.Payload) +} + +func (o *CreateChecklistTemplateBadRequest) String() string { + return fmt.Sprintf("[POST /v1/checklist_templates][%d] createChecklistTemplateBadRequest %+v", 400, o.Payload) +} + +func (o *CreateChecklistTemplateBadRequest) GetPayload() *models.ErrorEntity { + return o.Payload +} + +func (o *CreateChecklistTemplateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/tasks/create_incident_task_list_parameters.go b/client/tasks/create_incident_task_list_parameters.go new file mode 100644 index 0000000..242ffdc --- /dev/null +++ b/client/tasks/create_incident_task_list_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateIncidentTaskListParams creates a new CreateIncidentTaskListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentTaskListParams() *CreateIncidentTaskListParams { + return &CreateIncidentTaskListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentTaskListParamsWithTimeout creates a new CreateIncidentTaskListParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentTaskListParamsWithTimeout(timeout time.Duration) *CreateIncidentTaskListParams { + return &CreateIncidentTaskListParams{ + timeout: timeout, + } +} + +// NewCreateIncidentTaskListParamsWithContext creates a new CreateIncidentTaskListParams object +// with the ability to set a context for a request. +func NewCreateIncidentTaskListParamsWithContext(ctx context.Context) *CreateIncidentTaskListParams { + return &CreateIncidentTaskListParams{ + Context: ctx, + } +} + +// NewCreateIncidentTaskListParamsWithHTTPClient creates a new CreateIncidentTaskListParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentTaskListParamsWithHTTPClient(client *http.Client) *CreateIncidentTaskListParams { + return &CreateIncidentTaskListParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentTaskListParams contains all the parameters to send to the API endpoint + + for the create incident task list operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentTaskListParams struct { + + // CreateIncidentTaskList. + CreateIncidentTaskList *models.CreateIncidentTaskList + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident task list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentTaskListParams) WithDefaults() *CreateIncidentTaskListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident task list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentTaskListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident task list params +func (o *CreateIncidentTaskListParams) WithTimeout(timeout time.Duration) *CreateIncidentTaskListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident task list params +func (o *CreateIncidentTaskListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident task list params +func (o *CreateIncidentTaskListParams) WithContext(ctx context.Context) *CreateIncidentTaskListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident task list params +func (o *CreateIncidentTaskListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident task list params +func (o *CreateIncidentTaskListParams) WithHTTPClient(client *http.Client) *CreateIncidentTaskListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident task list params +func (o *CreateIncidentTaskListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateIncidentTaskList adds the createIncidentTaskList to the create incident task list params +func (o *CreateIncidentTaskListParams) WithCreateIncidentTaskList(createIncidentTaskList *models.CreateIncidentTaskList) *CreateIncidentTaskListParams { + o.SetCreateIncidentTaskList(createIncidentTaskList) + return o +} + +// SetCreateIncidentTaskList adds the createIncidentTaskList to the create incident task list params +func (o *CreateIncidentTaskListParams) SetCreateIncidentTaskList(createIncidentTaskList *models.CreateIncidentTaskList) { + o.CreateIncidentTaskList = createIncidentTaskList +} + +// WithIncidentID adds the incidentID to the create incident task list params +func (o *CreateIncidentTaskListParams) WithIncidentID(incidentID string) *CreateIncidentTaskListParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident task list params +func (o *CreateIncidentTaskListParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentTaskListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateIncidentTaskList != nil { + if err := r.SetBodyParam(o.CreateIncidentTaskList); err != nil { + return err + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/create_incident_task_list_responses.go b/client/tasks/create_incident_task_list_responses.go new file mode 100644 index 0000000..c96afac --- /dev/null +++ b/client/tasks/create_incident_task_list_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentTaskListReader is a Reader for the CreateIncidentTaskList structure. +type CreateIncidentTaskListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentTaskListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentTaskListCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentTaskListCreated creates a CreateIncidentTaskListCreated with default headers values +func NewCreateIncidentTaskListCreated() *CreateIncidentTaskListCreated { + return &CreateIncidentTaskListCreated{} +} + +/* +CreateIncidentTaskListCreated describes a response with status code 201, with default header values. + +Add all tasks from list to incident +*/ +type CreateIncidentTaskListCreated struct { + Payload *models.TaskEntity +} + +// IsSuccess returns true when this create incident task list created response has a 2xx status code +func (o *CreateIncidentTaskListCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident task list created response has a 3xx status code +func (o *CreateIncidentTaskListCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident task list created response has a 4xx status code +func (o *CreateIncidentTaskListCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident task list created response has a 5xx status code +func (o *CreateIncidentTaskListCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident task list created response a status code equal to that given +func (o *CreateIncidentTaskListCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentTaskListCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/task_lists][%d] createIncidentTaskListCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentTaskListCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/task_lists][%d] createIncidentTaskListCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentTaskListCreated) GetPayload() *models.TaskEntity { + return o.Payload +} + +func (o *CreateIncidentTaskListCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/tasks/create_incident_task_parameters.go b/client/tasks/create_incident_task_parameters.go new file mode 100644 index 0000000..4927687 --- /dev/null +++ b/client/tasks/create_incident_task_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateIncidentTaskParams creates a new CreateIncidentTaskParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateIncidentTaskParams() *CreateIncidentTaskParams { + return &CreateIncidentTaskParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateIncidentTaskParamsWithTimeout creates a new CreateIncidentTaskParams object +// with the ability to set a timeout on a request. +func NewCreateIncidentTaskParamsWithTimeout(timeout time.Duration) *CreateIncidentTaskParams { + return &CreateIncidentTaskParams{ + timeout: timeout, + } +} + +// NewCreateIncidentTaskParamsWithContext creates a new CreateIncidentTaskParams object +// with the ability to set a context for a request. +func NewCreateIncidentTaskParamsWithContext(ctx context.Context) *CreateIncidentTaskParams { + return &CreateIncidentTaskParams{ + Context: ctx, + } +} + +// NewCreateIncidentTaskParamsWithHTTPClient creates a new CreateIncidentTaskParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateIncidentTaskParamsWithHTTPClient(client *http.Client) *CreateIncidentTaskParams { + return &CreateIncidentTaskParams{ + HTTPClient: client, + } +} + +/* +CreateIncidentTaskParams contains all the parameters to send to the API endpoint + + for the create incident task operation. + + Typically these are written to a http.Request. +*/ +type CreateIncidentTaskParams struct { + + // CreateIncidentTask. + CreateIncidentTask *models.CreateIncidentTask + + // IncidentID. + IncidentID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create incident task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentTaskParams) WithDefaults() *CreateIncidentTaskParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create incident task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateIncidentTaskParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create incident task params +func (o *CreateIncidentTaskParams) WithTimeout(timeout time.Duration) *CreateIncidentTaskParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create incident task params +func (o *CreateIncidentTaskParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create incident task params +func (o *CreateIncidentTaskParams) WithContext(ctx context.Context) *CreateIncidentTaskParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create incident task params +func (o *CreateIncidentTaskParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create incident task params +func (o *CreateIncidentTaskParams) WithHTTPClient(client *http.Client) *CreateIncidentTaskParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create incident task params +func (o *CreateIncidentTaskParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateIncidentTask adds the createIncidentTask to the create incident task params +func (o *CreateIncidentTaskParams) WithCreateIncidentTask(createIncidentTask *models.CreateIncidentTask) *CreateIncidentTaskParams { + o.SetCreateIncidentTask(createIncidentTask) + return o +} + +// SetCreateIncidentTask adds the createIncidentTask to the create incident task params +func (o *CreateIncidentTaskParams) SetCreateIncidentTask(createIncidentTask *models.CreateIncidentTask) { + o.CreateIncidentTask = createIncidentTask +} + +// WithIncidentID adds the incidentID to the create incident task params +func (o *CreateIncidentTaskParams) WithIncidentID(incidentID string) *CreateIncidentTaskParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the create incident task params +func (o *CreateIncidentTaskParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateIncidentTaskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateIncidentTask != nil { + if err := r.SetBodyParam(o.CreateIncidentTask); err != nil { + return err + } + } + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/create_incident_task_responses.go b/client/tasks/create_incident_task_responses.go new file mode 100644 index 0000000..3121565 --- /dev/null +++ b/client/tasks/create_incident_task_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateIncidentTaskReader is a Reader for the CreateIncidentTask structure. +type CreateIncidentTaskReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateIncidentTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateIncidentTaskCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateIncidentTaskCreated creates a CreateIncidentTaskCreated with default headers values +func NewCreateIncidentTaskCreated() *CreateIncidentTaskCreated { + return &CreateIncidentTaskCreated{} +} + +/* +CreateIncidentTaskCreated describes a response with status code 201, with default header values. + +Create a task +*/ +type CreateIncidentTaskCreated struct { + Payload *models.TaskEntity +} + +// IsSuccess returns true when this create incident task created response has a 2xx status code +func (o *CreateIncidentTaskCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create incident task created response has a 3xx status code +func (o *CreateIncidentTaskCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create incident task created response has a 4xx status code +func (o *CreateIncidentTaskCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create incident task created response has a 5xx status code +func (o *CreateIncidentTaskCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create incident task created response a status code equal to that given +func (o *CreateIncidentTaskCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateIncidentTaskCreated) Error() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/tasks][%d] createIncidentTaskCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentTaskCreated) String() string { + return fmt.Sprintf("[POST /v1/incidents/{incident_id}/tasks][%d] createIncidentTaskCreated %+v", 201, o.Payload) +} + +func (o *CreateIncidentTaskCreated) GetPayload() *models.TaskEntity { + return o.Payload +} + +func (o *CreateIncidentTaskCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/tasks/create_task_list_parameters.go b/client/tasks/create_task_list_parameters.go new file mode 100644 index 0000000..9855354 --- /dev/null +++ b/client/tasks/create_task_list_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateTaskListParams creates a new CreateTaskListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateTaskListParams() *CreateTaskListParams { + return &CreateTaskListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateTaskListParamsWithTimeout creates a new CreateTaskListParams object +// with the ability to set a timeout on a request. +func NewCreateTaskListParamsWithTimeout(timeout time.Duration) *CreateTaskListParams { + return &CreateTaskListParams{ + timeout: timeout, + } +} + +// NewCreateTaskListParamsWithContext creates a new CreateTaskListParams object +// with the ability to set a context for a request. +func NewCreateTaskListParamsWithContext(ctx context.Context) *CreateTaskListParams { + return &CreateTaskListParams{ + Context: ctx, + } +} + +// NewCreateTaskListParamsWithHTTPClient creates a new CreateTaskListParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateTaskListParamsWithHTTPClient(client *http.Client) *CreateTaskListParams { + return &CreateTaskListParams{ + HTTPClient: client, + } +} + +/* +CreateTaskListParams contains all the parameters to send to the API endpoint + + for the create task list operation. + + Typically these are written to a http.Request. +*/ +type CreateTaskListParams struct { + + // CreateTaskList. + CreateTaskList *models.CreateTaskList + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create task list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTaskListParams) WithDefaults() *CreateTaskListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create task list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTaskListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create task list params +func (o *CreateTaskListParams) WithTimeout(timeout time.Duration) *CreateTaskListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create task list params +func (o *CreateTaskListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create task list params +func (o *CreateTaskListParams) WithContext(ctx context.Context) *CreateTaskListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create task list params +func (o *CreateTaskListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create task list params +func (o *CreateTaskListParams) WithHTTPClient(client *http.Client) *CreateTaskListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create task list params +func (o *CreateTaskListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateTaskList adds the createTaskList to the create task list params +func (o *CreateTaskListParams) WithCreateTaskList(createTaskList *models.CreateTaskList) *CreateTaskListParams { + o.SetCreateTaskList(createTaskList) + return o +} + +// SetCreateTaskList adds the createTaskList to the create task list params +func (o *CreateTaskListParams) SetCreateTaskList(createTaskList *models.CreateTaskList) { + o.CreateTaskList = createTaskList +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateTaskListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateTaskList != nil { + if err := r.SetBodyParam(o.CreateTaskList); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/create_task_list_responses.go b/client/tasks/create_task_list_responses.go new file mode 100644 index 0000000..d790c4e --- /dev/null +++ b/client/tasks/create_task_list_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateTaskListReader is a Reader for the CreateTaskList structure. +type CreateTaskListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateTaskListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateTaskListCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateTaskListCreated creates a CreateTaskListCreated with default headers values +func NewCreateTaskListCreated() *CreateTaskListCreated { + return &CreateTaskListCreated{} +} + +/* +CreateTaskListCreated describes a response with status code 201, with default header values. + +Creates a new task list +*/ +type CreateTaskListCreated struct { + Payload *models.TaskListEntity +} + +// IsSuccess returns true when this create task list created response has a 2xx status code +func (o *CreateTaskListCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create task list created response has a 3xx status code +func (o *CreateTaskListCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create task list created response has a 4xx status code +func (o *CreateTaskListCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create task list created response has a 5xx status code +func (o *CreateTaskListCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create task list created response a status code equal to that given +func (o *CreateTaskListCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateTaskListCreated) Error() string { + return fmt.Sprintf("[POST /v1/task_lists][%d] createTaskListCreated %+v", 201, o.Payload) +} + +func (o *CreateTaskListCreated) String() string { + return fmt.Sprintf("[POST /v1/task_lists][%d] createTaskListCreated %+v", 201, o.Payload) +} + +func (o *CreateTaskListCreated) GetPayload() *models.TaskListEntity { + return o.Payload +} + +func (o *CreateTaskListCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskListEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/tasks/delete_checklist_template_parameters.go b/client/tasks/delete_checklist_template_parameters.go new file mode 100644 index 0000000..aa8d8a6 --- /dev/null +++ b/client/tasks/delete_checklist_template_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteChecklistTemplateParams creates a new DeleteChecklistTemplateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteChecklistTemplateParams() *DeleteChecklistTemplateParams { + return &DeleteChecklistTemplateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteChecklistTemplateParamsWithTimeout creates a new DeleteChecklistTemplateParams object +// with the ability to set a timeout on a request. +func NewDeleteChecklistTemplateParamsWithTimeout(timeout time.Duration) *DeleteChecklistTemplateParams { + return &DeleteChecklistTemplateParams{ + timeout: timeout, + } +} + +// NewDeleteChecklistTemplateParamsWithContext creates a new DeleteChecklistTemplateParams object +// with the ability to set a context for a request. +func NewDeleteChecklistTemplateParamsWithContext(ctx context.Context) *DeleteChecklistTemplateParams { + return &DeleteChecklistTemplateParams{ + Context: ctx, + } +} + +// NewDeleteChecklistTemplateParamsWithHTTPClient creates a new DeleteChecklistTemplateParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteChecklistTemplateParamsWithHTTPClient(client *http.Client) *DeleteChecklistTemplateParams { + return &DeleteChecklistTemplateParams{ + HTTPClient: client, + } +} + +/* +DeleteChecklistTemplateParams contains all the parameters to send to the API endpoint + + for the delete checklist template operation. + + Typically these are written to a http.Request. +*/ +type DeleteChecklistTemplateParams struct { + + /* ID. + + Checklist Template UUID + */ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete checklist template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteChecklistTemplateParams) WithDefaults() *DeleteChecklistTemplateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete checklist template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteChecklistTemplateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete checklist template params +func (o *DeleteChecklistTemplateParams) WithTimeout(timeout time.Duration) *DeleteChecklistTemplateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete checklist template params +func (o *DeleteChecklistTemplateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete checklist template params +func (o *DeleteChecklistTemplateParams) WithContext(ctx context.Context) *DeleteChecklistTemplateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete checklist template params +func (o *DeleteChecklistTemplateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete checklist template params +func (o *DeleteChecklistTemplateParams) WithHTTPClient(client *http.Client) *DeleteChecklistTemplateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete checklist template params +func (o *DeleteChecklistTemplateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete checklist template params +func (o *DeleteChecklistTemplateParams) WithID(id string) *DeleteChecklistTemplateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete checklist template params +func (o *DeleteChecklistTemplateParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteChecklistTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/delete_checklist_template_responses.go b/client/tasks/delete_checklist_template_responses.go new file mode 100644 index 0000000..0454d6d --- /dev/null +++ b/client/tasks/delete_checklist_template_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteChecklistTemplateReader is a Reader for the DeleteChecklistTemplate structure. +type DeleteChecklistTemplateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteChecklistTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteChecklistTemplateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteChecklistTemplateOK creates a DeleteChecklistTemplateOK with default headers values +func NewDeleteChecklistTemplateOK() *DeleteChecklistTemplateOK { + return &DeleteChecklistTemplateOK{} +} + +/* +DeleteChecklistTemplateOK describes a response with status code 200, with default header values. + +Archive a checklist template +*/ +type DeleteChecklistTemplateOK struct { + Payload *models.ChecklistTemplateEntity +} + +// IsSuccess returns true when this delete checklist template o k response has a 2xx status code +func (o *DeleteChecklistTemplateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete checklist template o k response has a 3xx status code +func (o *DeleteChecklistTemplateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete checklist template o k response has a 4xx status code +func (o *DeleteChecklistTemplateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete checklist template o k response has a 5xx status code +func (o *DeleteChecklistTemplateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete checklist template o k response a status code equal to that given +func (o *DeleteChecklistTemplateOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteChecklistTemplateOK) Error() string { + return fmt.Sprintf("[DELETE /v1/checklist_templates/{id}][%d] deleteChecklistTemplateOK %+v", 200, o.Payload) +} + +func (o *DeleteChecklistTemplateOK) String() string { + return fmt.Sprintf("[DELETE /v1/checklist_templates/{id}][%d] deleteChecklistTemplateOK %+v", 200, o.Payload) +} + +func (o *DeleteChecklistTemplateOK) GetPayload() *models.ChecklistTemplateEntity { + return o.Payload +} + +func (o *DeleteChecklistTemplateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChecklistTemplateEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/tasks/delete_incident_task_parameters.go b/client/tasks/delete_incident_task_parameters.go new file mode 100644 index 0000000..1b7c51d --- /dev/null +++ b/client/tasks/delete_incident_task_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteIncidentTaskParams creates a new DeleteIncidentTaskParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteIncidentTaskParams() *DeleteIncidentTaskParams { + return &DeleteIncidentTaskParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteIncidentTaskParamsWithTimeout creates a new DeleteIncidentTaskParams object +// with the ability to set a timeout on a request. +func NewDeleteIncidentTaskParamsWithTimeout(timeout time.Duration) *DeleteIncidentTaskParams { + return &DeleteIncidentTaskParams{ + timeout: timeout, + } +} + +// NewDeleteIncidentTaskParamsWithContext creates a new DeleteIncidentTaskParams object +// with the ability to set a context for a request. +func NewDeleteIncidentTaskParamsWithContext(ctx context.Context) *DeleteIncidentTaskParams { + return &DeleteIncidentTaskParams{ + Context: ctx, + } +} + +// NewDeleteIncidentTaskParamsWithHTTPClient creates a new DeleteIncidentTaskParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteIncidentTaskParamsWithHTTPClient(client *http.Client) *DeleteIncidentTaskParams { + return &DeleteIncidentTaskParams{ + HTTPClient: client, + } +} + +/* +DeleteIncidentTaskParams contains all the parameters to send to the API endpoint + + for the delete incident task operation. + + Typically these are written to a http.Request. +*/ +type DeleteIncidentTaskParams struct { + + // IncidentID. + IncidentID string + + // TaskID. + TaskID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete incident task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentTaskParams) WithDefaults() *DeleteIncidentTaskParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete incident task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteIncidentTaskParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete incident task params +func (o *DeleteIncidentTaskParams) WithTimeout(timeout time.Duration) *DeleteIncidentTaskParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete incident task params +func (o *DeleteIncidentTaskParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete incident task params +func (o *DeleteIncidentTaskParams) WithContext(ctx context.Context) *DeleteIncidentTaskParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete incident task params +func (o *DeleteIncidentTaskParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete incident task params +func (o *DeleteIncidentTaskParams) WithHTTPClient(client *http.Client) *DeleteIncidentTaskParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete incident task params +func (o *DeleteIncidentTaskParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the delete incident task params +func (o *DeleteIncidentTaskParams) WithIncidentID(incidentID string) *DeleteIncidentTaskParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the delete incident task params +func (o *DeleteIncidentTaskParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithTaskID adds the taskID to the delete incident task params +func (o *DeleteIncidentTaskParams) WithTaskID(taskID string) *DeleteIncidentTaskParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the delete incident task params +func (o *DeleteIncidentTaskParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteIncidentTaskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/delete_incident_task_responses.go b/client/tasks/delete_incident_task_responses.go new file mode 100644 index 0000000..62cc4bb --- /dev/null +++ b/client/tasks/delete_incident_task_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteIncidentTaskReader is a Reader for the DeleteIncidentTask structure. +type DeleteIncidentTaskReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteIncidentTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteIncidentTaskNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteIncidentTaskNoContent creates a DeleteIncidentTaskNoContent with default headers values +func NewDeleteIncidentTaskNoContent() *DeleteIncidentTaskNoContent { + return &DeleteIncidentTaskNoContent{} +} + +/* +DeleteIncidentTaskNoContent describes a response with status code 204, with default header values. + +Delete a task +*/ +type DeleteIncidentTaskNoContent struct { +} + +// IsSuccess returns true when this delete incident task no content response has a 2xx status code +func (o *DeleteIncidentTaskNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete incident task no content response has a 3xx status code +func (o *DeleteIncidentTaskNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete incident task no content response has a 4xx status code +func (o *DeleteIncidentTaskNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete incident task no content response has a 5xx status code +func (o *DeleteIncidentTaskNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete incident task no content response a status code equal to that given +func (o *DeleteIncidentTaskNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteIncidentTaskNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/tasks/{task_id}][%d] deleteIncidentTaskNoContent ", 204) +} + +func (o *DeleteIncidentTaskNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/incidents/{incident_id}/tasks/{task_id}][%d] deleteIncidentTaskNoContent ", 204) +} + +func (o *DeleteIncidentTaskNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/tasks/delete_task_list_parameters.go b/client/tasks/delete_task_list_parameters.go new file mode 100644 index 0000000..eb1ff76 --- /dev/null +++ b/client/tasks/delete_task_list_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTaskListParams creates a new DeleteTaskListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTaskListParams() *DeleteTaskListParams { + return &DeleteTaskListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTaskListParamsWithTimeout creates a new DeleteTaskListParams object +// with the ability to set a timeout on a request. +func NewDeleteTaskListParamsWithTimeout(timeout time.Duration) *DeleteTaskListParams { + return &DeleteTaskListParams{ + timeout: timeout, + } +} + +// NewDeleteTaskListParamsWithContext creates a new DeleteTaskListParams object +// with the ability to set a context for a request. +func NewDeleteTaskListParamsWithContext(ctx context.Context) *DeleteTaskListParams { + return &DeleteTaskListParams{ + Context: ctx, + } +} + +// NewDeleteTaskListParamsWithHTTPClient creates a new DeleteTaskListParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTaskListParamsWithHTTPClient(client *http.Client) *DeleteTaskListParams { + return &DeleteTaskListParams{ + HTTPClient: client, + } +} + +/* +DeleteTaskListParams contains all the parameters to send to the API endpoint + + for the delete task list operation. + + Typically these are written to a http.Request. +*/ +type DeleteTaskListParams struct { + + // TaskListID. + TaskListID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete task list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTaskListParams) WithDefaults() *DeleteTaskListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete task list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTaskListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete task list params +func (o *DeleteTaskListParams) WithTimeout(timeout time.Duration) *DeleteTaskListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete task list params +func (o *DeleteTaskListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete task list params +func (o *DeleteTaskListParams) WithContext(ctx context.Context) *DeleteTaskListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete task list params +func (o *DeleteTaskListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete task list params +func (o *DeleteTaskListParams) WithHTTPClient(client *http.Client) *DeleteTaskListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete task list params +func (o *DeleteTaskListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskListID adds the taskListID to the delete task list params +func (o *DeleteTaskListParams) WithTaskListID(taskListID string) *DeleteTaskListParams { + o.SetTaskListID(taskListID) + return o +} + +// SetTaskListID adds the taskListId to the delete task list params +func (o *DeleteTaskListParams) SetTaskListID(taskListID string) { + o.TaskListID = taskListID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTaskListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param task_list_id + if err := r.SetPathParam("task_list_id", o.TaskListID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/delete_task_list_responses.go b/client/tasks/delete_task_list_responses.go new file mode 100644 index 0000000..956c141 --- /dev/null +++ b/client/tasks/delete_task_list_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteTaskListReader is a Reader for the DeleteTaskList structure. +type DeleteTaskListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTaskListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteTaskListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTaskListOK creates a DeleteTaskListOK with default headers values +func NewDeleteTaskListOK() *DeleteTaskListOK { + return &DeleteTaskListOK{} +} + +/* +DeleteTaskListOK describes a response with status code 200, with default header values. + +Delete a task list +*/ +type DeleteTaskListOK struct { + Payload *models.TaskListEntity +} + +// IsSuccess returns true when this delete task list o k response has a 2xx status code +func (o *DeleteTaskListOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete task list o k response has a 3xx status code +func (o *DeleteTaskListOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete task list o k response has a 4xx status code +func (o *DeleteTaskListOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete task list o k response has a 5xx status code +func (o *DeleteTaskListOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete task list o k response a status code equal to that given +func (o *DeleteTaskListOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteTaskListOK) Error() string { + return fmt.Sprintf("[DELETE /v1/task_lists/{task_list_id}][%d] deleteTaskListOK %+v", 200, o.Payload) +} + +func (o *DeleteTaskListOK) String() string { + return fmt.Sprintf("[DELETE /v1/task_lists/{task_list_id}][%d] deleteTaskListOK %+v", 200, o.Payload) +} + +func (o *DeleteTaskListOK) GetPayload() *models.TaskListEntity { + return o.Payload +} + +func (o *DeleteTaskListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskListEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/tasks/get_checklist_template_parameters.go b/client/tasks/get_checklist_template_parameters.go new file mode 100644 index 0000000..a439f35 --- /dev/null +++ b/client/tasks/get_checklist_template_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetChecklistTemplateParams creates a new GetChecklistTemplateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetChecklistTemplateParams() *GetChecklistTemplateParams { + return &GetChecklistTemplateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetChecklistTemplateParamsWithTimeout creates a new GetChecklistTemplateParams object +// with the ability to set a timeout on a request. +func NewGetChecklistTemplateParamsWithTimeout(timeout time.Duration) *GetChecklistTemplateParams { + return &GetChecklistTemplateParams{ + timeout: timeout, + } +} + +// NewGetChecklistTemplateParamsWithContext creates a new GetChecklistTemplateParams object +// with the ability to set a context for a request. +func NewGetChecklistTemplateParamsWithContext(ctx context.Context) *GetChecklistTemplateParams { + return &GetChecklistTemplateParams{ + Context: ctx, + } +} + +// NewGetChecklistTemplateParamsWithHTTPClient creates a new GetChecklistTemplateParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetChecklistTemplateParamsWithHTTPClient(client *http.Client) *GetChecklistTemplateParams { + return &GetChecklistTemplateParams{ + HTTPClient: client, + } +} + +/* +GetChecklistTemplateParams contains all the parameters to send to the API endpoint + + for the get checklist template operation. + + Typically these are written to a http.Request. +*/ +type GetChecklistTemplateParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get checklist template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetChecklistTemplateParams) WithDefaults() *GetChecklistTemplateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get checklist template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetChecklistTemplateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get checklist template params +func (o *GetChecklistTemplateParams) WithTimeout(timeout time.Duration) *GetChecklistTemplateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get checklist template params +func (o *GetChecklistTemplateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get checklist template params +func (o *GetChecklistTemplateParams) WithContext(ctx context.Context) *GetChecklistTemplateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get checklist template params +func (o *GetChecklistTemplateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get checklist template params +func (o *GetChecklistTemplateParams) WithHTTPClient(client *http.Client) *GetChecklistTemplateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get checklist template params +func (o *GetChecklistTemplateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get checklist template params +func (o *GetChecklistTemplateParams) WithID(id string) *GetChecklistTemplateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get checklist template params +func (o *GetChecklistTemplateParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *GetChecklistTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/get_checklist_template_responses.go b/client/tasks/get_checklist_template_responses.go new file mode 100644 index 0000000..6c3b63c --- /dev/null +++ b/client/tasks/get_checklist_template_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetChecklistTemplateReader is a Reader for the GetChecklistTemplate structure. +type GetChecklistTemplateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetChecklistTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetChecklistTemplateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetChecklistTemplateOK creates a GetChecklistTemplateOK with default headers values +func NewGetChecklistTemplateOK() *GetChecklistTemplateOK { + return &GetChecklistTemplateOK{} +} + +/* +GetChecklistTemplateOK describes a response with status code 200, with default header values. + +Retrieves a single checklist template by ID +*/ +type GetChecklistTemplateOK struct { + Payload *models.ChecklistTemplateEntity +} + +// IsSuccess returns true when this get checklist template o k response has a 2xx status code +func (o *GetChecklistTemplateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get checklist template o k response has a 3xx status code +func (o *GetChecklistTemplateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get checklist template o k response has a 4xx status code +func (o *GetChecklistTemplateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get checklist template o k response has a 5xx status code +func (o *GetChecklistTemplateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get checklist template o k response a status code equal to that given +func (o *GetChecklistTemplateOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetChecklistTemplateOK) Error() string { + return fmt.Sprintf("[GET /v1/checklist_templates/{id}][%d] getChecklistTemplateOK %+v", 200, o.Payload) +} + +func (o *GetChecklistTemplateOK) String() string { + return fmt.Sprintf("[GET /v1/checklist_templates/{id}][%d] getChecklistTemplateOK %+v", 200, o.Payload) +} + +func (o *GetChecklistTemplateOK) GetPayload() *models.ChecklistTemplateEntity { + return o.Payload +} + +func (o *GetChecklistTemplateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChecklistTemplateEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/tasks/get_incident_task_parameters.go b/client/tasks/get_incident_task_parameters.go new file mode 100644 index 0000000..92307eb --- /dev/null +++ b/client/tasks/get_incident_task_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetIncidentTaskParams creates a new GetIncidentTaskParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetIncidentTaskParams() *GetIncidentTaskParams { + return &GetIncidentTaskParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetIncidentTaskParamsWithTimeout creates a new GetIncidentTaskParams object +// with the ability to set a timeout on a request. +func NewGetIncidentTaskParamsWithTimeout(timeout time.Duration) *GetIncidentTaskParams { + return &GetIncidentTaskParams{ + timeout: timeout, + } +} + +// NewGetIncidentTaskParamsWithContext creates a new GetIncidentTaskParams object +// with the ability to set a context for a request. +func NewGetIncidentTaskParamsWithContext(ctx context.Context) *GetIncidentTaskParams { + return &GetIncidentTaskParams{ + Context: ctx, + } +} + +// NewGetIncidentTaskParamsWithHTTPClient creates a new GetIncidentTaskParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetIncidentTaskParamsWithHTTPClient(client *http.Client) *GetIncidentTaskParams { + return &GetIncidentTaskParams{ + HTTPClient: client, + } +} + +/* +GetIncidentTaskParams contains all the parameters to send to the API endpoint + + for the get incident task operation. + + Typically these are written to a http.Request. +*/ +type GetIncidentTaskParams struct { + + // IncidentID. + IncidentID string + + // TaskID. + TaskID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get incident task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentTaskParams) WithDefaults() *GetIncidentTaskParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get incident task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetIncidentTaskParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get incident task params +func (o *GetIncidentTaskParams) WithTimeout(timeout time.Duration) *GetIncidentTaskParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get incident task params +func (o *GetIncidentTaskParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get incident task params +func (o *GetIncidentTaskParams) WithContext(ctx context.Context) *GetIncidentTaskParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get incident task params +func (o *GetIncidentTaskParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get incident task params +func (o *GetIncidentTaskParams) WithHTTPClient(client *http.Client) *GetIncidentTaskParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get incident task params +func (o *GetIncidentTaskParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the get incident task params +func (o *GetIncidentTaskParams) WithIncidentID(incidentID string) *GetIncidentTaskParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the get incident task params +func (o *GetIncidentTaskParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithTaskID adds the taskID to the get incident task params +func (o *GetIncidentTaskParams) WithTaskID(taskID string) *GetIncidentTaskParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the get incident task params +func (o *GetIncidentTaskParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetIncidentTaskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/get_incident_task_responses.go b/client/tasks/get_incident_task_responses.go new file mode 100644 index 0000000..f0e3b7b --- /dev/null +++ b/client/tasks/get_incident_task_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetIncidentTaskReader is a Reader for the GetIncidentTask structure. +type GetIncidentTaskReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetIncidentTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetIncidentTaskOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetIncidentTaskOK creates a GetIncidentTaskOK with default headers values +func NewGetIncidentTaskOK() *GetIncidentTaskOK { + return &GetIncidentTaskOK{} +} + +/* +GetIncidentTaskOK describes a response with status code 200, with default header values. + +Retrieve a single task for an incident +*/ +type GetIncidentTaskOK struct { +} + +// IsSuccess returns true when this get incident task o k response has a 2xx status code +func (o *GetIncidentTaskOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get incident task o k response has a 3xx status code +func (o *GetIncidentTaskOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get incident task o k response has a 4xx status code +func (o *GetIncidentTaskOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get incident task o k response has a 5xx status code +func (o *GetIncidentTaskOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get incident task o k response a status code equal to that given +func (o *GetIncidentTaskOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetIncidentTaskOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/tasks/{task_id}][%d] getIncidentTaskOK ", 200) +} + +func (o *GetIncidentTaskOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/tasks/{task_id}][%d] getIncidentTaskOK ", 200) +} + +func (o *GetIncidentTaskOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/tasks/get_task_list_parameters.go b/client/tasks/get_task_list_parameters.go new file mode 100644 index 0000000..222eef2 --- /dev/null +++ b/client/tasks/get_task_list_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTaskListParams creates a new GetTaskListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTaskListParams() *GetTaskListParams { + return &GetTaskListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTaskListParamsWithTimeout creates a new GetTaskListParams object +// with the ability to set a timeout on a request. +func NewGetTaskListParamsWithTimeout(timeout time.Duration) *GetTaskListParams { + return &GetTaskListParams{ + timeout: timeout, + } +} + +// NewGetTaskListParamsWithContext creates a new GetTaskListParams object +// with the ability to set a context for a request. +func NewGetTaskListParamsWithContext(ctx context.Context) *GetTaskListParams { + return &GetTaskListParams{ + Context: ctx, + } +} + +// NewGetTaskListParamsWithHTTPClient creates a new GetTaskListParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTaskListParamsWithHTTPClient(client *http.Client) *GetTaskListParams { + return &GetTaskListParams{ + HTTPClient: client, + } +} + +/* +GetTaskListParams contains all the parameters to send to the API endpoint + + for the get task list operation. + + Typically these are written to a http.Request. +*/ +type GetTaskListParams struct { + + // TaskListID. + TaskListID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get task list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskListParams) WithDefaults() *GetTaskListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get task list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTaskListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get task list params +func (o *GetTaskListParams) WithTimeout(timeout time.Duration) *GetTaskListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get task list params +func (o *GetTaskListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get task list params +func (o *GetTaskListParams) WithContext(ctx context.Context) *GetTaskListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get task list params +func (o *GetTaskListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get task list params +func (o *GetTaskListParams) WithHTTPClient(client *http.Client) *GetTaskListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get task list params +func (o *GetTaskListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskListID adds the taskListID to the get task list params +func (o *GetTaskListParams) WithTaskListID(taskListID string) *GetTaskListParams { + o.SetTaskListID(taskListID) + return o +} + +// SetTaskListID adds the taskListId to the get task list params +func (o *GetTaskListParams) SetTaskListID(taskListID string) { + o.TaskListID = taskListID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTaskListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param task_list_id + if err := r.SetPathParam("task_list_id", o.TaskListID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/get_task_list_responses.go b/client/tasks/get_task_list_responses.go new file mode 100644 index 0000000..e83253c --- /dev/null +++ b/client/tasks/get_task_list_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetTaskListReader is a Reader for the GetTaskList structure. +type GetTaskListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTaskListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTaskListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTaskListOK creates a GetTaskListOK with default headers values +func NewGetTaskListOK() *GetTaskListOK { + return &GetTaskListOK{} +} + +/* +GetTaskListOK describes a response with status code 200, with default header values. + +Retrieves a single task list by ID +*/ +type GetTaskListOK struct { + Payload *models.TaskListEntity +} + +// IsSuccess returns true when this get task list o k response has a 2xx status code +func (o *GetTaskListOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get task list o k response has a 3xx status code +func (o *GetTaskListOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get task list o k response has a 4xx status code +func (o *GetTaskListOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get task list o k response has a 5xx status code +func (o *GetTaskListOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get task list o k response a status code equal to that given +func (o *GetTaskListOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetTaskListOK) Error() string { + return fmt.Sprintf("[GET /v1/task_lists/{task_list_id}][%d] getTaskListOK %+v", 200, o.Payload) +} + +func (o *GetTaskListOK) String() string { + return fmt.Sprintf("[GET /v1/task_lists/{task_list_id}][%d] getTaskListOK %+v", 200, o.Payload) +} + +func (o *GetTaskListOK) GetPayload() *models.TaskListEntity { + return o.Payload +} + +func (o *GetTaskListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskListEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/tasks/list_checklist_templates_parameters.go b/client/tasks/list_checklist_templates_parameters.go new file mode 100644 index 0000000..f6fe563 --- /dev/null +++ b/client/tasks/list_checklist_templates_parameters.go @@ -0,0 +1,230 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListChecklistTemplatesParams creates a new ListChecklistTemplatesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListChecklistTemplatesParams() *ListChecklistTemplatesParams { + return &ListChecklistTemplatesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListChecklistTemplatesParamsWithTimeout creates a new ListChecklistTemplatesParams object +// with the ability to set a timeout on a request. +func NewListChecklistTemplatesParamsWithTimeout(timeout time.Duration) *ListChecklistTemplatesParams { + return &ListChecklistTemplatesParams{ + timeout: timeout, + } +} + +// NewListChecklistTemplatesParamsWithContext creates a new ListChecklistTemplatesParams object +// with the ability to set a context for a request. +func NewListChecklistTemplatesParamsWithContext(ctx context.Context) *ListChecklistTemplatesParams { + return &ListChecklistTemplatesParams{ + Context: ctx, + } +} + +// NewListChecklistTemplatesParamsWithHTTPClient creates a new ListChecklistTemplatesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListChecklistTemplatesParamsWithHTTPClient(client *http.Client) *ListChecklistTemplatesParams { + return &ListChecklistTemplatesParams{ + HTTPClient: client, + } +} + +/* +ListChecklistTemplatesParams contains all the parameters to send to the API endpoint + + for the list checklist templates operation. + + Typically these are written to a http.Request. +*/ +type ListChecklistTemplatesParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + A query to search checklist templates by their name + */ + Query *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list checklist templates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListChecklistTemplatesParams) WithDefaults() *ListChecklistTemplatesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list checklist templates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListChecklistTemplatesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list checklist templates params +func (o *ListChecklistTemplatesParams) WithTimeout(timeout time.Duration) *ListChecklistTemplatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list checklist templates params +func (o *ListChecklistTemplatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list checklist templates params +func (o *ListChecklistTemplatesParams) WithContext(ctx context.Context) *ListChecklistTemplatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list checklist templates params +func (o *ListChecklistTemplatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list checklist templates params +func (o *ListChecklistTemplatesParams) WithHTTPClient(client *http.Client) *ListChecklistTemplatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list checklist templates params +func (o *ListChecklistTemplatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list checklist templates params +func (o *ListChecklistTemplatesParams) WithPage(page *int32) *ListChecklistTemplatesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list checklist templates params +func (o *ListChecklistTemplatesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list checklist templates params +func (o *ListChecklistTemplatesParams) WithPerPage(perPage *int32) *ListChecklistTemplatesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list checklist templates params +func (o *ListChecklistTemplatesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list checklist templates params +func (o *ListChecklistTemplatesParams) WithQuery(query *string) *ListChecklistTemplatesParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list checklist templates params +func (o *ListChecklistTemplatesParams) SetQuery(query *string) { + o.Query = query +} + +// WriteToRequest writes these params to a swagger request +func (o *ListChecklistTemplatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/list_checklist_templates_responses.go b/client/tasks/list_checklist_templates_responses.go new file mode 100644 index 0000000..2c0b107 --- /dev/null +++ b/client/tasks/list_checklist_templates_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListChecklistTemplatesReader is a Reader for the ListChecklistTemplates structure. +type ListChecklistTemplatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListChecklistTemplatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListChecklistTemplatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListChecklistTemplatesOK creates a ListChecklistTemplatesOK with default headers values +func NewListChecklistTemplatesOK() *ListChecklistTemplatesOK { + return &ListChecklistTemplatesOK{} +} + +/* +ListChecklistTemplatesOK describes a response with status code 200, with default header values. + +List all of the checklist templates that have been added to the organization +*/ +type ListChecklistTemplatesOK struct { + Payload *models.ChecklistTemplateEntityPaginated +} + +// IsSuccess returns true when this list checklist templates o k response has a 2xx status code +func (o *ListChecklistTemplatesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list checklist templates o k response has a 3xx status code +func (o *ListChecklistTemplatesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list checklist templates o k response has a 4xx status code +func (o *ListChecklistTemplatesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list checklist templates o k response has a 5xx status code +func (o *ListChecklistTemplatesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list checklist templates o k response a status code equal to that given +func (o *ListChecklistTemplatesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListChecklistTemplatesOK) Error() string { + return fmt.Sprintf("[GET /v1/checklist_templates][%d] listChecklistTemplatesOK %+v", 200, o.Payload) +} + +func (o *ListChecklistTemplatesOK) String() string { + return fmt.Sprintf("[GET /v1/checklist_templates][%d] listChecklistTemplatesOK %+v", 200, o.Payload) +} + +func (o *ListChecklistTemplatesOK) GetPayload() *models.ChecklistTemplateEntityPaginated { + return o.Payload +} + +func (o *ListChecklistTemplatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChecklistTemplateEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/tasks/list_incident_tasks_parameters.go b/client/tasks/list_incident_tasks_parameters.go new file mode 100644 index 0000000..dc93aba --- /dev/null +++ b/client/tasks/list_incident_tasks_parameters.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListIncidentTasksParams creates a new ListIncidentTasksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListIncidentTasksParams() *ListIncidentTasksParams { + return &ListIncidentTasksParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListIncidentTasksParamsWithTimeout creates a new ListIncidentTasksParams object +// with the ability to set a timeout on a request. +func NewListIncidentTasksParamsWithTimeout(timeout time.Duration) *ListIncidentTasksParams { + return &ListIncidentTasksParams{ + timeout: timeout, + } +} + +// NewListIncidentTasksParamsWithContext creates a new ListIncidentTasksParams object +// with the ability to set a context for a request. +func NewListIncidentTasksParamsWithContext(ctx context.Context) *ListIncidentTasksParams { + return &ListIncidentTasksParams{ + Context: ctx, + } +} + +// NewListIncidentTasksParamsWithHTTPClient creates a new ListIncidentTasksParams object +// with the ability to set a custom HTTPClient for a request. +func NewListIncidentTasksParamsWithHTTPClient(client *http.Client) *ListIncidentTasksParams { + return &ListIncidentTasksParams{ + HTTPClient: client, + } +} + +/* +ListIncidentTasksParams contains all the parameters to send to the API endpoint + + for the list incident tasks operation. + + Typically these are written to a http.Request. +*/ +type ListIncidentTasksParams struct { + + // IncidentID. + IncidentID string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list incident tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentTasksParams) WithDefaults() *ListIncidentTasksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list incident tasks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListIncidentTasksParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list incident tasks params +func (o *ListIncidentTasksParams) WithTimeout(timeout time.Duration) *ListIncidentTasksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list incident tasks params +func (o *ListIncidentTasksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list incident tasks params +func (o *ListIncidentTasksParams) WithContext(ctx context.Context) *ListIncidentTasksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list incident tasks params +func (o *ListIncidentTasksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list incident tasks params +func (o *ListIncidentTasksParams) WithHTTPClient(client *http.Client) *ListIncidentTasksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list incident tasks params +func (o *ListIncidentTasksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the list incident tasks params +func (o *ListIncidentTasksParams) WithIncidentID(incidentID string) *ListIncidentTasksParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the list incident tasks params +func (o *ListIncidentTasksParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithPage adds the page to the list incident tasks params +func (o *ListIncidentTasksParams) WithPage(page *int32) *ListIncidentTasksParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list incident tasks params +func (o *ListIncidentTasksParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list incident tasks params +func (o *ListIncidentTasksParams) WithPerPage(perPage *int32) *ListIncidentTasksParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list incident tasks params +func (o *ListIncidentTasksParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListIncidentTasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/list_incident_tasks_responses.go b/client/tasks/list_incident_tasks_responses.go new file mode 100644 index 0000000..a47123d --- /dev/null +++ b/client/tasks/list_incident_tasks_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListIncidentTasksReader is a Reader for the ListIncidentTasks structure. +type ListIncidentTasksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListIncidentTasksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListIncidentTasksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListIncidentTasksOK creates a ListIncidentTasksOK with default headers values +func NewListIncidentTasksOK() *ListIncidentTasksOK { + return &ListIncidentTasksOK{} +} + +/* +ListIncidentTasksOK describes a response with status code 200, with default header values. + +Retrieve a list of all tasks for a specific incident +*/ +type ListIncidentTasksOK struct { + Payload *models.TaskEntityPaginated +} + +// IsSuccess returns true when this list incident tasks o k response has a 2xx status code +func (o *ListIncidentTasksOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list incident tasks o k response has a 3xx status code +func (o *ListIncidentTasksOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list incident tasks o k response has a 4xx status code +func (o *ListIncidentTasksOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list incident tasks o k response has a 5xx status code +func (o *ListIncidentTasksOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list incident tasks o k response a status code equal to that given +func (o *ListIncidentTasksOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListIncidentTasksOK) Error() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/tasks][%d] listIncidentTasksOK %+v", 200, o.Payload) +} + +func (o *ListIncidentTasksOK) String() string { + return fmt.Sprintf("[GET /v1/incidents/{incident_id}/tasks][%d] listIncidentTasksOK %+v", 200, o.Payload) +} + +func (o *ListIncidentTasksOK) GetPayload() *models.TaskEntityPaginated { + return o.Payload +} + +func (o *ListIncidentTasksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/tasks/list_task_lists_parameters.go b/client/tasks/list_task_lists_parameters.go new file mode 100644 index 0000000..0e4b9b4 --- /dev/null +++ b/client/tasks/list_task_lists_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListTaskListsParams creates a new ListTaskListsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListTaskListsParams() *ListTaskListsParams { + return &ListTaskListsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListTaskListsParamsWithTimeout creates a new ListTaskListsParams object +// with the ability to set a timeout on a request. +func NewListTaskListsParamsWithTimeout(timeout time.Duration) *ListTaskListsParams { + return &ListTaskListsParams{ + timeout: timeout, + } +} + +// NewListTaskListsParamsWithContext creates a new ListTaskListsParams object +// with the ability to set a context for a request. +func NewListTaskListsParamsWithContext(ctx context.Context) *ListTaskListsParams { + return &ListTaskListsParams{ + Context: ctx, + } +} + +// NewListTaskListsParamsWithHTTPClient creates a new ListTaskListsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListTaskListsParamsWithHTTPClient(client *http.Client) *ListTaskListsParams { + return &ListTaskListsParams{ + HTTPClient: client, + } +} + +/* +ListTaskListsParams contains all the parameters to send to the API endpoint + + for the list task lists operation. + + Typically these are written to a http.Request. +*/ +type ListTaskListsParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list task lists params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTaskListsParams) WithDefaults() *ListTaskListsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list task lists params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTaskListsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list task lists params +func (o *ListTaskListsParams) WithTimeout(timeout time.Duration) *ListTaskListsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list task lists params +func (o *ListTaskListsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list task lists params +func (o *ListTaskListsParams) WithContext(ctx context.Context) *ListTaskListsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list task lists params +func (o *ListTaskListsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list task lists params +func (o *ListTaskListsParams) WithHTTPClient(client *http.Client) *ListTaskListsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list task lists params +func (o *ListTaskListsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list task lists params +func (o *ListTaskListsParams) WithPage(page *int32) *ListTaskListsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list task lists params +func (o *ListTaskListsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list task lists params +func (o *ListTaskListsParams) WithPerPage(perPage *int32) *ListTaskListsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list task lists params +func (o *ListTaskListsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListTaskListsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/list_task_lists_responses.go b/client/tasks/list_task_lists_responses.go new file mode 100644 index 0000000..fc44202 --- /dev/null +++ b/client/tasks/list_task_lists_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListTaskListsReader is a Reader for the ListTaskLists structure. +type ListTaskListsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListTaskListsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListTaskListsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListTaskListsOK creates a ListTaskListsOK with default headers values +func NewListTaskListsOK() *ListTaskListsOK { + return &ListTaskListsOK{} +} + +/* +ListTaskListsOK describes a response with status code 200, with default header values. + +Lists all task lists for your organization +*/ +type ListTaskListsOK struct { + Payload *models.TaskListEntity +} + +// IsSuccess returns true when this list task lists o k response has a 2xx status code +func (o *ListTaskListsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list task lists o k response has a 3xx status code +func (o *ListTaskListsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list task lists o k response has a 4xx status code +func (o *ListTaskListsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list task lists o k response has a 5xx status code +func (o *ListTaskListsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list task lists o k response a status code equal to that given +func (o *ListTaskListsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListTaskListsOK) Error() string { + return fmt.Sprintf("[GET /v1/task_lists][%d] listTaskListsOK %+v", 200, o.Payload) +} + +func (o *ListTaskListsOK) String() string { + return fmt.Sprintf("[GET /v1/task_lists][%d] listTaskListsOK %+v", 200, o.Payload) +} + +func (o *ListTaskListsOK) GetPayload() *models.TaskListEntity { + return o.Payload +} + +func (o *ListTaskListsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskListEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/tasks/tasks_client.go b/client/tasks/tasks_client.go index adcec43..f51e170 100644 --- a/client/tasks/tasks_client.go +++ b/client/tasks/tasks_client.go @@ -30,62 +30,62 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1ChecklistTemplatesID(params *DeleteV1ChecklistTemplatesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ChecklistTemplatesIDOK, error) + ConvertIncidentTask(params *ConvertIncidentTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ConvertIncidentTaskCreated, error) - DeleteV1IncidentsIncidentIDTasksTaskID(params *DeleteV1IncidentsIncidentIDTasksTaskIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDTasksTaskIDNoContent, error) + CreateChecklistTemplate(params *CreateChecklistTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateChecklistTemplateCreated, error) - DeleteV1TaskListsTaskListID(params *DeleteV1TaskListsTaskListIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TaskListsTaskListIDOK, error) + CreateIncidentTask(params *CreateIncidentTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentTaskCreated, error) - GetV1ChecklistTemplates(params *GetV1ChecklistTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ChecklistTemplatesOK, error) + CreateIncidentTaskList(params *CreateIncidentTaskListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentTaskListCreated, error) - GetV1ChecklistTemplatesID(params *GetV1ChecklistTemplatesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ChecklistTemplatesIDOK, error) + CreateTaskList(params *CreateTaskListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTaskListCreated, error) - GetV1IncidentsIncidentIDTasks(params *GetV1IncidentsIncidentIDTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDTasksOK, error) + DeleteChecklistTemplate(params *DeleteChecklistTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteChecklistTemplateOK, error) - GetV1IncidentsIncidentIDTasksTaskID(params *GetV1IncidentsIncidentIDTasksTaskIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDTasksTaskIDOK, error) + DeleteIncidentTask(params *DeleteIncidentTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentTaskNoContent, error) - GetV1TaskLists(params *GetV1TaskListsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TaskListsOK, error) + DeleteTaskList(params *DeleteTaskListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTaskListOK, error) - GetV1TaskListsTaskListID(params *GetV1TaskListsTaskListIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TaskListsTaskListIDOK, error) + GetChecklistTemplate(params *GetChecklistTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetChecklistTemplateOK, error) - PatchV1ChecklistTemplatesID(params *PatchV1ChecklistTemplatesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1ChecklistTemplatesIDOK, error) + GetIncidentTask(params *GetIncidentTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentTaskOK, error) - PatchV1IncidentsIncidentIDTasksTaskID(params *PatchV1IncidentsIncidentIDTasksTaskIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDTasksTaskIDOK, error) + GetTaskList(params *GetTaskListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskListOK, error) - PatchV1TaskListsTaskListID(params *PatchV1TaskListsTaskListIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TaskListsTaskListIDOK, error) + ListChecklistTemplates(params *ListChecklistTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListChecklistTemplatesOK, error) - PostV1ChecklistTemplates(params *PostV1ChecklistTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ChecklistTemplatesCreated, error) + ListIncidentTasks(params *ListIncidentTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentTasksOK, error) - PostV1IncidentsIncidentIDTaskLists(params *PostV1IncidentsIncidentIDTaskListsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDTaskListsCreated, error) + ListTaskLists(params *ListTaskListsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTaskListsOK, error) - PostV1IncidentsIncidentIDTasks(params *PostV1IncidentsIncidentIDTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDTasksCreated, error) + UpdateChecklistTemplate(params *UpdateChecklistTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateChecklistTemplateOK, error) - PostV1IncidentsIncidentIDTasksTaskIDConvert(params *PostV1IncidentsIncidentIDTasksTaskIDConvertParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDTasksTaskIDConvertCreated, error) + UpdateIncidentTask(params *UpdateIncidentTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentTaskOK, error) - PostV1TaskLists(params *PostV1TaskListsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TaskListsCreated, error) + UpdateTaskList(params *UpdateTaskListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTaskListOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1ChecklistTemplatesID archives a checklist template +ConvertIncidentTask converts a task to a follow up -Archive a checklist template +Convert a task to a follow-up */ -func (a *Client) DeleteV1ChecklistTemplatesID(params *DeleteV1ChecklistTemplatesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1ChecklistTemplatesIDOK, error) { +func (a *Client) ConvertIncidentTask(params *ConvertIncidentTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ConvertIncidentTaskCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1ChecklistTemplatesIDParams() + params = NewConvertIncidentTaskParams() } op := &runtime.ClientOperation{ - ID: "deleteV1ChecklistTemplatesId", - Method: "DELETE", - PathPattern: "/v1/checklist_templates/{id}", + ID: "convert_incident_task", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/tasks/{task_id}/convert", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1ChecklistTemplatesIDReader{formats: a.formats}, + Reader: &ConvertIncidentTaskReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -98,35 +98,35 @@ func (a *Client) DeleteV1ChecklistTemplatesID(params *DeleteV1ChecklistTemplates if err != nil { return nil, err } - success, ok := result.(*DeleteV1ChecklistTemplatesIDOK) + success, ok := result.(*ConvertIncidentTaskCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1ChecklistTemplatesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for convert_incident_task: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1IncidentsIncidentIDTasksTaskID deletes an incident task +CreateChecklistTemplate creates a checklist template -Delete a task +Creates a checklist template for the organization */ -func (a *Client) DeleteV1IncidentsIncidentIDTasksTaskID(params *DeleteV1IncidentsIncidentIDTasksTaskIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1IncidentsIncidentIDTasksTaskIDNoContent, error) { +func (a *Client) CreateChecklistTemplate(params *CreateChecklistTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateChecklistTemplateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1IncidentsIncidentIDTasksTaskIDParams() + params = NewCreateChecklistTemplateParams() } op := &runtime.ClientOperation{ - ID: "deleteV1IncidentsIncidentIdTasksTaskId", - Method: "DELETE", - PathPattern: "/v1/incidents/{incident_id}/tasks/{task_id}", + ID: "create_checklist_template", + Method: "POST", + PathPattern: "/v1/checklist_templates", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1IncidentsIncidentIDTasksTaskIDReader{formats: a.formats}, + Reader: &CreateChecklistTemplateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -139,35 +139,35 @@ func (a *Client) DeleteV1IncidentsIncidentIDTasksTaskID(params *DeleteV1Incident if err != nil { return nil, err } - success, ok := result.(*DeleteV1IncidentsIncidentIDTasksTaskIDNoContent) + success, ok := result.(*CreateChecklistTemplateCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1IncidentsIncidentIdTasksTaskId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_checklist_template: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1TaskListsTaskListID deletes a task list +CreateIncidentTask creates an incident task -Delete a task list +Create a task */ -func (a *Client) DeleteV1TaskListsTaskListID(params *DeleteV1TaskListsTaskListIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TaskListsTaskListIDOK, error) { +func (a *Client) CreateIncidentTask(params *CreateIncidentTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentTaskCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1TaskListsTaskListIDParams() + params = NewCreateIncidentTaskParams() } op := &runtime.ClientOperation{ - ID: "deleteV1TaskListsTaskListId", - Method: "DELETE", - PathPattern: "/v1/task_lists/{task_list_id}", + ID: "create_incident_task", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/tasks", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1TaskListsTaskListIDReader{formats: a.formats}, + Reader: &CreateIncidentTaskReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -180,35 +180,35 @@ func (a *Client) DeleteV1TaskListsTaskListID(params *DeleteV1TaskListsTaskListID if err != nil { return nil, err } - success, ok := result.(*DeleteV1TaskListsTaskListIDOK) + success, ok := result.(*CreateIncidentTaskCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1TaskListsTaskListId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_task: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ChecklistTemplates lists checklist templates +CreateIncidentTaskList adds tasks from a task list to an incident -List all of the checklist templates that have been added to the organization +Add all tasks from list to incident */ -func (a *Client) GetV1ChecklistTemplates(params *GetV1ChecklistTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ChecklistTemplatesOK, error) { +func (a *Client) CreateIncidentTaskList(params *CreateIncidentTaskListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIncidentTaskListCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ChecklistTemplatesParams() + params = NewCreateIncidentTaskListParams() } op := &runtime.ClientOperation{ - ID: "getV1ChecklistTemplates", - Method: "GET", - PathPattern: "/v1/checklist_templates", + ID: "create_incident_task_list", + Method: "POST", + PathPattern: "/v1/incidents/{incident_id}/task_lists", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ChecklistTemplatesReader{formats: a.formats}, + Reader: &CreateIncidentTaskListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -221,35 +221,35 @@ func (a *Client) GetV1ChecklistTemplates(params *GetV1ChecklistTemplatesParams, if err != nil { return nil, err } - success, ok := result.(*GetV1ChecklistTemplatesOK) + success, ok := result.(*CreateIncidentTaskListCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ChecklistTemplates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_incident_task_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1ChecklistTemplatesID gets a checklist template +CreateTaskList creates a task list -Retrieves a single checklist template by ID +Creates a new task list */ -func (a *Client) GetV1ChecklistTemplatesID(params *GetV1ChecklistTemplatesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1ChecklistTemplatesIDOK, error) { +func (a *Client) CreateTaskList(params *CreateTaskListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTaskListCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1ChecklistTemplatesIDParams() + params = NewCreateTaskListParams() } op := &runtime.ClientOperation{ - ID: "getV1ChecklistTemplatesId", - Method: "GET", - PathPattern: "/v1/checklist_templates/{id}", + ID: "create_task_list", + Method: "POST", + PathPattern: "/v1/task_lists", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1ChecklistTemplatesIDReader{formats: a.formats}, + Reader: &CreateTaskListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -262,35 +262,35 @@ func (a *Client) GetV1ChecklistTemplatesID(params *GetV1ChecklistTemplatesIDPara if err != nil { return nil, err } - success, ok := result.(*GetV1ChecklistTemplatesIDOK) + success, ok := result.(*CreateTaskListCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1ChecklistTemplatesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_task_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDTasks lists tasks for an incident +DeleteChecklistTemplate archives a checklist template -Retrieve a list of all tasks for a specific incident +Archive a checklist template */ -func (a *Client) GetV1IncidentsIncidentIDTasks(params *GetV1IncidentsIncidentIDTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDTasksOK, error) { +func (a *Client) DeleteChecklistTemplate(params *DeleteChecklistTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteChecklistTemplateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDTasksParams() + params = NewDeleteChecklistTemplateParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdTasks", - Method: "GET", - PathPattern: "/v1/incidents/{incident_id}/tasks", + ID: "delete_checklist_template", + Method: "DELETE", + PathPattern: "/v1/checklist_templates/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDTasksReader{formats: a.formats}, + Reader: &DeleteChecklistTemplateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -303,35 +303,35 @@ func (a *Client) GetV1IncidentsIncidentIDTasks(params *GetV1IncidentsIncidentIDT if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDTasksOK) + success, ok := result.(*DeleteChecklistTemplateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdTasks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_checklist_template: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1IncidentsIncidentIDTasksTaskID gets an incident task +DeleteIncidentTask deletes an incident task -Retrieve a single task for an incident +Delete a task */ -func (a *Client) GetV1IncidentsIncidentIDTasksTaskID(params *GetV1IncidentsIncidentIDTasksTaskIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1IncidentsIncidentIDTasksTaskIDOK, error) { +func (a *Client) DeleteIncidentTask(params *DeleteIncidentTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIncidentTaskNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1IncidentsIncidentIDTasksTaskIDParams() + params = NewDeleteIncidentTaskParams() } op := &runtime.ClientOperation{ - ID: "getV1IncidentsIncidentIdTasksTaskId", - Method: "GET", + ID: "delete_incident_task", + Method: "DELETE", PathPattern: "/v1/incidents/{incident_id}/tasks/{task_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1IncidentsIncidentIDTasksTaskIDReader{formats: a.formats}, + Reader: &DeleteIncidentTaskReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -344,35 +344,35 @@ func (a *Client) GetV1IncidentsIncidentIDTasksTaskID(params *GetV1IncidentsIncid if err != nil { return nil, err } - success, ok := result.(*GetV1IncidentsIncidentIDTasksTaskIDOK) + success, ok := result.(*DeleteIncidentTaskNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1IncidentsIncidentIdTasksTaskId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_incident_task: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TaskLists lists task lists +DeleteTaskList deletes a task list -Lists all task lists for your organization +Delete a task list */ -func (a *Client) GetV1TaskLists(params *GetV1TaskListsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TaskListsOK, error) { +func (a *Client) DeleteTaskList(params *DeleteTaskListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTaskListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TaskListsParams() + params = NewDeleteTaskListParams() } op := &runtime.ClientOperation{ - ID: "getV1TaskLists", - Method: "GET", - PathPattern: "/v1/task_lists", + ID: "delete_task_list", + Method: "DELETE", + PathPattern: "/v1/task_lists/{task_list_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TaskListsReader{formats: a.formats}, + Reader: &DeleteTaskListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -385,35 +385,35 @@ func (a *Client) GetV1TaskLists(params *GetV1TaskListsParams, authInfo runtime.C if err != nil { return nil, err } - success, ok := result.(*GetV1TaskListsOK) + success, ok := result.(*DeleteTaskListOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TaskLists: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_task_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TaskListsTaskListID gets a task list +GetChecklistTemplate gets a checklist template -Retrieves a single task list by ID +Retrieves a single checklist template by ID */ -func (a *Client) GetV1TaskListsTaskListID(params *GetV1TaskListsTaskListIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TaskListsTaskListIDOK, error) { +func (a *Client) GetChecklistTemplate(params *GetChecklistTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetChecklistTemplateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TaskListsTaskListIDParams() + params = NewGetChecklistTemplateParams() } op := &runtime.ClientOperation{ - ID: "getV1TaskListsTaskListId", + ID: "get_checklist_template", Method: "GET", - PathPattern: "/v1/task_lists/{task_list_id}", + PathPattern: "/v1/checklist_templates/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TaskListsTaskListIDReader{formats: a.formats}, + Reader: &GetChecklistTemplateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -426,35 +426,35 @@ func (a *Client) GetV1TaskListsTaskListID(params *GetV1TaskListsTaskListIDParams if err != nil { return nil, err } - success, ok := result.(*GetV1TaskListsTaskListIDOK) + success, ok := result.(*GetChecklistTemplateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TaskListsTaskListId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_checklist_template: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1ChecklistTemplatesID updates a checklist template +GetIncidentTask gets an incident task -Update a checklist templates attributes +Retrieve a single task for an incident */ -func (a *Client) PatchV1ChecklistTemplatesID(params *PatchV1ChecklistTemplatesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1ChecklistTemplatesIDOK, error) { +func (a *Client) GetIncidentTask(params *GetIncidentTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIncidentTaskOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1ChecklistTemplatesIDParams() + params = NewGetIncidentTaskParams() } op := &runtime.ClientOperation{ - ID: "patchV1ChecklistTemplatesId", - Method: "PATCH", - PathPattern: "/v1/checklist_templates/{id}", + ID: "get_incident_task", + Method: "GET", + PathPattern: "/v1/incidents/{incident_id}/tasks/{task_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1ChecklistTemplatesIDReader{formats: a.formats}, + Reader: &GetIncidentTaskReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -467,35 +467,35 @@ func (a *Client) PatchV1ChecklistTemplatesID(params *PatchV1ChecklistTemplatesID if err != nil { return nil, err } - success, ok := result.(*PatchV1ChecklistTemplatesIDOK) + success, ok := result.(*GetIncidentTaskOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1ChecklistTemplatesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_incident_task: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1IncidentsIncidentIDTasksTaskID updates an incident task +GetTaskList gets a task list -Update a task's attributes +Retrieves a single task list by ID */ -func (a *Client) PatchV1IncidentsIncidentIDTasksTaskID(params *PatchV1IncidentsIncidentIDTasksTaskIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1IncidentsIncidentIDTasksTaskIDOK, error) { +func (a *Client) GetTaskList(params *GetTaskListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTaskListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1IncidentsIncidentIDTasksTaskIDParams() + params = NewGetTaskListParams() } op := &runtime.ClientOperation{ - ID: "patchV1IncidentsIncidentIdTasksTaskId", - Method: "PATCH", - PathPattern: "/v1/incidents/{incident_id}/tasks/{task_id}", + ID: "get_task_list", + Method: "GET", + PathPattern: "/v1/task_lists/{task_list_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1IncidentsIncidentIDTasksTaskIDReader{formats: a.formats}, + Reader: &GetTaskListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -508,35 +508,35 @@ func (a *Client) PatchV1IncidentsIncidentIDTasksTaskID(params *PatchV1IncidentsI if err != nil { return nil, err } - success, ok := result.(*PatchV1IncidentsIncidentIDTasksTaskIDOK) + success, ok := result.(*GetTaskListOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1IncidentsIncidentIdTasksTaskId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_task_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1TaskListsTaskListID updates a task list +ListChecklistTemplates lists checklist templates -Updates a task list's attributes and task list items +List all of the checklist templates that have been added to the organization */ -func (a *Client) PatchV1TaskListsTaskListID(params *PatchV1TaskListsTaskListIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TaskListsTaskListIDOK, error) { +func (a *Client) ListChecklistTemplates(params *ListChecklistTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListChecklistTemplatesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1TaskListsTaskListIDParams() + params = NewListChecklistTemplatesParams() } op := &runtime.ClientOperation{ - ID: "patchV1TaskListsTaskListId", - Method: "PATCH", - PathPattern: "/v1/task_lists/{task_list_id}", + ID: "list_checklist_templates", + Method: "GET", + PathPattern: "/v1/checklist_templates", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1TaskListsTaskListIDReader{formats: a.formats}, + Reader: &ListChecklistTemplatesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -549,35 +549,35 @@ func (a *Client) PatchV1TaskListsTaskListID(params *PatchV1TaskListsTaskListIDPa if err != nil { return nil, err } - success, ok := result.(*PatchV1TaskListsTaskListIDOK) + success, ok := result.(*ListChecklistTemplatesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1TaskListsTaskListId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_checklist_templates: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1ChecklistTemplates creates a checklist template +ListIncidentTasks lists tasks for an incident -Creates a checklist template for the organization +Retrieve a list of all tasks for a specific incident */ -func (a *Client) PostV1ChecklistTemplates(params *PostV1ChecklistTemplatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1ChecklistTemplatesCreated, error) { +func (a *Client) ListIncidentTasks(params *ListIncidentTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIncidentTasksOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1ChecklistTemplatesParams() + params = NewListIncidentTasksParams() } op := &runtime.ClientOperation{ - ID: "postV1ChecklistTemplates", - Method: "POST", - PathPattern: "/v1/checklist_templates", + ID: "list_incident_tasks", + Method: "GET", + PathPattern: "/v1/incidents/{incident_id}/tasks", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1ChecklistTemplatesReader{formats: a.formats}, + Reader: &ListIncidentTasksReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -590,35 +590,35 @@ func (a *Client) PostV1ChecklistTemplates(params *PostV1ChecklistTemplatesParams if err != nil { return nil, err } - success, ok := result.(*PostV1ChecklistTemplatesCreated) + success, ok := result.(*ListIncidentTasksOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1ChecklistTemplates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_incident_tasks: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDTaskLists adds tasks from a task list to an incident +ListTaskLists lists task lists -Add all tasks from list to incident +Lists all task lists for your organization */ -func (a *Client) PostV1IncidentsIncidentIDTaskLists(params *PostV1IncidentsIncidentIDTaskListsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDTaskListsCreated, error) { +func (a *Client) ListTaskLists(params *ListTaskListsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTaskListsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDTaskListsParams() + params = NewListTaskListsParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdTaskLists", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/task_lists", + ID: "list_task_lists", + Method: "GET", + PathPattern: "/v1/task_lists", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDTaskListsReader{formats: a.formats}, + Reader: &ListTaskListsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -631,35 +631,35 @@ func (a *Client) PostV1IncidentsIncidentIDTaskLists(params *PostV1IncidentsIncid if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDTaskListsCreated) + success, ok := result.(*ListTaskListsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdTaskLists: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_task_lists: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDTasks creates an incident task +UpdateChecklistTemplate updates a checklist template -Create a task +Update a checklist templates attributes */ -func (a *Client) PostV1IncidentsIncidentIDTasks(params *PostV1IncidentsIncidentIDTasksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDTasksCreated, error) { +func (a *Client) UpdateChecklistTemplate(params *UpdateChecklistTemplateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateChecklistTemplateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDTasksParams() + params = NewUpdateChecklistTemplateParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdTasks", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/tasks", + ID: "update_checklist_template", + Method: "PATCH", + PathPattern: "/v1/checklist_templates/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDTasksReader{formats: a.formats}, + Reader: &UpdateChecklistTemplateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -672,35 +672,35 @@ func (a *Client) PostV1IncidentsIncidentIDTasks(params *PostV1IncidentsIncidentI if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDTasksCreated) + success, ok := result.(*UpdateChecklistTemplateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdTasks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_checklist_template: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1IncidentsIncidentIDTasksTaskIDConvert converts a task to a follow up +UpdateIncidentTask updates an incident task -Convert a task to a follow-up +Update a task's attributes */ -func (a *Client) PostV1IncidentsIncidentIDTasksTaskIDConvert(params *PostV1IncidentsIncidentIDTasksTaskIDConvertParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1IncidentsIncidentIDTasksTaskIDConvertCreated, error) { +func (a *Client) UpdateIncidentTask(params *UpdateIncidentTaskParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIncidentTaskOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1IncidentsIncidentIDTasksTaskIDConvertParams() + params = NewUpdateIncidentTaskParams() } op := &runtime.ClientOperation{ - ID: "postV1IncidentsIncidentIdTasksTaskIdConvert", - Method: "POST", - PathPattern: "/v1/incidents/{incident_id}/tasks/{task_id}/convert", + ID: "update_incident_task", + Method: "PATCH", + PathPattern: "/v1/incidents/{incident_id}/tasks/{task_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1IncidentsIncidentIDTasksTaskIDConvertReader{formats: a.formats}, + Reader: &UpdateIncidentTaskReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -713,35 +713,35 @@ func (a *Client) PostV1IncidentsIncidentIDTasksTaskIDConvert(params *PostV1Incid if err != nil { return nil, err } - success, ok := result.(*PostV1IncidentsIncidentIDTasksTaskIDConvertCreated) + success, ok := result.(*UpdateIncidentTaskOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1IncidentsIncidentIdTasksTaskIdConvert: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_incident_task: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1TaskLists creates a task list +UpdateTaskList updates a task list -Creates a new task list +Updates a task list's attributes and task list items */ -func (a *Client) PostV1TaskLists(params *PostV1TaskListsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TaskListsCreated, error) { +func (a *Client) UpdateTaskList(params *UpdateTaskListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTaskListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1TaskListsParams() + params = NewUpdateTaskListParams() } op := &runtime.ClientOperation{ - ID: "postV1TaskLists", - Method: "POST", - PathPattern: "/v1/task_lists", + ID: "update_task_list", + Method: "PATCH", + PathPattern: "/v1/task_lists/{task_list_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1TaskListsReader{formats: a.formats}, + Reader: &UpdateTaskListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -754,13 +754,13 @@ func (a *Client) PostV1TaskLists(params *PostV1TaskListsParams, authInfo runtime if err != nil { return nil, err } - success, ok := result.(*PostV1TaskListsCreated) + success, ok := result.(*UpdateTaskListOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1TaskLists: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_task_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/tasks/update_checklist_template_parameters.go b/client/tasks/update_checklist_template_parameters.go new file mode 100644 index 0000000..e8393df --- /dev/null +++ b/client/tasks/update_checklist_template_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateChecklistTemplateParams creates a new UpdateChecklistTemplateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateChecklistTemplateParams() *UpdateChecklistTemplateParams { + return &UpdateChecklistTemplateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateChecklistTemplateParamsWithTimeout creates a new UpdateChecklistTemplateParams object +// with the ability to set a timeout on a request. +func NewUpdateChecklistTemplateParamsWithTimeout(timeout time.Duration) *UpdateChecklistTemplateParams { + return &UpdateChecklistTemplateParams{ + timeout: timeout, + } +} + +// NewUpdateChecklistTemplateParamsWithContext creates a new UpdateChecklistTemplateParams object +// with the ability to set a context for a request. +func NewUpdateChecklistTemplateParamsWithContext(ctx context.Context) *UpdateChecklistTemplateParams { + return &UpdateChecklistTemplateParams{ + Context: ctx, + } +} + +// NewUpdateChecklistTemplateParamsWithHTTPClient creates a new UpdateChecklistTemplateParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateChecklistTemplateParamsWithHTTPClient(client *http.Client) *UpdateChecklistTemplateParams { + return &UpdateChecklistTemplateParams{ + HTTPClient: client, + } +} + +/* +UpdateChecklistTemplateParams contains all the parameters to send to the API endpoint + + for the update checklist template operation. + + Typically these are written to a http.Request. +*/ +type UpdateChecklistTemplateParams struct { + + // ID. + ID string + + // UpdateChecklistTemplate. + UpdateChecklistTemplate *models.UpdateChecklistTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update checklist template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateChecklistTemplateParams) WithDefaults() *UpdateChecklistTemplateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update checklist template params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateChecklistTemplateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update checklist template params +func (o *UpdateChecklistTemplateParams) WithTimeout(timeout time.Duration) *UpdateChecklistTemplateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update checklist template params +func (o *UpdateChecklistTemplateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update checklist template params +func (o *UpdateChecklistTemplateParams) WithContext(ctx context.Context) *UpdateChecklistTemplateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update checklist template params +func (o *UpdateChecklistTemplateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update checklist template params +func (o *UpdateChecklistTemplateParams) WithHTTPClient(client *http.Client) *UpdateChecklistTemplateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update checklist template params +func (o *UpdateChecklistTemplateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the update checklist template params +func (o *UpdateChecklistTemplateParams) WithID(id string) *UpdateChecklistTemplateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the update checklist template params +func (o *UpdateChecklistTemplateParams) SetID(id string) { + o.ID = id +} + +// WithUpdateChecklistTemplate adds the updateChecklistTemplate to the update checklist template params +func (o *UpdateChecklistTemplateParams) WithUpdateChecklistTemplate(updateChecklistTemplate *models.UpdateChecklistTemplate) *UpdateChecklistTemplateParams { + o.SetUpdateChecklistTemplate(updateChecklistTemplate) + return o +} + +// SetUpdateChecklistTemplate adds the updateChecklistTemplate to the update checklist template params +func (o *UpdateChecklistTemplateParams) SetUpdateChecklistTemplate(updateChecklistTemplate *models.UpdateChecklistTemplate) { + o.UpdateChecklistTemplate = updateChecklistTemplate +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateChecklistTemplateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + if o.UpdateChecklistTemplate != nil { + if err := r.SetBodyParam(o.UpdateChecklistTemplate); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/update_checklist_template_responses.go b/client/tasks/update_checklist_template_responses.go new file mode 100644 index 0000000..cac30c4 --- /dev/null +++ b/client/tasks/update_checklist_template_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateChecklistTemplateReader is a Reader for the UpdateChecklistTemplate structure. +type UpdateChecklistTemplateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateChecklistTemplateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateChecklistTemplateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateChecklistTemplateOK creates a UpdateChecklistTemplateOK with default headers values +func NewUpdateChecklistTemplateOK() *UpdateChecklistTemplateOK { + return &UpdateChecklistTemplateOK{} +} + +/* +UpdateChecklistTemplateOK describes a response with status code 200, with default header values. + +Update a checklist templates attributes +*/ +type UpdateChecklistTemplateOK struct { + Payload *models.ChecklistTemplateEntity +} + +// IsSuccess returns true when this update checklist template o k response has a 2xx status code +func (o *UpdateChecklistTemplateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update checklist template o k response has a 3xx status code +func (o *UpdateChecklistTemplateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update checklist template o k response has a 4xx status code +func (o *UpdateChecklistTemplateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update checklist template o k response has a 5xx status code +func (o *UpdateChecklistTemplateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update checklist template o k response a status code equal to that given +func (o *UpdateChecklistTemplateOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateChecklistTemplateOK) Error() string { + return fmt.Sprintf("[PATCH /v1/checklist_templates/{id}][%d] updateChecklistTemplateOK %+v", 200, o.Payload) +} + +func (o *UpdateChecklistTemplateOK) String() string { + return fmt.Sprintf("[PATCH /v1/checklist_templates/{id}][%d] updateChecklistTemplateOK %+v", 200, o.Payload) +} + +func (o *UpdateChecklistTemplateOK) GetPayload() *models.ChecklistTemplateEntity { + return o.Payload +} + +func (o *UpdateChecklistTemplateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ChecklistTemplateEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/tasks/update_incident_task_parameters.go b/client/tasks/update_incident_task_parameters.go new file mode 100644 index 0000000..3e57c97 --- /dev/null +++ b/client/tasks/update_incident_task_parameters.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateIncidentTaskParams creates a new UpdateIncidentTaskParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateIncidentTaskParams() *UpdateIncidentTaskParams { + return &UpdateIncidentTaskParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateIncidentTaskParamsWithTimeout creates a new UpdateIncidentTaskParams object +// with the ability to set a timeout on a request. +func NewUpdateIncidentTaskParamsWithTimeout(timeout time.Duration) *UpdateIncidentTaskParams { + return &UpdateIncidentTaskParams{ + timeout: timeout, + } +} + +// NewUpdateIncidentTaskParamsWithContext creates a new UpdateIncidentTaskParams object +// with the ability to set a context for a request. +func NewUpdateIncidentTaskParamsWithContext(ctx context.Context) *UpdateIncidentTaskParams { + return &UpdateIncidentTaskParams{ + Context: ctx, + } +} + +// NewUpdateIncidentTaskParamsWithHTTPClient creates a new UpdateIncidentTaskParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateIncidentTaskParamsWithHTTPClient(client *http.Client) *UpdateIncidentTaskParams { + return &UpdateIncidentTaskParams{ + HTTPClient: client, + } +} + +/* +UpdateIncidentTaskParams contains all the parameters to send to the API endpoint + + for the update incident task operation. + + Typically these are written to a http.Request. +*/ +type UpdateIncidentTaskParams struct { + + // IncidentID. + IncidentID string + + // TaskID. + TaskID string + + // UpdateIncidentTask. + UpdateIncidentTask *models.UpdateIncidentTask + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update incident task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentTaskParams) WithDefaults() *UpdateIncidentTaskParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update incident task params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateIncidentTaskParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update incident task params +func (o *UpdateIncidentTaskParams) WithTimeout(timeout time.Duration) *UpdateIncidentTaskParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update incident task params +func (o *UpdateIncidentTaskParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update incident task params +func (o *UpdateIncidentTaskParams) WithContext(ctx context.Context) *UpdateIncidentTaskParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update incident task params +func (o *UpdateIncidentTaskParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update incident task params +func (o *UpdateIncidentTaskParams) WithHTTPClient(client *http.Client) *UpdateIncidentTaskParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update incident task params +func (o *UpdateIncidentTaskParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIncidentID adds the incidentID to the update incident task params +func (o *UpdateIncidentTaskParams) WithIncidentID(incidentID string) *UpdateIncidentTaskParams { + o.SetIncidentID(incidentID) + return o +} + +// SetIncidentID adds the incidentId to the update incident task params +func (o *UpdateIncidentTaskParams) SetIncidentID(incidentID string) { + o.IncidentID = incidentID +} + +// WithTaskID adds the taskID to the update incident task params +func (o *UpdateIncidentTaskParams) WithTaskID(taskID string) *UpdateIncidentTaskParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the update incident task params +func (o *UpdateIncidentTaskParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WithUpdateIncidentTask adds the updateIncidentTask to the update incident task params +func (o *UpdateIncidentTaskParams) WithUpdateIncidentTask(updateIncidentTask *models.UpdateIncidentTask) *UpdateIncidentTaskParams { + o.SetUpdateIncidentTask(updateIncidentTask) + return o +} + +// SetUpdateIncidentTask adds the updateIncidentTask to the update incident task params +func (o *UpdateIncidentTaskParams) SetUpdateIncidentTask(updateIncidentTask *models.UpdateIncidentTask) { + o.UpdateIncidentTask = updateIncidentTask +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateIncidentTaskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param incident_id + if err := r.SetPathParam("incident_id", o.IncidentID); err != nil { + return err + } + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + if o.UpdateIncidentTask != nil { + if err := r.SetBodyParam(o.UpdateIncidentTask); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/update_incident_task_responses.go b/client/tasks/update_incident_task_responses.go new file mode 100644 index 0000000..717d8ad --- /dev/null +++ b/client/tasks/update_incident_task_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateIncidentTaskReader is a Reader for the UpdateIncidentTask structure. +type UpdateIncidentTaskReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateIncidentTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateIncidentTaskOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateIncidentTaskOK creates a UpdateIncidentTaskOK with default headers values +func NewUpdateIncidentTaskOK() *UpdateIncidentTaskOK { + return &UpdateIncidentTaskOK{} +} + +/* +UpdateIncidentTaskOK describes a response with status code 200, with default header values. + +Update a task's attributes +*/ +type UpdateIncidentTaskOK struct { + Payload *models.TaskEntity +} + +// IsSuccess returns true when this update incident task o k response has a 2xx status code +func (o *UpdateIncidentTaskOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update incident task o k response has a 3xx status code +func (o *UpdateIncidentTaskOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update incident task o k response has a 4xx status code +func (o *UpdateIncidentTaskOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update incident task o k response has a 5xx status code +func (o *UpdateIncidentTaskOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update incident task o k response a status code equal to that given +func (o *UpdateIncidentTaskOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateIncidentTaskOK) Error() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/tasks/{task_id}][%d] updateIncidentTaskOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentTaskOK) String() string { + return fmt.Sprintf("[PATCH /v1/incidents/{incident_id}/tasks/{task_id}][%d] updateIncidentTaskOK %+v", 200, o.Payload) +} + +func (o *UpdateIncidentTaskOK) GetPayload() *models.TaskEntity { + return o.Payload +} + +func (o *UpdateIncidentTaskOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/tasks/update_task_list_parameters.go b/client/tasks/update_task_list_parameters.go new file mode 100644 index 0000000..67c1ae1 --- /dev/null +++ b/client/tasks/update_task_list_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateTaskListParams creates a new UpdateTaskListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateTaskListParams() *UpdateTaskListParams { + return &UpdateTaskListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateTaskListParamsWithTimeout creates a new UpdateTaskListParams object +// with the ability to set a timeout on a request. +func NewUpdateTaskListParamsWithTimeout(timeout time.Duration) *UpdateTaskListParams { + return &UpdateTaskListParams{ + timeout: timeout, + } +} + +// NewUpdateTaskListParamsWithContext creates a new UpdateTaskListParams object +// with the ability to set a context for a request. +func NewUpdateTaskListParamsWithContext(ctx context.Context) *UpdateTaskListParams { + return &UpdateTaskListParams{ + Context: ctx, + } +} + +// NewUpdateTaskListParamsWithHTTPClient creates a new UpdateTaskListParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateTaskListParamsWithHTTPClient(client *http.Client) *UpdateTaskListParams { + return &UpdateTaskListParams{ + HTTPClient: client, + } +} + +/* +UpdateTaskListParams contains all the parameters to send to the API endpoint + + for the update task list operation. + + Typically these are written to a http.Request. +*/ +type UpdateTaskListParams struct { + + // TaskListID. + TaskListID string + + // UpdateTaskList. + UpdateTaskList *models.UpdateTaskList + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update task list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTaskListParams) WithDefaults() *UpdateTaskListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update task list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTaskListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update task list params +func (o *UpdateTaskListParams) WithTimeout(timeout time.Duration) *UpdateTaskListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update task list params +func (o *UpdateTaskListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update task list params +func (o *UpdateTaskListParams) WithContext(ctx context.Context) *UpdateTaskListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update task list params +func (o *UpdateTaskListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update task list params +func (o *UpdateTaskListParams) WithHTTPClient(client *http.Client) *UpdateTaskListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update task list params +func (o *UpdateTaskListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskListID adds the taskListID to the update task list params +func (o *UpdateTaskListParams) WithTaskListID(taskListID string) *UpdateTaskListParams { + o.SetTaskListID(taskListID) + return o +} + +// SetTaskListID adds the taskListId to the update task list params +func (o *UpdateTaskListParams) SetTaskListID(taskListID string) { + o.TaskListID = taskListID +} + +// WithUpdateTaskList adds the updateTaskList to the update task list params +func (o *UpdateTaskListParams) WithUpdateTaskList(updateTaskList *models.UpdateTaskList) *UpdateTaskListParams { + o.SetUpdateTaskList(updateTaskList) + return o +} + +// SetUpdateTaskList adds the updateTaskList to the update task list params +func (o *UpdateTaskListParams) SetUpdateTaskList(updateTaskList *models.UpdateTaskList) { + o.UpdateTaskList = updateTaskList +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateTaskListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param task_list_id + if err := r.SetPathParam("task_list_id", o.TaskListID); err != nil { + return err + } + if o.UpdateTaskList != nil { + if err := r.SetBodyParam(o.UpdateTaskList); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/tasks/update_task_list_responses.go b/client/tasks/update_task_list_responses.go new file mode 100644 index 0000000..51d400a --- /dev/null +++ b/client/tasks/update_task_list_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tasks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateTaskListReader is a Reader for the UpdateTaskList structure. +type UpdateTaskListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateTaskListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateTaskListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateTaskListOK creates a UpdateTaskListOK with default headers values +func NewUpdateTaskListOK() *UpdateTaskListOK { + return &UpdateTaskListOK{} +} + +/* +UpdateTaskListOK describes a response with status code 200, with default header values. + +Updates a task list's attributes and task list items +*/ +type UpdateTaskListOK struct { + Payload *models.TaskListEntity +} + +// IsSuccess returns true when this update task list o k response has a 2xx status code +func (o *UpdateTaskListOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update task list o k response has a 3xx status code +func (o *UpdateTaskListOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update task list o k response has a 4xx status code +func (o *UpdateTaskListOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update task list o k response has a 5xx status code +func (o *UpdateTaskListOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update task list o k response a status code equal to that given +func (o *UpdateTaskListOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateTaskListOK) Error() string { + return fmt.Sprintf("[PATCH /v1/task_lists/{task_list_id}][%d] updateTaskListOK %+v", 200, o.Payload) +} + +func (o *UpdateTaskListOK) String() string { + return fmt.Sprintf("[PATCH /v1/task_lists/{task_list_id}][%d] updateTaskListOK %+v", 200, o.Payload) +} + +func (o *UpdateTaskListOK) GetPayload() *models.TaskListEntity { + return o.Payload +} + +func (o *UpdateTaskListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskListEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/teams/create_team_parameters.go b/client/teams/create_team_parameters.go new file mode 100644 index 0000000..ce71069 --- /dev/null +++ b/client/teams/create_team_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package teams + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateTeamParams creates a new CreateTeamParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateTeamParams() *CreateTeamParams { + return &CreateTeamParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateTeamParamsWithTimeout creates a new CreateTeamParams object +// with the ability to set a timeout on a request. +func NewCreateTeamParamsWithTimeout(timeout time.Duration) *CreateTeamParams { + return &CreateTeamParams{ + timeout: timeout, + } +} + +// NewCreateTeamParamsWithContext creates a new CreateTeamParams object +// with the ability to set a context for a request. +func NewCreateTeamParamsWithContext(ctx context.Context) *CreateTeamParams { + return &CreateTeamParams{ + Context: ctx, + } +} + +// NewCreateTeamParamsWithHTTPClient creates a new CreateTeamParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateTeamParamsWithHTTPClient(client *http.Client) *CreateTeamParams { + return &CreateTeamParams{ + HTTPClient: client, + } +} + +/* +CreateTeamParams contains all the parameters to send to the API endpoint + + for the create team operation. + + Typically these are written to a http.Request. +*/ +type CreateTeamParams struct { + + // CreateTeam. + CreateTeam *models.CreateTeam + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create team params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTeamParams) WithDefaults() *CreateTeamParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create team params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTeamParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create team params +func (o *CreateTeamParams) WithTimeout(timeout time.Duration) *CreateTeamParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create team params +func (o *CreateTeamParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create team params +func (o *CreateTeamParams) WithContext(ctx context.Context) *CreateTeamParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create team params +func (o *CreateTeamParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create team params +func (o *CreateTeamParams) WithHTTPClient(client *http.Client) *CreateTeamParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create team params +func (o *CreateTeamParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateTeam adds the createTeam to the create team params +func (o *CreateTeamParams) WithCreateTeam(createTeam *models.CreateTeam) *CreateTeamParams { + o.SetCreateTeam(createTeam) + return o +} + +// SetCreateTeam adds the createTeam to the create team params +func (o *CreateTeamParams) SetCreateTeam(createTeam *models.CreateTeam) { + o.CreateTeam = createTeam +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateTeamParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateTeam != nil { + if err := r.SetBodyParam(o.CreateTeam); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/teams/create_team_responses.go b/client/teams/create_team_responses.go new file mode 100644 index 0000000..b79a69c --- /dev/null +++ b/client/teams/create_team_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package teams + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateTeamReader is a Reader for the CreateTeam structure. +type CreateTeamReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateTeamReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateTeamCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateTeamCreated creates a CreateTeamCreated with default headers values +func NewCreateTeamCreated() *CreateTeamCreated { + return &CreateTeamCreated{} +} + +/* +CreateTeamCreated describes a response with status code 201, with default header values. + +Create a new team +*/ +type CreateTeamCreated struct { + Payload *models.TeamEntity +} + +// IsSuccess returns true when this create team created response has a 2xx status code +func (o *CreateTeamCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create team created response has a 3xx status code +func (o *CreateTeamCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create team created response has a 4xx status code +func (o *CreateTeamCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create team created response has a 5xx status code +func (o *CreateTeamCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create team created response a status code equal to that given +func (o *CreateTeamCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateTeamCreated) Error() string { + return fmt.Sprintf("[POST /v1/teams][%d] createTeamCreated %+v", 201, o.Payload) +} + +func (o *CreateTeamCreated) String() string { + return fmt.Sprintf("[POST /v1/teams][%d] createTeamCreated %+v", 201, o.Payload) +} + +func (o *CreateTeamCreated) GetPayload() *models.TeamEntity { + return o.Payload +} + +func (o *CreateTeamCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TeamEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/teams/delete_team_parameters.go b/client/teams/delete_team_parameters.go new file mode 100644 index 0000000..5cbaa17 --- /dev/null +++ b/client/teams/delete_team_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package teams + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTeamParams creates a new DeleteTeamParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTeamParams() *DeleteTeamParams { + return &DeleteTeamParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTeamParamsWithTimeout creates a new DeleteTeamParams object +// with the ability to set a timeout on a request. +func NewDeleteTeamParamsWithTimeout(timeout time.Duration) *DeleteTeamParams { + return &DeleteTeamParams{ + timeout: timeout, + } +} + +// NewDeleteTeamParamsWithContext creates a new DeleteTeamParams object +// with the ability to set a context for a request. +func NewDeleteTeamParamsWithContext(ctx context.Context) *DeleteTeamParams { + return &DeleteTeamParams{ + Context: ctx, + } +} + +// NewDeleteTeamParamsWithHTTPClient creates a new DeleteTeamParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTeamParamsWithHTTPClient(client *http.Client) *DeleteTeamParams { + return &DeleteTeamParams{ + HTTPClient: client, + } +} + +/* +DeleteTeamParams contains all the parameters to send to the API endpoint + + for the delete team operation. + + Typically these are written to a http.Request. +*/ +type DeleteTeamParams struct { + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete team params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTeamParams) WithDefaults() *DeleteTeamParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete team params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTeamParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete team params +func (o *DeleteTeamParams) WithTimeout(timeout time.Duration) *DeleteTeamParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete team params +func (o *DeleteTeamParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete team params +func (o *DeleteTeamParams) WithContext(ctx context.Context) *DeleteTeamParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete team params +func (o *DeleteTeamParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete team params +func (o *DeleteTeamParams) WithHTTPClient(client *http.Client) *DeleteTeamParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete team params +func (o *DeleteTeamParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTeamID adds the teamID to the delete team params +func (o *DeleteTeamParams) WithTeamID(teamID string) *DeleteTeamParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the delete team params +func (o *DeleteTeamParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTeamParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/teams/delete_team_responses.go b/client/teams/delete_team_responses.go new file mode 100644 index 0000000..480b03d --- /dev/null +++ b/client/teams/delete_team_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package teams + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteTeamReader is a Reader for the DeleteTeam structure. +type DeleteTeamReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTeamReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteTeamOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTeamOK creates a DeleteTeamOK with default headers values +func NewDeleteTeamOK() *DeleteTeamOK { + return &DeleteTeamOK{} +} + +/* +DeleteTeamOK describes a response with status code 200, with default header values. + +Archives an team which will hide it from lists and metrics +*/ +type DeleteTeamOK struct { + Payload *models.TeamEntity +} + +// IsSuccess returns true when this delete team o k response has a 2xx status code +func (o *DeleteTeamOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete team o k response has a 3xx status code +func (o *DeleteTeamOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete team o k response has a 4xx status code +func (o *DeleteTeamOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete team o k response has a 5xx status code +func (o *DeleteTeamOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete team o k response a status code equal to that given +func (o *DeleteTeamOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteTeamOK) Error() string { + return fmt.Sprintf("[DELETE /v1/teams/{team_id}][%d] deleteTeamOK %+v", 200, o.Payload) +} + +func (o *DeleteTeamOK) String() string { + return fmt.Sprintf("[DELETE /v1/teams/{team_id}][%d] deleteTeamOK %+v", 200, o.Payload) +} + +func (o *DeleteTeamOK) GetPayload() *models.TeamEntity { + return o.Payload +} + +func (o *DeleteTeamOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TeamEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/teams/get_team_parameters.go b/client/teams/get_team_parameters.go new file mode 100644 index 0000000..7bba982 --- /dev/null +++ b/client/teams/get_team_parameters.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package teams + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetTeamParams creates a new GetTeamParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTeamParams() *GetTeamParams { + return &GetTeamParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTeamParamsWithTimeout creates a new GetTeamParams object +// with the ability to set a timeout on a request. +func NewGetTeamParamsWithTimeout(timeout time.Duration) *GetTeamParams { + return &GetTeamParams{ + timeout: timeout, + } +} + +// NewGetTeamParamsWithContext creates a new GetTeamParams object +// with the ability to set a context for a request. +func NewGetTeamParamsWithContext(ctx context.Context) *GetTeamParams { + return &GetTeamParams{ + Context: ctx, + } +} + +// NewGetTeamParamsWithHTTPClient creates a new GetTeamParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTeamParamsWithHTTPClient(client *http.Client) *GetTeamParams { + return &GetTeamParams{ + HTTPClient: client, + } +} + +/* +GetTeamParams contains all the parameters to send to the API endpoint + + for the get team operation. + + Typically these are written to a http.Request. +*/ +type GetTeamParams struct { + + /* Lite. + + Boolean to determine whether to return a slimified version of the teams object + */ + Lite *bool + + // TeamID. + TeamID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get team params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTeamParams) WithDefaults() *GetTeamParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get team params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTeamParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get team params +func (o *GetTeamParams) WithTimeout(timeout time.Duration) *GetTeamParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get team params +func (o *GetTeamParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get team params +func (o *GetTeamParams) WithContext(ctx context.Context) *GetTeamParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get team params +func (o *GetTeamParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get team params +func (o *GetTeamParams) WithHTTPClient(client *http.Client) *GetTeamParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get team params +func (o *GetTeamParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLite adds the lite to the get team params +func (o *GetTeamParams) WithLite(lite *bool) *GetTeamParams { + o.SetLite(lite) + return o +} + +// SetLite adds the lite to the get team params +func (o *GetTeamParams) SetLite(lite *bool) { + o.Lite = lite +} + +// WithTeamID adds the teamID to the get team params +func (o *GetTeamParams) WithTeamID(teamID string) *GetTeamParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the get team params +func (o *GetTeamParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTeamParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Lite != nil { + + // query param lite + var qrLite bool + + if o.Lite != nil { + qrLite = *o.Lite + } + qLite := swag.FormatBool(qrLite) + if qLite != "" { + + if err := r.SetQueryParam("lite", qLite); err != nil { + return err + } + } + } + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/teams/get_team_responses.go b/client/teams/get_team_responses.go new file mode 100644 index 0000000..60cdde8 --- /dev/null +++ b/client/teams/get_team_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package teams + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetTeamReader is a Reader for the GetTeam structure. +type GetTeamReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTeamReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTeamOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTeamOK creates a GetTeamOK with default headers values +func NewGetTeamOK() *GetTeamOK { + return &GetTeamOK{} +} + +/* +GetTeamOK describes a response with status code 200, with default header values. + +Retrieve a single team from its ID +*/ +type GetTeamOK struct { + Payload *models.TeamEntity +} + +// IsSuccess returns true when this get team o k response has a 2xx status code +func (o *GetTeamOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get team o k response has a 3xx status code +func (o *GetTeamOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get team o k response has a 4xx status code +func (o *GetTeamOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get team o k response has a 5xx status code +func (o *GetTeamOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get team o k response a status code equal to that given +func (o *GetTeamOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetTeamOK) Error() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}][%d] getTeamOK %+v", 200, o.Payload) +} + +func (o *GetTeamOK) String() string { + return fmt.Sprintf("[GET /v1/teams/{team_id}][%d] getTeamOK %+v", 200, o.Payload) +} + +func (o *GetTeamOK) GetPayload() *models.TeamEntity { + return o.Payload +} + +func (o *GetTeamOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TeamEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/teams/list_schedules_parameters.go b/client/teams/list_schedules_parameters.go new file mode 100644 index 0000000..f7bdca0 --- /dev/null +++ b/client/teams/list_schedules_parameters.go @@ -0,0 +1,230 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package teams + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListSchedulesParams creates a new ListSchedulesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListSchedulesParams() *ListSchedulesParams { + return &ListSchedulesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListSchedulesParamsWithTimeout creates a new ListSchedulesParams object +// with the ability to set a timeout on a request. +func NewListSchedulesParamsWithTimeout(timeout time.Duration) *ListSchedulesParams { + return &ListSchedulesParams{ + timeout: timeout, + } +} + +// NewListSchedulesParamsWithContext creates a new ListSchedulesParams object +// with the ability to set a context for a request. +func NewListSchedulesParamsWithContext(ctx context.Context) *ListSchedulesParams { + return &ListSchedulesParams{ + Context: ctx, + } +} + +// NewListSchedulesParamsWithHTTPClient creates a new ListSchedulesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListSchedulesParamsWithHTTPClient(client *http.Client) *ListSchedulesParams { + return &ListSchedulesParams{ + HTTPClient: client, + } +} + +/* +ListSchedulesParams contains all the parameters to send to the API endpoint + + for the list schedules operation. + + Typically these are written to a http.Request. +*/ +type ListSchedulesParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + Filter schedules with a query on their name + */ + Query *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list schedules params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSchedulesParams) WithDefaults() *ListSchedulesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list schedules params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSchedulesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list schedules params +func (o *ListSchedulesParams) WithTimeout(timeout time.Duration) *ListSchedulesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list schedules params +func (o *ListSchedulesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list schedules params +func (o *ListSchedulesParams) WithContext(ctx context.Context) *ListSchedulesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list schedules params +func (o *ListSchedulesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list schedules params +func (o *ListSchedulesParams) WithHTTPClient(client *http.Client) *ListSchedulesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list schedules params +func (o *ListSchedulesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list schedules params +func (o *ListSchedulesParams) WithPage(page *int32) *ListSchedulesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list schedules params +func (o *ListSchedulesParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list schedules params +func (o *ListSchedulesParams) WithPerPage(perPage *int32) *ListSchedulesParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list schedules params +func (o *ListSchedulesParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list schedules params +func (o *ListSchedulesParams) WithQuery(query *string) *ListSchedulesParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list schedules params +func (o *ListSchedulesParams) SetQuery(query *string) { + o.Query = query +} + +// WriteToRequest writes these params to a swagger request +func (o *ListSchedulesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/teams/list_schedules_responses.go b/client/teams/list_schedules_responses.go new file mode 100644 index 0000000..7925b84 --- /dev/null +++ b/client/teams/list_schedules_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package teams + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListSchedulesReader is a Reader for the ListSchedules structure. +type ListSchedulesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListSchedulesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListSchedulesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListSchedulesOK creates a ListSchedulesOK with default headers values +func NewListSchedulesOK() *ListSchedulesOK { + return &ListSchedulesOK{} +} + +/* +ListSchedulesOK describes a response with status code 200, with default header values. + +List all known schedules in FireHydrant as pulled from external sources +*/ +type ListSchedulesOK struct { + Payload *models.ScheduleEntityPaginated +} + +// IsSuccess returns true when this list schedules o k response has a 2xx status code +func (o *ListSchedulesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list schedules o k response has a 3xx status code +func (o *ListSchedulesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list schedules o k response has a 4xx status code +func (o *ListSchedulesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list schedules o k response has a 5xx status code +func (o *ListSchedulesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list schedules o k response a status code equal to that given +func (o *ListSchedulesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListSchedulesOK) Error() string { + return fmt.Sprintf("[GET /v1/schedules][%d] listSchedulesOK %+v", 200, o.Payload) +} + +func (o *ListSchedulesOK) String() string { + return fmt.Sprintf("[GET /v1/schedules][%d] listSchedulesOK %+v", 200, o.Payload) +} + +func (o *ListSchedulesOK) GetPayload() *models.ScheduleEntityPaginated { + return o.Payload +} + +func (o *ListSchedulesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ScheduleEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/teams/list_teams_parameters.go b/client/teams/list_teams_parameters.go new file mode 100644 index 0000000..7ebd941 --- /dev/null +++ b/client/teams/list_teams_parameters.go @@ -0,0 +1,366 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package teams + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListTeamsParams creates a new ListTeamsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListTeamsParams() *ListTeamsParams { + return &ListTeamsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListTeamsParamsWithTimeout creates a new ListTeamsParams object +// with the ability to set a timeout on a request. +func NewListTeamsParamsWithTimeout(timeout time.Duration) *ListTeamsParams { + return &ListTeamsParams{ + timeout: timeout, + } +} + +// NewListTeamsParamsWithContext creates a new ListTeamsParams object +// with the ability to set a context for a request. +func NewListTeamsParamsWithContext(ctx context.Context) *ListTeamsParams { + return &ListTeamsParams{ + Context: ctx, + } +} + +// NewListTeamsParamsWithHTTPClient creates a new ListTeamsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListTeamsParamsWithHTTPClient(client *http.Client) *ListTeamsParams { + return &ListTeamsParams{ + HTTPClient: client, + } +} + +/* +ListTeamsParams contains all the parameters to send to the API endpoint + + for the list teams operation. + + Typically these are written to a http.Request. +*/ +type ListTeamsParams struct { + + /* DefaultIncidentRole. + + Filter by teams that have or do not have members with a default incident role asssigned. Value may be 'present', 'blank', or the ID of an incident role. + */ + DefaultIncidentRole *string + + /* Lite. + + Boolean to determine whether to return a slimified version of the teams object + */ + Lite *bool + + /* Name. + + A query to search teams by their name + */ + Name *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + A query to search teams by their name or description + */ + Query *string + + /* Services. + + A comma separated list of service IDs + */ + Services *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list teams params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTeamsParams) WithDefaults() *ListTeamsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list teams params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTeamsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list teams params +func (o *ListTeamsParams) WithTimeout(timeout time.Duration) *ListTeamsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list teams params +func (o *ListTeamsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list teams params +func (o *ListTeamsParams) WithContext(ctx context.Context) *ListTeamsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list teams params +func (o *ListTeamsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list teams params +func (o *ListTeamsParams) WithHTTPClient(client *http.Client) *ListTeamsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list teams params +func (o *ListTeamsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDefaultIncidentRole adds the defaultIncidentRole to the list teams params +func (o *ListTeamsParams) WithDefaultIncidentRole(defaultIncidentRole *string) *ListTeamsParams { + o.SetDefaultIncidentRole(defaultIncidentRole) + return o +} + +// SetDefaultIncidentRole adds the defaultIncidentRole to the list teams params +func (o *ListTeamsParams) SetDefaultIncidentRole(defaultIncidentRole *string) { + o.DefaultIncidentRole = defaultIncidentRole +} + +// WithLite adds the lite to the list teams params +func (o *ListTeamsParams) WithLite(lite *bool) *ListTeamsParams { + o.SetLite(lite) + return o +} + +// SetLite adds the lite to the list teams params +func (o *ListTeamsParams) SetLite(lite *bool) { + o.Lite = lite +} + +// WithName adds the name to the list teams params +func (o *ListTeamsParams) WithName(name *string) *ListTeamsParams { + o.SetName(name) + return o +} + +// SetName adds the name to the list teams params +func (o *ListTeamsParams) SetName(name *string) { + o.Name = name +} + +// WithPage adds the page to the list teams params +func (o *ListTeamsParams) WithPage(page *int32) *ListTeamsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list teams params +func (o *ListTeamsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list teams params +func (o *ListTeamsParams) WithPerPage(perPage *int32) *ListTeamsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list teams params +func (o *ListTeamsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list teams params +func (o *ListTeamsParams) WithQuery(query *string) *ListTeamsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list teams params +func (o *ListTeamsParams) SetQuery(query *string) { + o.Query = query +} + +// WithServices adds the services to the list teams params +func (o *ListTeamsParams) WithServices(services *string) *ListTeamsParams { + o.SetServices(services) + return o +} + +// SetServices adds the services to the list teams params +func (o *ListTeamsParams) SetServices(services *string) { + o.Services = services +} + +// WriteToRequest writes these params to a swagger request +func (o *ListTeamsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DefaultIncidentRole != nil { + + // query param default_incident_role + var qrDefaultIncidentRole string + + if o.DefaultIncidentRole != nil { + qrDefaultIncidentRole = *o.DefaultIncidentRole + } + qDefaultIncidentRole := qrDefaultIncidentRole + if qDefaultIncidentRole != "" { + + if err := r.SetQueryParam("default_incident_role", qDefaultIncidentRole); err != nil { + return err + } + } + } + + if o.Lite != nil { + + // query param lite + var qrLite bool + + if o.Lite != nil { + qrLite = *o.Lite + } + qLite := swag.FormatBool(qrLite) + if qLite != "" { + + if err := r.SetQueryParam("lite", qLite); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if o.Services != nil { + + // query param services + var qrServices string + + if o.Services != nil { + qrServices = *o.Services + } + qServices := qrServices + if qServices != "" { + + if err := r.SetQueryParam("services", qServices); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/teams/list_teams_responses.go b/client/teams/list_teams_responses.go new file mode 100644 index 0000000..9244e58 --- /dev/null +++ b/client/teams/list_teams_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package teams + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListTeamsReader is a Reader for the ListTeams structure. +type ListTeamsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListTeamsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListTeamsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListTeamsOK creates a ListTeamsOK with default headers values +func NewListTeamsOK() *ListTeamsOK { + return &ListTeamsOK{} +} + +/* +ListTeamsOK describes a response with status code 200, with default header values. + +List all of the teams in the organization +*/ +type ListTeamsOK struct { + Payload *models.TeamEntityPaginated +} + +// IsSuccess returns true when this list teams o k response has a 2xx status code +func (o *ListTeamsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list teams o k response has a 3xx status code +func (o *ListTeamsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list teams o k response has a 4xx status code +func (o *ListTeamsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list teams o k response has a 5xx status code +func (o *ListTeamsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list teams o k response a status code equal to that given +func (o *ListTeamsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListTeamsOK) Error() string { + return fmt.Sprintf("[GET /v1/teams][%d] listTeamsOK %+v", 200, o.Payload) +} + +func (o *ListTeamsOK) String() string { + return fmt.Sprintf("[GET /v1/teams][%d] listTeamsOK %+v", 200, o.Payload) +} + +func (o *ListTeamsOK) GetPayload() *models.TeamEntityPaginated { + return o.Payload +} + +func (o *ListTeamsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TeamEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/teams/teams_client.go b/client/teams/teams_client.go index 5056097..7f5d371 100644 --- a/client/teams/teams_client.go +++ b/client/teams/teams_client.go @@ -30,40 +30,40 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1TeamsTeamID(params *DeleteV1TeamsTeamIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TeamsTeamIDOK, error) + CreateTeam(params *CreateTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTeamCreated, error) - GetV1Schedules(params *GetV1SchedulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SchedulesOK, error) + DeleteTeam(params *DeleteTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTeamOK, error) - GetV1Teams(params *GetV1TeamsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsOK, error) + GetTeam(params *GetTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTeamOK, error) - GetV1TeamsTeamID(params *GetV1TeamsTeamIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDOK, error) + ListSchedules(params *ListSchedulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSchedulesOK, error) - PatchV1TeamsTeamID(params *PatchV1TeamsTeamIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TeamsTeamIDOK, error) + ListTeams(params *ListTeamsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTeamsOK, error) - PostV1Teams(params *PostV1TeamsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TeamsCreated, error) + UpdateTeam(params *UpdateTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTeamOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1TeamsTeamID archives a team +CreateTeam creates a team -Archives an team which will hide it from lists and metrics +Create a new team */ -func (a *Client) DeleteV1TeamsTeamID(params *DeleteV1TeamsTeamIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TeamsTeamIDOK, error) { +func (a *Client) CreateTeam(params *CreateTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTeamCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1TeamsTeamIDParams() + params = NewCreateTeamParams() } op := &runtime.ClientOperation{ - ID: "deleteV1TeamsTeamId", - Method: "DELETE", - PathPattern: "/v1/teams/{team_id}", + ID: "create_team", + Method: "POST", + PathPattern: "/v1/teams", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1TeamsTeamIDReader{formats: a.formats}, + Reader: &CreateTeamReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -76,35 +76,35 @@ func (a *Client) DeleteV1TeamsTeamID(params *DeleteV1TeamsTeamIDParams, authInfo if err != nil { return nil, err } - success, ok := result.(*DeleteV1TeamsTeamIDOK) + success, ok := result.(*CreateTeamCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1TeamsTeamId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_team: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Schedules lists schedules +DeleteTeam archives a team -List all known schedules in FireHydrant as pulled from external sources +Archives an team which will hide it from lists and metrics */ -func (a *Client) GetV1Schedules(params *GetV1SchedulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1SchedulesOK, error) { +func (a *Client) DeleteTeam(params *DeleteTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTeamOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1SchedulesParams() + params = NewDeleteTeamParams() } op := &runtime.ClientOperation{ - ID: "getV1Schedules", - Method: "GET", - PathPattern: "/v1/schedules", + ID: "delete_team", + Method: "DELETE", + PathPattern: "/v1/teams/{team_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1SchedulesReader{formats: a.formats}, + Reader: &DeleteTeamReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -117,35 +117,35 @@ func (a *Client) GetV1Schedules(params *GetV1SchedulesParams, authInfo runtime.C if err != nil { return nil, err } - success, ok := result.(*GetV1SchedulesOK) + success, ok := result.(*DeleteTeamOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Schedules: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_team: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Teams lists teams +GetTeam gets a team -List all of the teams in the organization +Retrieve a single team from its ID */ -func (a *Client) GetV1Teams(params *GetV1TeamsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsOK, error) { +func (a *Client) GetTeam(params *GetTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTeamOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TeamsParams() + params = NewGetTeamParams() } op := &runtime.ClientOperation{ - ID: "getV1Teams", + ID: "get_team", Method: "GET", - PathPattern: "/v1/teams", + PathPattern: "/v1/teams/{team_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TeamsReader{formats: a.formats}, + Reader: &GetTeamReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -158,35 +158,35 @@ func (a *Client) GetV1Teams(params *GetV1TeamsParams, authInfo runtime.ClientAut if err != nil { return nil, err } - success, ok := result.(*GetV1TeamsOK) + success, ok := result.(*GetTeamOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Teams: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_team: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TeamsTeamID gets a team +ListSchedules lists schedules -Retrieve a single team from its ID +List all known schedules in FireHydrant as pulled from external sources */ -func (a *Client) GetV1TeamsTeamID(params *GetV1TeamsTeamIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TeamsTeamIDOK, error) { +func (a *Client) ListSchedules(params *ListSchedulesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSchedulesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TeamsTeamIDParams() + params = NewListSchedulesParams() } op := &runtime.ClientOperation{ - ID: "getV1TeamsTeamId", + ID: "list_schedules", Method: "GET", - PathPattern: "/v1/teams/{team_id}", + PathPattern: "/v1/schedules", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TeamsTeamIDReader{formats: a.formats}, + Reader: &ListSchedulesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -199,35 +199,35 @@ func (a *Client) GetV1TeamsTeamID(params *GetV1TeamsTeamIDParams, authInfo runti if err != nil { return nil, err } - success, ok := result.(*GetV1TeamsTeamIDOK) + success, ok := result.(*ListSchedulesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TeamsTeamId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_schedules: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1TeamsTeamID updates a team +ListTeams lists teams -Update a single team from its ID +List all of the teams in the organization */ -func (a *Client) PatchV1TeamsTeamID(params *PatchV1TeamsTeamIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TeamsTeamIDOK, error) { +func (a *Client) ListTeams(params *ListTeamsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTeamsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1TeamsTeamIDParams() + params = NewListTeamsParams() } op := &runtime.ClientOperation{ - ID: "patchV1TeamsTeamId", - Method: "PATCH", - PathPattern: "/v1/teams/{team_id}", + ID: "list_teams", + Method: "GET", + PathPattern: "/v1/teams", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1TeamsTeamIDReader{formats: a.formats}, + Reader: &ListTeamsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -240,35 +240,35 @@ func (a *Client) PatchV1TeamsTeamID(params *PatchV1TeamsTeamIDParams, authInfo r if err != nil { return nil, err } - success, ok := result.(*PatchV1TeamsTeamIDOK) + success, ok := result.(*ListTeamsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1TeamsTeamId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_teams: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1Teams creates a team +UpdateTeam updates a team -Create a new team +Update a single team from its ID */ -func (a *Client) PostV1Teams(params *PostV1TeamsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TeamsCreated, error) { +func (a *Client) UpdateTeam(params *UpdateTeamParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTeamOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1TeamsParams() + params = NewUpdateTeamParams() } op := &runtime.ClientOperation{ - ID: "postV1Teams", - Method: "POST", - PathPattern: "/v1/teams", + ID: "update_team", + Method: "PATCH", + PathPattern: "/v1/teams/{team_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1TeamsReader{formats: a.formats}, + Reader: &UpdateTeamReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -281,13 +281,13 @@ func (a *Client) PostV1Teams(params *PostV1TeamsParams, authInfo runtime.ClientA if err != nil { return nil, err } - success, ok := result.(*PostV1TeamsCreated) + success, ok := result.(*UpdateTeamOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1Teams: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_team: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/teams/update_team_parameters.go b/client/teams/update_team_parameters.go new file mode 100644 index 0000000..cbd2783 --- /dev/null +++ b/client/teams/update_team_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package teams + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateTeamParams creates a new UpdateTeamParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateTeamParams() *UpdateTeamParams { + return &UpdateTeamParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateTeamParamsWithTimeout creates a new UpdateTeamParams object +// with the ability to set a timeout on a request. +func NewUpdateTeamParamsWithTimeout(timeout time.Duration) *UpdateTeamParams { + return &UpdateTeamParams{ + timeout: timeout, + } +} + +// NewUpdateTeamParamsWithContext creates a new UpdateTeamParams object +// with the ability to set a context for a request. +func NewUpdateTeamParamsWithContext(ctx context.Context) *UpdateTeamParams { + return &UpdateTeamParams{ + Context: ctx, + } +} + +// NewUpdateTeamParamsWithHTTPClient creates a new UpdateTeamParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateTeamParamsWithHTTPClient(client *http.Client) *UpdateTeamParams { + return &UpdateTeamParams{ + HTTPClient: client, + } +} + +/* +UpdateTeamParams contains all the parameters to send to the API endpoint + + for the update team operation. + + Typically these are written to a http.Request. +*/ +type UpdateTeamParams struct { + + // TeamID. + TeamID string + + // UpdateTeam. + UpdateTeam *models.UpdateTeam + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update team params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTeamParams) WithDefaults() *UpdateTeamParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update team params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTeamParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update team params +func (o *UpdateTeamParams) WithTimeout(timeout time.Duration) *UpdateTeamParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update team params +func (o *UpdateTeamParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update team params +func (o *UpdateTeamParams) WithContext(ctx context.Context) *UpdateTeamParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update team params +func (o *UpdateTeamParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update team params +func (o *UpdateTeamParams) WithHTTPClient(client *http.Client) *UpdateTeamParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update team params +func (o *UpdateTeamParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTeamID adds the teamID to the update team params +func (o *UpdateTeamParams) WithTeamID(teamID string) *UpdateTeamParams { + o.SetTeamID(teamID) + return o +} + +// SetTeamID adds the teamId to the update team params +func (o *UpdateTeamParams) SetTeamID(teamID string) { + o.TeamID = teamID +} + +// WithUpdateTeam adds the updateTeam to the update team params +func (o *UpdateTeamParams) WithUpdateTeam(updateTeam *models.UpdateTeam) *UpdateTeamParams { + o.SetUpdateTeam(updateTeam) + return o +} + +// SetUpdateTeam adds the updateTeam to the update team params +func (o *UpdateTeamParams) SetUpdateTeam(updateTeam *models.UpdateTeam) { + o.UpdateTeam = updateTeam +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateTeamParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param team_id + if err := r.SetPathParam("team_id", o.TeamID); err != nil { + return err + } + if o.UpdateTeam != nil { + if err := r.SetBodyParam(o.UpdateTeam); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/teams/update_team_responses.go b/client/teams/update_team_responses.go new file mode 100644 index 0000000..6e46d70 --- /dev/null +++ b/client/teams/update_team_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package teams + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateTeamReader is a Reader for the UpdateTeam structure. +type UpdateTeamReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateTeamReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateTeamOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateTeamOK creates a UpdateTeamOK with default headers values +func NewUpdateTeamOK() *UpdateTeamOK { + return &UpdateTeamOK{} +} + +/* +UpdateTeamOK describes a response with status code 200, with default header values. + +Update a single team from its ID +*/ +type UpdateTeamOK struct { + Payload *models.TeamEntity +} + +// IsSuccess returns true when this update team o k response has a 2xx status code +func (o *UpdateTeamOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update team o k response has a 3xx status code +func (o *UpdateTeamOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update team o k response has a 4xx status code +func (o *UpdateTeamOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update team o k response has a 5xx status code +func (o *UpdateTeamOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update team o k response a status code equal to that given +func (o *UpdateTeamOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateTeamOK) Error() string { + return fmt.Sprintf("[PATCH /v1/teams/{team_id}][%d] updateTeamOK %+v", 200, o.Payload) +} + +func (o *UpdateTeamOK) String() string { + return fmt.Sprintf("[PATCH /v1/teams/{team_id}][%d] updateTeamOK %+v", 200, o.Payload) +} + +func (o *UpdateTeamOK) GetPayload() *models.TeamEntity { + return o.Payload +} + +func (o *UpdateTeamOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TeamEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/create_inbound_field_map_parameters.go b/client/ticketing/create_inbound_field_map_parameters.go new file mode 100644 index 0000000..7c22aa9 --- /dev/null +++ b/client/ticketing/create_inbound_field_map_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateInboundFieldMapParams creates a new CreateInboundFieldMapParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateInboundFieldMapParams() *CreateInboundFieldMapParams { + return &CreateInboundFieldMapParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateInboundFieldMapParamsWithTimeout creates a new CreateInboundFieldMapParams object +// with the ability to set a timeout on a request. +func NewCreateInboundFieldMapParamsWithTimeout(timeout time.Duration) *CreateInboundFieldMapParams { + return &CreateInboundFieldMapParams{ + timeout: timeout, + } +} + +// NewCreateInboundFieldMapParamsWithContext creates a new CreateInboundFieldMapParams object +// with the ability to set a context for a request. +func NewCreateInboundFieldMapParamsWithContext(ctx context.Context) *CreateInboundFieldMapParams { + return &CreateInboundFieldMapParams{ + Context: ctx, + } +} + +// NewCreateInboundFieldMapParamsWithHTTPClient creates a new CreateInboundFieldMapParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateInboundFieldMapParamsWithHTTPClient(client *http.Client) *CreateInboundFieldMapParams { + return &CreateInboundFieldMapParams{ + HTTPClient: client, + } +} + +/* +CreateInboundFieldMapParams contains all the parameters to send to the API endpoint + + for the create inbound field map operation. + + Typically these are written to a http.Request. +*/ +type CreateInboundFieldMapParams struct { + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create inbound field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateInboundFieldMapParams) WithDefaults() *CreateInboundFieldMapParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create inbound field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateInboundFieldMapParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create inbound field map params +func (o *CreateInboundFieldMapParams) WithTimeout(timeout time.Duration) *CreateInboundFieldMapParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create inbound field map params +func (o *CreateInboundFieldMapParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create inbound field map params +func (o *CreateInboundFieldMapParams) WithContext(ctx context.Context) *CreateInboundFieldMapParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create inbound field map params +func (o *CreateInboundFieldMapParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create inbound field map params +func (o *CreateInboundFieldMapParams) WithHTTPClient(client *http.Client) *CreateInboundFieldMapParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create inbound field map params +func (o *CreateInboundFieldMapParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTicketingProjectID adds the ticketingProjectID to the create inbound field map params +func (o *CreateInboundFieldMapParams) WithTicketingProjectID(ticketingProjectID string) *CreateInboundFieldMapParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the create inbound field map params +func (o *CreateInboundFieldMapParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateInboundFieldMapParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/create_inbound_field_map_responses.go b/client/ticketing/create_inbound_field_map_responses.go new file mode 100644 index 0000000..5f7f723 --- /dev/null +++ b/client/ticketing/create_inbound_field_map_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateInboundFieldMapReader is a Reader for the CreateInboundFieldMap structure. +type CreateInboundFieldMapReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateInboundFieldMapReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateInboundFieldMapCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateInboundFieldMapCreated creates a CreateInboundFieldMapCreated with default headers values +func NewCreateInboundFieldMapCreated() *CreateInboundFieldMapCreated { + return &CreateInboundFieldMapCreated{} +} + +/* +CreateInboundFieldMapCreated describes a response with status code 201, with default header values. + +Creates inbound field map for a ticketing project +*/ +type CreateInboundFieldMapCreated struct { + Payload *models.TicketingProjectInboundFieldMapEntity +} + +// IsSuccess returns true when this create inbound field map created response has a 2xx status code +func (o *CreateInboundFieldMapCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create inbound field map created response has a 3xx status code +func (o *CreateInboundFieldMapCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create inbound field map created response has a 4xx status code +func (o *CreateInboundFieldMapCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create inbound field map created response has a 5xx status code +func (o *CreateInboundFieldMapCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create inbound field map created response a status code equal to that given +func (o *CreateInboundFieldMapCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateInboundFieldMapCreated) Error() string { + return fmt.Sprintf("[POST /v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps][%d] createInboundFieldMapCreated %+v", 201, o.Payload) +} + +func (o *CreateInboundFieldMapCreated) String() string { + return fmt.Sprintf("[POST /v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps][%d] createInboundFieldMapCreated %+v", 201, o.Payload) +} + +func (o *CreateInboundFieldMapCreated) GetPayload() *models.TicketingProjectInboundFieldMapEntity { + return o.Payload +} + +func (o *CreateInboundFieldMapCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingProjectInboundFieldMapEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/create_ticket_parameters.go b/client/ticketing/create_ticket_parameters.go new file mode 100644 index 0000000..28437fb --- /dev/null +++ b/client/ticketing/create_ticket_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateTicketParams creates a new CreateTicketParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateTicketParams() *CreateTicketParams { + return &CreateTicketParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateTicketParamsWithTimeout creates a new CreateTicketParams object +// with the ability to set a timeout on a request. +func NewCreateTicketParamsWithTimeout(timeout time.Duration) *CreateTicketParams { + return &CreateTicketParams{ + timeout: timeout, + } +} + +// NewCreateTicketParamsWithContext creates a new CreateTicketParams object +// with the ability to set a context for a request. +func NewCreateTicketParamsWithContext(ctx context.Context) *CreateTicketParams { + return &CreateTicketParams{ + Context: ctx, + } +} + +// NewCreateTicketParamsWithHTTPClient creates a new CreateTicketParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateTicketParamsWithHTTPClient(client *http.Client) *CreateTicketParams { + return &CreateTicketParams{ + HTTPClient: client, + } +} + +/* +CreateTicketParams contains all the parameters to send to the API endpoint + + for the create ticket operation. + + Typically these are written to a http.Request. +*/ +type CreateTicketParams struct { + + // CreateTicket. + CreateTicket *models.CreateTicket + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create ticket params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTicketParams) WithDefaults() *CreateTicketParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create ticket params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTicketParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create ticket params +func (o *CreateTicketParams) WithTimeout(timeout time.Duration) *CreateTicketParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create ticket params +func (o *CreateTicketParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create ticket params +func (o *CreateTicketParams) WithContext(ctx context.Context) *CreateTicketParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create ticket params +func (o *CreateTicketParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create ticket params +func (o *CreateTicketParams) WithHTTPClient(client *http.Client) *CreateTicketParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create ticket params +func (o *CreateTicketParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateTicket adds the createTicket to the create ticket params +func (o *CreateTicketParams) WithCreateTicket(createTicket *models.CreateTicket) *CreateTicketParams { + o.SetCreateTicket(createTicket) + return o +} + +// SetCreateTicket adds the createTicket to the create ticket params +func (o *CreateTicketParams) SetCreateTicket(createTicket *models.CreateTicket) { + o.CreateTicket = createTicket +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateTicketParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateTicket != nil { + if err := r.SetBodyParam(o.CreateTicket); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/create_ticket_responses.go b/client/ticketing/create_ticket_responses.go new file mode 100644 index 0000000..9e7869e --- /dev/null +++ b/client/ticketing/create_ticket_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateTicketReader is a Reader for the CreateTicket structure. +type CreateTicketReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateTicketReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateTicketCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateTicketCreated creates a CreateTicketCreated with default headers values +func NewCreateTicketCreated() *CreateTicketCreated { + return &CreateTicketCreated{} +} + +/* +CreateTicketCreated describes a response with status code 201, with default header values. + +Creates a ticket for a project +*/ +type CreateTicketCreated struct { + Payload *models.TicketingTicketEntity +} + +// IsSuccess returns true when this create ticket created response has a 2xx status code +func (o *CreateTicketCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create ticket created response has a 3xx status code +func (o *CreateTicketCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create ticket created response has a 4xx status code +func (o *CreateTicketCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create ticket created response has a 5xx status code +func (o *CreateTicketCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create ticket created response a status code equal to that given +func (o *CreateTicketCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateTicketCreated) Error() string { + return fmt.Sprintf("[POST /v1/ticketing/tickets][%d] createTicketCreated %+v", 201, o.Payload) +} + +func (o *CreateTicketCreated) String() string { + return fmt.Sprintf("[POST /v1/ticketing/tickets][%d] createTicketCreated %+v", 201, o.Payload) +} + +func (o *CreateTicketCreated) GetPayload() *models.TicketingTicketEntity { + return o.Payload +} + +func (o *CreateTicketCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingTicketEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/create_ticketing_field_map_parameters.go b/client/ticketing/create_ticketing_field_map_parameters.go new file mode 100644 index 0000000..0954cf3 --- /dev/null +++ b/client/ticketing/create_ticketing_field_map_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateTicketingFieldMapParams creates a new CreateTicketingFieldMapParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateTicketingFieldMapParams() *CreateTicketingFieldMapParams { + return &CreateTicketingFieldMapParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateTicketingFieldMapParamsWithTimeout creates a new CreateTicketingFieldMapParams object +// with the ability to set a timeout on a request. +func NewCreateTicketingFieldMapParamsWithTimeout(timeout time.Duration) *CreateTicketingFieldMapParams { + return &CreateTicketingFieldMapParams{ + timeout: timeout, + } +} + +// NewCreateTicketingFieldMapParamsWithContext creates a new CreateTicketingFieldMapParams object +// with the ability to set a context for a request. +func NewCreateTicketingFieldMapParamsWithContext(ctx context.Context) *CreateTicketingFieldMapParams { + return &CreateTicketingFieldMapParams{ + Context: ctx, + } +} + +// NewCreateTicketingFieldMapParamsWithHTTPClient creates a new CreateTicketingFieldMapParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateTicketingFieldMapParamsWithHTTPClient(client *http.Client) *CreateTicketingFieldMapParams { + return &CreateTicketingFieldMapParams{ + HTTPClient: client, + } +} + +/* +CreateTicketingFieldMapParams contains all the parameters to send to the API endpoint + + for the create ticketing field map operation. + + Typically these are written to a http.Request. +*/ +type CreateTicketingFieldMapParams struct { + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create ticketing field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTicketingFieldMapParams) WithDefaults() *CreateTicketingFieldMapParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create ticketing field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTicketingFieldMapParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create ticketing field map params +func (o *CreateTicketingFieldMapParams) WithTimeout(timeout time.Duration) *CreateTicketingFieldMapParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create ticketing field map params +func (o *CreateTicketingFieldMapParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create ticketing field map params +func (o *CreateTicketingFieldMapParams) WithContext(ctx context.Context) *CreateTicketingFieldMapParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create ticketing field map params +func (o *CreateTicketingFieldMapParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create ticketing field map params +func (o *CreateTicketingFieldMapParams) WithHTTPClient(client *http.Client) *CreateTicketingFieldMapParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create ticketing field map params +func (o *CreateTicketingFieldMapParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTicketingProjectID adds the ticketingProjectID to the create ticketing field map params +func (o *CreateTicketingFieldMapParams) WithTicketingProjectID(ticketingProjectID string) *CreateTicketingFieldMapParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the create ticketing field map params +func (o *CreateTicketingFieldMapParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateTicketingFieldMapParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/create_ticketing_field_map_responses.go b/client/ticketing/create_ticketing_field_map_responses.go new file mode 100644 index 0000000..15a9b63 --- /dev/null +++ b/client/ticketing/create_ticketing_field_map_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateTicketingFieldMapReader is a Reader for the CreateTicketingFieldMap structure. +type CreateTicketingFieldMapReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateTicketingFieldMapReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateTicketingFieldMapCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateTicketingFieldMapCreated creates a CreateTicketingFieldMapCreated with default headers values +func NewCreateTicketingFieldMapCreated() *CreateTicketingFieldMapCreated { + return &CreateTicketingFieldMapCreated{} +} + +/* +CreateTicketingFieldMapCreated describes a response with status code 201, with default header values. + +Creates field map for a ticketing project +*/ +type CreateTicketingFieldMapCreated struct { + Payload *models.TicketingProjectFieldMapEntity +} + +// IsSuccess returns true when this create ticketing field map created response has a 2xx status code +func (o *CreateTicketingFieldMapCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create ticketing field map created response has a 3xx status code +func (o *CreateTicketingFieldMapCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create ticketing field map created response has a 4xx status code +func (o *CreateTicketingFieldMapCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create ticketing field map created response has a 5xx status code +func (o *CreateTicketingFieldMapCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create ticketing field map created response a status code equal to that given +func (o *CreateTicketingFieldMapCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateTicketingFieldMapCreated) Error() string { + return fmt.Sprintf("[POST /v1/ticketing/projects/{ticketing_project_id}/field_maps][%d] createTicketingFieldMapCreated %+v", 201, o.Payload) +} + +func (o *CreateTicketingFieldMapCreated) String() string { + return fmt.Sprintf("[POST /v1/ticketing/projects/{ticketing_project_id}/field_maps][%d] createTicketingFieldMapCreated %+v", 201, o.Payload) +} + +func (o *CreateTicketingFieldMapCreated) GetPayload() *models.TicketingProjectFieldMapEntity { + return o.Payload +} + +func (o *CreateTicketingFieldMapCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingProjectFieldMapEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/create_ticketing_priority_parameters.go b/client/ticketing/create_ticketing_priority_parameters.go new file mode 100644 index 0000000..ef1b25b --- /dev/null +++ b/client/ticketing/create_ticketing_priority_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateTicketingPriorityParams creates a new CreateTicketingPriorityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateTicketingPriorityParams() *CreateTicketingPriorityParams { + return &CreateTicketingPriorityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateTicketingPriorityParamsWithTimeout creates a new CreateTicketingPriorityParams object +// with the ability to set a timeout on a request. +func NewCreateTicketingPriorityParamsWithTimeout(timeout time.Duration) *CreateTicketingPriorityParams { + return &CreateTicketingPriorityParams{ + timeout: timeout, + } +} + +// NewCreateTicketingPriorityParamsWithContext creates a new CreateTicketingPriorityParams object +// with the ability to set a context for a request. +func NewCreateTicketingPriorityParamsWithContext(ctx context.Context) *CreateTicketingPriorityParams { + return &CreateTicketingPriorityParams{ + Context: ctx, + } +} + +// NewCreateTicketingPriorityParamsWithHTTPClient creates a new CreateTicketingPriorityParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateTicketingPriorityParamsWithHTTPClient(client *http.Client) *CreateTicketingPriorityParams { + return &CreateTicketingPriorityParams{ + HTTPClient: client, + } +} + +/* +CreateTicketingPriorityParams contains all the parameters to send to the API endpoint + + for the create ticketing priority operation. + + Typically these are written to a http.Request. +*/ +type CreateTicketingPriorityParams struct { + + // CreateTicketingPriority. + CreateTicketingPriority *models.CreateTicketingPriority + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create ticketing priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTicketingPriorityParams) WithDefaults() *CreateTicketingPriorityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create ticketing priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTicketingPriorityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create ticketing priority params +func (o *CreateTicketingPriorityParams) WithTimeout(timeout time.Duration) *CreateTicketingPriorityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create ticketing priority params +func (o *CreateTicketingPriorityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create ticketing priority params +func (o *CreateTicketingPriorityParams) WithContext(ctx context.Context) *CreateTicketingPriorityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create ticketing priority params +func (o *CreateTicketingPriorityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create ticketing priority params +func (o *CreateTicketingPriorityParams) WithHTTPClient(client *http.Client) *CreateTicketingPriorityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create ticketing priority params +func (o *CreateTicketingPriorityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateTicketingPriority adds the createTicketingPriority to the create ticketing priority params +func (o *CreateTicketingPriorityParams) WithCreateTicketingPriority(createTicketingPriority *models.CreateTicketingPriority) *CreateTicketingPriorityParams { + o.SetCreateTicketingPriority(createTicketingPriority) + return o +} + +// SetCreateTicketingPriority adds the createTicketingPriority to the create ticketing priority params +func (o *CreateTicketingPriorityParams) SetCreateTicketingPriority(createTicketingPriority *models.CreateTicketingPriority) { + o.CreateTicketingPriority = createTicketingPriority +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateTicketingPriorityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateTicketingPriority != nil { + if err := r.SetBodyParam(o.CreateTicketingPriority); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/create_ticketing_priority_responses.go b/client/ticketing/create_ticketing_priority_responses.go new file mode 100644 index 0000000..7553c23 --- /dev/null +++ b/client/ticketing/create_ticketing_priority_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateTicketingPriorityReader is a Reader for the CreateTicketingPriority structure. +type CreateTicketingPriorityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateTicketingPriorityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateTicketingPriorityCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateTicketingPriorityCreated creates a CreateTicketingPriorityCreated with default headers values +func NewCreateTicketingPriorityCreated() *CreateTicketingPriorityCreated { + return &CreateTicketingPriorityCreated{} +} + +/* +CreateTicketingPriorityCreated describes a response with status code 201, with default header values. + +Create a single ticketing priority +*/ +type CreateTicketingPriorityCreated struct { + Payload *models.TicketingPriorityEntity +} + +// IsSuccess returns true when this create ticketing priority created response has a 2xx status code +func (o *CreateTicketingPriorityCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create ticketing priority created response has a 3xx status code +func (o *CreateTicketingPriorityCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create ticketing priority created response has a 4xx status code +func (o *CreateTicketingPriorityCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create ticketing priority created response has a 5xx status code +func (o *CreateTicketingPriorityCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create ticketing priority created response a status code equal to that given +func (o *CreateTicketingPriorityCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateTicketingPriorityCreated) Error() string { + return fmt.Sprintf("[POST /v1/ticketing/priorities][%d] createTicketingPriorityCreated %+v", 201, o.Payload) +} + +func (o *CreateTicketingPriorityCreated) String() string { + return fmt.Sprintf("[POST /v1/ticketing/priorities][%d] createTicketingPriorityCreated %+v", 201, o.Payload) +} + +func (o *CreateTicketingPriorityCreated) GetPayload() *models.TicketingPriorityEntity { + return o.Payload +} + +func (o *CreateTicketingPriorityCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingPriorityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/create_ticketing_project_config_parameters.go b/client/ticketing/create_ticketing_project_config_parameters.go new file mode 100644 index 0000000..f4f48e6 --- /dev/null +++ b/client/ticketing/create_ticketing_project_config_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateTicketingProjectConfigParams creates a new CreateTicketingProjectConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateTicketingProjectConfigParams() *CreateTicketingProjectConfigParams { + return &CreateTicketingProjectConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateTicketingProjectConfigParamsWithTimeout creates a new CreateTicketingProjectConfigParams object +// with the ability to set a timeout on a request. +func NewCreateTicketingProjectConfigParamsWithTimeout(timeout time.Duration) *CreateTicketingProjectConfigParams { + return &CreateTicketingProjectConfigParams{ + timeout: timeout, + } +} + +// NewCreateTicketingProjectConfigParamsWithContext creates a new CreateTicketingProjectConfigParams object +// with the ability to set a context for a request. +func NewCreateTicketingProjectConfigParamsWithContext(ctx context.Context) *CreateTicketingProjectConfigParams { + return &CreateTicketingProjectConfigParams{ + Context: ctx, + } +} + +// NewCreateTicketingProjectConfigParamsWithHTTPClient creates a new CreateTicketingProjectConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateTicketingProjectConfigParamsWithHTTPClient(client *http.Client) *CreateTicketingProjectConfigParams { + return &CreateTicketingProjectConfigParams{ + HTTPClient: client, + } +} + +/* +CreateTicketingProjectConfigParams contains all the parameters to send to the API endpoint + + for the create ticketing project config operation. + + Typically these are written to a http.Request. +*/ +type CreateTicketingProjectConfigParams struct { + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create ticketing project config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTicketingProjectConfigParams) WithDefaults() *CreateTicketingProjectConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create ticketing project config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateTicketingProjectConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create ticketing project config params +func (o *CreateTicketingProjectConfigParams) WithTimeout(timeout time.Duration) *CreateTicketingProjectConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create ticketing project config params +func (o *CreateTicketingProjectConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create ticketing project config params +func (o *CreateTicketingProjectConfigParams) WithContext(ctx context.Context) *CreateTicketingProjectConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create ticketing project config params +func (o *CreateTicketingProjectConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create ticketing project config params +func (o *CreateTicketingProjectConfigParams) WithHTTPClient(client *http.Client) *CreateTicketingProjectConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create ticketing project config params +func (o *CreateTicketingProjectConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTicketingProjectID adds the ticketingProjectID to the create ticketing project config params +func (o *CreateTicketingProjectConfigParams) WithTicketingProjectID(ticketingProjectID string) *CreateTicketingProjectConfigParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the create ticketing project config params +func (o *CreateTicketingProjectConfigParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateTicketingProjectConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/create_ticketing_project_config_responses.go b/client/ticketing/create_ticketing_project_config_responses.go new file mode 100644 index 0000000..c4df464 --- /dev/null +++ b/client/ticketing/create_ticketing_project_config_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateTicketingProjectConfigReader is a Reader for the CreateTicketingProjectConfig structure. +type CreateTicketingProjectConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateTicketingProjectConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateTicketingProjectConfigCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateTicketingProjectConfigCreated creates a CreateTicketingProjectConfigCreated with default headers values +func NewCreateTicketingProjectConfigCreated() *CreateTicketingProjectConfigCreated { + return &CreateTicketingProjectConfigCreated{} +} + +/* +CreateTicketingProjectConfigCreated describes a response with status code 201, with default header values. + +Creates configuration for a ticketing project +*/ +type CreateTicketingProjectConfigCreated struct { + Payload *models.TicketingProjectConfigEntity +} + +// IsSuccess returns true when this create ticketing project config created response has a 2xx status code +func (o *CreateTicketingProjectConfigCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create ticketing project config created response has a 3xx status code +func (o *CreateTicketingProjectConfigCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create ticketing project config created response has a 4xx status code +func (o *CreateTicketingProjectConfigCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create ticketing project config created response has a 5xx status code +func (o *CreateTicketingProjectConfigCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create ticketing project config created response a status code equal to that given +func (o *CreateTicketingProjectConfigCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateTicketingProjectConfigCreated) Error() string { + return fmt.Sprintf("[POST /v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations][%d] createTicketingProjectConfigCreated %+v", 201, o.Payload) +} + +func (o *CreateTicketingProjectConfigCreated) String() string { + return fmt.Sprintf("[POST /v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations][%d] createTicketingProjectConfigCreated %+v", 201, o.Payload) +} + +func (o *CreateTicketingProjectConfigCreated) GetPayload() *models.TicketingProjectConfigEntity { + return o.Payload +} + +func (o *CreateTicketingProjectConfigCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingProjectConfigEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/delete_inbound_field_map_parameters.go b/client/ticketing/delete_inbound_field_map_parameters.go new file mode 100644 index 0000000..6cfc316 --- /dev/null +++ b/client/ticketing/delete_inbound_field_map_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteInboundFieldMapParams creates a new DeleteInboundFieldMapParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteInboundFieldMapParams() *DeleteInboundFieldMapParams { + return &DeleteInboundFieldMapParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteInboundFieldMapParamsWithTimeout creates a new DeleteInboundFieldMapParams object +// with the ability to set a timeout on a request. +func NewDeleteInboundFieldMapParamsWithTimeout(timeout time.Duration) *DeleteInboundFieldMapParams { + return &DeleteInboundFieldMapParams{ + timeout: timeout, + } +} + +// NewDeleteInboundFieldMapParamsWithContext creates a new DeleteInboundFieldMapParams object +// with the ability to set a context for a request. +func NewDeleteInboundFieldMapParamsWithContext(ctx context.Context) *DeleteInboundFieldMapParams { + return &DeleteInboundFieldMapParams{ + Context: ctx, + } +} + +// NewDeleteInboundFieldMapParamsWithHTTPClient creates a new DeleteInboundFieldMapParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteInboundFieldMapParamsWithHTTPClient(client *http.Client) *DeleteInboundFieldMapParams { + return &DeleteInboundFieldMapParams{ + HTTPClient: client, + } +} + +/* +DeleteInboundFieldMapParams contains all the parameters to send to the API endpoint + + for the delete inbound field map operation. + + Typically these are written to a http.Request. +*/ +type DeleteInboundFieldMapParams struct { + + // MapID. + MapID string + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete inbound field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteInboundFieldMapParams) WithDefaults() *DeleteInboundFieldMapParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete inbound field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteInboundFieldMapParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete inbound field map params +func (o *DeleteInboundFieldMapParams) WithTimeout(timeout time.Duration) *DeleteInboundFieldMapParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete inbound field map params +func (o *DeleteInboundFieldMapParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete inbound field map params +func (o *DeleteInboundFieldMapParams) WithContext(ctx context.Context) *DeleteInboundFieldMapParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete inbound field map params +func (o *DeleteInboundFieldMapParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete inbound field map params +func (o *DeleteInboundFieldMapParams) WithHTTPClient(client *http.Client) *DeleteInboundFieldMapParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete inbound field map params +func (o *DeleteInboundFieldMapParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMapID adds the mapID to the delete inbound field map params +func (o *DeleteInboundFieldMapParams) WithMapID(mapID string) *DeleteInboundFieldMapParams { + o.SetMapID(mapID) + return o +} + +// SetMapID adds the mapId to the delete inbound field map params +func (o *DeleteInboundFieldMapParams) SetMapID(mapID string) { + o.MapID = mapID +} + +// WithTicketingProjectID adds the ticketingProjectID to the delete inbound field map params +func (o *DeleteInboundFieldMapParams) WithTicketingProjectID(ticketingProjectID string) *DeleteInboundFieldMapParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the delete inbound field map params +func (o *DeleteInboundFieldMapParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteInboundFieldMapParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param map_id + if err := r.SetPathParam("map_id", o.MapID); err != nil { + return err + } + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/delete_inbound_field_map_responses.go b/client/ticketing/delete_inbound_field_map_responses.go new file mode 100644 index 0000000..759f432 --- /dev/null +++ b/client/ticketing/delete_inbound_field_map_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteInboundFieldMapReader is a Reader for the DeleteInboundFieldMap structure. +type DeleteInboundFieldMapReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteInboundFieldMapReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteInboundFieldMapNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteInboundFieldMapNoContent creates a DeleteInboundFieldMapNoContent with default headers values +func NewDeleteInboundFieldMapNoContent() *DeleteInboundFieldMapNoContent { + return &DeleteInboundFieldMapNoContent{} +} + +/* +DeleteInboundFieldMapNoContent describes a response with status code 204, with default header values. + +Archive inbound field map for a ticketing project +*/ +type DeleteInboundFieldMapNoContent struct { +} + +// IsSuccess returns true when this delete inbound field map no content response has a 2xx status code +func (o *DeleteInboundFieldMapNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete inbound field map no content response has a 3xx status code +func (o *DeleteInboundFieldMapNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete inbound field map no content response has a 4xx status code +func (o *DeleteInboundFieldMapNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete inbound field map no content response has a 5xx status code +func (o *DeleteInboundFieldMapNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete inbound field map no content response a status code equal to that given +func (o *DeleteInboundFieldMapNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteInboundFieldMapNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/{map_id}][%d] deleteInboundFieldMapNoContent ", 204) +} + +func (o *DeleteInboundFieldMapNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/{map_id}][%d] deleteInboundFieldMapNoContent ", 204) +} + +func (o *DeleteInboundFieldMapNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/ticketing/delete_ticket_parameters.go b/client/ticketing/delete_ticket_parameters.go new file mode 100644 index 0000000..bfca885 --- /dev/null +++ b/client/ticketing/delete_ticket_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTicketParams creates a new DeleteTicketParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTicketParams() *DeleteTicketParams { + return &DeleteTicketParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTicketParamsWithTimeout creates a new DeleteTicketParams object +// with the ability to set a timeout on a request. +func NewDeleteTicketParamsWithTimeout(timeout time.Duration) *DeleteTicketParams { + return &DeleteTicketParams{ + timeout: timeout, + } +} + +// NewDeleteTicketParamsWithContext creates a new DeleteTicketParams object +// with the ability to set a context for a request. +func NewDeleteTicketParamsWithContext(ctx context.Context) *DeleteTicketParams { + return &DeleteTicketParams{ + Context: ctx, + } +} + +// NewDeleteTicketParamsWithHTTPClient creates a new DeleteTicketParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTicketParamsWithHTTPClient(client *http.Client) *DeleteTicketParams { + return &DeleteTicketParams{ + HTTPClient: client, + } +} + +/* +DeleteTicketParams contains all the parameters to send to the API endpoint + + for the delete ticket operation. + + Typically these are written to a http.Request. +*/ +type DeleteTicketParams struct { + + // TicketID. + TicketID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete ticket params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTicketParams) WithDefaults() *DeleteTicketParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete ticket params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTicketParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete ticket params +func (o *DeleteTicketParams) WithTimeout(timeout time.Duration) *DeleteTicketParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete ticket params +func (o *DeleteTicketParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete ticket params +func (o *DeleteTicketParams) WithContext(ctx context.Context) *DeleteTicketParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete ticket params +func (o *DeleteTicketParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete ticket params +func (o *DeleteTicketParams) WithHTTPClient(client *http.Client) *DeleteTicketParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete ticket params +func (o *DeleteTicketParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTicketID adds the ticketID to the delete ticket params +func (o *DeleteTicketParams) WithTicketID(ticketID string) *DeleteTicketParams { + o.SetTicketID(ticketID) + return o +} + +// SetTicketID adds the ticketId to the delete ticket params +func (o *DeleteTicketParams) SetTicketID(ticketID string) { + o.TicketID = ticketID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTicketParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param ticket_id + if err := r.SetPathParam("ticket_id", o.TicketID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/delete_ticket_responses.go b/client/ticketing/delete_ticket_responses.go new file mode 100644 index 0000000..7e9addd --- /dev/null +++ b/client/ticketing/delete_ticket_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteTicketReader is a Reader for the DeleteTicket structure. +type DeleteTicketReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTicketReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteTicketNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTicketNoContent creates a DeleteTicketNoContent with default headers values +func NewDeleteTicketNoContent() *DeleteTicketNoContent { + return &DeleteTicketNoContent{} +} + +/* +DeleteTicketNoContent describes a response with status code 204, with default header values. + +Archive a ticket +*/ +type DeleteTicketNoContent struct { +} + +// IsSuccess returns true when this delete ticket no content response has a 2xx status code +func (o *DeleteTicketNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete ticket no content response has a 3xx status code +func (o *DeleteTicketNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete ticket no content response has a 4xx status code +func (o *DeleteTicketNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete ticket no content response has a 5xx status code +func (o *DeleteTicketNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete ticket no content response a status code equal to that given +func (o *DeleteTicketNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteTicketNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/ticketing/tickets/{ticket_id}][%d] deleteTicketNoContent ", 204) +} + +func (o *DeleteTicketNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/ticketing/tickets/{ticket_id}][%d] deleteTicketNoContent ", 204) +} + +func (o *DeleteTicketNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/ticketing/delete_ticketing_field_map_parameters.go b/client/ticketing/delete_ticketing_field_map_parameters.go new file mode 100644 index 0000000..8527c4b --- /dev/null +++ b/client/ticketing/delete_ticketing_field_map_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTicketingFieldMapParams creates a new DeleteTicketingFieldMapParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTicketingFieldMapParams() *DeleteTicketingFieldMapParams { + return &DeleteTicketingFieldMapParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTicketingFieldMapParamsWithTimeout creates a new DeleteTicketingFieldMapParams object +// with the ability to set a timeout on a request. +func NewDeleteTicketingFieldMapParamsWithTimeout(timeout time.Duration) *DeleteTicketingFieldMapParams { + return &DeleteTicketingFieldMapParams{ + timeout: timeout, + } +} + +// NewDeleteTicketingFieldMapParamsWithContext creates a new DeleteTicketingFieldMapParams object +// with the ability to set a context for a request. +func NewDeleteTicketingFieldMapParamsWithContext(ctx context.Context) *DeleteTicketingFieldMapParams { + return &DeleteTicketingFieldMapParams{ + Context: ctx, + } +} + +// NewDeleteTicketingFieldMapParamsWithHTTPClient creates a new DeleteTicketingFieldMapParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTicketingFieldMapParamsWithHTTPClient(client *http.Client) *DeleteTicketingFieldMapParams { + return &DeleteTicketingFieldMapParams{ + HTTPClient: client, + } +} + +/* +DeleteTicketingFieldMapParams contains all the parameters to send to the API endpoint + + for the delete ticketing field map operation. + + Typically these are written to a http.Request. +*/ +type DeleteTicketingFieldMapParams struct { + + // MapID. + MapID string + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete ticketing field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTicketingFieldMapParams) WithDefaults() *DeleteTicketingFieldMapParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete ticketing field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTicketingFieldMapParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete ticketing field map params +func (o *DeleteTicketingFieldMapParams) WithTimeout(timeout time.Duration) *DeleteTicketingFieldMapParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete ticketing field map params +func (o *DeleteTicketingFieldMapParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete ticketing field map params +func (o *DeleteTicketingFieldMapParams) WithContext(ctx context.Context) *DeleteTicketingFieldMapParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete ticketing field map params +func (o *DeleteTicketingFieldMapParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete ticketing field map params +func (o *DeleteTicketingFieldMapParams) WithHTTPClient(client *http.Client) *DeleteTicketingFieldMapParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete ticketing field map params +func (o *DeleteTicketingFieldMapParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMapID adds the mapID to the delete ticketing field map params +func (o *DeleteTicketingFieldMapParams) WithMapID(mapID string) *DeleteTicketingFieldMapParams { + o.SetMapID(mapID) + return o +} + +// SetMapID adds the mapId to the delete ticketing field map params +func (o *DeleteTicketingFieldMapParams) SetMapID(mapID string) { + o.MapID = mapID +} + +// WithTicketingProjectID adds the ticketingProjectID to the delete ticketing field map params +func (o *DeleteTicketingFieldMapParams) WithTicketingProjectID(ticketingProjectID string) *DeleteTicketingFieldMapParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the delete ticketing field map params +func (o *DeleteTicketingFieldMapParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTicketingFieldMapParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param map_id + if err := r.SetPathParam("map_id", o.MapID); err != nil { + return err + } + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/delete_ticketing_field_map_responses.go b/client/ticketing/delete_ticketing_field_map_responses.go new file mode 100644 index 0000000..2d05562 --- /dev/null +++ b/client/ticketing/delete_ticketing_field_map_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteTicketingFieldMapReader is a Reader for the DeleteTicketingFieldMap structure. +type DeleteTicketingFieldMapReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTicketingFieldMapReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteTicketingFieldMapNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTicketingFieldMapNoContent creates a DeleteTicketingFieldMapNoContent with default headers values +func NewDeleteTicketingFieldMapNoContent() *DeleteTicketingFieldMapNoContent { + return &DeleteTicketingFieldMapNoContent{} +} + +/* +DeleteTicketingFieldMapNoContent describes a response with status code 204, with default header values. + +Archive field map for a ticketing project +*/ +type DeleteTicketingFieldMapNoContent struct { +} + +// IsSuccess returns true when this delete ticketing field map no content response has a 2xx status code +func (o *DeleteTicketingFieldMapNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete ticketing field map no content response has a 3xx status code +func (o *DeleteTicketingFieldMapNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete ticketing field map no content response has a 4xx status code +func (o *DeleteTicketingFieldMapNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete ticketing field map no content response has a 5xx status code +func (o *DeleteTicketingFieldMapNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete ticketing field map no content response a status code equal to that given +func (o *DeleteTicketingFieldMapNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteTicketingFieldMapNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/ticketing/projects/{ticketing_project_id}/field_maps/{map_id}][%d] deleteTicketingFieldMapNoContent ", 204) +} + +func (o *DeleteTicketingFieldMapNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/ticketing/projects/{ticketing_project_id}/field_maps/{map_id}][%d] deleteTicketingFieldMapNoContent ", 204) +} + +func (o *DeleteTicketingFieldMapNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/ticketing/delete_ticketing_priority_parameters.go b/client/ticketing/delete_ticketing_priority_parameters.go new file mode 100644 index 0000000..442d5fc --- /dev/null +++ b/client/ticketing/delete_ticketing_priority_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTicketingPriorityParams creates a new DeleteTicketingPriorityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTicketingPriorityParams() *DeleteTicketingPriorityParams { + return &DeleteTicketingPriorityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTicketingPriorityParamsWithTimeout creates a new DeleteTicketingPriorityParams object +// with the ability to set a timeout on a request. +func NewDeleteTicketingPriorityParamsWithTimeout(timeout time.Duration) *DeleteTicketingPriorityParams { + return &DeleteTicketingPriorityParams{ + timeout: timeout, + } +} + +// NewDeleteTicketingPriorityParamsWithContext creates a new DeleteTicketingPriorityParams object +// with the ability to set a context for a request. +func NewDeleteTicketingPriorityParamsWithContext(ctx context.Context) *DeleteTicketingPriorityParams { + return &DeleteTicketingPriorityParams{ + Context: ctx, + } +} + +// NewDeleteTicketingPriorityParamsWithHTTPClient creates a new DeleteTicketingPriorityParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTicketingPriorityParamsWithHTTPClient(client *http.Client) *DeleteTicketingPriorityParams { + return &DeleteTicketingPriorityParams{ + HTTPClient: client, + } +} + +/* +DeleteTicketingPriorityParams contains all the parameters to send to the API endpoint + + for the delete ticketing priority operation. + + Typically these are written to a http.Request. +*/ +type DeleteTicketingPriorityParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete ticketing priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTicketingPriorityParams) WithDefaults() *DeleteTicketingPriorityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete ticketing priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTicketingPriorityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete ticketing priority params +func (o *DeleteTicketingPriorityParams) WithTimeout(timeout time.Duration) *DeleteTicketingPriorityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete ticketing priority params +func (o *DeleteTicketingPriorityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete ticketing priority params +func (o *DeleteTicketingPriorityParams) WithContext(ctx context.Context) *DeleteTicketingPriorityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete ticketing priority params +func (o *DeleteTicketingPriorityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete ticketing priority params +func (o *DeleteTicketingPriorityParams) WithHTTPClient(client *http.Client) *DeleteTicketingPriorityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete ticketing priority params +func (o *DeleteTicketingPriorityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete ticketing priority params +func (o *DeleteTicketingPriorityParams) WithID(id string) *DeleteTicketingPriorityParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete ticketing priority params +func (o *DeleteTicketingPriorityParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTicketingPriorityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/delete_ticketing_priority_responses.go b/client/ticketing/delete_ticketing_priority_responses.go new file mode 100644 index 0000000..99abcc2 --- /dev/null +++ b/client/ticketing/delete_ticketing_priority_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteTicketingPriorityReader is a Reader for the DeleteTicketingPriority structure. +type DeleteTicketingPriorityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTicketingPriorityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteTicketingPriorityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTicketingPriorityOK creates a DeleteTicketingPriorityOK with default headers values +func NewDeleteTicketingPriorityOK() *DeleteTicketingPriorityOK { + return &DeleteTicketingPriorityOK{} +} + +/* +DeleteTicketingPriorityOK describes a response with status code 200, with default header values. + +Delete a single ticketing priority by ID +*/ +type DeleteTicketingPriorityOK struct { + Payload *models.TicketingPriorityEntity +} + +// IsSuccess returns true when this delete ticketing priority o k response has a 2xx status code +func (o *DeleteTicketingPriorityOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete ticketing priority o k response has a 3xx status code +func (o *DeleteTicketingPriorityOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete ticketing priority o k response has a 4xx status code +func (o *DeleteTicketingPriorityOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete ticketing priority o k response has a 5xx status code +func (o *DeleteTicketingPriorityOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete ticketing priority o k response a status code equal to that given +func (o *DeleteTicketingPriorityOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteTicketingPriorityOK) Error() string { + return fmt.Sprintf("[DELETE /v1/ticketing/priorities/{id}][%d] deleteTicketingPriorityOK %+v", 200, o.Payload) +} + +func (o *DeleteTicketingPriorityOK) String() string { + return fmt.Sprintf("[DELETE /v1/ticketing/priorities/{id}][%d] deleteTicketingPriorityOK %+v", 200, o.Payload) +} + +func (o *DeleteTicketingPriorityOK) GetPayload() *models.TicketingPriorityEntity { + return o.Payload +} + +func (o *DeleteTicketingPriorityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingPriorityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/delete_ticketing_project_config_parameters.go b/client/ticketing/delete_ticketing_project_config_parameters.go new file mode 100644 index 0000000..50e9a98 --- /dev/null +++ b/client/ticketing/delete_ticketing_project_config_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTicketingProjectConfigParams creates a new DeleteTicketingProjectConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTicketingProjectConfigParams() *DeleteTicketingProjectConfigParams { + return &DeleteTicketingProjectConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTicketingProjectConfigParamsWithTimeout creates a new DeleteTicketingProjectConfigParams object +// with the ability to set a timeout on a request. +func NewDeleteTicketingProjectConfigParamsWithTimeout(timeout time.Duration) *DeleteTicketingProjectConfigParams { + return &DeleteTicketingProjectConfigParams{ + timeout: timeout, + } +} + +// NewDeleteTicketingProjectConfigParamsWithContext creates a new DeleteTicketingProjectConfigParams object +// with the ability to set a context for a request. +func NewDeleteTicketingProjectConfigParamsWithContext(ctx context.Context) *DeleteTicketingProjectConfigParams { + return &DeleteTicketingProjectConfigParams{ + Context: ctx, + } +} + +// NewDeleteTicketingProjectConfigParamsWithHTTPClient creates a new DeleteTicketingProjectConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTicketingProjectConfigParamsWithHTTPClient(client *http.Client) *DeleteTicketingProjectConfigParams { + return &DeleteTicketingProjectConfigParams{ + HTTPClient: client, + } +} + +/* +DeleteTicketingProjectConfigParams contains all the parameters to send to the API endpoint + + for the delete ticketing project config operation. + + Typically these are written to a http.Request. +*/ +type DeleteTicketingProjectConfigParams struct { + + // ConfigID. + ConfigID string + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete ticketing project config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTicketingProjectConfigParams) WithDefaults() *DeleteTicketingProjectConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete ticketing project config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTicketingProjectConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete ticketing project config params +func (o *DeleteTicketingProjectConfigParams) WithTimeout(timeout time.Duration) *DeleteTicketingProjectConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete ticketing project config params +func (o *DeleteTicketingProjectConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete ticketing project config params +func (o *DeleteTicketingProjectConfigParams) WithContext(ctx context.Context) *DeleteTicketingProjectConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete ticketing project config params +func (o *DeleteTicketingProjectConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete ticketing project config params +func (o *DeleteTicketingProjectConfigParams) WithHTTPClient(client *http.Client) *DeleteTicketingProjectConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete ticketing project config params +func (o *DeleteTicketingProjectConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConfigID adds the configID to the delete ticketing project config params +func (o *DeleteTicketingProjectConfigParams) WithConfigID(configID string) *DeleteTicketingProjectConfigParams { + o.SetConfigID(configID) + return o +} + +// SetConfigID adds the configId to the delete ticketing project config params +func (o *DeleteTicketingProjectConfigParams) SetConfigID(configID string) { + o.ConfigID = configID +} + +// WithTicketingProjectID adds the ticketingProjectID to the delete ticketing project config params +func (o *DeleteTicketingProjectConfigParams) WithTicketingProjectID(ticketingProjectID string) *DeleteTicketingProjectConfigParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the delete ticketing project config params +func (o *DeleteTicketingProjectConfigParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTicketingProjectConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param config_id + if err := r.SetPathParam("config_id", o.ConfigID); err != nil { + return err + } + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/delete_ticketing_project_config_responses.go b/client/ticketing/delete_ticketing_project_config_responses.go new file mode 100644 index 0000000..47af41a --- /dev/null +++ b/client/ticketing/delete_ticketing_project_config_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// DeleteTicketingProjectConfigReader is a Reader for the DeleteTicketingProjectConfig structure. +type DeleteTicketingProjectConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTicketingProjectConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteTicketingProjectConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTicketingProjectConfigOK creates a DeleteTicketingProjectConfigOK with default headers values +func NewDeleteTicketingProjectConfigOK() *DeleteTicketingProjectConfigOK { + return &DeleteTicketingProjectConfigOK{} +} + +/* +DeleteTicketingProjectConfigOK describes a response with status code 200, with default header values. + +Archive configuration for a ticketing project +*/ +type DeleteTicketingProjectConfigOK struct { + Payload *models.TicketingProjectConfigEntity +} + +// IsSuccess returns true when this delete ticketing project config o k response has a 2xx status code +func (o *DeleteTicketingProjectConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete ticketing project config o k response has a 3xx status code +func (o *DeleteTicketingProjectConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete ticketing project config o k response has a 4xx status code +func (o *DeleteTicketingProjectConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete ticketing project config o k response has a 5xx status code +func (o *DeleteTicketingProjectConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete ticketing project config o k response a status code equal to that given +func (o *DeleteTicketingProjectConfigOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteTicketingProjectConfigOK) Error() string { + return fmt.Sprintf("[DELETE /v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations/{config_id}][%d] deleteTicketingProjectConfigOK %+v", 200, o.Payload) +} + +func (o *DeleteTicketingProjectConfigOK) String() string { + return fmt.Sprintf("[DELETE /v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations/{config_id}][%d] deleteTicketingProjectConfigOK %+v", 200, o.Payload) +} + +func (o *DeleteTicketingProjectConfigOK) GetPayload() *models.TicketingProjectConfigEntity { + return o.Payload +} + +func (o *DeleteTicketingProjectConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingProjectConfigEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/get_configuration_options_parameters.go b/client/ticketing/get_configuration_options_parameters.go new file mode 100644 index 0000000..9a1af2f --- /dev/null +++ b/client/ticketing/get_configuration_options_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetConfigurationOptionsParams creates a new GetConfigurationOptionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetConfigurationOptionsParams() *GetConfigurationOptionsParams { + return &GetConfigurationOptionsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetConfigurationOptionsParamsWithTimeout creates a new GetConfigurationOptionsParams object +// with the ability to set a timeout on a request. +func NewGetConfigurationOptionsParamsWithTimeout(timeout time.Duration) *GetConfigurationOptionsParams { + return &GetConfigurationOptionsParams{ + timeout: timeout, + } +} + +// NewGetConfigurationOptionsParamsWithContext creates a new GetConfigurationOptionsParams object +// with the ability to set a context for a request. +func NewGetConfigurationOptionsParamsWithContext(ctx context.Context) *GetConfigurationOptionsParams { + return &GetConfigurationOptionsParams{ + Context: ctx, + } +} + +// NewGetConfigurationOptionsParamsWithHTTPClient creates a new GetConfigurationOptionsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetConfigurationOptionsParamsWithHTTPClient(client *http.Client) *GetConfigurationOptionsParams { + return &GetConfigurationOptionsParams{ + HTTPClient: client, + } +} + +/* +GetConfigurationOptionsParams contains all the parameters to send to the API endpoint + + for the get configuration options operation. + + Typically these are written to a http.Request. +*/ +type GetConfigurationOptionsParams struct { + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get configuration options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetConfigurationOptionsParams) WithDefaults() *GetConfigurationOptionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get configuration options params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetConfigurationOptionsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get configuration options params +func (o *GetConfigurationOptionsParams) WithTimeout(timeout time.Duration) *GetConfigurationOptionsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get configuration options params +func (o *GetConfigurationOptionsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get configuration options params +func (o *GetConfigurationOptionsParams) WithContext(ctx context.Context) *GetConfigurationOptionsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get configuration options params +func (o *GetConfigurationOptionsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get configuration options params +func (o *GetConfigurationOptionsParams) WithHTTPClient(client *http.Client) *GetConfigurationOptionsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get configuration options params +func (o *GetConfigurationOptionsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTicketingProjectID adds the ticketingProjectID to the get configuration options params +func (o *GetConfigurationOptionsParams) WithTicketingProjectID(ticketingProjectID string) *GetConfigurationOptionsParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the get configuration options params +func (o *GetConfigurationOptionsParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetConfigurationOptionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/get_configuration_options_responses.go b/client/ticketing/get_configuration_options_responses.go new file mode 100644 index 0000000..9d4b80d --- /dev/null +++ b/client/ticketing/get_configuration_options_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetConfigurationOptionsReader is a Reader for the GetConfigurationOptions structure. +type GetConfigurationOptionsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetConfigurationOptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetConfigurationOptionsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetConfigurationOptionsOK creates a GetConfigurationOptionsOK with default headers values +func NewGetConfigurationOptionsOK() *GetConfigurationOptionsOK { + return &GetConfigurationOptionsOK{} +} + +/* +GetConfigurationOptionsOK describes a response with status code 200, with default header values. + +List all configuration options for a ticketing project +*/ +type GetConfigurationOptionsOK struct { +} + +// IsSuccess returns true when this get configuration options o k response has a 2xx status code +func (o *GetConfigurationOptionsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get configuration options o k response has a 3xx status code +func (o *GetConfigurationOptionsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get configuration options o k response has a 4xx status code +func (o *GetConfigurationOptionsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get configuration options o k response has a 5xx status code +func (o *GetConfigurationOptionsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get configuration options o k response a status code equal to that given +func (o *GetConfigurationOptionsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetConfigurationOptionsOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/configuration_options][%d] getConfigurationOptionsOK ", 200) +} + +func (o *GetConfigurationOptionsOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/configuration_options][%d] getConfigurationOptionsOK ", 200) +} + +func (o *GetConfigurationOptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/ticketing/get_inbound_field_map_parameters.go b/client/ticketing/get_inbound_field_map_parameters.go new file mode 100644 index 0000000..e6a0eaa --- /dev/null +++ b/client/ticketing/get_inbound_field_map_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetInboundFieldMapParams creates a new GetInboundFieldMapParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetInboundFieldMapParams() *GetInboundFieldMapParams { + return &GetInboundFieldMapParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetInboundFieldMapParamsWithTimeout creates a new GetInboundFieldMapParams object +// with the ability to set a timeout on a request. +func NewGetInboundFieldMapParamsWithTimeout(timeout time.Duration) *GetInboundFieldMapParams { + return &GetInboundFieldMapParams{ + timeout: timeout, + } +} + +// NewGetInboundFieldMapParamsWithContext creates a new GetInboundFieldMapParams object +// with the ability to set a context for a request. +func NewGetInboundFieldMapParamsWithContext(ctx context.Context) *GetInboundFieldMapParams { + return &GetInboundFieldMapParams{ + Context: ctx, + } +} + +// NewGetInboundFieldMapParamsWithHTTPClient creates a new GetInboundFieldMapParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetInboundFieldMapParamsWithHTTPClient(client *http.Client) *GetInboundFieldMapParams { + return &GetInboundFieldMapParams{ + HTTPClient: client, + } +} + +/* +GetInboundFieldMapParams contains all the parameters to send to the API endpoint + + for the get inbound field map operation. + + Typically these are written to a http.Request. +*/ +type GetInboundFieldMapParams struct { + + // MapID. + MapID string + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get inbound field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetInboundFieldMapParams) WithDefaults() *GetInboundFieldMapParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get inbound field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetInboundFieldMapParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get inbound field map params +func (o *GetInboundFieldMapParams) WithTimeout(timeout time.Duration) *GetInboundFieldMapParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get inbound field map params +func (o *GetInboundFieldMapParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get inbound field map params +func (o *GetInboundFieldMapParams) WithContext(ctx context.Context) *GetInboundFieldMapParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get inbound field map params +func (o *GetInboundFieldMapParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get inbound field map params +func (o *GetInboundFieldMapParams) WithHTTPClient(client *http.Client) *GetInboundFieldMapParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get inbound field map params +func (o *GetInboundFieldMapParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMapID adds the mapID to the get inbound field map params +func (o *GetInboundFieldMapParams) WithMapID(mapID string) *GetInboundFieldMapParams { + o.SetMapID(mapID) + return o +} + +// SetMapID adds the mapId to the get inbound field map params +func (o *GetInboundFieldMapParams) SetMapID(mapID string) { + o.MapID = mapID +} + +// WithTicketingProjectID adds the ticketingProjectID to the get inbound field map params +func (o *GetInboundFieldMapParams) WithTicketingProjectID(ticketingProjectID string) *GetInboundFieldMapParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the get inbound field map params +func (o *GetInboundFieldMapParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetInboundFieldMapParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param map_id + if err := r.SetPathParam("map_id", o.MapID); err != nil { + return err + } + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/get_inbound_field_map_responses.go b/client/ticketing/get_inbound_field_map_responses.go new file mode 100644 index 0000000..890ee59 --- /dev/null +++ b/client/ticketing/get_inbound_field_map_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetInboundFieldMapReader is a Reader for the GetInboundFieldMap structure. +type GetInboundFieldMapReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetInboundFieldMapReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetInboundFieldMapOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetInboundFieldMapOK creates a GetInboundFieldMapOK with default headers values +func NewGetInboundFieldMapOK() *GetInboundFieldMapOK { + return &GetInboundFieldMapOK{} +} + +/* +GetInboundFieldMapOK describes a response with status code 200, with default header values. + +Retrieve inbound field map for a ticketing project +*/ +type GetInboundFieldMapOK struct { + Payload *models.TicketingProjectInboundFieldMapEntity +} + +// IsSuccess returns true when this get inbound field map o k response has a 2xx status code +func (o *GetInboundFieldMapOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get inbound field map o k response has a 3xx status code +func (o *GetInboundFieldMapOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get inbound field map o k response has a 4xx status code +func (o *GetInboundFieldMapOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get inbound field map o k response has a 5xx status code +func (o *GetInboundFieldMapOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get inbound field map o k response a status code equal to that given +func (o *GetInboundFieldMapOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetInboundFieldMapOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/{map_id}][%d] getInboundFieldMapOK %+v", 200, o.Payload) +} + +func (o *GetInboundFieldMapOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/{map_id}][%d] getInboundFieldMapOK %+v", 200, o.Payload) +} + +func (o *GetInboundFieldMapOK) GetPayload() *models.TicketingProjectInboundFieldMapEntity { + return o.Payload +} + +func (o *GetInboundFieldMapOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingProjectInboundFieldMapEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/get_options_for_field_parameters.go b/client/ticketing/get_options_for_field_parameters.go new file mode 100644 index 0000000..6cd6d04 --- /dev/null +++ b/client/ticketing/get_options_for_field_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetOptionsForFieldParams creates a new GetOptionsForFieldParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetOptionsForFieldParams() *GetOptionsForFieldParams { + return &GetOptionsForFieldParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetOptionsForFieldParamsWithTimeout creates a new GetOptionsForFieldParams object +// with the ability to set a timeout on a request. +func NewGetOptionsForFieldParamsWithTimeout(timeout time.Duration) *GetOptionsForFieldParams { + return &GetOptionsForFieldParams{ + timeout: timeout, + } +} + +// NewGetOptionsForFieldParamsWithContext creates a new GetOptionsForFieldParams object +// with the ability to set a context for a request. +func NewGetOptionsForFieldParamsWithContext(ctx context.Context) *GetOptionsForFieldParams { + return &GetOptionsForFieldParams{ + Context: ctx, + } +} + +// NewGetOptionsForFieldParamsWithHTTPClient creates a new GetOptionsForFieldParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetOptionsForFieldParamsWithHTTPClient(client *http.Client) *GetOptionsForFieldParams { + return &GetOptionsForFieldParams{ + HTTPClient: client, + } +} + +/* +GetOptionsForFieldParams contains all the parameters to send to the API endpoint + + for the get options for field operation. + + Typically these are written to a http.Request. +*/ +type GetOptionsForFieldParams struct { + + // FieldID. + FieldID string + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get options for field params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOptionsForFieldParams) WithDefaults() *GetOptionsForFieldParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get options for field params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOptionsForFieldParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get options for field params +func (o *GetOptionsForFieldParams) WithTimeout(timeout time.Duration) *GetOptionsForFieldParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get options for field params +func (o *GetOptionsForFieldParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get options for field params +func (o *GetOptionsForFieldParams) WithContext(ctx context.Context) *GetOptionsForFieldParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get options for field params +func (o *GetOptionsForFieldParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get options for field params +func (o *GetOptionsForFieldParams) WithHTTPClient(client *http.Client) *GetOptionsForFieldParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get options for field params +func (o *GetOptionsForFieldParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFieldID adds the fieldID to the get options for field params +func (o *GetOptionsForFieldParams) WithFieldID(fieldID string) *GetOptionsForFieldParams { + o.SetFieldID(fieldID) + return o +} + +// SetFieldID adds the fieldId to the get options for field params +func (o *GetOptionsForFieldParams) SetFieldID(fieldID string) { + o.FieldID = fieldID +} + +// WithTicketingProjectID adds the ticketingProjectID to the get options for field params +func (o *GetOptionsForFieldParams) WithTicketingProjectID(ticketingProjectID string) *GetOptionsForFieldParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the get options for field params +func (o *GetOptionsForFieldParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetOptionsForFieldParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param field_id + if err := r.SetPathParam("field_id", o.FieldID); err != nil { + return err + } + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/get_options_for_field_responses.go b/client/ticketing/get_options_for_field_responses.go new file mode 100644 index 0000000..4cbd8a6 --- /dev/null +++ b/client/ticketing/get_options_for_field_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetOptionsForFieldReader is a Reader for the GetOptionsForField structure. +type GetOptionsForFieldReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetOptionsForFieldReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetOptionsForFieldOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetOptionsForFieldOK creates a GetOptionsForFieldOK with default headers values +func NewGetOptionsForFieldOK() *GetOptionsForFieldOK { + return &GetOptionsForFieldOK{} +} + +/* +GetOptionsForFieldOK describes a response with status code 200, with default header values. + +List a field's configuration options for a ticketing project +*/ +type GetOptionsForFieldOK struct { +} + +// IsSuccess returns true when this get options for field o k response has a 2xx status code +func (o *GetOptionsForFieldOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get options for field o k response has a 3xx status code +func (o *GetOptionsForFieldOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get options for field o k response has a 4xx status code +func (o *GetOptionsForFieldOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get options for field o k response has a 5xx status code +func (o *GetOptionsForFieldOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get options for field o k response a status code equal to that given +func (o *GetOptionsForFieldOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetOptionsForFieldOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/configuration_options/options_for/{field_id}][%d] getOptionsForFieldOK ", 200) +} + +func (o *GetOptionsForFieldOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/configuration_options/options_for/{field_id}][%d] getOptionsForFieldOK ", 200) +} + +func (o *GetOptionsForFieldOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/ticketing/get_ticket_parameters.go b/client/ticketing/get_ticket_parameters.go new file mode 100644 index 0000000..dcb8bc0 --- /dev/null +++ b/client/ticketing/get_ticket_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTicketParams creates a new GetTicketParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTicketParams() *GetTicketParams { + return &GetTicketParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTicketParamsWithTimeout creates a new GetTicketParams object +// with the ability to set a timeout on a request. +func NewGetTicketParamsWithTimeout(timeout time.Duration) *GetTicketParams { + return &GetTicketParams{ + timeout: timeout, + } +} + +// NewGetTicketParamsWithContext creates a new GetTicketParams object +// with the ability to set a context for a request. +func NewGetTicketParamsWithContext(ctx context.Context) *GetTicketParams { + return &GetTicketParams{ + Context: ctx, + } +} + +// NewGetTicketParamsWithHTTPClient creates a new GetTicketParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTicketParamsWithHTTPClient(client *http.Client) *GetTicketParams { + return &GetTicketParams{ + HTTPClient: client, + } +} + +/* +GetTicketParams contains all the parameters to send to the API endpoint + + for the get ticket operation. + + Typically these are written to a http.Request. +*/ +type GetTicketParams struct { + + // TicketID. + TicketID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get ticket params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTicketParams) WithDefaults() *GetTicketParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get ticket params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTicketParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get ticket params +func (o *GetTicketParams) WithTimeout(timeout time.Duration) *GetTicketParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get ticket params +func (o *GetTicketParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get ticket params +func (o *GetTicketParams) WithContext(ctx context.Context) *GetTicketParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get ticket params +func (o *GetTicketParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get ticket params +func (o *GetTicketParams) WithHTTPClient(client *http.Client) *GetTicketParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get ticket params +func (o *GetTicketParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTicketID adds the ticketID to the get ticket params +func (o *GetTicketParams) WithTicketID(ticketID string) *GetTicketParams { + o.SetTicketID(ticketID) + return o +} + +// SetTicketID adds the ticketId to the get ticket params +func (o *GetTicketParams) SetTicketID(ticketID string) { + o.TicketID = ticketID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTicketParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param ticket_id + if err := r.SetPathParam("ticket_id", o.TicketID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/get_ticket_responses.go b/client/ticketing/get_ticket_responses.go new file mode 100644 index 0000000..adf4353 --- /dev/null +++ b/client/ticketing/get_ticket_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetTicketReader is a Reader for the GetTicket structure. +type GetTicketReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTicketReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTicketOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTicketOK creates a GetTicketOK with default headers values +func NewGetTicketOK() *GetTicketOK { + return &GetTicketOK{} +} + +/* +GetTicketOK describes a response with status code 200, with default header values. + +Retrieves a single ticket by ID +*/ +type GetTicketOK struct { + Payload *models.TicketingTicketEntity +} + +// IsSuccess returns true when this get ticket o k response has a 2xx status code +func (o *GetTicketOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get ticket o k response has a 3xx status code +func (o *GetTicketOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get ticket o k response has a 4xx status code +func (o *GetTicketOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get ticket o k response has a 5xx status code +func (o *GetTicketOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get ticket o k response a status code equal to that given +func (o *GetTicketOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetTicketOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/tickets/{ticket_id}][%d] getTicketOK %+v", 200, o.Payload) +} + +func (o *GetTicketOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/tickets/{ticket_id}][%d] getTicketOK %+v", 200, o.Payload) +} + +func (o *GetTicketOK) GetPayload() *models.TicketingTicketEntity { + return o.Payload +} + +func (o *GetTicketOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingTicketEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/get_ticketing_field_map_parameters.go b/client/ticketing/get_ticketing_field_map_parameters.go new file mode 100644 index 0000000..f624195 --- /dev/null +++ b/client/ticketing/get_ticketing_field_map_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTicketingFieldMapParams creates a new GetTicketingFieldMapParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTicketingFieldMapParams() *GetTicketingFieldMapParams { + return &GetTicketingFieldMapParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTicketingFieldMapParamsWithTimeout creates a new GetTicketingFieldMapParams object +// with the ability to set a timeout on a request. +func NewGetTicketingFieldMapParamsWithTimeout(timeout time.Duration) *GetTicketingFieldMapParams { + return &GetTicketingFieldMapParams{ + timeout: timeout, + } +} + +// NewGetTicketingFieldMapParamsWithContext creates a new GetTicketingFieldMapParams object +// with the ability to set a context for a request. +func NewGetTicketingFieldMapParamsWithContext(ctx context.Context) *GetTicketingFieldMapParams { + return &GetTicketingFieldMapParams{ + Context: ctx, + } +} + +// NewGetTicketingFieldMapParamsWithHTTPClient creates a new GetTicketingFieldMapParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTicketingFieldMapParamsWithHTTPClient(client *http.Client) *GetTicketingFieldMapParams { + return &GetTicketingFieldMapParams{ + HTTPClient: client, + } +} + +/* +GetTicketingFieldMapParams contains all the parameters to send to the API endpoint + + for the get ticketing field map operation. + + Typically these are written to a http.Request. +*/ +type GetTicketingFieldMapParams struct { + + // MapID. + MapID string + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get ticketing field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTicketingFieldMapParams) WithDefaults() *GetTicketingFieldMapParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get ticketing field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTicketingFieldMapParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get ticketing field map params +func (o *GetTicketingFieldMapParams) WithTimeout(timeout time.Duration) *GetTicketingFieldMapParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get ticketing field map params +func (o *GetTicketingFieldMapParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get ticketing field map params +func (o *GetTicketingFieldMapParams) WithContext(ctx context.Context) *GetTicketingFieldMapParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get ticketing field map params +func (o *GetTicketingFieldMapParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get ticketing field map params +func (o *GetTicketingFieldMapParams) WithHTTPClient(client *http.Client) *GetTicketingFieldMapParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get ticketing field map params +func (o *GetTicketingFieldMapParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMapID adds the mapID to the get ticketing field map params +func (o *GetTicketingFieldMapParams) WithMapID(mapID string) *GetTicketingFieldMapParams { + o.SetMapID(mapID) + return o +} + +// SetMapID adds the mapId to the get ticketing field map params +func (o *GetTicketingFieldMapParams) SetMapID(mapID string) { + o.MapID = mapID +} + +// WithTicketingProjectID adds the ticketingProjectID to the get ticketing field map params +func (o *GetTicketingFieldMapParams) WithTicketingProjectID(ticketingProjectID string) *GetTicketingFieldMapParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the get ticketing field map params +func (o *GetTicketingFieldMapParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTicketingFieldMapParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param map_id + if err := r.SetPathParam("map_id", o.MapID); err != nil { + return err + } + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/get_ticketing_field_map_responses.go b/client/ticketing/get_ticketing_field_map_responses.go new file mode 100644 index 0000000..a46c112 --- /dev/null +++ b/client/ticketing/get_ticketing_field_map_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetTicketingFieldMapReader is a Reader for the GetTicketingFieldMap structure. +type GetTicketingFieldMapReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTicketingFieldMapReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTicketingFieldMapOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTicketingFieldMapOK creates a GetTicketingFieldMapOK with default headers values +func NewGetTicketingFieldMapOK() *GetTicketingFieldMapOK { + return &GetTicketingFieldMapOK{} +} + +/* +GetTicketingFieldMapOK describes a response with status code 200, with default header values. + +Retrieve field map for a ticketing project +*/ +type GetTicketingFieldMapOK struct { + Payload *models.TicketingProjectFieldMapEntity +} + +// IsSuccess returns true when this get ticketing field map o k response has a 2xx status code +func (o *GetTicketingFieldMapOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get ticketing field map o k response has a 3xx status code +func (o *GetTicketingFieldMapOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get ticketing field map o k response has a 4xx status code +func (o *GetTicketingFieldMapOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get ticketing field map o k response has a 5xx status code +func (o *GetTicketingFieldMapOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get ticketing field map o k response a status code equal to that given +func (o *GetTicketingFieldMapOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetTicketingFieldMapOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/field_maps/{map_id}][%d] getTicketingFieldMapOK %+v", 200, o.Payload) +} + +func (o *GetTicketingFieldMapOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/field_maps/{map_id}][%d] getTicketingFieldMapOK %+v", 200, o.Payload) +} + +func (o *GetTicketingFieldMapOK) GetPayload() *models.TicketingProjectFieldMapEntity { + return o.Payload +} + +func (o *GetTicketingFieldMapOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingProjectFieldMapEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/get_ticketing_priority_parameters.go b/client/ticketing/get_ticketing_priority_parameters.go new file mode 100644 index 0000000..d9bec35 --- /dev/null +++ b/client/ticketing/get_ticketing_priority_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTicketingPriorityParams creates a new GetTicketingPriorityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTicketingPriorityParams() *GetTicketingPriorityParams { + return &GetTicketingPriorityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTicketingPriorityParamsWithTimeout creates a new GetTicketingPriorityParams object +// with the ability to set a timeout on a request. +func NewGetTicketingPriorityParamsWithTimeout(timeout time.Duration) *GetTicketingPriorityParams { + return &GetTicketingPriorityParams{ + timeout: timeout, + } +} + +// NewGetTicketingPriorityParamsWithContext creates a new GetTicketingPriorityParams object +// with the ability to set a context for a request. +func NewGetTicketingPriorityParamsWithContext(ctx context.Context) *GetTicketingPriorityParams { + return &GetTicketingPriorityParams{ + Context: ctx, + } +} + +// NewGetTicketingPriorityParamsWithHTTPClient creates a new GetTicketingPriorityParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTicketingPriorityParamsWithHTTPClient(client *http.Client) *GetTicketingPriorityParams { + return &GetTicketingPriorityParams{ + HTTPClient: client, + } +} + +/* +GetTicketingPriorityParams contains all the parameters to send to the API endpoint + + for the get ticketing priority operation. + + Typically these are written to a http.Request. +*/ +type GetTicketingPriorityParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get ticketing priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTicketingPriorityParams) WithDefaults() *GetTicketingPriorityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get ticketing priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTicketingPriorityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get ticketing priority params +func (o *GetTicketingPriorityParams) WithTimeout(timeout time.Duration) *GetTicketingPriorityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get ticketing priority params +func (o *GetTicketingPriorityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get ticketing priority params +func (o *GetTicketingPriorityParams) WithContext(ctx context.Context) *GetTicketingPriorityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get ticketing priority params +func (o *GetTicketingPriorityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get ticketing priority params +func (o *GetTicketingPriorityParams) WithHTTPClient(client *http.Client) *GetTicketingPriorityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get ticketing priority params +func (o *GetTicketingPriorityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get ticketing priority params +func (o *GetTicketingPriorityParams) WithID(id string) *GetTicketingPriorityParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get ticketing priority params +func (o *GetTicketingPriorityParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTicketingPriorityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/get_ticketing_priority_responses.go b/client/ticketing/get_ticketing_priority_responses.go new file mode 100644 index 0000000..19d76ee --- /dev/null +++ b/client/ticketing/get_ticketing_priority_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetTicketingPriorityReader is a Reader for the GetTicketingPriority structure. +type GetTicketingPriorityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTicketingPriorityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTicketingPriorityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTicketingPriorityOK creates a GetTicketingPriorityOK with default headers values +func NewGetTicketingPriorityOK() *GetTicketingPriorityOK { + return &GetTicketingPriorityOK{} +} + +/* +GetTicketingPriorityOK describes a response with status code 200, with default header values. + +Retrieve a single ticketing priority by ID +*/ +type GetTicketingPriorityOK struct { + Payload *models.TicketingPriorityEntity +} + +// IsSuccess returns true when this get ticketing priority o k response has a 2xx status code +func (o *GetTicketingPriorityOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get ticketing priority o k response has a 3xx status code +func (o *GetTicketingPriorityOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get ticketing priority o k response has a 4xx status code +func (o *GetTicketingPriorityOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get ticketing priority o k response has a 5xx status code +func (o *GetTicketingPriorityOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get ticketing priority o k response a status code equal to that given +func (o *GetTicketingPriorityOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetTicketingPriorityOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/priorities/{id}][%d] getTicketingPriorityOK %+v", 200, o.Payload) +} + +func (o *GetTicketingPriorityOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/priorities/{id}][%d] getTicketingPriorityOK %+v", 200, o.Payload) +} + +func (o *GetTicketingPriorityOK) GetPayload() *models.TicketingPriorityEntity { + return o.Payload +} + +func (o *GetTicketingPriorityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingPriorityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/get_ticketing_project_config_parameters.go b/client/ticketing/get_ticketing_project_config_parameters.go new file mode 100644 index 0000000..62b9395 --- /dev/null +++ b/client/ticketing/get_ticketing_project_config_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTicketingProjectConfigParams creates a new GetTicketingProjectConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTicketingProjectConfigParams() *GetTicketingProjectConfigParams { + return &GetTicketingProjectConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTicketingProjectConfigParamsWithTimeout creates a new GetTicketingProjectConfigParams object +// with the ability to set a timeout on a request. +func NewGetTicketingProjectConfigParamsWithTimeout(timeout time.Duration) *GetTicketingProjectConfigParams { + return &GetTicketingProjectConfigParams{ + timeout: timeout, + } +} + +// NewGetTicketingProjectConfigParamsWithContext creates a new GetTicketingProjectConfigParams object +// with the ability to set a context for a request. +func NewGetTicketingProjectConfigParamsWithContext(ctx context.Context) *GetTicketingProjectConfigParams { + return &GetTicketingProjectConfigParams{ + Context: ctx, + } +} + +// NewGetTicketingProjectConfigParamsWithHTTPClient creates a new GetTicketingProjectConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTicketingProjectConfigParamsWithHTTPClient(client *http.Client) *GetTicketingProjectConfigParams { + return &GetTicketingProjectConfigParams{ + HTTPClient: client, + } +} + +/* +GetTicketingProjectConfigParams contains all the parameters to send to the API endpoint + + for the get ticketing project config operation. + + Typically these are written to a http.Request. +*/ +type GetTicketingProjectConfigParams struct { + + // ConfigID. + ConfigID string + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get ticketing project config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTicketingProjectConfigParams) WithDefaults() *GetTicketingProjectConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get ticketing project config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTicketingProjectConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get ticketing project config params +func (o *GetTicketingProjectConfigParams) WithTimeout(timeout time.Duration) *GetTicketingProjectConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get ticketing project config params +func (o *GetTicketingProjectConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get ticketing project config params +func (o *GetTicketingProjectConfigParams) WithContext(ctx context.Context) *GetTicketingProjectConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get ticketing project config params +func (o *GetTicketingProjectConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get ticketing project config params +func (o *GetTicketingProjectConfigParams) WithHTTPClient(client *http.Client) *GetTicketingProjectConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get ticketing project config params +func (o *GetTicketingProjectConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConfigID adds the configID to the get ticketing project config params +func (o *GetTicketingProjectConfigParams) WithConfigID(configID string) *GetTicketingProjectConfigParams { + o.SetConfigID(configID) + return o +} + +// SetConfigID adds the configId to the get ticketing project config params +func (o *GetTicketingProjectConfigParams) SetConfigID(configID string) { + o.ConfigID = configID +} + +// WithTicketingProjectID adds the ticketingProjectID to the get ticketing project config params +func (o *GetTicketingProjectConfigParams) WithTicketingProjectID(ticketingProjectID string) *GetTicketingProjectConfigParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the get ticketing project config params +func (o *GetTicketingProjectConfigParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTicketingProjectConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param config_id + if err := r.SetPathParam("config_id", o.ConfigID); err != nil { + return err + } + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/get_ticketing_project_config_responses.go b/client/ticketing/get_ticketing_project_config_responses.go new file mode 100644 index 0000000..e1aedf1 --- /dev/null +++ b/client/ticketing/get_ticketing_project_config_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetTicketingProjectConfigReader is a Reader for the GetTicketingProjectConfig structure. +type GetTicketingProjectConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTicketingProjectConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTicketingProjectConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTicketingProjectConfigOK creates a GetTicketingProjectConfigOK with default headers values +func NewGetTicketingProjectConfigOK() *GetTicketingProjectConfigOK { + return &GetTicketingProjectConfigOK{} +} + +/* +GetTicketingProjectConfigOK describes a response with status code 200, with default header values. + +Retrieve configuration for a ticketing project +*/ +type GetTicketingProjectConfigOK struct { + Payload *models.TicketingProjectConfigEntity +} + +// IsSuccess returns true when this get ticketing project config o k response has a 2xx status code +func (o *GetTicketingProjectConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get ticketing project config o k response has a 3xx status code +func (o *GetTicketingProjectConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get ticketing project config o k response has a 4xx status code +func (o *GetTicketingProjectConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get ticketing project config o k response has a 5xx status code +func (o *GetTicketingProjectConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get ticketing project config o k response a status code equal to that given +func (o *GetTicketingProjectConfigOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetTicketingProjectConfigOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations/{config_id}][%d] getTicketingProjectConfigOK %+v", 200, o.Payload) +} + +func (o *GetTicketingProjectConfigOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations/{config_id}][%d] getTicketingProjectConfigOK %+v", 200, o.Payload) +} + +func (o *GetTicketingProjectConfigOK) GetPayload() *models.TicketingProjectConfigEntity { + return o.Payload +} + +func (o *GetTicketingProjectConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingProjectConfigEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/get_ticketing_project_parameters.go b/client/ticketing/get_ticketing_project_parameters.go new file mode 100644 index 0000000..72a5ff8 --- /dev/null +++ b/client/ticketing/get_ticketing_project_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTicketingProjectParams creates a new GetTicketingProjectParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTicketingProjectParams() *GetTicketingProjectParams { + return &GetTicketingProjectParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTicketingProjectParamsWithTimeout creates a new GetTicketingProjectParams object +// with the ability to set a timeout on a request. +func NewGetTicketingProjectParamsWithTimeout(timeout time.Duration) *GetTicketingProjectParams { + return &GetTicketingProjectParams{ + timeout: timeout, + } +} + +// NewGetTicketingProjectParamsWithContext creates a new GetTicketingProjectParams object +// with the ability to set a context for a request. +func NewGetTicketingProjectParamsWithContext(ctx context.Context) *GetTicketingProjectParams { + return &GetTicketingProjectParams{ + Context: ctx, + } +} + +// NewGetTicketingProjectParamsWithHTTPClient creates a new GetTicketingProjectParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTicketingProjectParamsWithHTTPClient(client *http.Client) *GetTicketingProjectParams { + return &GetTicketingProjectParams{ + HTTPClient: client, + } +} + +/* +GetTicketingProjectParams contains all the parameters to send to the API endpoint + + for the get ticketing project operation. + + Typically these are written to a http.Request. +*/ +type GetTicketingProjectParams struct { + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get ticketing project params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTicketingProjectParams) WithDefaults() *GetTicketingProjectParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get ticketing project params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTicketingProjectParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get ticketing project params +func (o *GetTicketingProjectParams) WithTimeout(timeout time.Duration) *GetTicketingProjectParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get ticketing project params +func (o *GetTicketingProjectParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get ticketing project params +func (o *GetTicketingProjectParams) WithContext(ctx context.Context) *GetTicketingProjectParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get ticketing project params +func (o *GetTicketingProjectParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get ticketing project params +func (o *GetTicketingProjectParams) WithHTTPClient(client *http.Client) *GetTicketingProjectParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get ticketing project params +func (o *GetTicketingProjectParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTicketingProjectID adds the ticketingProjectID to the get ticketing project params +func (o *GetTicketingProjectParams) WithTicketingProjectID(ticketingProjectID string) *GetTicketingProjectParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the get ticketing project params +func (o *GetTicketingProjectParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTicketingProjectParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/get_ticketing_project_responses.go b/client/ticketing/get_ticketing_project_responses.go new file mode 100644 index 0000000..d561712 --- /dev/null +++ b/client/ticketing/get_ticketing_project_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetTicketingProjectReader is a Reader for the GetTicketingProject structure. +type GetTicketingProjectReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTicketingProjectReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTicketingProjectOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTicketingProjectOK creates a GetTicketingProjectOK with default headers values +func NewGetTicketingProjectOK() *GetTicketingProjectOK { + return &GetTicketingProjectOK{} +} + +/* +GetTicketingProjectOK describes a response with status code 200, with default header values. + +Retrieve a single ticketing project by ID +*/ +type GetTicketingProjectOK struct { + Payload *models.TicketingProjectsProjectListItemEntity +} + +// IsSuccess returns true when this get ticketing project o k response has a 2xx status code +func (o *GetTicketingProjectOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get ticketing project o k response has a 3xx status code +func (o *GetTicketingProjectOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get ticketing project o k response has a 4xx status code +func (o *GetTicketingProjectOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get ticketing project o k response has a 5xx status code +func (o *GetTicketingProjectOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get ticketing project o k response a status code equal to that given +func (o *GetTicketingProjectOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetTicketingProjectOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}][%d] getTicketingProjectOK %+v", 200, o.Payload) +} + +func (o *GetTicketingProjectOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}][%d] getTicketingProjectOK %+v", 200, o.Payload) +} + +func (o *GetTicketingProjectOK) GetPayload() *models.TicketingProjectsProjectListItemEntity { + return o.Payload +} + +func (o *GetTicketingProjectOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingProjectsProjectListItemEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/list_available_inbound_field_maps_parameters.go b/client/ticketing/list_available_inbound_field_maps_parameters.go new file mode 100644 index 0000000..37ec434 --- /dev/null +++ b/client/ticketing/list_available_inbound_field_maps_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListAvailableInboundFieldMapsParams creates a new ListAvailableInboundFieldMapsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListAvailableInboundFieldMapsParams() *ListAvailableInboundFieldMapsParams { + return &ListAvailableInboundFieldMapsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListAvailableInboundFieldMapsParamsWithTimeout creates a new ListAvailableInboundFieldMapsParams object +// with the ability to set a timeout on a request. +func NewListAvailableInboundFieldMapsParamsWithTimeout(timeout time.Duration) *ListAvailableInboundFieldMapsParams { + return &ListAvailableInboundFieldMapsParams{ + timeout: timeout, + } +} + +// NewListAvailableInboundFieldMapsParamsWithContext creates a new ListAvailableInboundFieldMapsParams object +// with the ability to set a context for a request. +func NewListAvailableInboundFieldMapsParamsWithContext(ctx context.Context) *ListAvailableInboundFieldMapsParams { + return &ListAvailableInboundFieldMapsParams{ + Context: ctx, + } +} + +// NewListAvailableInboundFieldMapsParamsWithHTTPClient creates a new ListAvailableInboundFieldMapsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListAvailableInboundFieldMapsParamsWithHTTPClient(client *http.Client) *ListAvailableInboundFieldMapsParams { + return &ListAvailableInboundFieldMapsParams{ + HTTPClient: client, + } +} + +/* +ListAvailableInboundFieldMapsParams contains all the parameters to send to the API endpoint + + for the list available inbound field maps operation. + + Typically these are written to a http.Request. +*/ +type ListAvailableInboundFieldMapsParams struct { + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list available inbound field maps params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAvailableInboundFieldMapsParams) WithDefaults() *ListAvailableInboundFieldMapsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list available inbound field maps params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAvailableInboundFieldMapsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list available inbound field maps params +func (o *ListAvailableInboundFieldMapsParams) WithTimeout(timeout time.Duration) *ListAvailableInboundFieldMapsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list available inbound field maps params +func (o *ListAvailableInboundFieldMapsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list available inbound field maps params +func (o *ListAvailableInboundFieldMapsParams) WithContext(ctx context.Context) *ListAvailableInboundFieldMapsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list available inbound field maps params +func (o *ListAvailableInboundFieldMapsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list available inbound field maps params +func (o *ListAvailableInboundFieldMapsParams) WithHTTPClient(client *http.Client) *ListAvailableInboundFieldMapsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list available inbound field maps params +func (o *ListAvailableInboundFieldMapsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTicketingProjectID adds the ticketingProjectID to the list available inbound field maps params +func (o *ListAvailableInboundFieldMapsParams) WithTicketingProjectID(ticketingProjectID string) *ListAvailableInboundFieldMapsParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the list available inbound field maps params +func (o *ListAvailableInboundFieldMapsParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListAvailableInboundFieldMapsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/list_available_inbound_field_maps_responses.go b/client/ticketing/list_available_inbound_field_maps_responses.go new file mode 100644 index 0000000..5b9ad66 --- /dev/null +++ b/client/ticketing/list_available_inbound_field_maps_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListAvailableInboundFieldMapsReader is a Reader for the ListAvailableInboundFieldMaps structure. +type ListAvailableInboundFieldMapsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListAvailableInboundFieldMapsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListAvailableInboundFieldMapsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListAvailableInboundFieldMapsOK creates a ListAvailableInboundFieldMapsOK with default headers values +func NewListAvailableInboundFieldMapsOK() *ListAvailableInboundFieldMapsOK { + return &ListAvailableInboundFieldMapsOK{} +} + +/* +ListAvailableInboundFieldMapsOK describes a response with status code 200, with default header values. + +Returns metadata for the fields that are available for inbound field mapping. +*/ +type ListAvailableInboundFieldMapsOK struct { + Payload *models.TicketingProjectInboundMappableFieldEntity +} + +// IsSuccess returns true when this list available inbound field maps o k response has a 2xx status code +func (o *ListAvailableInboundFieldMapsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list available inbound field maps o k response has a 3xx status code +func (o *ListAvailableInboundFieldMapsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list available inbound field maps o k response has a 4xx status code +func (o *ListAvailableInboundFieldMapsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list available inbound field maps o k response has a 5xx status code +func (o *ListAvailableInboundFieldMapsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list available inbound field maps o k response a status code equal to that given +func (o *ListAvailableInboundFieldMapsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListAvailableInboundFieldMapsOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/available_fields][%d] listAvailableInboundFieldMapsOK %+v", 200, o.Payload) +} + +func (o *ListAvailableInboundFieldMapsOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/available_fields][%d] listAvailableInboundFieldMapsOK %+v", 200, o.Payload) +} + +func (o *ListAvailableInboundFieldMapsOK) GetPayload() *models.TicketingProjectInboundMappableFieldEntity { + return o.Payload +} + +func (o *ListAvailableInboundFieldMapsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingProjectInboundMappableFieldEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/list_available_ticketing_field_maps_parameters.go b/client/ticketing/list_available_ticketing_field_maps_parameters.go new file mode 100644 index 0000000..ad01bd3 --- /dev/null +++ b/client/ticketing/list_available_ticketing_field_maps_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListAvailableTicketingFieldMapsParams creates a new ListAvailableTicketingFieldMapsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListAvailableTicketingFieldMapsParams() *ListAvailableTicketingFieldMapsParams { + return &ListAvailableTicketingFieldMapsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListAvailableTicketingFieldMapsParamsWithTimeout creates a new ListAvailableTicketingFieldMapsParams object +// with the ability to set a timeout on a request. +func NewListAvailableTicketingFieldMapsParamsWithTimeout(timeout time.Duration) *ListAvailableTicketingFieldMapsParams { + return &ListAvailableTicketingFieldMapsParams{ + timeout: timeout, + } +} + +// NewListAvailableTicketingFieldMapsParamsWithContext creates a new ListAvailableTicketingFieldMapsParams object +// with the ability to set a context for a request. +func NewListAvailableTicketingFieldMapsParamsWithContext(ctx context.Context) *ListAvailableTicketingFieldMapsParams { + return &ListAvailableTicketingFieldMapsParams{ + Context: ctx, + } +} + +// NewListAvailableTicketingFieldMapsParamsWithHTTPClient creates a new ListAvailableTicketingFieldMapsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListAvailableTicketingFieldMapsParamsWithHTTPClient(client *http.Client) *ListAvailableTicketingFieldMapsParams { + return &ListAvailableTicketingFieldMapsParams{ + HTTPClient: client, + } +} + +/* +ListAvailableTicketingFieldMapsParams contains all the parameters to send to the API endpoint + + for the list available ticketing field maps operation. + + Typically these are written to a http.Request. +*/ +type ListAvailableTicketingFieldMapsParams struct { + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list available ticketing field maps params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAvailableTicketingFieldMapsParams) WithDefaults() *ListAvailableTicketingFieldMapsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list available ticketing field maps params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListAvailableTicketingFieldMapsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list available ticketing field maps params +func (o *ListAvailableTicketingFieldMapsParams) WithTimeout(timeout time.Duration) *ListAvailableTicketingFieldMapsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list available ticketing field maps params +func (o *ListAvailableTicketingFieldMapsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list available ticketing field maps params +func (o *ListAvailableTicketingFieldMapsParams) WithContext(ctx context.Context) *ListAvailableTicketingFieldMapsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list available ticketing field maps params +func (o *ListAvailableTicketingFieldMapsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list available ticketing field maps params +func (o *ListAvailableTicketingFieldMapsParams) WithHTTPClient(client *http.Client) *ListAvailableTicketingFieldMapsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list available ticketing field maps params +func (o *ListAvailableTicketingFieldMapsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTicketingProjectID adds the ticketingProjectID to the list available ticketing field maps params +func (o *ListAvailableTicketingFieldMapsParams) WithTicketingProjectID(ticketingProjectID string) *ListAvailableTicketingFieldMapsParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the list available ticketing field maps params +func (o *ListAvailableTicketingFieldMapsParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListAvailableTicketingFieldMapsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/list_available_ticketing_field_maps_responses.go b/client/ticketing/list_available_ticketing_field_maps_responses.go new file mode 100644 index 0000000..3770512 --- /dev/null +++ b/client/ticketing/list_available_ticketing_field_maps_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListAvailableTicketingFieldMapsReader is a Reader for the ListAvailableTicketingFieldMaps structure. +type ListAvailableTicketingFieldMapsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListAvailableTicketingFieldMapsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListAvailableTicketingFieldMapsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListAvailableTicketingFieldMapsOK creates a ListAvailableTicketingFieldMapsOK with default headers values +func NewListAvailableTicketingFieldMapsOK() *ListAvailableTicketingFieldMapsOK { + return &ListAvailableTicketingFieldMapsOK{} +} + +/* +ListAvailableTicketingFieldMapsOK describes a response with status code 200, with default header values. + +Returns metadata for the fields that are available for field mapping. +*/ +type ListAvailableTicketingFieldMapsOK struct { + Payload *models.TicketingFieldMapsMappableFieldEntity +} + +// IsSuccess returns true when this list available ticketing field maps o k response has a 2xx status code +func (o *ListAvailableTicketingFieldMapsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list available ticketing field maps o k response has a 3xx status code +func (o *ListAvailableTicketingFieldMapsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list available ticketing field maps o k response has a 4xx status code +func (o *ListAvailableTicketingFieldMapsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list available ticketing field maps o k response has a 5xx status code +func (o *ListAvailableTicketingFieldMapsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list available ticketing field maps o k response a status code equal to that given +func (o *ListAvailableTicketingFieldMapsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListAvailableTicketingFieldMapsOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/field_maps/available_fields][%d] listAvailableTicketingFieldMapsOK %+v", 200, o.Payload) +} + +func (o *ListAvailableTicketingFieldMapsOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/field_maps/available_fields][%d] listAvailableTicketingFieldMapsOK %+v", 200, o.Payload) +} + +func (o *ListAvailableTicketingFieldMapsOK) GetPayload() *models.TicketingFieldMapsMappableFieldEntity { + return o.Payload +} + +func (o *ListAvailableTicketingFieldMapsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingFieldMapsMappableFieldEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/list_inbound_field_maps_parameters.go b/client/ticketing/list_inbound_field_maps_parameters.go new file mode 100644 index 0000000..32e1e08 --- /dev/null +++ b/client/ticketing/list_inbound_field_maps_parameters.go @@ -0,0 +1,249 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListInboundFieldMapsParams creates a new ListInboundFieldMapsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListInboundFieldMapsParams() *ListInboundFieldMapsParams { + return &ListInboundFieldMapsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListInboundFieldMapsParamsWithTimeout creates a new ListInboundFieldMapsParams object +// with the ability to set a timeout on a request. +func NewListInboundFieldMapsParamsWithTimeout(timeout time.Duration) *ListInboundFieldMapsParams { + return &ListInboundFieldMapsParams{ + timeout: timeout, + } +} + +// NewListInboundFieldMapsParamsWithContext creates a new ListInboundFieldMapsParams object +// with the ability to set a context for a request. +func NewListInboundFieldMapsParamsWithContext(ctx context.Context) *ListInboundFieldMapsParams { + return &ListInboundFieldMapsParams{ + Context: ctx, + } +} + +// NewListInboundFieldMapsParamsWithHTTPClient creates a new ListInboundFieldMapsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListInboundFieldMapsParamsWithHTTPClient(client *http.Client) *ListInboundFieldMapsParams { + return &ListInboundFieldMapsParams{ + HTTPClient: client, + } +} + +/* +ListInboundFieldMapsParams contains all the parameters to send to the API endpoint + + for the list inbound field maps operation. + + Typically these are written to a http.Request. +*/ +type ListInboundFieldMapsParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* TicketType. + + Filter by ticket type. Values: incident, follow_up + */ + TicketType *string + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list inbound field maps params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListInboundFieldMapsParams) WithDefaults() *ListInboundFieldMapsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list inbound field maps params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListInboundFieldMapsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list inbound field maps params +func (o *ListInboundFieldMapsParams) WithTimeout(timeout time.Duration) *ListInboundFieldMapsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list inbound field maps params +func (o *ListInboundFieldMapsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list inbound field maps params +func (o *ListInboundFieldMapsParams) WithContext(ctx context.Context) *ListInboundFieldMapsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list inbound field maps params +func (o *ListInboundFieldMapsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list inbound field maps params +func (o *ListInboundFieldMapsParams) WithHTTPClient(client *http.Client) *ListInboundFieldMapsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list inbound field maps params +func (o *ListInboundFieldMapsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list inbound field maps params +func (o *ListInboundFieldMapsParams) WithPage(page *int32) *ListInboundFieldMapsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list inbound field maps params +func (o *ListInboundFieldMapsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list inbound field maps params +func (o *ListInboundFieldMapsParams) WithPerPage(perPage *int32) *ListInboundFieldMapsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list inbound field maps params +func (o *ListInboundFieldMapsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithTicketType adds the ticketType to the list inbound field maps params +func (o *ListInboundFieldMapsParams) WithTicketType(ticketType *string) *ListInboundFieldMapsParams { + o.SetTicketType(ticketType) + return o +} + +// SetTicketType adds the ticketType to the list inbound field maps params +func (o *ListInboundFieldMapsParams) SetTicketType(ticketType *string) { + o.TicketType = ticketType +} + +// WithTicketingProjectID adds the ticketingProjectID to the list inbound field maps params +func (o *ListInboundFieldMapsParams) WithTicketingProjectID(ticketingProjectID string) *ListInboundFieldMapsParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the list inbound field maps params +func (o *ListInboundFieldMapsParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListInboundFieldMapsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.TicketType != nil { + + // query param ticket_type + var qrTicketType string + + if o.TicketType != nil { + qrTicketType = *o.TicketType + } + qTicketType := qrTicketType + if qTicketType != "" { + + if err := r.SetQueryParam("ticket_type", qTicketType); err != nil { + return err + } + } + } + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/list_inbound_field_maps_responses.go b/client/ticketing/list_inbound_field_maps_responses.go new file mode 100644 index 0000000..dff9890 --- /dev/null +++ b/client/ticketing/list_inbound_field_maps_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListInboundFieldMapsReader is a Reader for the ListInboundFieldMaps structure. +type ListInboundFieldMapsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListInboundFieldMapsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListInboundFieldMapsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListInboundFieldMapsOK creates a ListInboundFieldMapsOK with default headers values +func NewListInboundFieldMapsOK() *ListInboundFieldMapsOK { + return &ListInboundFieldMapsOK{} +} + +/* +ListInboundFieldMapsOK describes a response with status code 200, with default header values. + +List all inbound field maps for a ticketing project +*/ +type ListInboundFieldMapsOK struct { + Payload *models.TicketingProjectInboundFieldMapEntity +} + +// IsSuccess returns true when this list inbound field maps o k response has a 2xx status code +func (o *ListInboundFieldMapsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list inbound field maps o k response has a 3xx status code +func (o *ListInboundFieldMapsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list inbound field maps o k response has a 4xx status code +func (o *ListInboundFieldMapsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list inbound field maps o k response has a 5xx status code +func (o *ListInboundFieldMapsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list inbound field maps o k response a status code equal to that given +func (o *ListInboundFieldMapsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListInboundFieldMapsOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps][%d] listInboundFieldMapsOK %+v", 200, o.Payload) +} + +func (o *ListInboundFieldMapsOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps][%d] listInboundFieldMapsOK %+v", 200, o.Payload) +} + +func (o *ListInboundFieldMapsOK) GetPayload() *models.TicketingProjectInboundFieldMapEntity { + return o.Payload +} + +func (o *ListInboundFieldMapsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingProjectInboundFieldMapEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/list_ticket_tags_parameters.go b/client/ticketing/list_ticket_tags_parameters.go new file mode 100644 index 0000000..fc563d6 --- /dev/null +++ b/client/ticketing/list_ticket_tags_parameters.go @@ -0,0 +1,160 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListTicketTagsParams creates a new ListTicketTagsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListTicketTagsParams() *ListTicketTagsParams { + return &ListTicketTagsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListTicketTagsParamsWithTimeout creates a new ListTicketTagsParams object +// with the ability to set a timeout on a request. +func NewListTicketTagsParamsWithTimeout(timeout time.Duration) *ListTicketTagsParams { + return &ListTicketTagsParams{ + timeout: timeout, + } +} + +// NewListTicketTagsParamsWithContext creates a new ListTicketTagsParams object +// with the ability to set a context for a request. +func NewListTicketTagsParamsWithContext(ctx context.Context) *ListTicketTagsParams { + return &ListTicketTagsParams{ + Context: ctx, + } +} + +// NewListTicketTagsParamsWithHTTPClient creates a new ListTicketTagsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListTicketTagsParamsWithHTTPClient(client *http.Client) *ListTicketTagsParams { + return &ListTicketTagsParams{ + HTTPClient: client, + } +} + +/* +ListTicketTagsParams contains all the parameters to send to the API endpoint + + for the list ticket tags operation. + + Typically these are written to a http.Request. +*/ +type ListTicketTagsParams struct { + + // Prefix. + Prefix *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list ticket tags params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTicketTagsParams) WithDefaults() *ListTicketTagsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list ticket tags params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTicketTagsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list ticket tags params +func (o *ListTicketTagsParams) WithTimeout(timeout time.Duration) *ListTicketTagsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list ticket tags params +func (o *ListTicketTagsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list ticket tags params +func (o *ListTicketTagsParams) WithContext(ctx context.Context) *ListTicketTagsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list ticket tags params +func (o *ListTicketTagsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list ticket tags params +func (o *ListTicketTagsParams) WithHTTPClient(client *http.Client) *ListTicketTagsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list ticket tags params +func (o *ListTicketTagsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPrefix adds the prefix to the list ticket tags params +func (o *ListTicketTagsParams) WithPrefix(prefix *string) *ListTicketTagsParams { + o.SetPrefix(prefix) + return o +} + +// SetPrefix adds the prefix to the list ticket tags params +func (o *ListTicketTagsParams) SetPrefix(prefix *string) { + o.Prefix = prefix +} + +// WriteToRequest writes these params to a swagger request +func (o *ListTicketTagsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Prefix != nil { + + // query param prefix + var qrPrefix string + + if o.Prefix != nil { + qrPrefix = *o.Prefix + } + qPrefix := qrPrefix + if qPrefix != "" { + + if err := r.SetQueryParam("prefix", qPrefix); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/list_ticket_tags_responses.go b/client/ticketing/list_ticket_tags_responses.go new file mode 100644 index 0000000..fc65cfb --- /dev/null +++ b/client/ticketing/list_ticket_tags_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListTicketTagsReader is a Reader for the ListTicketTags structure. +type ListTicketTagsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListTicketTagsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListTicketTagsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListTicketTagsOK creates a ListTicketTagsOK with default headers values +func NewListTicketTagsOK() *ListTicketTagsOK { + return &ListTicketTagsOK{} +} + +/* +ListTicketTagsOK describes a response with status code 200, with default header values. + +List all of the ticket tags in the organization +*/ +type ListTicketTagsOK struct { + Payload *models.TagEntityPaginated +} + +// IsSuccess returns true when this list ticket tags o k response has a 2xx status code +func (o *ListTicketTagsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list ticket tags o k response has a 3xx status code +func (o *ListTicketTagsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list ticket tags o k response has a 4xx status code +func (o *ListTicketTagsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list ticket tags o k response has a 5xx status code +func (o *ListTicketTagsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list ticket tags o k response a status code equal to that given +func (o *ListTicketTagsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListTicketTagsOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/ticket_tags][%d] listTicketTagsOK %+v", 200, o.Payload) +} + +func (o *ListTicketTagsOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/ticket_tags][%d] listTicketTagsOK %+v", 200, o.Payload) +} + +func (o *ListTicketTagsOK) GetPayload() *models.TagEntityPaginated { + return o.Payload +} + +func (o *ListTicketTagsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TagEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/list_ticketing_priorities_parameters.go b/client/ticketing/list_ticketing_priorities_parameters.go new file mode 100644 index 0000000..1e17a36 --- /dev/null +++ b/client/ticketing/list_ticketing_priorities_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListTicketingPrioritiesParams creates a new ListTicketingPrioritiesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListTicketingPrioritiesParams() *ListTicketingPrioritiesParams { + return &ListTicketingPrioritiesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListTicketingPrioritiesParamsWithTimeout creates a new ListTicketingPrioritiesParams object +// with the ability to set a timeout on a request. +func NewListTicketingPrioritiesParamsWithTimeout(timeout time.Duration) *ListTicketingPrioritiesParams { + return &ListTicketingPrioritiesParams{ + timeout: timeout, + } +} + +// NewListTicketingPrioritiesParamsWithContext creates a new ListTicketingPrioritiesParams object +// with the ability to set a context for a request. +func NewListTicketingPrioritiesParamsWithContext(ctx context.Context) *ListTicketingPrioritiesParams { + return &ListTicketingPrioritiesParams{ + Context: ctx, + } +} + +// NewListTicketingPrioritiesParamsWithHTTPClient creates a new ListTicketingPrioritiesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListTicketingPrioritiesParamsWithHTTPClient(client *http.Client) *ListTicketingPrioritiesParams { + return &ListTicketingPrioritiesParams{ + HTTPClient: client, + } +} + +/* +ListTicketingPrioritiesParams contains all the parameters to send to the API endpoint + + for the list ticketing priorities operation. + + Typically these are written to a http.Request. +*/ +type ListTicketingPrioritiesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list ticketing priorities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTicketingPrioritiesParams) WithDefaults() *ListTicketingPrioritiesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list ticketing priorities params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTicketingPrioritiesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list ticketing priorities params +func (o *ListTicketingPrioritiesParams) WithTimeout(timeout time.Duration) *ListTicketingPrioritiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list ticketing priorities params +func (o *ListTicketingPrioritiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list ticketing priorities params +func (o *ListTicketingPrioritiesParams) WithContext(ctx context.Context) *ListTicketingPrioritiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list ticketing priorities params +func (o *ListTicketingPrioritiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list ticketing priorities params +func (o *ListTicketingPrioritiesParams) WithHTTPClient(client *http.Client) *ListTicketingPrioritiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list ticketing priorities params +func (o *ListTicketingPrioritiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ListTicketingPrioritiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/list_ticketing_priorities_responses.go b/client/ticketing/list_ticketing_priorities_responses.go new file mode 100644 index 0000000..59d80c8 --- /dev/null +++ b/client/ticketing/list_ticketing_priorities_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListTicketingPrioritiesReader is a Reader for the ListTicketingPriorities structure. +type ListTicketingPrioritiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListTicketingPrioritiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListTicketingPrioritiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListTicketingPrioritiesOK creates a ListTicketingPrioritiesOK with default headers values +func NewListTicketingPrioritiesOK() *ListTicketingPrioritiesOK { + return &ListTicketingPrioritiesOK{} +} + +/* +ListTicketingPrioritiesOK describes a response with status code 200, with default header values. + +List all ticketing priorities available to the organization +*/ +type ListTicketingPrioritiesOK struct { + Payload *models.TicketingPriorityEntity +} + +// IsSuccess returns true when this list ticketing priorities o k response has a 2xx status code +func (o *ListTicketingPrioritiesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list ticketing priorities o k response has a 3xx status code +func (o *ListTicketingPrioritiesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list ticketing priorities o k response has a 4xx status code +func (o *ListTicketingPrioritiesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list ticketing priorities o k response has a 5xx status code +func (o *ListTicketingPrioritiesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list ticketing priorities o k response a status code equal to that given +func (o *ListTicketingPrioritiesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListTicketingPrioritiesOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/priorities][%d] listTicketingPrioritiesOK %+v", 200, o.Payload) +} + +func (o *ListTicketingPrioritiesOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/priorities][%d] listTicketingPrioritiesOK %+v", 200, o.Payload) +} + +func (o *ListTicketingPrioritiesOK) GetPayload() *models.TicketingPriorityEntity { + return o.Payload +} + +func (o *ListTicketingPrioritiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingPriorityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/list_ticketing_projects_parameters.go b/client/ticketing/list_ticketing_projects_parameters.go new file mode 100644 index 0000000..bcf01b3 --- /dev/null +++ b/client/ticketing/list_ticketing_projects_parameters.go @@ -0,0 +1,351 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListTicketingProjectsParams creates a new ListTicketingProjectsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListTicketingProjectsParams() *ListTicketingProjectsParams { + return &ListTicketingProjectsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListTicketingProjectsParamsWithTimeout creates a new ListTicketingProjectsParams object +// with the ability to set a timeout on a request. +func NewListTicketingProjectsParamsWithTimeout(timeout time.Duration) *ListTicketingProjectsParams { + return &ListTicketingProjectsParams{ + timeout: timeout, + } +} + +// NewListTicketingProjectsParamsWithContext creates a new ListTicketingProjectsParams object +// with the ability to set a context for a request. +func NewListTicketingProjectsParamsWithContext(ctx context.Context) *ListTicketingProjectsParams { + return &ListTicketingProjectsParams{ + Context: ctx, + } +} + +// NewListTicketingProjectsParamsWithHTTPClient creates a new ListTicketingProjectsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListTicketingProjectsParamsWithHTTPClient(client *http.Client) *ListTicketingProjectsParams { + return &ListTicketingProjectsParams{ + HTTPClient: client, + } +} + +/* +ListTicketingProjectsParams contains all the parameters to send to the API endpoint + + for the list ticketing projects operation. + + Typically these are written to a http.Request. +*/ +type ListTicketingProjectsParams struct { + + // ConfiguredProjects. + ConfiguredProjects *bool + + // ConnectionIds. + ConnectionIds *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + // Providers. + Providers *string + + // Query. + Query *string + + // SupportsTicketTypes. + SupportsTicketTypes *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list ticketing projects params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTicketingProjectsParams) WithDefaults() *ListTicketingProjectsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list ticketing projects params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTicketingProjectsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list ticketing projects params +func (o *ListTicketingProjectsParams) WithTimeout(timeout time.Duration) *ListTicketingProjectsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list ticketing projects params +func (o *ListTicketingProjectsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list ticketing projects params +func (o *ListTicketingProjectsParams) WithContext(ctx context.Context) *ListTicketingProjectsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list ticketing projects params +func (o *ListTicketingProjectsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list ticketing projects params +func (o *ListTicketingProjectsParams) WithHTTPClient(client *http.Client) *ListTicketingProjectsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list ticketing projects params +func (o *ListTicketingProjectsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConfiguredProjects adds the configuredProjects to the list ticketing projects params +func (o *ListTicketingProjectsParams) WithConfiguredProjects(configuredProjects *bool) *ListTicketingProjectsParams { + o.SetConfiguredProjects(configuredProjects) + return o +} + +// SetConfiguredProjects adds the configuredProjects to the list ticketing projects params +func (o *ListTicketingProjectsParams) SetConfiguredProjects(configuredProjects *bool) { + o.ConfiguredProjects = configuredProjects +} + +// WithConnectionIds adds the connectionIds to the list ticketing projects params +func (o *ListTicketingProjectsParams) WithConnectionIds(connectionIds *string) *ListTicketingProjectsParams { + o.SetConnectionIds(connectionIds) + return o +} + +// SetConnectionIds adds the connectionIds to the list ticketing projects params +func (o *ListTicketingProjectsParams) SetConnectionIds(connectionIds *string) { + o.ConnectionIds = connectionIds +} + +// WithPage adds the page to the list ticketing projects params +func (o *ListTicketingProjectsParams) WithPage(page *int32) *ListTicketingProjectsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list ticketing projects params +func (o *ListTicketingProjectsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list ticketing projects params +func (o *ListTicketingProjectsParams) WithPerPage(perPage *int32) *ListTicketingProjectsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list ticketing projects params +func (o *ListTicketingProjectsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithProviders adds the providers to the list ticketing projects params +func (o *ListTicketingProjectsParams) WithProviders(providers *string) *ListTicketingProjectsParams { + o.SetProviders(providers) + return o +} + +// SetProviders adds the providers to the list ticketing projects params +func (o *ListTicketingProjectsParams) SetProviders(providers *string) { + o.Providers = providers +} + +// WithQuery adds the query to the list ticketing projects params +func (o *ListTicketingProjectsParams) WithQuery(query *string) *ListTicketingProjectsParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list ticketing projects params +func (o *ListTicketingProjectsParams) SetQuery(query *string) { + o.Query = query +} + +// WithSupportsTicketTypes adds the supportsTicketTypes to the list ticketing projects params +func (o *ListTicketingProjectsParams) WithSupportsTicketTypes(supportsTicketTypes *string) *ListTicketingProjectsParams { + o.SetSupportsTicketTypes(supportsTicketTypes) + return o +} + +// SetSupportsTicketTypes adds the supportsTicketTypes to the list ticketing projects params +func (o *ListTicketingProjectsParams) SetSupportsTicketTypes(supportsTicketTypes *string) { + o.SupportsTicketTypes = supportsTicketTypes +} + +// WriteToRequest writes these params to a swagger request +func (o *ListTicketingProjectsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ConfiguredProjects != nil { + + // query param configured_projects + var qrConfiguredProjects bool + + if o.ConfiguredProjects != nil { + qrConfiguredProjects = *o.ConfiguredProjects + } + qConfiguredProjects := swag.FormatBool(qrConfiguredProjects) + if qConfiguredProjects != "" { + + if err := r.SetQueryParam("configured_projects", qConfiguredProjects); err != nil { + return err + } + } + } + + if o.ConnectionIds != nil { + + // query param connection_ids + var qrConnectionIds string + + if o.ConnectionIds != nil { + qrConnectionIds = *o.ConnectionIds + } + qConnectionIds := qrConnectionIds + if qConnectionIds != "" { + + if err := r.SetQueryParam("connection_ids", qConnectionIds); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Providers != nil { + + // query param providers + var qrProviders string + + if o.Providers != nil { + qrProviders = *o.Providers + } + qProviders := qrProviders + if qProviders != "" { + + if err := r.SetQueryParam("providers", qProviders); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if o.SupportsTicketTypes != nil { + + // query param supports_ticket_types + var qrSupportsTicketTypes string + + if o.SupportsTicketTypes != nil { + qrSupportsTicketTypes = *o.SupportsTicketTypes + } + qSupportsTicketTypes := qrSupportsTicketTypes + if qSupportsTicketTypes != "" { + + if err := r.SetQueryParam("supports_ticket_types", qSupportsTicketTypes); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/list_ticketing_projects_responses.go b/client/ticketing/list_ticketing_projects_responses.go new file mode 100644 index 0000000..cee66e6 --- /dev/null +++ b/client/ticketing/list_ticketing_projects_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListTicketingProjectsReader is a Reader for the ListTicketingProjects structure. +type ListTicketingProjectsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListTicketingProjectsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListTicketingProjectsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListTicketingProjectsOK creates a ListTicketingProjectsOK with default headers values +func NewListTicketingProjectsOK() *ListTicketingProjectsOK { + return &ListTicketingProjectsOK{} +} + +/* +ListTicketingProjectsOK describes a response with status code 200, with default header values. + +List all ticketing projects available to the organization +*/ +type ListTicketingProjectsOK struct { + Payload *models.TicketingProjectsProjectListItemEntity +} + +// IsSuccess returns true when this list ticketing projects o k response has a 2xx status code +func (o *ListTicketingProjectsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list ticketing projects o k response has a 3xx status code +func (o *ListTicketingProjectsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list ticketing projects o k response has a 4xx status code +func (o *ListTicketingProjectsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list ticketing projects o k response has a 5xx status code +func (o *ListTicketingProjectsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list ticketing projects o k response a status code equal to that given +func (o *ListTicketingProjectsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListTicketingProjectsOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/projects][%d] listTicketingProjectsOK %+v", 200, o.Payload) +} + +func (o *ListTicketingProjectsOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/projects][%d] listTicketingProjectsOK %+v", 200, o.Payload) +} + +func (o *ListTicketingProjectsOK) GetPayload() *models.TicketingProjectsProjectListItemEntity { + return o.Payload +} + +func (o *ListTicketingProjectsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingProjectsProjectListItemEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/list_tickets_parameters.go b/client/ticketing/list_tickets_parameters.go new file mode 100644 index 0000000..0919480 --- /dev/null +++ b/client/ticketing/list_tickets_parameters.go @@ -0,0 +1,332 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListTicketsParams creates a new ListTicketsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListTicketsParams() *ListTicketsParams { + return &ListTicketsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListTicketsParamsWithTimeout creates a new ListTicketsParams object +// with the ability to set a timeout on a request. +func NewListTicketsParamsWithTimeout(timeout time.Duration) *ListTicketsParams { + return &ListTicketsParams{ + timeout: timeout, + } +} + +// NewListTicketsParamsWithContext creates a new ListTicketsParams object +// with the ability to set a context for a request. +func NewListTicketsParamsWithContext(ctx context.Context) *ListTicketsParams { + return &ListTicketsParams{ + Context: ctx, + } +} + +// NewListTicketsParamsWithHTTPClient creates a new ListTicketsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListTicketsParamsWithHTTPClient(client *http.Client) *ListTicketsParams { + return &ListTicketsParams{ + HTTPClient: client, + } +} + +/* +ListTicketsParams contains all the parameters to send to the API endpoint + + for the list tickets operation. + + Typically these are written to a http.Request. +*/ +type ListTicketsParams struct { + + /* AssignedUser. + + Filter tickets assigned to this user id + */ + AssignedUser *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* State. + + Filter tickets by state + */ + State *string + + /* TagMatchStrategy. + + A matching strategy for the tags provided + */ + TagMatchStrategy *string + + /* Tags. + + A comma separated list of tags + */ + Tags *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list tickets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTicketsParams) WithDefaults() *ListTicketsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list tickets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListTicketsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list tickets params +func (o *ListTicketsParams) WithTimeout(timeout time.Duration) *ListTicketsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list tickets params +func (o *ListTicketsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list tickets params +func (o *ListTicketsParams) WithContext(ctx context.Context) *ListTicketsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list tickets params +func (o *ListTicketsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list tickets params +func (o *ListTicketsParams) WithHTTPClient(client *http.Client) *ListTicketsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list tickets params +func (o *ListTicketsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAssignedUser adds the assignedUser to the list tickets params +func (o *ListTicketsParams) WithAssignedUser(assignedUser *string) *ListTicketsParams { + o.SetAssignedUser(assignedUser) + return o +} + +// SetAssignedUser adds the assignedUser to the list tickets params +func (o *ListTicketsParams) SetAssignedUser(assignedUser *string) { + o.AssignedUser = assignedUser +} + +// WithPage adds the page to the list tickets params +func (o *ListTicketsParams) WithPage(page *int32) *ListTicketsParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list tickets params +func (o *ListTicketsParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list tickets params +func (o *ListTicketsParams) WithPerPage(perPage *int32) *ListTicketsParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list tickets params +func (o *ListTicketsParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithState adds the state to the list tickets params +func (o *ListTicketsParams) WithState(state *string) *ListTicketsParams { + o.SetState(state) + return o +} + +// SetState adds the state to the list tickets params +func (o *ListTicketsParams) SetState(state *string) { + o.State = state +} + +// WithTagMatchStrategy adds the tagMatchStrategy to the list tickets params +func (o *ListTicketsParams) WithTagMatchStrategy(tagMatchStrategy *string) *ListTicketsParams { + o.SetTagMatchStrategy(tagMatchStrategy) + return o +} + +// SetTagMatchStrategy adds the tagMatchStrategy to the list tickets params +func (o *ListTicketsParams) SetTagMatchStrategy(tagMatchStrategy *string) { + o.TagMatchStrategy = tagMatchStrategy +} + +// WithTags adds the tags to the list tickets params +func (o *ListTicketsParams) WithTags(tags *string) *ListTicketsParams { + o.SetTags(tags) + return o +} + +// SetTags adds the tags to the list tickets params +func (o *ListTicketsParams) SetTags(tags *string) { + o.Tags = tags +} + +// WriteToRequest writes these params to a swagger request +func (o *ListTicketsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AssignedUser != nil { + + // query param assigned_user + var qrAssignedUser string + + if o.AssignedUser != nil { + qrAssignedUser = *o.AssignedUser + } + qAssignedUser := qrAssignedUser + if qAssignedUser != "" { + + if err := r.SetQueryParam("assigned_user", qAssignedUser); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.State != nil { + + // query param state + var qrState string + + if o.State != nil { + qrState = *o.State + } + qState := qrState + if qState != "" { + + if err := r.SetQueryParam("state", qState); err != nil { + return err + } + } + } + + if o.TagMatchStrategy != nil { + + // query param tag_match_strategy + var qrTagMatchStrategy string + + if o.TagMatchStrategy != nil { + qrTagMatchStrategy = *o.TagMatchStrategy + } + qTagMatchStrategy := qrTagMatchStrategy + if qTagMatchStrategy != "" { + + if err := r.SetQueryParam("tag_match_strategy", qTagMatchStrategy); err != nil { + return err + } + } + } + + if o.Tags != nil { + + // query param tags + var qrTags string + + if o.Tags != nil { + qrTags = *o.Tags + } + qTags := qrTags + if qTags != "" { + + if err := r.SetQueryParam("tags", qTags); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/list_tickets_responses.go b/client/ticketing/list_tickets_responses.go new file mode 100644 index 0000000..ba7b22a --- /dev/null +++ b/client/ticketing/list_tickets_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListTicketsReader is a Reader for the ListTickets structure. +type ListTicketsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListTicketsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListTicketsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListTicketsOK creates a ListTicketsOK with default headers values +func NewListTicketsOK() *ListTicketsOK { + return &ListTicketsOK{} +} + +/* +ListTicketsOK describes a response with status code 200, with default header values. + +List all of the tickets that have been added to the organiation +*/ +type ListTicketsOK struct { + Payload *models.TicketingTicketEntity +} + +// IsSuccess returns true when this list tickets o k response has a 2xx status code +func (o *ListTicketsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list tickets o k response has a 3xx status code +func (o *ListTicketsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list tickets o k response has a 4xx status code +func (o *ListTicketsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list tickets o k response has a 5xx status code +func (o *ListTicketsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list tickets o k response a status code equal to that given +func (o *ListTicketsOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListTicketsOK) Error() string { + return fmt.Sprintf("[GET /v1/ticketing/tickets][%d] listTicketsOK %+v", 200, o.Payload) +} + +func (o *ListTicketsOK) String() string { + return fmt.Sprintf("[GET /v1/ticketing/tickets][%d] listTicketsOK %+v", 200, o.Payload) +} + +func (o *ListTicketsOK) GetPayload() *models.TicketingTicketEntity { + return o.Payload +} + +func (o *ListTicketsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingTicketEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/ticketing_client.go b/client/ticketing/ticketing_client.go index bc650b3..ac3c803 100644 --- a/client/ticketing/ticketing_client.go +++ b/client/ticketing/ticketing_client.go @@ -30,88 +30,88 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1TicketingPrioritiesID(params *DeleteV1TicketingPrioritiesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TicketingPrioritiesIDOK, error) + CreateInboundFieldMap(params *CreateInboundFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateInboundFieldMapCreated, error) - DeleteV1TicketingProjectsTicketingProjectIDFieldMapsMapID(params *DeleteV1TicketingProjectsTicketingProjectIDFieldMapsMapIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TicketingProjectsTicketingProjectIDFieldMapsMapIDNoContent, error) + CreateTicket(params *CreateTicketParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTicketCreated, error) - DeleteV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapID(params *DeleteV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDNoContent, error) + CreateTicketingFieldMap(params *CreateTicketingFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTicketingFieldMapCreated, error) - DeleteV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigID(params *DeleteV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDOK, error) + CreateTicketingPriority(params *CreateTicketingPriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTicketingPriorityCreated, error) - DeleteV1TicketingTicketsTicketID(params *DeleteV1TicketingTicketsTicketIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TicketingTicketsTicketIDNoContent, error) + CreateTicketingProjectConfig(params *CreateTicketingProjectConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTicketingProjectConfigCreated, error) - GetV1TicketingPriorities(params *GetV1TicketingPrioritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingPrioritiesOK, error) + DeleteInboundFieldMap(params *DeleteInboundFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteInboundFieldMapNoContent, error) - GetV1TicketingPrioritiesID(params *GetV1TicketingPrioritiesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingPrioritiesIDOK, error) + DeleteTicket(params *DeleteTicketParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTicketNoContent, error) - GetV1TicketingProjects(params *GetV1TicketingProjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsOK, error) + DeleteTicketingFieldMap(params *DeleteTicketingFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTicketingFieldMapNoContent, error) - GetV1TicketingProjectsTicketingProjectID(params *GetV1TicketingProjectsTicketingProjectIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDOK, error) + DeleteTicketingPriority(params *DeleteTicketingPriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTicketingPriorityOK, error) - GetV1TicketingProjectsTicketingProjectIDConfigurationOptions(params *GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsOK, error) + DeleteTicketingProjectConfig(params *DeleteTicketingProjectConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTicketingProjectConfigOK, error) - GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsOptionsForFieldID(params *GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsOptionsForFieldIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsOptionsForFieldIDOK, error) + GetConfigurationOptions(params *GetConfigurationOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetConfigurationOptionsOK, error) - GetV1TicketingProjectsTicketingProjectIDFieldMapsAvailableFields(params *GetV1TicketingProjectsTicketingProjectIDFieldMapsAvailableFieldsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDFieldMapsAvailableFieldsOK, error) + GetInboundFieldMap(params *GetInboundFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetInboundFieldMapOK, error) - GetV1TicketingProjectsTicketingProjectIDFieldMapsMapID(params *GetV1TicketingProjectsTicketingProjectIDFieldMapsMapIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDFieldMapsMapIDOK, error) + GetOptionsForField(params *GetOptionsForFieldParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOptionsForFieldOK, error) - GetV1TicketingProjectsTicketingProjectIDInboundFieldMaps(params *GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsOK, error) + GetTicket(params *GetTicketParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTicketOK, error) - GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsAvailableFields(params *GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsAvailableFieldsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsAvailableFieldsOK, error) + GetTicketingFieldMap(params *GetTicketingFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTicketingFieldMapOK, error) - GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapID(params *GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDOK, error) + GetTicketingPriority(params *GetTicketingPriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTicketingPriorityOK, error) - GetV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigID(params *GetV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDOK, error) + GetTicketingProject(params *GetTicketingProjectParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTicketingProjectOK, error) - GetV1TicketingTicketTags(params *GetV1TicketingTicketTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingTicketTagsOK, error) + GetTicketingProjectConfig(params *GetTicketingProjectConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTicketingProjectConfigOK, error) - GetV1TicketingTickets(params *GetV1TicketingTicketsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingTicketsOK, error) + ListAvailableInboundFieldMaps(params *ListAvailableInboundFieldMapsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAvailableInboundFieldMapsOK, error) - GetV1TicketingTicketsTicketID(params *GetV1TicketingTicketsTicketIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingTicketsTicketIDOK, error) + ListAvailableTicketingFieldMaps(params *ListAvailableTicketingFieldMapsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAvailableTicketingFieldMapsOK, error) - PatchV1TicketingPrioritiesID(params *PatchV1TicketingPrioritiesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TicketingPrioritiesIDOK, error) + ListInboundFieldMaps(params *ListInboundFieldMapsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListInboundFieldMapsOK, error) - PatchV1TicketingProjectsTicketingProjectIDFieldMapsMapID(params *PatchV1TicketingProjectsTicketingProjectIDFieldMapsMapIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TicketingProjectsTicketingProjectIDFieldMapsMapIDOK, error) + ListTicketTags(params *ListTicketTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTicketTagsOK, error) - PatchV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigID(params *PatchV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDOK, error) + ListTicketingPriorities(params *ListTicketingPrioritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTicketingPrioritiesOK, error) - PatchV1TicketingTicketsTicketID(params *PatchV1TicketingTicketsTicketIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TicketingTicketsTicketIDOK, error) + ListTicketingProjects(params *ListTicketingProjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTicketingProjectsOK, error) - PostV1TicketingPriorities(params *PostV1TicketingPrioritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TicketingPrioritiesCreated, error) + ListTickets(params *ListTicketsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTicketsOK, error) - PostV1TicketingProjectsTicketingProjectIDFieldMaps(params *PostV1TicketingProjectsTicketingProjectIDFieldMapsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TicketingProjectsTicketingProjectIDFieldMapsCreated, error) + UpdateInboundFieldMap(params *UpdateInboundFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateInboundFieldMapOK, error) - PostV1TicketingProjectsTicketingProjectIDInboundFieldMaps(params *PostV1TicketingProjectsTicketingProjectIDInboundFieldMapsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TicketingProjectsTicketingProjectIDInboundFieldMapsCreated, error) + UpdateTicket(params *UpdateTicketParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTicketOK, error) - PostV1TicketingProjectsTicketingProjectIDProviderProjectConfigurations(params *PostV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsCreated, error) + UpdateTicketingFieldMap(params *UpdateTicketingFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTicketingFieldMapOK, error) - PostV1TicketingTickets(params *PostV1TicketingTicketsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TicketingTicketsCreated, error) + UpdateTicketingPriority(params *UpdateTicketingPriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTicketingPriorityOK, error) - PutV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapID(params *PutV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDOK, error) + UpdateTicketingProjectConfig(params *UpdateTicketingProjectConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTicketingProjectConfigOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1TicketingPrioritiesID deletes a ticketing priority +CreateInboundFieldMap creates inbound field map for a ticketing project -Delete a single ticketing priority by ID +Creates inbound field map for a ticketing project */ -func (a *Client) DeleteV1TicketingPrioritiesID(params *DeleteV1TicketingPrioritiesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TicketingPrioritiesIDOK, error) { +func (a *Client) CreateInboundFieldMap(params *CreateInboundFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateInboundFieldMapCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1TicketingPrioritiesIDParams() + params = NewCreateInboundFieldMapParams() } op := &runtime.ClientOperation{ - ID: "deleteV1TicketingPrioritiesId", - Method: "DELETE", - PathPattern: "/v1/ticketing/priorities/{id}", + ID: "create_inbound_field_map", + Method: "POST", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1TicketingPrioritiesIDReader{formats: a.formats}, + Reader: &CreateInboundFieldMapReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -124,35 +124,35 @@ func (a *Client) DeleteV1TicketingPrioritiesID(params *DeleteV1TicketingPrioriti if err != nil { return nil, err } - success, ok := result.(*DeleteV1TicketingPrioritiesIDOK) + success, ok := result.(*CreateInboundFieldMapCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1TicketingPrioritiesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_inbound_field_map: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1TicketingProjectsTicketingProjectIDFieldMapsMapID archives a field map for a ticketing project +CreateTicket creates a ticket -Archive field map for a ticketing project +Creates a ticket for a project */ -func (a *Client) DeleteV1TicketingProjectsTicketingProjectIDFieldMapsMapID(params *DeleteV1TicketingProjectsTicketingProjectIDFieldMapsMapIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TicketingProjectsTicketingProjectIDFieldMapsMapIDNoContent, error) { +func (a *Client) CreateTicket(params *CreateTicketParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTicketCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1TicketingProjectsTicketingProjectIDFieldMapsMapIDParams() + params = NewCreateTicketParams() } op := &runtime.ClientOperation{ - ID: "deleteV1TicketingProjectsTicketingProjectIdFieldMapsMapId", - Method: "DELETE", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/field_maps/{map_id}", + ID: "create_ticket", + Method: "POST", + PathPattern: "/v1/ticketing/tickets", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1TicketingProjectsTicketingProjectIDFieldMapsMapIDReader{formats: a.formats}, + Reader: &CreateTicketReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -165,35 +165,35 @@ func (a *Client) DeleteV1TicketingProjectsTicketingProjectIDFieldMapsMapID(param if err != nil { return nil, err } - success, ok := result.(*DeleteV1TicketingProjectsTicketingProjectIDFieldMapsMapIDNoContent) + success, ok := result.(*CreateTicketCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1TicketingProjectsTicketingProjectIdFieldMapsMapId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_ticket: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapID archives inbound field map for a ticketing project +CreateTicketingFieldMap creates a field mapping for a ticketing project -Archive inbound field map for a ticketing project +Creates field map for a ticketing project */ -func (a *Client) DeleteV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapID(params *DeleteV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDNoContent, error) { +func (a *Client) CreateTicketingFieldMap(params *CreateTicketingFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTicketingFieldMapCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDParams() + params = NewCreateTicketingFieldMapParams() } op := &runtime.ClientOperation{ - ID: "deleteV1TicketingProjectsTicketingProjectIdInboundFieldMapsMapId", - Method: "DELETE", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/{map_id}", + ID: "create_ticketing_field_map", + Method: "POST", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/field_maps", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDReader{formats: a.formats}, + Reader: &CreateTicketingFieldMapReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -206,35 +206,35 @@ func (a *Client) DeleteV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapI if err != nil { return nil, err } - success, ok := result.(*DeleteV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDNoContent) + success, ok := result.(*CreateTicketingFieldMapCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1TicketingProjectsTicketingProjectIdInboundFieldMapsMapId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_ticketing_field_map: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigID archives a ticketing project configuration +CreateTicketingPriority creates a ticketing priority -Archive configuration for a ticketing project +Create a single ticketing priority */ -func (a *Client) DeleteV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigID(params *DeleteV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDOK, error) { +func (a *Client) CreateTicketingPriority(params *CreateTicketingPriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTicketingPriorityCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDParams() + params = NewCreateTicketingPriorityParams() } op := &runtime.ClientOperation{ - ID: "deleteV1TicketingProjectsTicketingProjectIdProviderProjectConfigurationsConfigId", - Method: "DELETE", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations/{config_id}", + ID: "create_ticketing_priority", + Method: "POST", + PathPattern: "/v1/ticketing/priorities", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDReader{formats: a.formats}, + Reader: &CreateTicketingPriorityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -247,35 +247,35 @@ func (a *Client) DeleteV1TicketingProjectsTicketingProjectIDProviderProjectConfi if err != nil { return nil, err } - success, ok := result.(*DeleteV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDOK) + success, ok := result.(*CreateTicketingPriorityCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1TicketingProjectsTicketingProjectIdProviderProjectConfigurationsConfigId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_ticketing_priority: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -DeleteV1TicketingTicketsTicketID archives a ticket +CreateTicketingProjectConfig creates a ticketing project configuration -Archive a ticket +Creates configuration for a ticketing project */ -func (a *Client) DeleteV1TicketingTicketsTicketID(params *DeleteV1TicketingTicketsTicketIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1TicketingTicketsTicketIDNoContent, error) { +func (a *Client) CreateTicketingProjectConfig(params *CreateTicketingProjectConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTicketingProjectConfigCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1TicketingTicketsTicketIDParams() + params = NewCreateTicketingProjectConfigParams() } op := &runtime.ClientOperation{ - ID: "deleteV1TicketingTicketsTicketId", - Method: "DELETE", - PathPattern: "/v1/ticketing/tickets/{ticket_id}", + ID: "create_ticketing_project_config", + Method: "POST", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1TicketingTicketsTicketIDReader{formats: a.formats}, + Reader: &CreateTicketingProjectConfigReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -288,35 +288,35 @@ func (a *Client) DeleteV1TicketingTicketsTicketID(params *DeleteV1TicketingTicke if err != nil { return nil, err } - success, ok := result.(*DeleteV1TicketingTicketsTicketIDNoContent) + success, ok := result.(*CreateTicketingProjectConfigCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1TicketingTicketsTicketId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_ticketing_project_config: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingPriorities lists ticketing priorities +DeleteInboundFieldMap archives inbound field map for a ticketing project -List all ticketing priorities available to the organization +Archive inbound field map for a ticketing project */ -func (a *Client) GetV1TicketingPriorities(params *GetV1TicketingPrioritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingPrioritiesOK, error) { +func (a *Client) DeleteInboundFieldMap(params *DeleteInboundFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteInboundFieldMapNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingPrioritiesParams() + params = NewDeleteInboundFieldMapParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingPriorities", - Method: "GET", - PathPattern: "/v1/ticketing/priorities", + ID: "delete_inbound_field_map", + Method: "DELETE", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/{map_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingPrioritiesReader{formats: a.formats}, + Reader: &DeleteInboundFieldMapReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -329,35 +329,35 @@ func (a *Client) GetV1TicketingPriorities(params *GetV1TicketingPrioritiesParams if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingPrioritiesOK) + success, ok := result.(*DeleteInboundFieldMapNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingPriorities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_inbound_field_map: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingPrioritiesID gets a ticketing priority +DeleteTicket archives a ticket -Retrieve a single ticketing priority by ID +Archive a ticket */ -func (a *Client) GetV1TicketingPrioritiesID(params *GetV1TicketingPrioritiesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingPrioritiesIDOK, error) { +func (a *Client) DeleteTicket(params *DeleteTicketParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTicketNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingPrioritiesIDParams() + params = NewDeleteTicketParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingPrioritiesId", - Method: "GET", - PathPattern: "/v1/ticketing/priorities/{id}", + ID: "delete_ticket", + Method: "DELETE", + PathPattern: "/v1/ticketing/tickets/{ticket_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingPrioritiesIDReader{formats: a.formats}, + Reader: &DeleteTicketReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -370,35 +370,35 @@ func (a *Client) GetV1TicketingPrioritiesID(params *GetV1TicketingPrioritiesIDPa if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingPrioritiesIDOK) + success, ok := result.(*DeleteTicketNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingPrioritiesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_ticket: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingProjects lists ticketing projects +DeleteTicketingFieldMap archives a field map for a ticketing project -List all ticketing projects available to the organization +Archive field map for a ticketing project */ -func (a *Client) GetV1TicketingProjects(params *GetV1TicketingProjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsOK, error) { +func (a *Client) DeleteTicketingFieldMap(params *DeleteTicketingFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTicketingFieldMapNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingProjectsParams() + params = NewDeleteTicketingFieldMapParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingProjects", - Method: "GET", - PathPattern: "/v1/ticketing/projects", + ID: "delete_ticketing_field_map", + Method: "DELETE", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/field_maps/{map_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingProjectsReader{formats: a.formats}, + Reader: &DeleteTicketingFieldMapReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -411,35 +411,35 @@ func (a *Client) GetV1TicketingProjects(params *GetV1TicketingProjectsParams, au if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingProjectsOK) + success, ok := result.(*DeleteTicketingFieldMapNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingProjects: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_ticketing_field_map: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingProjectsTicketingProjectID gets a ticketing project +DeleteTicketingPriority deletes a ticketing priority -Retrieve a single ticketing project by ID +Delete a single ticketing priority by ID */ -func (a *Client) GetV1TicketingProjectsTicketingProjectID(params *GetV1TicketingProjectsTicketingProjectIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDOK, error) { +func (a *Client) DeleteTicketingPriority(params *DeleteTicketingPriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTicketingPriorityOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingProjectsTicketingProjectIDParams() + params = NewDeleteTicketingPriorityParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingProjectsTicketingProjectId", - Method: "GET", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}", + ID: "delete_ticketing_priority", + Method: "DELETE", + PathPattern: "/v1/ticketing/priorities/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingProjectsTicketingProjectIDReader{formats: a.formats}, + Reader: &DeleteTicketingPriorityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -452,35 +452,35 @@ func (a *Client) GetV1TicketingProjectsTicketingProjectID(params *GetV1Ticketing if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingProjectsTicketingProjectIDOK) + success, ok := result.(*DeleteTicketingPriorityOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingProjectsTicketingProjectId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_ticketing_priority: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingProjectsTicketingProjectIDConfigurationOptions lists configuration options for a ticketing project +DeleteTicketingProjectConfig archives a ticketing project configuration -List all configuration options for a ticketing project +Archive configuration for a ticketing project */ -func (a *Client) GetV1TicketingProjectsTicketingProjectIDConfigurationOptions(params *GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsOK, error) { +func (a *Client) DeleteTicketingProjectConfig(params *DeleteTicketingProjectConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTicketingProjectConfigOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingProjectsTicketingProjectIDConfigurationOptionsParams() + params = NewDeleteTicketingProjectConfigParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingProjectsTicketingProjectIdConfigurationOptions", - Method: "GET", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/configuration_options", + ID: "delete_ticketing_project_config", + Method: "DELETE", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations/{config_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsReader{formats: a.formats}, + Reader: &DeleteTicketingProjectConfigReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -493,35 +493,35 @@ func (a *Client) GetV1TicketingProjectsTicketingProjectIDConfigurationOptions(pa if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsOK) + success, ok := result.(*DeleteTicketingProjectConfigOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingProjectsTicketingProjectIdConfigurationOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_ticketing_project_config: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsOptionsForFieldID lists a field s configuration options for a ticketing project +GetConfigurationOptions lists configuration options for a ticketing project -List a field's configuration options for a ticketing project +List all configuration options for a ticketing project */ -func (a *Client) GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsOptionsForFieldID(params *GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsOptionsForFieldIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsOptionsForFieldIDOK, error) { +func (a *Client) GetConfigurationOptions(params *GetConfigurationOptionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetConfigurationOptionsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingProjectsTicketingProjectIDConfigurationOptionsOptionsForFieldIDParams() + params = NewGetConfigurationOptionsParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingProjectsTicketingProjectIdConfigurationOptionsOptionsForFieldId", + ID: "get_configuration_options", Method: "GET", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/configuration_options/options_for/{field_id}", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/configuration_options", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsOptionsForFieldIDReader{formats: a.formats}, + Reader: &GetConfigurationOptionsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -534,35 +534,35 @@ func (a *Client) GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsOpt if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingProjectsTicketingProjectIDConfigurationOptionsOptionsForFieldIDOK) + success, ok := result.(*GetConfigurationOptionsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingProjectsTicketingProjectIdConfigurationOptionsOptionsForFieldId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_configuration_options: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingProjectsTicketingProjectIDFieldMapsAvailableFields lists available fields for ticket field mapping +GetInboundFieldMap gets inbound field map for a ticketing project -Returns metadata for the fields that are available for field mapping. +Retrieve inbound field map for a ticketing project */ -func (a *Client) GetV1TicketingProjectsTicketingProjectIDFieldMapsAvailableFields(params *GetV1TicketingProjectsTicketingProjectIDFieldMapsAvailableFieldsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDFieldMapsAvailableFieldsOK, error) { +func (a *Client) GetInboundFieldMap(params *GetInboundFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetInboundFieldMapOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingProjectsTicketingProjectIDFieldMapsAvailableFieldsParams() + params = NewGetInboundFieldMapParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingProjectsTicketingProjectIdFieldMapsAvailableFields", + ID: "get_inbound_field_map", Method: "GET", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/field_maps/available_fields", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/{map_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingProjectsTicketingProjectIDFieldMapsAvailableFieldsReader{formats: a.formats}, + Reader: &GetInboundFieldMapReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -575,35 +575,35 @@ func (a *Client) GetV1TicketingProjectsTicketingProjectIDFieldMapsAvailableField if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingProjectsTicketingProjectIDFieldMapsAvailableFieldsOK) + success, ok := result.(*GetInboundFieldMapOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingProjectsTicketingProjectIdFieldMapsAvailableFields: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_inbound_field_map: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingProjectsTicketingProjectIDFieldMapsMapID gets a field map for a ticketing project +GetOptionsForField lists a field s configuration options for a ticketing project -Retrieve field map for a ticketing project +List a field's configuration options for a ticketing project */ -func (a *Client) GetV1TicketingProjectsTicketingProjectIDFieldMapsMapID(params *GetV1TicketingProjectsTicketingProjectIDFieldMapsMapIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDFieldMapsMapIDOK, error) { +func (a *Client) GetOptionsForField(params *GetOptionsForFieldParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOptionsForFieldOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingProjectsTicketingProjectIDFieldMapsMapIDParams() + params = NewGetOptionsForFieldParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingProjectsTicketingProjectIdFieldMapsMapId", + ID: "get_options_for_field", Method: "GET", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/field_maps/{map_id}", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/configuration_options/options_for/{field_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingProjectsTicketingProjectIDFieldMapsMapIDReader{formats: a.formats}, + Reader: &GetOptionsForFieldReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -616,35 +616,35 @@ func (a *Client) GetV1TicketingProjectsTicketingProjectIDFieldMapsMapID(params * if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingProjectsTicketingProjectIDFieldMapsMapIDOK) + success, ok := result.(*GetOptionsForFieldOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingProjectsTicketingProjectIdFieldMapsMapId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_options_for_field: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingProjectsTicketingProjectIDInboundFieldMaps lists inbound field maps for a ticketing project +GetTicket gets a ticket -List all inbound field maps for a ticketing project +Retrieves a single ticket by ID */ -func (a *Client) GetV1TicketingProjectsTicketingProjectIDInboundFieldMaps(params *GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsOK, error) { +func (a *Client) GetTicket(params *GetTicketParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTicketOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingProjectsTicketingProjectIDInboundFieldMapsParams() + params = NewGetTicketParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingProjectsTicketingProjectIdInboundFieldMaps", + ID: "get_ticket", Method: "GET", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps", + PathPattern: "/v1/ticketing/tickets/{ticket_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsReader{formats: a.formats}, + Reader: &GetTicketReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -657,35 +657,35 @@ func (a *Client) GetV1TicketingProjectsTicketingProjectIDInboundFieldMaps(params if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsOK) + success, ok := result.(*GetTicketOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingProjectsTicketingProjectIdInboundFieldMaps: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_ticket: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsAvailableFields lists available fields for ticket field mapping +GetTicketingFieldMap gets a field map for a ticketing project -Returns metadata for the fields that are available for inbound field mapping. +Retrieve field map for a ticketing project */ -func (a *Client) GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsAvailableFields(params *GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsAvailableFieldsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsAvailableFieldsOK, error) { +func (a *Client) GetTicketingFieldMap(params *GetTicketingFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTicketingFieldMapOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingProjectsTicketingProjectIDInboundFieldMapsAvailableFieldsParams() + params = NewGetTicketingFieldMapParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingProjectsTicketingProjectIdInboundFieldMapsAvailableFields", + ID: "get_ticketing_field_map", Method: "GET", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/available_fields", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/field_maps/{map_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsAvailableFieldsReader{formats: a.formats}, + Reader: &GetTicketingFieldMapReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -698,35 +698,35 @@ func (a *Client) GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsAvailab if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsAvailableFieldsOK) + success, ok := result.(*GetTicketingFieldMapOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingProjectsTicketingProjectIdInboundFieldMapsAvailableFields: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_ticketing_field_map: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapID gets inbound field map for a ticketing project +GetTicketingPriority gets a ticketing priority -Retrieve inbound field map for a ticketing project +Retrieve a single ticketing priority by ID */ -func (a *Client) GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapID(params *GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDOK, error) { +func (a *Client) GetTicketingPriority(params *GetTicketingPriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTicketingPriorityOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDParams() + params = NewGetTicketingPriorityParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingProjectsTicketingProjectIdInboundFieldMapsMapId", + ID: "get_ticketing_priority", Method: "GET", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/{map_id}", + PathPattern: "/v1/ticketing/priorities/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDReader{formats: a.formats}, + Reader: &GetTicketingPriorityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -739,35 +739,35 @@ func (a *Client) GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapID(p if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDOK) + success, ok := result.(*GetTicketingPriorityOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingProjectsTicketingProjectIdInboundFieldMapsMapId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_ticketing_priority: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigID gets configuration for a ticketing project +GetTicketingProject gets a ticketing project -Retrieve configuration for a ticketing project +Retrieve a single ticketing project by ID */ -func (a *Client) GetV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigID(params *GetV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDOK, error) { +func (a *Client) GetTicketingProject(params *GetTicketingProjectParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTicketingProjectOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDParams() + params = NewGetTicketingProjectParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingProjectsTicketingProjectIdProviderProjectConfigurationsConfigId", + ID: "get_ticketing_project", Method: "GET", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations/{config_id}", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDReader{formats: a.formats}, + Reader: &GetTicketingProjectReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -780,35 +780,35 @@ func (a *Client) GetV1TicketingProjectsTicketingProjectIDProviderProjectConfigur if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDOK) + success, ok := result.(*GetTicketingProjectOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingProjectsTicketingProjectIdProviderProjectConfigurationsConfigId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_ticketing_project: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingTicketTags lists ticket tags +GetTicketingProjectConfig gets configuration for a ticketing project -List all of the ticket tags in the organization +Retrieve configuration for a ticketing project */ -func (a *Client) GetV1TicketingTicketTags(params *GetV1TicketingTicketTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingTicketTagsOK, error) { +func (a *Client) GetTicketingProjectConfig(params *GetTicketingProjectConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetTicketingProjectConfigOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingTicketTagsParams() + params = NewGetTicketingProjectConfigParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingTicketTags", + ID: "get_ticketing_project_config", Method: "GET", - PathPattern: "/v1/ticketing/ticket_tags", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations/{config_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingTicketTagsReader{formats: a.formats}, + Reader: &GetTicketingProjectConfigReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -821,35 +821,35 @@ func (a *Client) GetV1TicketingTicketTags(params *GetV1TicketingTicketTagsParams if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingTicketTagsOK) + success, ok := result.(*GetTicketingProjectConfigOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingTicketTags: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_ticketing_project_config: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingTickets lists tickets +ListAvailableInboundFieldMaps lists available fields for ticket field mapping -List all of the tickets that have been added to the organiation +Returns metadata for the fields that are available for inbound field mapping. */ -func (a *Client) GetV1TicketingTickets(params *GetV1TicketingTicketsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingTicketsOK, error) { +func (a *Client) ListAvailableInboundFieldMaps(params *ListAvailableInboundFieldMapsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAvailableInboundFieldMapsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingTicketsParams() + params = NewListAvailableInboundFieldMapsParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingTickets", + ID: "list_available_inbound_field_maps", Method: "GET", - PathPattern: "/v1/ticketing/tickets", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/available_fields", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingTicketsReader{formats: a.formats}, + Reader: &ListAvailableInboundFieldMapsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -862,35 +862,35 @@ func (a *Client) GetV1TicketingTickets(params *GetV1TicketingTicketsParams, auth if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingTicketsOK) + success, ok := result.(*ListAvailableInboundFieldMapsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingTickets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_available_inbound_field_maps: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1TicketingTicketsTicketID gets a ticket +ListAvailableTicketingFieldMaps lists available fields for ticket field mapping -Retrieves a single ticket by ID +Returns metadata for the fields that are available for field mapping. */ -func (a *Client) GetV1TicketingTicketsTicketID(params *GetV1TicketingTicketsTicketIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1TicketingTicketsTicketIDOK, error) { +func (a *Client) ListAvailableTicketingFieldMaps(params *ListAvailableTicketingFieldMapsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAvailableTicketingFieldMapsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1TicketingTicketsTicketIDParams() + params = NewListAvailableTicketingFieldMapsParams() } op := &runtime.ClientOperation{ - ID: "getV1TicketingTicketsTicketId", + ID: "list_available_ticketing_field_maps", Method: "GET", - PathPattern: "/v1/ticketing/tickets/{ticket_id}", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/field_maps/available_fields", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1TicketingTicketsTicketIDReader{formats: a.formats}, + Reader: &ListAvailableTicketingFieldMapsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -903,35 +903,35 @@ func (a *Client) GetV1TicketingTicketsTicketID(params *GetV1TicketingTicketsTick if err != nil { return nil, err } - success, ok := result.(*GetV1TicketingTicketsTicketIDOK) + success, ok := result.(*ListAvailableTicketingFieldMapsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1TicketingTicketsTicketId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_available_ticketing_field_maps: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1TicketingPrioritiesID updates a ticketing priority +ListInboundFieldMaps lists inbound field maps for a ticketing project -Update a single ticketing priority's attributes +List all inbound field maps for a ticketing project */ -func (a *Client) PatchV1TicketingPrioritiesID(params *PatchV1TicketingPrioritiesIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TicketingPrioritiesIDOK, error) { +func (a *Client) ListInboundFieldMaps(params *ListInboundFieldMapsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListInboundFieldMapsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1TicketingPrioritiesIDParams() + params = NewListInboundFieldMapsParams() } op := &runtime.ClientOperation{ - ID: "patchV1TicketingPrioritiesId", - Method: "PATCH", - PathPattern: "/v1/ticketing/priorities/{id}", + ID: "list_inbound_field_maps", + Method: "GET", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1TicketingPrioritiesIDReader{formats: a.formats}, + Reader: &ListInboundFieldMapsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -944,35 +944,35 @@ func (a *Client) PatchV1TicketingPrioritiesID(params *PatchV1TicketingPriorities if err != nil { return nil, err } - success, ok := result.(*PatchV1TicketingPrioritiesIDOK) + success, ok := result.(*ListInboundFieldMapsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1TicketingPrioritiesId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_inbound_field_maps: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1TicketingProjectsTicketingProjectIDFieldMapsMapID updates a field map for a ticketing project +ListTicketTags lists ticket tags -Update field map for a ticketing project +List all of the ticket tags in the organization */ -func (a *Client) PatchV1TicketingProjectsTicketingProjectIDFieldMapsMapID(params *PatchV1TicketingProjectsTicketingProjectIDFieldMapsMapIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TicketingProjectsTicketingProjectIDFieldMapsMapIDOK, error) { +func (a *Client) ListTicketTags(params *ListTicketTagsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTicketTagsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1TicketingProjectsTicketingProjectIDFieldMapsMapIDParams() + params = NewListTicketTagsParams() } op := &runtime.ClientOperation{ - ID: "patchV1TicketingProjectsTicketingProjectIdFieldMapsMapId", - Method: "PATCH", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/field_maps/{map_id}", + ID: "list_ticket_tags", + Method: "GET", + PathPattern: "/v1/ticketing/ticket_tags", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1TicketingProjectsTicketingProjectIDFieldMapsMapIDReader{formats: a.formats}, + Reader: &ListTicketTagsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -985,35 +985,35 @@ func (a *Client) PatchV1TicketingProjectsTicketingProjectIDFieldMapsMapID(params if err != nil { return nil, err } - success, ok := result.(*PatchV1TicketingProjectsTicketingProjectIDFieldMapsMapIDOK) + success, ok := result.(*ListTicketTagsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1TicketingProjectsTicketingProjectIdFieldMapsMapId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_ticket_tags: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigID updates configuration for a ticketing project +ListTicketingPriorities lists ticketing priorities -Update configuration for a ticketing project +List all ticketing priorities available to the organization */ -func (a *Client) PatchV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigID(params *PatchV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDOK, error) { +func (a *Client) ListTicketingPriorities(params *ListTicketingPrioritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTicketingPrioritiesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDParams() + params = NewListTicketingPrioritiesParams() } op := &runtime.ClientOperation{ - ID: "patchV1TicketingProjectsTicketingProjectIdProviderProjectConfigurationsConfigId", - Method: "PATCH", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations/{config_id}", + ID: "list_ticketing_priorities", + Method: "GET", + PathPattern: "/v1/ticketing/priorities", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDReader{formats: a.formats}, + Reader: &ListTicketingPrioritiesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1026,35 +1026,35 @@ func (a *Client) PatchV1TicketingProjectsTicketingProjectIDProviderProjectConfig if err != nil { return nil, err } - success, ok := result.(*PatchV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsConfigIDOK) + success, ok := result.(*ListTicketingPrioritiesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1TicketingProjectsTicketingProjectIdProviderProjectConfigurationsConfigId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_ticketing_priorities: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1TicketingTicketsTicketID updates a ticket +ListTicketingProjects lists ticketing projects -Update a ticket's attributes +List all ticketing projects available to the organization */ -func (a *Client) PatchV1TicketingTicketsTicketID(params *PatchV1TicketingTicketsTicketIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1TicketingTicketsTicketIDOK, error) { +func (a *Client) ListTicketingProjects(params *ListTicketingProjectsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTicketingProjectsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1TicketingTicketsTicketIDParams() + params = NewListTicketingProjectsParams() } op := &runtime.ClientOperation{ - ID: "patchV1TicketingTicketsTicketId", - Method: "PATCH", - PathPattern: "/v1/ticketing/tickets/{ticket_id}", + ID: "list_ticketing_projects", + Method: "GET", + PathPattern: "/v1/ticketing/projects", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1TicketingTicketsTicketIDReader{formats: a.formats}, + Reader: &ListTicketingProjectsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1067,35 +1067,35 @@ func (a *Client) PatchV1TicketingTicketsTicketID(params *PatchV1TicketingTickets if err != nil { return nil, err } - success, ok := result.(*PatchV1TicketingTicketsTicketIDOK) + success, ok := result.(*ListTicketingProjectsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1TicketingTicketsTicketId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_ticketing_projects: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1TicketingPriorities creates a ticketing priority +ListTickets lists tickets -Create a single ticketing priority +List all of the tickets that have been added to the organiation */ -func (a *Client) PostV1TicketingPriorities(params *PostV1TicketingPrioritiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TicketingPrioritiesCreated, error) { +func (a *Client) ListTickets(params *ListTicketsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTicketsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1TicketingPrioritiesParams() + params = NewListTicketsParams() } op := &runtime.ClientOperation{ - ID: "postV1TicketingPriorities", - Method: "POST", - PathPattern: "/v1/ticketing/priorities", + ID: "list_tickets", + Method: "GET", + PathPattern: "/v1/ticketing/tickets", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1TicketingPrioritiesReader{formats: a.formats}, + Reader: &ListTicketsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1108,35 +1108,35 @@ func (a *Client) PostV1TicketingPriorities(params *PostV1TicketingPrioritiesPara if err != nil { return nil, err } - success, ok := result.(*PostV1TicketingPrioritiesCreated) + success, ok := result.(*ListTicketsOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1TicketingPriorities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_tickets: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1TicketingProjectsTicketingProjectIDFieldMaps creates a field mapping for a ticketing project +UpdateInboundFieldMap updates inbound field map for a ticketing project -Creates field map for a ticketing project +Update inbound field map for a ticketing project */ -func (a *Client) PostV1TicketingProjectsTicketingProjectIDFieldMaps(params *PostV1TicketingProjectsTicketingProjectIDFieldMapsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TicketingProjectsTicketingProjectIDFieldMapsCreated, error) { +func (a *Client) UpdateInboundFieldMap(params *UpdateInboundFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateInboundFieldMapOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1TicketingProjectsTicketingProjectIDFieldMapsParams() + params = NewUpdateInboundFieldMapParams() } op := &runtime.ClientOperation{ - ID: "postV1TicketingProjectsTicketingProjectIdFieldMaps", - Method: "POST", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/field_maps", + ID: "update_inbound_field_map", + Method: "PUT", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/{map_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1TicketingProjectsTicketingProjectIDFieldMapsReader{formats: a.formats}, + Reader: &UpdateInboundFieldMapReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1149,35 +1149,35 @@ func (a *Client) PostV1TicketingProjectsTicketingProjectIDFieldMaps(params *Post if err != nil { return nil, err } - success, ok := result.(*PostV1TicketingProjectsTicketingProjectIDFieldMapsCreated) + success, ok := result.(*UpdateInboundFieldMapOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1TicketingProjectsTicketingProjectIdFieldMaps: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_inbound_field_map: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1TicketingProjectsTicketingProjectIDInboundFieldMaps creates inbound field map for a ticketing project +UpdateTicket updates a ticket -Creates inbound field map for a ticketing project +Update a ticket's attributes */ -func (a *Client) PostV1TicketingProjectsTicketingProjectIDInboundFieldMaps(params *PostV1TicketingProjectsTicketingProjectIDInboundFieldMapsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TicketingProjectsTicketingProjectIDInboundFieldMapsCreated, error) { +func (a *Client) UpdateTicket(params *UpdateTicketParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTicketOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1TicketingProjectsTicketingProjectIDInboundFieldMapsParams() + params = NewUpdateTicketParams() } op := &runtime.ClientOperation{ - ID: "postV1TicketingProjectsTicketingProjectIdInboundFieldMaps", - Method: "POST", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps", + ID: "update_ticket", + Method: "PATCH", + PathPattern: "/v1/ticketing/tickets/{ticket_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1TicketingProjectsTicketingProjectIDInboundFieldMapsReader{formats: a.formats}, + Reader: &UpdateTicketReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1190,35 +1190,35 @@ func (a *Client) PostV1TicketingProjectsTicketingProjectIDInboundFieldMaps(param if err != nil { return nil, err } - success, ok := result.(*PostV1TicketingProjectsTicketingProjectIDInboundFieldMapsCreated) + success, ok := result.(*UpdateTicketOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1TicketingProjectsTicketingProjectIdInboundFieldMaps: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_ticket: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1TicketingProjectsTicketingProjectIDProviderProjectConfigurations creates a ticketing project configuration +UpdateTicketingFieldMap updates a field map for a ticketing project -Creates configuration for a ticketing project +Update field map for a ticketing project */ -func (a *Client) PostV1TicketingProjectsTicketingProjectIDProviderProjectConfigurations(params *PostV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsCreated, error) { +func (a *Client) UpdateTicketingFieldMap(params *UpdateTicketingFieldMapParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTicketingFieldMapOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsParams() + params = NewUpdateTicketingFieldMapParams() } op := &runtime.ClientOperation{ - ID: "postV1TicketingProjectsTicketingProjectIdProviderProjectConfigurations", - Method: "POST", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations", + ID: "update_ticketing_field_map", + Method: "PATCH", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/field_maps/{map_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsReader{formats: a.formats}, + Reader: &UpdateTicketingFieldMapReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1231,35 +1231,35 @@ func (a *Client) PostV1TicketingProjectsTicketingProjectIDProviderProjectConfigu if err != nil { return nil, err } - success, ok := result.(*PostV1TicketingProjectsTicketingProjectIDProviderProjectConfigurationsCreated) + success, ok := result.(*UpdateTicketingFieldMapOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1TicketingProjectsTicketingProjectIdProviderProjectConfigurations: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_ticketing_field_map: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1TicketingTickets creates a ticket +UpdateTicketingPriority updates a ticketing priority -Creates a ticket for a project +Update a single ticketing priority's attributes */ -func (a *Client) PostV1TicketingTickets(params *PostV1TicketingTicketsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1TicketingTicketsCreated, error) { +func (a *Client) UpdateTicketingPriority(params *UpdateTicketingPriorityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTicketingPriorityOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1TicketingTicketsParams() + params = NewUpdateTicketingPriorityParams() } op := &runtime.ClientOperation{ - ID: "postV1TicketingTickets", - Method: "POST", - PathPattern: "/v1/ticketing/tickets", + ID: "update_ticketing_priority", + Method: "PATCH", + PathPattern: "/v1/ticketing/priorities/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1TicketingTicketsReader{formats: a.formats}, + Reader: &UpdateTicketingPriorityReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1272,35 +1272,35 @@ func (a *Client) PostV1TicketingTickets(params *PostV1TicketingTicketsParams, au if err != nil { return nil, err } - success, ok := result.(*PostV1TicketingTicketsCreated) + success, ok := result.(*UpdateTicketingPriorityOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1TicketingTickets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_ticketing_priority: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PutV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapID updates inbound field map for a ticketing project +UpdateTicketingProjectConfig updates configuration for a ticketing project -Update inbound field map for a ticketing project +Update configuration for a ticketing project */ -func (a *Client) PutV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapID(params *PutV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDOK, error) { +func (a *Client) UpdateTicketingProjectConfig(params *UpdateTicketingProjectConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTicketingProjectConfigOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPutV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDParams() + params = NewUpdateTicketingProjectConfigParams() } op := &runtime.ClientOperation{ - ID: "putV1TicketingProjectsTicketingProjectIdInboundFieldMapsMapId", - Method: "PUT", - PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/{map_id}", + ID: "update_ticketing_project_config", + Method: "PATCH", + PathPattern: "/v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations/{config_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PutV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDReader{formats: a.formats}, + Reader: &UpdateTicketingProjectConfigReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1313,13 +1313,13 @@ func (a *Client) PutV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapID(p if err != nil { return nil, err } - success, ok := result.(*PutV1TicketingProjectsTicketingProjectIDInboundFieldMapsMapIDOK) + success, ok := result.(*UpdateTicketingProjectConfigOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for putV1TicketingProjectsTicketingProjectIdInboundFieldMapsMapId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_ticketing_project_config: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/ticketing/update_inbound_field_map_parameters.go b/client/ticketing/update_inbound_field_map_parameters.go new file mode 100644 index 0000000..1303013 --- /dev/null +++ b/client/ticketing/update_inbound_field_map_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateInboundFieldMapParams creates a new UpdateInboundFieldMapParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateInboundFieldMapParams() *UpdateInboundFieldMapParams { + return &UpdateInboundFieldMapParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateInboundFieldMapParamsWithTimeout creates a new UpdateInboundFieldMapParams object +// with the ability to set a timeout on a request. +func NewUpdateInboundFieldMapParamsWithTimeout(timeout time.Duration) *UpdateInboundFieldMapParams { + return &UpdateInboundFieldMapParams{ + timeout: timeout, + } +} + +// NewUpdateInboundFieldMapParamsWithContext creates a new UpdateInboundFieldMapParams object +// with the ability to set a context for a request. +func NewUpdateInboundFieldMapParamsWithContext(ctx context.Context) *UpdateInboundFieldMapParams { + return &UpdateInboundFieldMapParams{ + Context: ctx, + } +} + +// NewUpdateInboundFieldMapParamsWithHTTPClient creates a new UpdateInboundFieldMapParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateInboundFieldMapParamsWithHTTPClient(client *http.Client) *UpdateInboundFieldMapParams { + return &UpdateInboundFieldMapParams{ + HTTPClient: client, + } +} + +/* +UpdateInboundFieldMapParams contains all the parameters to send to the API endpoint + + for the update inbound field map operation. + + Typically these are written to a http.Request. +*/ +type UpdateInboundFieldMapParams struct { + + // MapID. + MapID string + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update inbound field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateInboundFieldMapParams) WithDefaults() *UpdateInboundFieldMapParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update inbound field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateInboundFieldMapParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update inbound field map params +func (o *UpdateInboundFieldMapParams) WithTimeout(timeout time.Duration) *UpdateInboundFieldMapParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update inbound field map params +func (o *UpdateInboundFieldMapParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update inbound field map params +func (o *UpdateInboundFieldMapParams) WithContext(ctx context.Context) *UpdateInboundFieldMapParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update inbound field map params +func (o *UpdateInboundFieldMapParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update inbound field map params +func (o *UpdateInboundFieldMapParams) WithHTTPClient(client *http.Client) *UpdateInboundFieldMapParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update inbound field map params +func (o *UpdateInboundFieldMapParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMapID adds the mapID to the update inbound field map params +func (o *UpdateInboundFieldMapParams) WithMapID(mapID string) *UpdateInboundFieldMapParams { + o.SetMapID(mapID) + return o +} + +// SetMapID adds the mapId to the update inbound field map params +func (o *UpdateInboundFieldMapParams) SetMapID(mapID string) { + o.MapID = mapID +} + +// WithTicketingProjectID adds the ticketingProjectID to the update inbound field map params +func (o *UpdateInboundFieldMapParams) WithTicketingProjectID(ticketingProjectID string) *UpdateInboundFieldMapParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the update inbound field map params +func (o *UpdateInboundFieldMapParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateInboundFieldMapParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param map_id + if err := r.SetPathParam("map_id", o.MapID); err != nil { + return err + } + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/update_inbound_field_map_responses.go b/client/ticketing/update_inbound_field_map_responses.go new file mode 100644 index 0000000..d1e4a80 --- /dev/null +++ b/client/ticketing/update_inbound_field_map_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateInboundFieldMapReader is a Reader for the UpdateInboundFieldMap structure. +type UpdateInboundFieldMapReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateInboundFieldMapReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateInboundFieldMapOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateInboundFieldMapOK creates a UpdateInboundFieldMapOK with default headers values +func NewUpdateInboundFieldMapOK() *UpdateInboundFieldMapOK { + return &UpdateInboundFieldMapOK{} +} + +/* +UpdateInboundFieldMapOK describes a response with status code 200, with default header values. + +Update inbound field map for a ticketing project +*/ +type UpdateInboundFieldMapOK struct { + Payload *models.TicketingProjectInboundFieldMapEntity +} + +// IsSuccess returns true when this update inbound field map o k response has a 2xx status code +func (o *UpdateInboundFieldMapOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update inbound field map o k response has a 3xx status code +func (o *UpdateInboundFieldMapOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update inbound field map o k response has a 4xx status code +func (o *UpdateInboundFieldMapOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update inbound field map o k response has a 5xx status code +func (o *UpdateInboundFieldMapOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update inbound field map o k response a status code equal to that given +func (o *UpdateInboundFieldMapOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateInboundFieldMapOK) Error() string { + return fmt.Sprintf("[PUT /v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/{map_id}][%d] updateInboundFieldMapOK %+v", 200, o.Payload) +} + +func (o *UpdateInboundFieldMapOK) String() string { + return fmt.Sprintf("[PUT /v1/ticketing/projects/{ticketing_project_id}/inbound_field_maps/{map_id}][%d] updateInboundFieldMapOK %+v", 200, o.Payload) +} + +func (o *UpdateInboundFieldMapOK) GetPayload() *models.TicketingProjectInboundFieldMapEntity { + return o.Payload +} + +func (o *UpdateInboundFieldMapOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingProjectInboundFieldMapEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/update_ticket_parameters.go b/client/ticketing/update_ticket_parameters.go new file mode 100644 index 0000000..c6fa283 --- /dev/null +++ b/client/ticketing/update_ticket_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateTicketParams creates a new UpdateTicketParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateTicketParams() *UpdateTicketParams { + return &UpdateTicketParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateTicketParamsWithTimeout creates a new UpdateTicketParams object +// with the ability to set a timeout on a request. +func NewUpdateTicketParamsWithTimeout(timeout time.Duration) *UpdateTicketParams { + return &UpdateTicketParams{ + timeout: timeout, + } +} + +// NewUpdateTicketParamsWithContext creates a new UpdateTicketParams object +// with the ability to set a context for a request. +func NewUpdateTicketParamsWithContext(ctx context.Context) *UpdateTicketParams { + return &UpdateTicketParams{ + Context: ctx, + } +} + +// NewUpdateTicketParamsWithHTTPClient creates a new UpdateTicketParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateTicketParamsWithHTTPClient(client *http.Client) *UpdateTicketParams { + return &UpdateTicketParams{ + HTTPClient: client, + } +} + +/* +UpdateTicketParams contains all the parameters to send to the API endpoint + + for the update ticket operation. + + Typically these are written to a http.Request. +*/ +type UpdateTicketParams struct { + + // TicketID. + TicketID string + + // UpdateTicket. + UpdateTicket *models.UpdateTicket + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update ticket params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTicketParams) WithDefaults() *UpdateTicketParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update ticket params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTicketParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update ticket params +func (o *UpdateTicketParams) WithTimeout(timeout time.Duration) *UpdateTicketParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update ticket params +func (o *UpdateTicketParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update ticket params +func (o *UpdateTicketParams) WithContext(ctx context.Context) *UpdateTicketParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update ticket params +func (o *UpdateTicketParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update ticket params +func (o *UpdateTicketParams) WithHTTPClient(client *http.Client) *UpdateTicketParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update ticket params +func (o *UpdateTicketParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTicketID adds the ticketID to the update ticket params +func (o *UpdateTicketParams) WithTicketID(ticketID string) *UpdateTicketParams { + o.SetTicketID(ticketID) + return o +} + +// SetTicketID adds the ticketId to the update ticket params +func (o *UpdateTicketParams) SetTicketID(ticketID string) { + o.TicketID = ticketID +} + +// WithUpdateTicket adds the updateTicket to the update ticket params +func (o *UpdateTicketParams) WithUpdateTicket(updateTicket *models.UpdateTicket) *UpdateTicketParams { + o.SetUpdateTicket(updateTicket) + return o +} + +// SetUpdateTicket adds the updateTicket to the update ticket params +func (o *UpdateTicketParams) SetUpdateTicket(updateTicket *models.UpdateTicket) { + o.UpdateTicket = updateTicket +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateTicketParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param ticket_id + if err := r.SetPathParam("ticket_id", o.TicketID); err != nil { + return err + } + if o.UpdateTicket != nil { + if err := r.SetBodyParam(o.UpdateTicket); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/update_ticket_responses.go b/client/ticketing/update_ticket_responses.go new file mode 100644 index 0000000..9bd4f23 --- /dev/null +++ b/client/ticketing/update_ticket_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateTicketReader is a Reader for the UpdateTicket structure. +type UpdateTicketReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateTicketReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateTicketOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateTicketOK creates a UpdateTicketOK with default headers values +func NewUpdateTicketOK() *UpdateTicketOK { + return &UpdateTicketOK{} +} + +/* +UpdateTicketOK describes a response with status code 200, with default header values. + +Update a ticket's attributes +*/ +type UpdateTicketOK struct { + Payload *models.TicketingTicketEntity +} + +// IsSuccess returns true when this update ticket o k response has a 2xx status code +func (o *UpdateTicketOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update ticket o k response has a 3xx status code +func (o *UpdateTicketOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update ticket o k response has a 4xx status code +func (o *UpdateTicketOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update ticket o k response has a 5xx status code +func (o *UpdateTicketOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update ticket o k response a status code equal to that given +func (o *UpdateTicketOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateTicketOK) Error() string { + return fmt.Sprintf("[PATCH /v1/ticketing/tickets/{ticket_id}][%d] updateTicketOK %+v", 200, o.Payload) +} + +func (o *UpdateTicketOK) String() string { + return fmt.Sprintf("[PATCH /v1/ticketing/tickets/{ticket_id}][%d] updateTicketOK %+v", 200, o.Payload) +} + +func (o *UpdateTicketOK) GetPayload() *models.TicketingTicketEntity { + return o.Payload +} + +func (o *UpdateTicketOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingTicketEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/update_ticketing_field_map_parameters.go b/client/ticketing/update_ticketing_field_map_parameters.go new file mode 100644 index 0000000..5b3b7c1 --- /dev/null +++ b/client/ticketing/update_ticketing_field_map_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateTicketingFieldMapParams creates a new UpdateTicketingFieldMapParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateTicketingFieldMapParams() *UpdateTicketingFieldMapParams { + return &UpdateTicketingFieldMapParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateTicketingFieldMapParamsWithTimeout creates a new UpdateTicketingFieldMapParams object +// with the ability to set a timeout on a request. +func NewUpdateTicketingFieldMapParamsWithTimeout(timeout time.Duration) *UpdateTicketingFieldMapParams { + return &UpdateTicketingFieldMapParams{ + timeout: timeout, + } +} + +// NewUpdateTicketingFieldMapParamsWithContext creates a new UpdateTicketingFieldMapParams object +// with the ability to set a context for a request. +func NewUpdateTicketingFieldMapParamsWithContext(ctx context.Context) *UpdateTicketingFieldMapParams { + return &UpdateTicketingFieldMapParams{ + Context: ctx, + } +} + +// NewUpdateTicketingFieldMapParamsWithHTTPClient creates a new UpdateTicketingFieldMapParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateTicketingFieldMapParamsWithHTTPClient(client *http.Client) *UpdateTicketingFieldMapParams { + return &UpdateTicketingFieldMapParams{ + HTTPClient: client, + } +} + +/* +UpdateTicketingFieldMapParams contains all the parameters to send to the API endpoint + + for the update ticketing field map operation. + + Typically these are written to a http.Request. +*/ +type UpdateTicketingFieldMapParams struct { + + // MapID. + MapID string + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update ticketing field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTicketingFieldMapParams) WithDefaults() *UpdateTicketingFieldMapParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update ticketing field map params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTicketingFieldMapParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update ticketing field map params +func (o *UpdateTicketingFieldMapParams) WithTimeout(timeout time.Duration) *UpdateTicketingFieldMapParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update ticketing field map params +func (o *UpdateTicketingFieldMapParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update ticketing field map params +func (o *UpdateTicketingFieldMapParams) WithContext(ctx context.Context) *UpdateTicketingFieldMapParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update ticketing field map params +func (o *UpdateTicketingFieldMapParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update ticketing field map params +func (o *UpdateTicketingFieldMapParams) WithHTTPClient(client *http.Client) *UpdateTicketingFieldMapParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update ticketing field map params +func (o *UpdateTicketingFieldMapParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMapID adds the mapID to the update ticketing field map params +func (o *UpdateTicketingFieldMapParams) WithMapID(mapID string) *UpdateTicketingFieldMapParams { + o.SetMapID(mapID) + return o +} + +// SetMapID adds the mapId to the update ticketing field map params +func (o *UpdateTicketingFieldMapParams) SetMapID(mapID string) { + o.MapID = mapID +} + +// WithTicketingProjectID adds the ticketingProjectID to the update ticketing field map params +func (o *UpdateTicketingFieldMapParams) WithTicketingProjectID(ticketingProjectID string) *UpdateTicketingFieldMapParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the update ticketing field map params +func (o *UpdateTicketingFieldMapParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateTicketingFieldMapParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param map_id + if err := r.SetPathParam("map_id", o.MapID); err != nil { + return err + } + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/update_ticketing_field_map_responses.go b/client/ticketing/update_ticketing_field_map_responses.go new file mode 100644 index 0000000..4c691fb --- /dev/null +++ b/client/ticketing/update_ticketing_field_map_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateTicketingFieldMapReader is a Reader for the UpdateTicketingFieldMap structure. +type UpdateTicketingFieldMapReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateTicketingFieldMapReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateTicketingFieldMapOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateTicketingFieldMapOK creates a UpdateTicketingFieldMapOK with default headers values +func NewUpdateTicketingFieldMapOK() *UpdateTicketingFieldMapOK { + return &UpdateTicketingFieldMapOK{} +} + +/* +UpdateTicketingFieldMapOK describes a response with status code 200, with default header values. + +Update field map for a ticketing project +*/ +type UpdateTicketingFieldMapOK struct { + Payload *models.TicketingProjectFieldMapEntity +} + +// IsSuccess returns true when this update ticketing field map o k response has a 2xx status code +func (o *UpdateTicketingFieldMapOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update ticketing field map o k response has a 3xx status code +func (o *UpdateTicketingFieldMapOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update ticketing field map o k response has a 4xx status code +func (o *UpdateTicketingFieldMapOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update ticketing field map o k response has a 5xx status code +func (o *UpdateTicketingFieldMapOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update ticketing field map o k response a status code equal to that given +func (o *UpdateTicketingFieldMapOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateTicketingFieldMapOK) Error() string { + return fmt.Sprintf("[PATCH /v1/ticketing/projects/{ticketing_project_id}/field_maps/{map_id}][%d] updateTicketingFieldMapOK %+v", 200, o.Payload) +} + +func (o *UpdateTicketingFieldMapOK) String() string { + return fmt.Sprintf("[PATCH /v1/ticketing/projects/{ticketing_project_id}/field_maps/{map_id}][%d] updateTicketingFieldMapOK %+v", 200, o.Payload) +} + +func (o *UpdateTicketingFieldMapOK) GetPayload() *models.TicketingProjectFieldMapEntity { + return o.Payload +} + +func (o *UpdateTicketingFieldMapOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingProjectFieldMapEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/update_ticketing_priority_parameters.go b/client/ticketing/update_ticketing_priority_parameters.go new file mode 100644 index 0000000..a044871 --- /dev/null +++ b/client/ticketing/update_ticketing_priority_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateTicketingPriorityParams creates a new UpdateTicketingPriorityParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateTicketingPriorityParams() *UpdateTicketingPriorityParams { + return &UpdateTicketingPriorityParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateTicketingPriorityParamsWithTimeout creates a new UpdateTicketingPriorityParams object +// with the ability to set a timeout on a request. +func NewUpdateTicketingPriorityParamsWithTimeout(timeout time.Duration) *UpdateTicketingPriorityParams { + return &UpdateTicketingPriorityParams{ + timeout: timeout, + } +} + +// NewUpdateTicketingPriorityParamsWithContext creates a new UpdateTicketingPriorityParams object +// with the ability to set a context for a request. +func NewUpdateTicketingPriorityParamsWithContext(ctx context.Context) *UpdateTicketingPriorityParams { + return &UpdateTicketingPriorityParams{ + Context: ctx, + } +} + +// NewUpdateTicketingPriorityParamsWithHTTPClient creates a new UpdateTicketingPriorityParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateTicketingPriorityParamsWithHTTPClient(client *http.Client) *UpdateTicketingPriorityParams { + return &UpdateTicketingPriorityParams{ + HTTPClient: client, + } +} + +/* +UpdateTicketingPriorityParams contains all the parameters to send to the API endpoint + + for the update ticketing priority operation. + + Typically these are written to a http.Request. +*/ +type UpdateTicketingPriorityParams struct { + + // ID. + ID string + + // UpdateTicketingPriority. + UpdateTicketingPriority *models.UpdateTicketingPriority + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update ticketing priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTicketingPriorityParams) WithDefaults() *UpdateTicketingPriorityParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update ticketing priority params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTicketingPriorityParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update ticketing priority params +func (o *UpdateTicketingPriorityParams) WithTimeout(timeout time.Duration) *UpdateTicketingPriorityParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update ticketing priority params +func (o *UpdateTicketingPriorityParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update ticketing priority params +func (o *UpdateTicketingPriorityParams) WithContext(ctx context.Context) *UpdateTicketingPriorityParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update ticketing priority params +func (o *UpdateTicketingPriorityParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update ticketing priority params +func (o *UpdateTicketingPriorityParams) WithHTTPClient(client *http.Client) *UpdateTicketingPriorityParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update ticketing priority params +func (o *UpdateTicketingPriorityParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the update ticketing priority params +func (o *UpdateTicketingPriorityParams) WithID(id string) *UpdateTicketingPriorityParams { + o.SetID(id) + return o +} + +// SetID adds the id to the update ticketing priority params +func (o *UpdateTicketingPriorityParams) SetID(id string) { + o.ID = id +} + +// WithUpdateTicketingPriority adds the updateTicketingPriority to the update ticketing priority params +func (o *UpdateTicketingPriorityParams) WithUpdateTicketingPriority(updateTicketingPriority *models.UpdateTicketingPriority) *UpdateTicketingPriorityParams { + o.SetUpdateTicketingPriority(updateTicketingPriority) + return o +} + +// SetUpdateTicketingPriority adds the updateTicketingPriority to the update ticketing priority params +func (o *UpdateTicketingPriorityParams) SetUpdateTicketingPriority(updateTicketingPriority *models.UpdateTicketingPriority) { + o.UpdateTicketingPriority = updateTicketingPriority +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateTicketingPriorityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + if o.UpdateTicketingPriority != nil { + if err := r.SetBodyParam(o.UpdateTicketingPriority); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/update_ticketing_priority_responses.go b/client/ticketing/update_ticketing_priority_responses.go new file mode 100644 index 0000000..659c462 --- /dev/null +++ b/client/ticketing/update_ticketing_priority_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateTicketingPriorityReader is a Reader for the UpdateTicketingPriority structure. +type UpdateTicketingPriorityReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateTicketingPriorityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateTicketingPriorityOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateTicketingPriorityOK creates a UpdateTicketingPriorityOK with default headers values +func NewUpdateTicketingPriorityOK() *UpdateTicketingPriorityOK { + return &UpdateTicketingPriorityOK{} +} + +/* +UpdateTicketingPriorityOK describes a response with status code 200, with default header values. + +Update a single ticketing priority's attributes +*/ +type UpdateTicketingPriorityOK struct { + Payload *models.TicketingPriorityEntity +} + +// IsSuccess returns true when this update ticketing priority o k response has a 2xx status code +func (o *UpdateTicketingPriorityOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update ticketing priority o k response has a 3xx status code +func (o *UpdateTicketingPriorityOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update ticketing priority o k response has a 4xx status code +func (o *UpdateTicketingPriorityOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update ticketing priority o k response has a 5xx status code +func (o *UpdateTicketingPriorityOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update ticketing priority o k response a status code equal to that given +func (o *UpdateTicketingPriorityOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateTicketingPriorityOK) Error() string { + return fmt.Sprintf("[PATCH /v1/ticketing/priorities/{id}][%d] updateTicketingPriorityOK %+v", 200, o.Payload) +} + +func (o *UpdateTicketingPriorityOK) String() string { + return fmt.Sprintf("[PATCH /v1/ticketing/priorities/{id}][%d] updateTicketingPriorityOK %+v", 200, o.Payload) +} + +func (o *UpdateTicketingPriorityOK) GetPayload() *models.TicketingPriorityEntity { + return o.Payload +} + +func (o *UpdateTicketingPriorityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingPriorityEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/ticketing/update_ticketing_project_config_parameters.go b/client/ticketing/update_ticketing_project_config_parameters.go new file mode 100644 index 0000000..8bf0f42 --- /dev/null +++ b/client/ticketing/update_ticketing_project_config_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateTicketingProjectConfigParams creates a new UpdateTicketingProjectConfigParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateTicketingProjectConfigParams() *UpdateTicketingProjectConfigParams { + return &UpdateTicketingProjectConfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateTicketingProjectConfigParamsWithTimeout creates a new UpdateTicketingProjectConfigParams object +// with the ability to set a timeout on a request. +func NewUpdateTicketingProjectConfigParamsWithTimeout(timeout time.Duration) *UpdateTicketingProjectConfigParams { + return &UpdateTicketingProjectConfigParams{ + timeout: timeout, + } +} + +// NewUpdateTicketingProjectConfigParamsWithContext creates a new UpdateTicketingProjectConfigParams object +// with the ability to set a context for a request. +func NewUpdateTicketingProjectConfigParamsWithContext(ctx context.Context) *UpdateTicketingProjectConfigParams { + return &UpdateTicketingProjectConfigParams{ + Context: ctx, + } +} + +// NewUpdateTicketingProjectConfigParamsWithHTTPClient creates a new UpdateTicketingProjectConfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateTicketingProjectConfigParamsWithHTTPClient(client *http.Client) *UpdateTicketingProjectConfigParams { + return &UpdateTicketingProjectConfigParams{ + HTTPClient: client, + } +} + +/* +UpdateTicketingProjectConfigParams contains all the parameters to send to the API endpoint + + for the update ticketing project config operation. + + Typically these are written to a http.Request. +*/ +type UpdateTicketingProjectConfigParams struct { + + // ConfigID. + ConfigID string + + // TicketingProjectID. + TicketingProjectID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update ticketing project config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTicketingProjectConfigParams) WithDefaults() *UpdateTicketingProjectConfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update ticketing project config params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateTicketingProjectConfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update ticketing project config params +func (o *UpdateTicketingProjectConfigParams) WithTimeout(timeout time.Duration) *UpdateTicketingProjectConfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update ticketing project config params +func (o *UpdateTicketingProjectConfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update ticketing project config params +func (o *UpdateTicketingProjectConfigParams) WithContext(ctx context.Context) *UpdateTicketingProjectConfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update ticketing project config params +func (o *UpdateTicketingProjectConfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update ticketing project config params +func (o *UpdateTicketingProjectConfigParams) WithHTTPClient(client *http.Client) *UpdateTicketingProjectConfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update ticketing project config params +func (o *UpdateTicketingProjectConfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConfigID adds the configID to the update ticketing project config params +func (o *UpdateTicketingProjectConfigParams) WithConfigID(configID string) *UpdateTicketingProjectConfigParams { + o.SetConfigID(configID) + return o +} + +// SetConfigID adds the configId to the update ticketing project config params +func (o *UpdateTicketingProjectConfigParams) SetConfigID(configID string) { + o.ConfigID = configID +} + +// WithTicketingProjectID adds the ticketingProjectID to the update ticketing project config params +func (o *UpdateTicketingProjectConfigParams) WithTicketingProjectID(ticketingProjectID string) *UpdateTicketingProjectConfigParams { + o.SetTicketingProjectID(ticketingProjectID) + return o +} + +// SetTicketingProjectID adds the ticketingProjectId to the update ticketing project config params +func (o *UpdateTicketingProjectConfigParams) SetTicketingProjectID(ticketingProjectID string) { + o.TicketingProjectID = ticketingProjectID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateTicketingProjectConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param config_id + if err := r.SetPathParam("config_id", o.ConfigID); err != nil { + return err + } + + // path param ticketing_project_id + if err := r.SetPathParam("ticketing_project_id", o.TicketingProjectID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/ticketing/update_ticketing_project_config_responses.go b/client/ticketing/update_ticketing_project_config_responses.go new file mode 100644 index 0000000..2eea65e --- /dev/null +++ b/client/ticketing/update_ticketing_project_config_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ticketing + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateTicketingProjectConfigReader is a Reader for the UpdateTicketingProjectConfig structure. +type UpdateTicketingProjectConfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateTicketingProjectConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateTicketingProjectConfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateTicketingProjectConfigOK creates a UpdateTicketingProjectConfigOK with default headers values +func NewUpdateTicketingProjectConfigOK() *UpdateTicketingProjectConfigOK { + return &UpdateTicketingProjectConfigOK{} +} + +/* +UpdateTicketingProjectConfigOK describes a response with status code 200, with default header values. + +Update configuration for a ticketing project +*/ +type UpdateTicketingProjectConfigOK struct { + Payload *models.TicketingProjectConfigEntity +} + +// IsSuccess returns true when this update ticketing project config o k response has a 2xx status code +func (o *UpdateTicketingProjectConfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update ticketing project config o k response has a 3xx status code +func (o *UpdateTicketingProjectConfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update ticketing project config o k response has a 4xx status code +func (o *UpdateTicketingProjectConfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update ticketing project config o k response has a 5xx status code +func (o *UpdateTicketingProjectConfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update ticketing project config o k response a status code equal to that given +func (o *UpdateTicketingProjectConfigOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateTicketingProjectConfigOK) Error() string { + return fmt.Sprintf("[PATCH /v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations/{config_id}][%d] updateTicketingProjectConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateTicketingProjectConfigOK) String() string { + return fmt.Sprintf("[PATCH /v1/ticketing/projects/{ticketing_project_id}/provider_project_configurations/{config_id}][%d] updateTicketingProjectConfigOK %+v", 200, o.Payload) +} + +func (o *UpdateTicketingProjectConfigOK) GetPayload() *models.TicketingProjectConfigEntity { + return o.Payload +} + +func (o *UpdateTicketingProjectConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TicketingProjectConfigEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/users/get_current_user_parameters.go b/client/users/get_current_user_parameters.go new file mode 100644 index 0000000..3384fdf --- /dev/null +++ b/client/users/get_current_user_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetCurrentUserParams creates a new GetCurrentUserParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetCurrentUserParams() *GetCurrentUserParams { + return &GetCurrentUserParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetCurrentUserParamsWithTimeout creates a new GetCurrentUserParams object +// with the ability to set a timeout on a request. +func NewGetCurrentUserParamsWithTimeout(timeout time.Duration) *GetCurrentUserParams { + return &GetCurrentUserParams{ + timeout: timeout, + } +} + +// NewGetCurrentUserParamsWithContext creates a new GetCurrentUserParams object +// with the ability to set a context for a request. +func NewGetCurrentUserParamsWithContext(ctx context.Context) *GetCurrentUserParams { + return &GetCurrentUserParams{ + Context: ctx, + } +} + +// NewGetCurrentUserParamsWithHTTPClient creates a new GetCurrentUserParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetCurrentUserParamsWithHTTPClient(client *http.Client) *GetCurrentUserParams { + return &GetCurrentUserParams{ + HTTPClient: client, + } +} + +/* +GetCurrentUserParams contains all the parameters to send to the API endpoint + + for the get current user operation. + + Typically these are written to a http.Request. +*/ +type GetCurrentUserParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get current user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCurrentUserParams) WithDefaults() *GetCurrentUserParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get current user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCurrentUserParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get current user params +func (o *GetCurrentUserParams) WithTimeout(timeout time.Duration) *GetCurrentUserParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get current user params +func (o *GetCurrentUserParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get current user params +func (o *GetCurrentUserParams) WithContext(ctx context.Context) *GetCurrentUserParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get current user params +func (o *GetCurrentUserParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get current user params +func (o *GetCurrentUserParams) WithHTTPClient(client *http.Client) *GetCurrentUserParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get current user params +func (o *GetCurrentUserParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCurrentUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/users/get_current_user_responses.go b/client/users/get_current_user_responses.go new file mode 100644 index 0000000..be6eb44 --- /dev/null +++ b/client/users/get_current_user_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetCurrentUserReader is a Reader for the GetCurrentUser structure. +type GetCurrentUserReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCurrentUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCurrentUserOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetCurrentUserOK creates a GetCurrentUserOK with default headers values +func NewGetCurrentUserOK() *GetCurrentUserOK { + return &GetCurrentUserOK{} +} + +/* +GetCurrentUserOK describes a response with status code 200, with default header values. + +Retrieve the current user +*/ +type GetCurrentUserOK struct { + Payload *models.CurrentUserEntity +} + +// IsSuccess returns true when this get current user o k response has a 2xx status code +func (o *GetCurrentUserOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get current user o k response has a 3xx status code +func (o *GetCurrentUserOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get current user o k response has a 4xx status code +func (o *GetCurrentUserOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get current user o k response has a 5xx status code +func (o *GetCurrentUserOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get current user o k response a status code equal to that given +func (o *GetCurrentUserOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetCurrentUserOK) Error() string { + return fmt.Sprintf("[GET /v1/current_user][%d] getCurrentUserOK %+v", 200, o.Payload) +} + +func (o *GetCurrentUserOK) String() string { + return fmt.Sprintf("[GET /v1/current_user][%d] getCurrentUserOK %+v", 200, o.Payload) +} + +func (o *GetCurrentUserOK) GetPayload() *models.CurrentUserEntity { + return o.Payload +} + +func (o *GetCurrentUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CurrentUserEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/users/get_user_parameters.go b/client/users/get_user_parameters.go new file mode 100644 index 0000000..dc6e81f --- /dev/null +++ b/client/users/get_user_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetUserParams creates a new GetUserParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetUserParams() *GetUserParams { + return &GetUserParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetUserParamsWithTimeout creates a new GetUserParams object +// with the ability to set a timeout on a request. +func NewGetUserParamsWithTimeout(timeout time.Duration) *GetUserParams { + return &GetUserParams{ + timeout: timeout, + } +} + +// NewGetUserParamsWithContext creates a new GetUserParams object +// with the ability to set a context for a request. +func NewGetUserParamsWithContext(ctx context.Context) *GetUserParams { + return &GetUserParams{ + Context: ctx, + } +} + +// NewGetUserParamsWithHTTPClient creates a new GetUserParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetUserParamsWithHTTPClient(client *http.Client) *GetUserParams { + return &GetUserParams{ + HTTPClient: client, + } +} + +/* +GetUserParams contains all the parameters to send to the API endpoint + + for the get user operation. + + Typically these are written to a http.Request. +*/ +type GetUserParams struct { + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUserParams) WithDefaults() *GetUserParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetUserParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get user params +func (o *GetUserParams) WithTimeout(timeout time.Duration) *GetUserParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get user params +func (o *GetUserParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get user params +func (o *GetUserParams) WithContext(ctx context.Context) *GetUserParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get user params +func (o *GetUserParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get user params +func (o *GetUserParams) WithHTTPClient(client *http.Client) *GetUserParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get user params +func (o *GetUserParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get user params +func (o *GetUserParams) WithID(id string) *GetUserParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get user params +func (o *GetUserParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *GetUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/users/get_user_responses.go b/client/users/get_user_responses.go new file mode 100644 index 0000000..3266dae --- /dev/null +++ b/client/users/get_user_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetUserReader is a Reader for the GetUser structure. +type GetUserReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetUserOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetUserOK creates a GetUserOK with default headers values +func NewGetUserOK() *GetUserOK { + return &GetUserOK{} +} + +/* +GetUserOK describes a response with status code 200, with default header values. + +Retrieve a single user by ID +*/ +type GetUserOK struct { + Payload *models.UserEntity +} + +// IsSuccess returns true when this get user o k response has a 2xx status code +func (o *GetUserOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get user o k response has a 3xx status code +func (o *GetUserOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get user o k response has a 4xx status code +func (o *GetUserOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get user o k response has a 5xx status code +func (o *GetUserOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get user o k response a status code equal to that given +func (o *GetUserOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetUserOK) Error() string { + return fmt.Sprintf("[GET /v1/users/{id}][%d] getUserOK %+v", 200, o.Payload) +} + +func (o *GetUserOK) String() string { + return fmt.Sprintf("[GET /v1/users/{id}][%d] getUserOK %+v", 200, o.Payload) +} + +func (o *GetUserOK) GetPayload() *models.UserEntity { + return o.Payload +} + +func (o *GetUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.UserEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/users/list_users_parameters.go b/client/users/list_users_parameters.go new file mode 100644 index 0000000..0e60595 --- /dev/null +++ b/client/users/list_users_parameters.go @@ -0,0 +1,264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListUsersParams creates a new ListUsersParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListUsersParams() *ListUsersParams { + return &ListUsersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListUsersParamsWithTimeout creates a new ListUsersParams object +// with the ability to set a timeout on a request. +func NewListUsersParamsWithTimeout(timeout time.Duration) *ListUsersParams { + return &ListUsersParams{ + timeout: timeout, + } +} + +// NewListUsersParamsWithContext creates a new ListUsersParams object +// with the ability to set a context for a request. +func NewListUsersParamsWithContext(ctx context.Context) *ListUsersParams { + return &ListUsersParams{ + Context: ctx, + } +} + +// NewListUsersParamsWithHTTPClient creates a new ListUsersParams object +// with the ability to set a custom HTTPClient for a request. +func NewListUsersParamsWithHTTPClient(client *http.Client) *ListUsersParams { + return &ListUsersParams{ + HTTPClient: client, + } +} + +/* +ListUsersParams contains all the parameters to send to the API endpoint + + for the list users operation. + + Typically these are written to a http.Request. +*/ +type ListUsersParams struct { + + /* Name. + + Text string of a query to filter users by name + */ + Name *string + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + /* Query. + + Text string of a query to filter users by name or email + */ + Query *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListUsersParams) WithDefaults() *ListUsersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list users params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListUsersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list users params +func (o *ListUsersParams) WithTimeout(timeout time.Duration) *ListUsersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list users params +func (o *ListUsersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list users params +func (o *ListUsersParams) WithContext(ctx context.Context) *ListUsersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list users params +func (o *ListUsersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list users params +func (o *ListUsersParams) WithHTTPClient(client *http.Client) *ListUsersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list users params +func (o *ListUsersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithName adds the name to the list users params +func (o *ListUsersParams) WithName(name *string) *ListUsersParams { + o.SetName(name) + return o +} + +// SetName adds the name to the list users params +func (o *ListUsersParams) SetName(name *string) { + o.Name = name +} + +// WithPage adds the page to the list users params +func (o *ListUsersParams) WithPage(page *int32) *ListUsersParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list users params +func (o *ListUsersParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list users params +func (o *ListUsersParams) WithPerPage(perPage *int32) *ListUsersParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list users params +func (o *ListUsersParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WithQuery adds the query to the list users params +func (o *ListUsersParams) WithQuery(query *string) *ListUsersParams { + o.SetQuery(query) + return o +} + +// SetQuery adds the query to the list users params +func (o *ListUsersParams) SetQuery(query *string) { + o.Query = query +} + +// WriteToRequest writes these params to a swagger request +func (o *ListUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if o.Query != nil { + + // query param query + var qrQuery string + + if o.Query != nil { + qrQuery = *o.Query + } + qQuery := qrQuery + if qQuery != "" { + + if err := r.SetQueryParam("query", qQuery); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/users/list_users_responses.go b/client/users/list_users_responses.go new file mode 100644 index 0000000..6120f35 --- /dev/null +++ b/client/users/list_users_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListUsersReader is a Reader for the ListUsers structure. +type ListUsersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListUsersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListUsersOK creates a ListUsersOK with default headers values +func NewListUsersOK() *ListUsersOK { + return &ListUsersOK{} +} + +/* +ListUsersOK describes a response with status code 200, with default header values. + +Retrieve a list of all users in an organization +*/ +type ListUsersOK struct { + Payload *models.UserEntityPaginated +} + +// IsSuccess returns true when this list users o k response has a 2xx status code +func (o *ListUsersOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list users o k response has a 3xx status code +func (o *ListUsersOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list users o k response has a 4xx status code +func (o *ListUsersOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list users o k response has a 5xx status code +func (o *ListUsersOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list users o k response a status code equal to that given +func (o *ListUsersOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListUsersOK) Error() string { + return fmt.Sprintf("[GET /v1/users][%d] listUsersOK %+v", 200, o.Payload) +} + +func (o *ListUsersOK) String() string { + return fmt.Sprintf("[GET /v1/users][%d] listUsersOK %+v", 200, o.Payload) +} + +func (o *ListUsersOK) GetPayload() *models.UserEntityPaginated { + return o.Payload +} + +func (o *ListUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.UserEntityPaginated) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/users/users_client.go b/client/users/users_client.go index 03697e2..eaa8bcf 100644 --- a/client/users/users_client.go +++ b/client/users/users_client.go @@ -30,34 +30,34 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - GetV1CurrentUser(params *GetV1CurrentUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1CurrentUserOK, error) + GetCurrentUser(params *GetCurrentUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentUserOK, error) - GetV1Users(params *GetV1UsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1UsersOK, error) + GetUser(params *GetUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUserOK, error) - GetV1UsersID(params *GetV1UsersIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1UsersIDOK, error) + ListUsers(params *ListUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListUsersOK, error) SetTransport(transport runtime.ClientTransport) } /* -GetV1CurrentUser gets the currently authenticated user +GetCurrentUser gets the currently authenticated user Retrieve the current user */ -func (a *Client) GetV1CurrentUser(params *GetV1CurrentUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1CurrentUserOK, error) { +func (a *Client) GetCurrentUser(params *GetCurrentUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentUserOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1CurrentUserParams() + params = NewGetCurrentUserParams() } op := &runtime.ClientOperation{ - ID: "getV1CurrentUser", + ID: "get_current_user", Method: "GET", PathPattern: "/v1/current_user", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1CurrentUserReader{formats: a.formats}, + Reader: &GetCurrentUserReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -70,35 +70,35 @@ func (a *Client) GetV1CurrentUser(params *GetV1CurrentUserParams, authInfo runti if err != nil { return nil, err } - success, ok := result.(*GetV1CurrentUserOK) + success, ok := result.(*GetCurrentUserOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1CurrentUser: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_current_user: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Users lists users +GetUser gets a user -Retrieve a list of all users in an organization +Retrieve a single user by ID */ -func (a *Client) GetV1Users(params *GetV1UsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1UsersOK, error) { +func (a *Client) GetUser(params *GetUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUserOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1UsersParams() + params = NewGetUserParams() } op := &runtime.ClientOperation{ - ID: "getV1Users", + ID: "get_user", Method: "GET", - PathPattern: "/v1/users", + PathPattern: "/v1/users/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1UsersReader{formats: a.formats}, + Reader: &GetUserReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -111,35 +111,35 @@ func (a *Client) GetV1Users(params *GetV1UsersParams, authInfo runtime.ClientAut if err != nil { return nil, err } - success, ok := result.(*GetV1UsersOK) + success, ok := result.(*GetUserOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Users: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_user: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1UsersID gets a user +ListUsers lists users -Retrieve a single user by ID +Retrieve a list of all users in an organization */ -func (a *Client) GetV1UsersID(params *GetV1UsersIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1UsersIDOK, error) { +func (a *Client) ListUsers(params *ListUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListUsersOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1UsersIDParams() + params = NewListUsersParams() } op := &runtime.ClientOperation{ - ID: "getV1UsersId", + ID: "list_users", Method: "GET", - PathPattern: "/v1/users/{id}", + PathPattern: "/v1/users", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1UsersIDReader{formats: a.formats}, + Reader: &ListUsersReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -152,13 +152,13 @@ func (a *Client) GetV1UsersID(params *GetV1UsersIDParams, authInfo runtime.Clien if err != nil { return nil, err } - success, ok := result.(*GetV1UsersIDOK) + success, ok := result.(*ListUsersOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1UsersId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_users: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/client/webhooks/create_webhook_parameters.go b/client/webhooks/create_webhook_parameters.go new file mode 100644 index 0000000..7fcb4d7 --- /dev/null +++ b/client/webhooks/create_webhook_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewCreateWebhookParams creates a new CreateWebhookParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateWebhookParams() *CreateWebhookParams { + return &CreateWebhookParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateWebhookParamsWithTimeout creates a new CreateWebhookParams object +// with the ability to set a timeout on a request. +func NewCreateWebhookParamsWithTimeout(timeout time.Duration) *CreateWebhookParams { + return &CreateWebhookParams{ + timeout: timeout, + } +} + +// NewCreateWebhookParamsWithContext creates a new CreateWebhookParams object +// with the ability to set a context for a request. +func NewCreateWebhookParamsWithContext(ctx context.Context) *CreateWebhookParams { + return &CreateWebhookParams{ + Context: ctx, + } +} + +// NewCreateWebhookParamsWithHTTPClient creates a new CreateWebhookParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateWebhookParamsWithHTTPClient(client *http.Client) *CreateWebhookParams { + return &CreateWebhookParams{ + HTTPClient: client, + } +} + +/* +CreateWebhookParams contains all the parameters to send to the API endpoint + + for the create webhook operation. + + Typically these are written to a http.Request. +*/ +type CreateWebhookParams struct { + + // CreateWebhook. + CreateWebhook *models.CreateWebhook + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create webhook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateWebhookParams) WithDefaults() *CreateWebhookParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create webhook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateWebhookParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create webhook params +func (o *CreateWebhookParams) WithTimeout(timeout time.Duration) *CreateWebhookParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create webhook params +func (o *CreateWebhookParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create webhook params +func (o *CreateWebhookParams) WithContext(ctx context.Context) *CreateWebhookParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create webhook params +func (o *CreateWebhookParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create webhook params +func (o *CreateWebhookParams) WithHTTPClient(client *http.Client) *CreateWebhookParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create webhook params +func (o *CreateWebhookParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreateWebhook adds the createWebhook to the create webhook params +func (o *CreateWebhookParams) WithCreateWebhook(createWebhook *models.CreateWebhook) *CreateWebhookParams { + o.SetCreateWebhook(createWebhook) + return o +} + +// SetCreateWebhook adds the createWebhook to the create webhook params +func (o *CreateWebhookParams) SetCreateWebhook(createWebhook *models.CreateWebhook) { + o.CreateWebhook = createWebhook +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateWebhookParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.CreateWebhook != nil { + if err := r.SetBodyParam(o.CreateWebhook); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/webhooks/create_webhook_responses.go b/client/webhooks/create_webhook_responses.go new file mode 100644 index 0000000..528f986 --- /dev/null +++ b/client/webhooks/create_webhook_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// CreateWebhookReader is a Reader for the CreateWebhook structure. +type CreateWebhookReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateWebhookReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateWebhookCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateWebhookCreated creates a CreateWebhookCreated with default headers values +func NewCreateWebhookCreated() *CreateWebhookCreated { + return &CreateWebhookCreated{} +} + +/* +CreateWebhookCreated describes a response with status code 201, with default header values. + +Create a new webhook +*/ +type CreateWebhookCreated struct { + Payload *models.WebhooksEntitiesWebhookEntity +} + +// IsSuccess returns true when this create webhook created response has a 2xx status code +func (o *CreateWebhookCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create webhook created response has a 3xx status code +func (o *CreateWebhookCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create webhook created response has a 4xx status code +func (o *CreateWebhookCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create webhook created response has a 5xx status code +func (o *CreateWebhookCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create webhook created response a status code equal to that given +func (o *CreateWebhookCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *CreateWebhookCreated) Error() string { + return fmt.Sprintf("[POST /v1/webhooks][%d] createWebhookCreated %+v", 201, o.Payload) +} + +func (o *CreateWebhookCreated) String() string { + return fmt.Sprintf("[POST /v1/webhooks][%d] createWebhookCreated %+v", 201, o.Payload) +} + +func (o *CreateWebhookCreated) GetPayload() *models.WebhooksEntitiesWebhookEntity { + return o.Payload +} + +func (o *CreateWebhookCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WebhooksEntitiesWebhookEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/webhooks/delete_webhook_parameters.go b/client/webhooks/delete_webhook_parameters.go new file mode 100644 index 0000000..20209b4 --- /dev/null +++ b/client/webhooks/delete_webhook_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteWebhookParams creates a new DeleteWebhookParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteWebhookParams() *DeleteWebhookParams { + return &DeleteWebhookParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteWebhookParamsWithTimeout creates a new DeleteWebhookParams object +// with the ability to set a timeout on a request. +func NewDeleteWebhookParamsWithTimeout(timeout time.Duration) *DeleteWebhookParams { + return &DeleteWebhookParams{ + timeout: timeout, + } +} + +// NewDeleteWebhookParamsWithContext creates a new DeleteWebhookParams object +// with the ability to set a context for a request. +func NewDeleteWebhookParamsWithContext(ctx context.Context) *DeleteWebhookParams { + return &DeleteWebhookParams{ + Context: ctx, + } +} + +// NewDeleteWebhookParamsWithHTTPClient creates a new DeleteWebhookParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteWebhookParamsWithHTTPClient(client *http.Client) *DeleteWebhookParams { + return &DeleteWebhookParams{ + HTTPClient: client, + } +} + +/* +DeleteWebhookParams contains all the parameters to send to the API endpoint + + for the delete webhook operation. + + Typically these are written to a http.Request. +*/ +type DeleteWebhookParams struct { + + // WebhookID. + WebhookID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete webhook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteWebhookParams) WithDefaults() *DeleteWebhookParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete webhook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteWebhookParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete webhook params +func (o *DeleteWebhookParams) WithTimeout(timeout time.Duration) *DeleteWebhookParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete webhook params +func (o *DeleteWebhookParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete webhook params +func (o *DeleteWebhookParams) WithContext(ctx context.Context) *DeleteWebhookParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete webhook params +func (o *DeleteWebhookParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete webhook params +func (o *DeleteWebhookParams) WithHTTPClient(client *http.Client) *DeleteWebhookParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete webhook params +func (o *DeleteWebhookParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithWebhookID adds the webhookID to the delete webhook params +func (o *DeleteWebhookParams) WithWebhookID(webhookID string) *DeleteWebhookParams { + o.SetWebhookID(webhookID) + return o +} + +// SetWebhookID adds the webhookId to the delete webhook params +func (o *DeleteWebhookParams) SetWebhookID(webhookID string) { + o.WebhookID = webhookID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteWebhookParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param webhook_id + if err := r.SetPathParam("webhook_id", o.WebhookID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/webhooks/delete_webhook_responses.go b/client/webhooks/delete_webhook_responses.go new file mode 100644 index 0000000..3632902 --- /dev/null +++ b/client/webhooks/delete_webhook_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteWebhookReader is a Reader for the DeleteWebhook structure. +type DeleteWebhookReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteWebhookReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteWebhookNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteWebhookNoContent creates a DeleteWebhookNoContent with default headers values +func NewDeleteWebhookNoContent() *DeleteWebhookNoContent { + return &DeleteWebhookNoContent{} +} + +/* +DeleteWebhookNoContent describes a response with status code 204, with default header values. + +Delete a specific webhook +*/ +type DeleteWebhookNoContent struct { +} + +// IsSuccess returns true when this delete webhook no content response has a 2xx status code +func (o *DeleteWebhookNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete webhook no content response has a 3xx status code +func (o *DeleteWebhookNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete webhook no content response has a 4xx status code +func (o *DeleteWebhookNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete webhook no content response has a 5xx status code +func (o *DeleteWebhookNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete webhook no content response a status code equal to that given +func (o *DeleteWebhookNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteWebhookNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/webhooks/{webhook_id}][%d] deleteWebhookNoContent ", 204) +} + +func (o *DeleteWebhookNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/webhooks/{webhook_id}][%d] deleteWebhookNoContent ", 204) +} + +func (o *DeleteWebhookNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/webhooks/get_webhook_parameters.go b/client/webhooks/get_webhook_parameters.go new file mode 100644 index 0000000..48741d7 --- /dev/null +++ b/client/webhooks/get_webhook_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetWebhookParams creates a new GetWebhookParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetWebhookParams() *GetWebhookParams { + return &GetWebhookParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetWebhookParamsWithTimeout creates a new GetWebhookParams object +// with the ability to set a timeout on a request. +func NewGetWebhookParamsWithTimeout(timeout time.Duration) *GetWebhookParams { + return &GetWebhookParams{ + timeout: timeout, + } +} + +// NewGetWebhookParamsWithContext creates a new GetWebhookParams object +// with the ability to set a context for a request. +func NewGetWebhookParamsWithContext(ctx context.Context) *GetWebhookParams { + return &GetWebhookParams{ + Context: ctx, + } +} + +// NewGetWebhookParamsWithHTTPClient creates a new GetWebhookParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetWebhookParamsWithHTTPClient(client *http.Client) *GetWebhookParams { + return &GetWebhookParams{ + HTTPClient: client, + } +} + +/* +GetWebhookParams contains all the parameters to send to the API endpoint + + for the get webhook operation. + + Typically these are written to a http.Request. +*/ +type GetWebhookParams struct { + + // WebhookID. + WebhookID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get webhook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetWebhookParams) WithDefaults() *GetWebhookParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get webhook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetWebhookParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get webhook params +func (o *GetWebhookParams) WithTimeout(timeout time.Duration) *GetWebhookParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get webhook params +func (o *GetWebhookParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get webhook params +func (o *GetWebhookParams) WithContext(ctx context.Context) *GetWebhookParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get webhook params +func (o *GetWebhookParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get webhook params +func (o *GetWebhookParams) WithHTTPClient(client *http.Client) *GetWebhookParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get webhook params +func (o *GetWebhookParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithWebhookID adds the webhookID to the get webhook params +func (o *GetWebhookParams) WithWebhookID(webhookID string) *GetWebhookParams { + o.SetWebhookID(webhookID) + return o +} + +// SetWebhookID adds the webhookId to the get webhook params +func (o *GetWebhookParams) SetWebhookID(webhookID string) { + o.WebhookID = webhookID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetWebhookParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param webhook_id + if err := r.SetPathParam("webhook_id", o.WebhookID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/webhooks/get_webhook_responses.go b/client/webhooks/get_webhook_responses.go new file mode 100644 index 0000000..20add16 --- /dev/null +++ b/client/webhooks/get_webhook_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// GetWebhookReader is a Reader for the GetWebhook structure. +type GetWebhookReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetWebhookReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetWebhookOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetWebhookOK creates a GetWebhookOK with default headers values +func NewGetWebhookOK() *GetWebhookOK { + return &GetWebhookOK{} +} + +/* +GetWebhookOK describes a response with status code 200, with default header values. + +Retrieve a specific webhook +*/ +type GetWebhookOK struct { + Payload *models.WebhooksEntitiesWebhookEntity +} + +// IsSuccess returns true when this get webhook o k response has a 2xx status code +func (o *GetWebhookOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get webhook o k response has a 3xx status code +func (o *GetWebhookOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get webhook o k response has a 4xx status code +func (o *GetWebhookOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get webhook o k response has a 5xx status code +func (o *GetWebhookOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get webhook o k response a status code equal to that given +func (o *GetWebhookOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetWebhookOK) Error() string { + return fmt.Sprintf("[GET /v1/webhooks/{webhook_id}][%d] getWebhookOK %+v", 200, o.Payload) +} + +func (o *GetWebhookOK) String() string { + return fmt.Sprintf("[GET /v1/webhooks/{webhook_id}][%d] getWebhookOK %+v", 200, o.Payload) +} + +func (o *GetWebhookOK) GetPayload() *models.WebhooksEntitiesWebhookEntity { + return o.Payload +} + +func (o *GetWebhookOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WebhooksEntitiesWebhookEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/webhooks/list_webhook_deliveries_parameters.go b/client/webhooks/list_webhook_deliveries_parameters.go new file mode 100644 index 0000000..edb77c8 --- /dev/null +++ b/client/webhooks/list_webhook_deliveries_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListWebhookDeliveriesParams creates a new ListWebhookDeliveriesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListWebhookDeliveriesParams() *ListWebhookDeliveriesParams { + return &ListWebhookDeliveriesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListWebhookDeliveriesParamsWithTimeout creates a new ListWebhookDeliveriesParams object +// with the ability to set a timeout on a request. +func NewListWebhookDeliveriesParamsWithTimeout(timeout time.Duration) *ListWebhookDeliveriesParams { + return &ListWebhookDeliveriesParams{ + timeout: timeout, + } +} + +// NewListWebhookDeliveriesParamsWithContext creates a new ListWebhookDeliveriesParams object +// with the ability to set a context for a request. +func NewListWebhookDeliveriesParamsWithContext(ctx context.Context) *ListWebhookDeliveriesParams { + return &ListWebhookDeliveriesParams{ + Context: ctx, + } +} + +// NewListWebhookDeliveriesParamsWithHTTPClient creates a new ListWebhookDeliveriesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListWebhookDeliveriesParamsWithHTTPClient(client *http.Client) *ListWebhookDeliveriesParams { + return &ListWebhookDeliveriesParams{ + HTTPClient: client, + } +} + +/* +ListWebhookDeliveriesParams contains all the parameters to send to the API endpoint + + for the list webhook deliveries operation. + + Typically these are written to a http.Request. +*/ +type ListWebhookDeliveriesParams struct { + + /* WebhookID. + + ID of a webhook + */ + WebhookID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list webhook deliveries params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListWebhookDeliveriesParams) WithDefaults() *ListWebhookDeliveriesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list webhook deliveries params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListWebhookDeliveriesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list webhook deliveries params +func (o *ListWebhookDeliveriesParams) WithTimeout(timeout time.Duration) *ListWebhookDeliveriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list webhook deliveries params +func (o *ListWebhookDeliveriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list webhook deliveries params +func (o *ListWebhookDeliveriesParams) WithContext(ctx context.Context) *ListWebhookDeliveriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list webhook deliveries params +func (o *ListWebhookDeliveriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list webhook deliveries params +func (o *ListWebhookDeliveriesParams) WithHTTPClient(client *http.Client) *ListWebhookDeliveriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list webhook deliveries params +func (o *ListWebhookDeliveriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithWebhookID adds the webhookID to the list webhook deliveries params +func (o *ListWebhookDeliveriesParams) WithWebhookID(webhookID string) *ListWebhookDeliveriesParams { + o.SetWebhookID(webhookID) + return o +} + +// SetWebhookID adds the webhookId to the list webhook deliveries params +func (o *ListWebhookDeliveriesParams) SetWebhookID(webhookID string) { + o.WebhookID = webhookID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListWebhookDeliveriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param webhook_id + if err := r.SetPathParam("webhook_id", o.WebhookID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/webhooks/list_webhook_deliveries_responses.go b/client/webhooks/list_webhook_deliveries_responses.go new file mode 100644 index 0000000..e30d346 --- /dev/null +++ b/client/webhooks/list_webhook_deliveries_responses.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ListWebhookDeliveriesReader is a Reader for the ListWebhookDeliveries structure. +type ListWebhookDeliveriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListWebhookDeliveriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListWebhookDeliveriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListWebhookDeliveriesOK creates a ListWebhookDeliveriesOK with default headers values +func NewListWebhookDeliveriesOK() *ListWebhookDeliveriesOK { + return &ListWebhookDeliveriesOK{} +} + +/* +ListWebhookDeliveriesOK describes a response with status code 200, with default header values. + +Get webhook deliveries +*/ +type ListWebhookDeliveriesOK struct { +} + +// IsSuccess returns true when this list webhook deliveries o k response has a 2xx status code +func (o *ListWebhookDeliveriesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list webhook deliveries o k response has a 3xx status code +func (o *ListWebhookDeliveriesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list webhook deliveries o k response has a 4xx status code +func (o *ListWebhookDeliveriesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list webhook deliveries o k response has a 5xx status code +func (o *ListWebhookDeliveriesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list webhook deliveries o k response a status code equal to that given +func (o *ListWebhookDeliveriesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListWebhookDeliveriesOK) Error() string { + return fmt.Sprintf("[GET /v1/webhooks/{webhook_id}/deliveries][%d] listWebhookDeliveriesOK ", 200) +} + +func (o *ListWebhookDeliveriesOK) String() string { + return fmt.Sprintf("[GET /v1/webhooks/{webhook_id}/deliveries][%d] listWebhookDeliveriesOK ", 200) +} + +func (o *ListWebhookDeliveriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/client/webhooks/list_webhooks_parameters.go b/client/webhooks/list_webhooks_parameters.go new file mode 100644 index 0000000..e11ecfd --- /dev/null +++ b/client/webhooks/list_webhooks_parameters.go @@ -0,0 +1,196 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListWebhooksParams creates a new ListWebhooksParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListWebhooksParams() *ListWebhooksParams { + return &ListWebhooksParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListWebhooksParamsWithTimeout creates a new ListWebhooksParams object +// with the ability to set a timeout on a request. +func NewListWebhooksParamsWithTimeout(timeout time.Duration) *ListWebhooksParams { + return &ListWebhooksParams{ + timeout: timeout, + } +} + +// NewListWebhooksParamsWithContext creates a new ListWebhooksParams object +// with the ability to set a context for a request. +func NewListWebhooksParamsWithContext(ctx context.Context) *ListWebhooksParams { + return &ListWebhooksParams{ + Context: ctx, + } +} + +// NewListWebhooksParamsWithHTTPClient creates a new ListWebhooksParams object +// with the ability to set a custom HTTPClient for a request. +func NewListWebhooksParamsWithHTTPClient(client *http.Client) *ListWebhooksParams { + return &ListWebhooksParams{ + HTTPClient: client, + } +} + +/* +ListWebhooksParams contains all the parameters to send to the API endpoint + + for the list webhooks operation. + + Typically these are written to a http.Request. +*/ +type ListWebhooksParams struct { + + // Page. + // + // Format: int32 + Page *int32 + + // PerPage. + // + // Format: int32 + PerPage *int32 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list webhooks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListWebhooksParams) WithDefaults() *ListWebhooksParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list webhooks params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListWebhooksParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list webhooks params +func (o *ListWebhooksParams) WithTimeout(timeout time.Duration) *ListWebhooksParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list webhooks params +func (o *ListWebhooksParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list webhooks params +func (o *ListWebhooksParams) WithContext(ctx context.Context) *ListWebhooksParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list webhooks params +func (o *ListWebhooksParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list webhooks params +func (o *ListWebhooksParams) WithHTTPClient(client *http.Client) *ListWebhooksParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list webhooks params +func (o *ListWebhooksParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPage adds the page to the list webhooks params +func (o *ListWebhooksParams) WithPage(page *int32) *ListWebhooksParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list webhooks params +func (o *ListWebhooksParams) SetPage(page *int32) { + o.Page = page +} + +// WithPerPage adds the perPage to the list webhooks params +func (o *ListWebhooksParams) WithPerPage(perPage *int32) *ListWebhooksParams { + o.SetPerPage(perPage) + return o +} + +// SetPerPage adds the perPage to the list webhooks params +func (o *ListWebhooksParams) SetPerPage(perPage *int32) { + o.PerPage = perPage +} + +// WriteToRequest writes these params to a swagger request +func (o *ListWebhooksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Page != nil { + + // query param page + var qrPage int32 + + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt32(qrPage) + if qPage != "" { + + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + } + + if o.PerPage != nil { + + // query param per_page + var qrPerPage int32 + + if o.PerPage != nil { + qrPerPage = *o.PerPage + } + qPerPage := swag.FormatInt32(qrPerPage) + if qPerPage != "" { + + if err := r.SetQueryParam("per_page", qPerPage); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/webhooks/list_webhooks_responses.go b/client/webhooks/list_webhooks_responses.go new file mode 100644 index 0000000..f74ddc8 --- /dev/null +++ b/client/webhooks/list_webhooks_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// ListWebhooksReader is a Reader for the ListWebhooks structure. +type ListWebhooksReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListWebhooksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListWebhooksOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListWebhooksOK creates a ListWebhooksOK with default headers values +func NewListWebhooksOK() *ListWebhooksOK { + return &ListWebhooksOK{} +} + +/* +ListWebhooksOK describes a response with status code 200, with default header values. + +Lists webhooks +*/ +type ListWebhooksOK struct { + Payload *models.WebhooksEntitiesWebhookEntity +} + +// IsSuccess returns true when this list webhooks o k response has a 2xx status code +func (o *ListWebhooksOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list webhooks o k response has a 3xx status code +func (o *ListWebhooksOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list webhooks o k response has a 4xx status code +func (o *ListWebhooksOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list webhooks o k response has a 5xx status code +func (o *ListWebhooksOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list webhooks o k response a status code equal to that given +func (o *ListWebhooksOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ListWebhooksOK) Error() string { + return fmt.Sprintf("[GET /v1/webhooks][%d] listWebhooksOK %+v", 200, o.Payload) +} + +func (o *ListWebhooksOK) String() string { + return fmt.Sprintf("[GET /v1/webhooks][%d] listWebhooksOK %+v", 200, o.Payload) +} + +func (o *ListWebhooksOK) GetPayload() *models.WebhooksEntitiesWebhookEntity { + return o.Payload +} + +func (o *ListWebhooksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WebhooksEntitiesWebhookEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/webhooks/update_webhook_parameters.go b/client/webhooks/update_webhook_parameters.go new file mode 100644 index 0000000..fbd28f2 --- /dev/null +++ b/client/webhooks/update_webhook_parameters.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// NewUpdateWebhookParams creates a new UpdateWebhookParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateWebhookParams() *UpdateWebhookParams { + return &UpdateWebhookParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateWebhookParamsWithTimeout creates a new UpdateWebhookParams object +// with the ability to set a timeout on a request. +func NewUpdateWebhookParamsWithTimeout(timeout time.Duration) *UpdateWebhookParams { + return &UpdateWebhookParams{ + timeout: timeout, + } +} + +// NewUpdateWebhookParamsWithContext creates a new UpdateWebhookParams object +// with the ability to set a context for a request. +func NewUpdateWebhookParamsWithContext(ctx context.Context) *UpdateWebhookParams { + return &UpdateWebhookParams{ + Context: ctx, + } +} + +// NewUpdateWebhookParamsWithHTTPClient creates a new UpdateWebhookParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateWebhookParamsWithHTTPClient(client *http.Client) *UpdateWebhookParams { + return &UpdateWebhookParams{ + HTTPClient: client, + } +} + +/* +UpdateWebhookParams contains all the parameters to send to the API endpoint + + for the update webhook operation. + + Typically these are written to a http.Request. +*/ +type UpdateWebhookParams struct { + + // UpdateWebhook. + UpdateWebhook *models.UpdateWebhook + + // WebhookID. + WebhookID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update webhook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateWebhookParams) WithDefaults() *UpdateWebhookParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update webhook params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateWebhookParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update webhook params +func (o *UpdateWebhookParams) WithTimeout(timeout time.Duration) *UpdateWebhookParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update webhook params +func (o *UpdateWebhookParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update webhook params +func (o *UpdateWebhookParams) WithContext(ctx context.Context) *UpdateWebhookParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update webhook params +func (o *UpdateWebhookParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update webhook params +func (o *UpdateWebhookParams) WithHTTPClient(client *http.Client) *UpdateWebhookParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update webhook params +func (o *UpdateWebhookParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithUpdateWebhook adds the updateWebhook to the update webhook params +func (o *UpdateWebhookParams) WithUpdateWebhook(updateWebhook *models.UpdateWebhook) *UpdateWebhookParams { + o.SetUpdateWebhook(updateWebhook) + return o +} + +// SetUpdateWebhook adds the updateWebhook to the update webhook params +func (o *UpdateWebhookParams) SetUpdateWebhook(updateWebhook *models.UpdateWebhook) { + o.UpdateWebhook = updateWebhook +} + +// WithWebhookID adds the webhookID to the update webhook params +func (o *UpdateWebhookParams) WithWebhookID(webhookID string) *UpdateWebhookParams { + o.SetWebhookID(webhookID) + return o +} + +// SetWebhookID adds the webhookId to the update webhook params +func (o *UpdateWebhookParams) SetWebhookID(webhookID string) { + o.WebhookID = webhookID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateWebhookParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.UpdateWebhook != nil { + if err := r.SetBodyParam(o.UpdateWebhook); err != nil { + return err + } + } + + // path param webhook_id + if err := r.SetPathParam("webhook_id", o.WebhookID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/webhooks/update_webhook_responses.go b/client/webhooks/update_webhook_responses.go new file mode 100644 index 0000000..9a49565 --- /dev/null +++ b/client/webhooks/update_webhook_responses.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhooks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/firehydrant/api-client-go/models" +) + +// UpdateWebhookReader is a Reader for the UpdateWebhook structure. +type UpdateWebhookReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateWebhookReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateWebhookOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateWebhookOK creates a UpdateWebhookOK with default headers values +func NewUpdateWebhookOK() *UpdateWebhookOK { + return &UpdateWebhookOK{} +} + +/* +UpdateWebhookOK describes a response with status code 200, with default header values. + +Update a specific webhook +*/ +type UpdateWebhookOK struct { + Payload *models.WebhooksEntitiesWebhookEntity +} + +// IsSuccess returns true when this update webhook o k response has a 2xx status code +func (o *UpdateWebhookOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update webhook o k response has a 3xx status code +func (o *UpdateWebhookOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update webhook o k response has a 4xx status code +func (o *UpdateWebhookOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update webhook o k response has a 5xx status code +func (o *UpdateWebhookOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update webhook o k response a status code equal to that given +func (o *UpdateWebhookOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateWebhookOK) Error() string { + return fmt.Sprintf("[PATCH /v1/webhooks/{webhook_id}][%d] updateWebhookOK %+v", 200, o.Payload) +} + +func (o *UpdateWebhookOK) String() string { + return fmt.Sprintf("[PATCH /v1/webhooks/{webhook_id}][%d] updateWebhookOK %+v", 200, o.Payload) +} + +func (o *UpdateWebhookOK) GetPayload() *models.WebhooksEntitiesWebhookEntity { + return o.Payload +} + +func (o *UpdateWebhookOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WebhooksEntitiesWebhookEntity) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/webhooks/webhooks_client.go b/client/webhooks/webhooks_client.go index 8e9f068..5083840 100644 --- a/client/webhooks/webhooks_client.go +++ b/client/webhooks/webhooks_client.go @@ -30,40 +30,40 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - DeleteV1WebhooksWebhookID(params *DeleteV1WebhooksWebhookIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1WebhooksWebhookIDNoContent, error) + CreateWebhook(params *CreateWebhookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateWebhookCreated, error) - GetV1Webhooks(params *GetV1WebhooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1WebhooksOK, error) + DeleteWebhook(params *DeleteWebhookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteWebhookNoContent, error) - GetV1WebhooksWebhookID(params *GetV1WebhooksWebhookIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1WebhooksWebhookIDOK, error) + GetWebhook(params *GetWebhookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetWebhookOK, error) - GetV1WebhooksWebhookIDDeliveries(params *GetV1WebhooksWebhookIDDeliveriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1WebhooksWebhookIDDeliveriesOK, error) + ListWebhookDeliveries(params *ListWebhookDeliveriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListWebhookDeliveriesOK, error) - PatchV1WebhooksWebhookID(params *PatchV1WebhooksWebhookIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1WebhooksWebhookIDOK, error) + ListWebhooks(params *ListWebhooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListWebhooksOK, error) - PostV1Webhooks(params *PostV1WebhooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1WebhooksCreated, error) + UpdateWebhook(params *UpdateWebhookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateWebhookOK, error) SetTransport(transport runtime.ClientTransport) } /* -DeleteV1WebhooksWebhookID deletes a webhook +CreateWebhook creates a webhook -Delete a specific webhook +Create a new webhook */ -func (a *Client) DeleteV1WebhooksWebhookID(params *DeleteV1WebhooksWebhookIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteV1WebhooksWebhookIDNoContent, error) { +func (a *Client) CreateWebhook(params *CreateWebhookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateWebhookCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteV1WebhooksWebhookIDParams() + params = NewCreateWebhookParams() } op := &runtime.ClientOperation{ - ID: "deleteV1WebhooksWebhookId", - Method: "DELETE", - PathPattern: "/v1/webhooks/{webhook_id}", + ID: "create_webhook", + Method: "POST", + PathPattern: "/v1/webhooks", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &DeleteV1WebhooksWebhookIDReader{formats: a.formats}, + Reader: &CreateWebhookReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -76,35 +76,35 @@ func (a *Client) DeleteV1WebhooksWebhookID(params *DeleteV1WebhooksWebhookIDPara if err != nil { return nil, err } - success, ok := result.(*DeleteV1WebhooksWebhookIDNoContent) + success, ok := result.(*CreateWebhookCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteV1WebhooksWebhookId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for create_webhook: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1Webhooks lists webhooks +DeleteWebhook deletes a webhook -Lists webhooks +Delete a specific webhook */ -func (a *Client) GetV1Webhooks(params *GetV1WebhooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1WebhooksOK, error) { +func (a *Client) DeleteWebhook(params *DeleteWebhookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteWebhookNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1WebhooksParams() + params = NewDeleteWebhookParams() } op := &runtime.ClientOperation{ - ID: "getV1Webhooks", - Method: "GET", - PathPattern: "/v1/webhooks", + ID: "delete_webhook", + Method: "DELETE", + PathPattern: "/v1/webhooks/{webhook_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1WebhooksReader{formats: a.formats}, + Reader: &DeleteWebhookReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -117,35 +117,35 @@ func (a *Client) GetV1Webhooks(params *GetV1WebhooksParams, authInfo runtime.Cli if err != nil { return nil, err } - success, ok := result.(*GetV1WebhooksOK) + success, ok := result.(*DeleteWebhookNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1Webhooks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for delete_webhook: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1WebhooksWebhookID gets a webhook +GetWebhook gets a webhook Retrieve a specific webhook */ -func (a *Client) GetV1WebhooksWebhookID(params *GetV1WebhooksWebhookIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1WebhooksWebhookIDOK, error) { +func (a *Client) GetWebhook(params *GetWebhookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetWebhookOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1WebhooksWebhookIDParams() + params = NewGetWebhookParams() } op := &runtime.ClientOperation{ - ID: "getV1WebhooksWebhookId", + ID: "get_webhook", Method: "GET", PathPattern: "/v1/webhooks/{webhook_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1WebhooksWebhookIDReader{formats: a.formats}, + Reader: &GetWebhookReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -158,35 +158,35 @@ func (a *Client) GetV1WebhooksWebhookID(params *GetV1WebhooksWebhookIDParams, au if err != nil { return nil, err } - success, ok := result.(*GetV1WebhooksWebhookIDOK) + success, ok := result.(*GetWebhookOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1WebhooksWebhookId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for get_webhook: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -GetV1WebhooksWebhookIDDeliveries lists webhook deliveries +ListWebhookDeliveries lists webhook deliveries Get webhook deliveries */ -func (a *Client) GetV1WebhooksWebhookIDDeliveries(params *GetV1WebhooksWebhookIDDeliveriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetV1WebhooksWebhookIDDeliveriesOK, error) { +func (a *Client) ListWebhookDeliveries(params *ListWebhookDeliveriesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListWebhookDeliveriesOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetV1WebhooksWebhookIDDeliveriesParams() + params = NewListWebhookDeliveriesParams() } op := &runtime.ClientOperation{ - ID: "getV1WebhooksWebhookIdDeliveries", + ID: "list_webhook_deliveries", Method: "GET", PathPattern: "/v1/webhooks/{webhook_id}/deliveries", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &GetV1WebhooksWebhookIDDeliveriesReader{formats: a.formats}, + Reader: &ListWebhookDeliveriesReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -199,35 +199,35 @@ func (a *Client) GetV1WebhooksWebhookIDDeliveries(params *GetV1WebhooksWebhookID if err != nil { return nil, err } - success, ok := result.(*GetV1WebhooksWebhookIDDeliveriesOK) + success, ok := result.(*ListWebhookDeliveriesOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getV1WebhooksWebhookIdDeliveries: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_webhook_deliveries: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PatchV1WebhooksWebhookID updates a webhook +ListWebhooks lists webhooks -Update a specific webhook +Lists webhooks */ -func (a *Client) PatchV1WebhooksWebhookID(params *PatchV1WebhooksWebhookIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchV1WebhooksWebhookIDOK, error) { +func (a *Client) ListWebhooks(params *ListWebhooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListWebhooksOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPatchV1WebhooksWebhookIDParams() + params = NewListWebhooksParams() } op := &runtime.ClientOperation{ - ID: "patchV1WebhooksWebhookId", - Method: "PATCH", - PathPattern: "/v1/webhooks/{webhook_id}", + ID: "list_webhooks", + Method: "GET", + PathPattern: "/v1/webhooks", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PatchV1WebhooksWebhookIDReader{formats: a.formats}, + Reader: &ListWebhooksReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -240,35 +240,35 @@ func (a *Client) PatchV1WebhooksWebhookID(params *PatchV1WebhooksWebhookIDParams if err != nil { return nil, err } - success, ok := result.(*PatchV1WebhooksWebhookIDOK) + success, ok := result.(*ListWebhooksOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchV1WebhooksWebhookId: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for list_webhooks: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -PostV1Webhooks creates a webhook +UpdateWebhook updates a webhook -Create a new webhook +Update a specific webhook */ -func (a *Client) PostV1Webhooks(params *PostV1WebhooksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostV1WebhooksCreated, error) { +func (a *Client) UpdateWebhook(params *UpdateWebhookParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateWebhookOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostV1WebhooksParams() + params = NewUpdateWebhookParams() } op := &runtime.ClientOperation{ - ID: "postV1Webhooks", - Method: "POST", - PathPattern: "/v1/webhooks", + ID: "update_webhook", + Method: "PATCH", + PathPattern: "/v1/webhooks/{webhook_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostV1WebhooksReader{formats: a.formats}, + Reader: &UpdateWebhookReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -281,13 +281,13 @@ func (a *Client) PostV1Webhooks(params *PostV1WebhooksParams, authInfo runtime.C if err != nil { return nil, err } - success, ok := result.(*PostV1WebhooksCreated) + success, ok := result.(*UpdateWebhookOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for postV1Webhooks: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for update_webhook: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/models/alerts_alert_entity.go b/models/alerts_alert_entity.go index 01f3094..e67b338 100644 --- a/models/alerts_alert_entity.go +++ b/models/alerts_alert_entity.go @@ -23,6 +23,9 @@ type AlertsAlertEntity struct { // child alerts ChildAlerts []*AlertsSirenAlertEntity `json:"child_alerts"` + // conversations + Conversations []*ConversationsAPIEntitiesReference `json:"conversations"` + // description Description string `json:"description,omitempty"` @@ -115,6 +118,10 @@ func (m *AlertsAlertEntity) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateConversations(formats); err != nil { + res = append(res, err) + } + if err := m.validateEndsAt(formats); err != nil { res = append(res, err) } @@ -183,6 +190,32 @@ func (m *AlertsAlertEntity) validateChildAlerts(formats strfmt.Registry) error { return nil } +func (m *AlertsAlertEntity) validateConversations(formats strfmt.Registry) error { + if swag.IsZero(m.Conversations) { // not required + return nil + } + + for i := 0; i < len(m.Conversations); i++ { + if swag.IsZero(m.Conversations[i]) { // not required + continue + } + + if m.Conversations[i] != nil { + if err := m.Conversations[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("conversations" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("conversations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *AlertsAlertEntity) validateEndsAt(formats strfmt.Registry) error { if swag.IsZero(m.EndsAt) { // not required return nil @@ -383,6 +416,10 @@ func (m *AlertsAlertEntity) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } + if err := m.contextValidateConversations(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateEnvironments(ctx, formats); err != nil { res = append(res, err) } @@ -437,6 +474,26 @@ func (m *AlertsAlertEntity) contextValidateChildAlerts(ctx context.Context, form return nil } +func (m *AlertsAlertEntity) contextValidateConversations(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Conversations); i++ { + + if m.Conversations[i] != nil { + if err := m.Conversations[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("conversations" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("conversations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *AlertsAlertEntity) contextValidateEnvironments(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Environments); i++ { diff --git a/models/bulk_update_incident_milestones.go b/models/bulk_update_incident_milestones.go new file mode 100644 index 0000000..b75ca13 --- /dev/null +++ b/models/bulk_update_incident_milestones.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// BulkUpdateIncidentMilestones Update milestone times in bulk for a given incident. All milestone +// times for an incident must occur in chronological order +// corresponding to the configured order of milestones. If the result +// of this request would cause any milestone(s) to appear out of place, +// a 422 response will instead be returned. This includes milestones +// not explicitly submitted or updated in this request. +// +// swagger:model bulk_update_incident_milestones +type BulkUpdateIncidentMilestones struct { + + // bulk + // Enum: [true] + Bulk string `json:"bulk,omitempty"` + + // milestones + // Required: true + Milestones []*BulkUpdateIncidentMilestonesMilestonesItems0 `json:"milestones"` +} + +// Validate validates this bulk update incident milestones +func (m *BulkUpdateIncidentMilestones) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBulk(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMilestones(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var bulkUpdateIncidentMilestonesTypeBulkPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["true"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + bulkUpdateIncidentMilestonesTypeBulkPropEnum = append(bulkUpdateIncidentMilestonesTypeBulkPropEnum, v) + } +} + +const ( + + // BulkUpdateIncidentMilestonesBulkTrue captures enum value "true" + BulkUpdateIncidentMilestonesBulkTrue string = "true" +) + +// prop value enum +func (m *BulkUpdateIncidentMilestones) validateBulkEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, bulkUpdateIncidentMilestonesTypeBulkPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *BulkUpdateIncidentMilestones) validateBulk(formats strfmt.Registry) error { + if swag.IsZero(m.Bulk) { // not required + return nil + } + + // value enum + if err := m.validateBulkEnum("bulk", "body", m.Bulk); err != nil { + return err + } + + return nil +} + +func (m *BulkUpdateIncidentMilestones) validateMilestones(formats strfmt.Registry) error { + + if err := validate.Required("milestones", "body", m.Milestones); err != nil { + return err + } + + for i := 0; i < len(m.Milestones); i++ { + if swag.IsZero(m.Milestones[i]) { // not required + continue + } + + if m.Milestones[i] != nil { + if err := m.Milestones[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("milestones" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("milestones" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this bulk update incident milestones based on the context it is used +func (m *BulkUpdateIncidentMilestones) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMilestones(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BulkUpdateIncidentMilestones) contextValidateMilestones(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Milestones); i++ { + + if m.Milestones[i] != nil { + if err := m.Milestones[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("milestones" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("milestones" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *BulkUpdateIncidentMilestones) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BulkUpdateIncidentMilestones) UnmarshalBinary(b []byte) error { + var res BulkUpdateIncidentMilestones + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// BulkUpdateIncidentMilestonesMilestonesItems0 bulk update incident milestones milestones items0 +// +// swagger:model BulkUpdateIncidentMilestonesMilestonesItems0 +type BulkUpdateIncidentMilestonesMilestonesItems0 struct { + + // An ISO8601 formatted string for when this milestone occurred. If you are removing a milestone, this field still needs to be set to some value + // Required: true + // Format: date-time + OccurredAt *strfmt.DateTime `json:"occurred_at"` + + // If set to true, the milestone will be removed from the incident + Remove bool `json:"remove,omitempty"` + + // The type/slug of the milestone. Must be one of the currently configured milestones for the given incident. + // Required: true + Type *string `json:"type"` +} + +// Validate validates this bulk update incident milestones milestones items0 +func (m *BulkUpdateIncidentMilestonesMilestonesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOccurredAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BulkUpdateIncidentMilestonesMilestonesItems0) validateOccurredAt(formats strfmt.Registry) error { + + if err := validate.Required("occurred_at", "body", m.OccurredAt); err != nil { + return err + } + + if err := validate.FormatOf("occurred_at", "body", "date-time", m.OccurredAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *BulkUpdateIncidentMilestonesMilestonesItems0) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this bulk update incident milestones milestones items0 based on context it is used +func (m *BulkUpdateIncidentMilestonesMilestonesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *BulkUpdateIncidentMilestonesMilestonesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BulkUpdateIncidentMilestonesMilestonesItems0) UnmarshalBinary(b []byte) error { + var res BulkUpdateIncidentMilestonesMilestonesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/convert_incident_task.go b/models/convert_incident_task.go new file mode 100644 index 0000000..9cb5daa --- /dev/null +++ b/models/convert_incident_task.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ConvertIncidentTask Convert a task to a follow-up +// +// swagger:model convert_incident_task +type ConvertIncidentTask struct { + + // description + Description string `json:"description,omitempty"` + + // project id + ProjectID string `json:"project_id,omitempty"` + + // state + State string `json:"state,omitempty"` + + // summary + Summary string `json:"summary,omitempty"` + + // List of tags for the ticket + TagList []string `json:"tag_list"` +} + +// Validate validates this convert incident task +func (m *ConvertIncidentTask) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this convert incident task based on context it is used +func (m *ConvertIncidentTask) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ConvertIncidentTask) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConvertIncidentTask) UnmarshalBinary(b []byte) error { + var res ConvertIncidentTask + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_change.go b/models/create_change.go new file mode 100644 index 0000000..c5f81cd --- /dev/null +++ b/models/create_change.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CreateChange Create a new change entry +// +// swagger:model create_change +type CreateChange struct { + + // description + Description string `json:"description,omitempty"` + + // A labels hash of keys and values + Labels map[string]string `json:"labels,omitempty"` + + // summary + Summary string `json:"summary,omitempty"` +} + +// Validate validates this create change +func (m *CreateChange) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this create change based on context it is used +func (m *CreateChange) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateChange) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateChange) UnmarshalBinary(b []byte) error { + var res CreateChange + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_change_event.go b/models/create_change_event.go new file mode 100644 index 0000000..428abd7 --- /dev/null +++ b/models/create_change_event.go @@ -0,0 +1,558 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateChangeEvent Create a change event +// +// swagger:model create_change_event +type CreateChangeEvent struct { + + // JSON objects representing attachments, see attachments documentation for the schema + Attachments []*CreateChangeEventAttachmentsItems0 `json:"attachments"` + + // Array of additional authors to add to the change event, the creating actor will automatically be added as an author + Authors []*CreateChangeEventAuthorsItems0 `json:"authors"` + + // If provided and valid, the event will be linked to all changes that have the same identities. Identity *values* must be unique. + ChangeIdentities []*CreateChangeEventChangeIdentitiesItems0 `json:"change_identities"` + + // An array of change IDs + Changes []string `json:"changes"` + + // description + Description string `json:"description,omitempty"` + + // ends at + // Format: date-time + EndsAt strfmt.DateTime `json:"ends_at,omitempty"` + + // An array of environment IDs + Environments []string `json:"environments"` + + // The ID of a change event as assigned by an external provider + ExternalID string `json:"external_id,omitempty"` + + // labels + Labels map[string]string `json:"labels,omitempty"` + + // An array of service IDs + Services []string `json:"services"` + + // starts at + // Format: date-time + StartsAt strfmt.DateTime `json:"starts_at,omitempty"` + + // summary + // Required: true + Summary *string `json:"summary"` +} + +// Validate validates this create change event +func (m *CreateChangeEvent) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAttachments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAuthors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateChangeIdentities(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEndsAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartsAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSummary(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateChangeEvent) validateAttachments(formats strfmt.Registry) error { + if swag.IsZero(m.Attachments) { // not required + return nil + } + + for i := 0; i < len(m.Attachments); i++ { + if swag.IsZero(m.Attachments[i]) { // not required + continue + } + + if m.Attachments[i] != nil { + if err := m.Attachments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attachments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("attachments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateChangeEvent) validateAuthors(formats strfmt.Registry) error { + if swag.IsZero(m.Authors) { // not required + return nil + } + + for i := 0; i < len(m.Authors); i++ { + if swag.IsZero(m.Authors[i]) { // not required + continue + } + + if m.Authors[i] != nil { + if err := m.Authors[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("authors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateChangeEvent) validateChangeIdentities(formats strfmt.Registry) error { + if swag.IsZero(m.ChangeIdentities) { // not required + return nil + } + + for i := 0; i < len(m.ChangeIdentities); i++ { + if swag.IsZero(m.ChangeIdentities[i]) { // not required + continue + } + + if m.ChangeIdentities[i] != nil { + if err := m.ChangeIdentities[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("change_identities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("change_identities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateChangeEvent) validateEndsAt(formats strfmt.Registry) error { + if swag.IsZero(m.EndsAt) { // not required + return nil + } + + if err := validate.FormatOf("ends_at", "body", "date-time", m.EndsAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateChangeEvent) validateStartsAt(formats strfmt.Registry) error { + if swag.IsZero(m.StartsAt) { // not required + return nil + } + + if err := validate.FormatOf("starts_at", "body", "date-time", m.StartsAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateChangeEvent) validateSummary(formats strfmt.Registry) error { + + if err := validate.Required("summary", "body", m.Summary); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create change event based on the context it is used +func (m *CreateChangeEvent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAttachments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAuthors(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateChangeIdentities(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateChangeEvent) contextValidateAttachments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Attachments); i++ { + + if m.Attachments[i] != nil { + if err := m.Attachments[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attachments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("attachments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateChangeEvent) contextValidateAuthors(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Authors); i++ { + + if m.Authors[i] != nil { + if err := m.Authors[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("authors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateChangeEvent) contextValidateChangeIdentities(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ChangeIdentities); i++ { + + if m.ChangeIdentities[i] != nil { + if err := m.ChangeIdentities[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("change_identities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("change_identities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateChangeEvent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateChangeEvent) UnmarshalBinary(b []byte) error { + var res CreateChangeEvent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateChangeEventAttachmentsItems0 create change event attachments items0 +// +// swagger:model CreateChangeEventAttachmentsItems0 +type CreateChangeEventAttachmentsItems0 struct { + + // type + // Required: true + // Enum: [link] + Type *string `json:"type"` +} + +// Validate validates this create change event attachments items0 +func (m *CreateChangeEventAttachmentsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var createChangeEventAttachmentsItems0TypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["link"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createChangeEventAttachmentsItems0TypeTypePropEnum = append(createChangeEventAttachmentsItems0TypeTypePropEnum, v) + } +} + +const ( + + // CreateChangeEventAttachmentsItems0TypeLink captures enum value "link" + CreateChangeEventAttachmentsItems0TypeLink string = "link" +) + +// prop value enum +func (m *CreateChangeEventAttachmentsItems0) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createChangeEventAttachmentsItems0TypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateChangeEventAttachmentsItems0) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create change event attachments items0 based on context it is used +func (m *CreateChangeEventAttachmentsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateChangeEventAttachmentsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateChangeEventAttachmentsItems0) UnmarshalBinary(b []byte) error { + var res CreateChangeEventAttachmentsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateChangeEventAuthorsItems0 create change event authors items0 +// +// swagger:model CreateChangeEventAuthorsItems0 +type CreateChangeEventAuthorsItems0 struct { + + // name + // Required: true + Name *string `json:"name"` + + // source + // Required: true + Source *string `json:"source"` + + // source id + // Required: true + SourceID *string `json:"source_id"` +} + +// Validate validates this create change event authors items0 +func (m *CreateChangeEventAuthorsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSource(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSourceID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateChangeEventAuthorsItems0) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *CreateChangeEventAuthorsItems0) validateSource(formats strfmt.Registry) error { + + if err := validate.Required("source", "body", m.Source); err != nil { + return err + } + + return nil +} + +func (m *CreateChangeEventAuthorsItems0) validateSourceID(formats strfmt.Registry) error { + + if err := validate.Required("source_id", "body", m.SourceID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create change event authors items0 based on context it is used +func (m *CreateChangeEventAuthorsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateChangeEventAuthorsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateChangeEventAuthorsItems0) UnmarshalBinary(b []byte) error { + var res CreateChangeEventAuthorsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateChangeEventChangeIdentitiesItems0 create change event change identities items0 +// +// swagger:model CreateChangeEventChangeIdentitiesItems0 +type CreateChangeEventChangeIdentitiesItems0 struct { + + // type + // Required: true + Type *string `json:"type"` + + // value + // Required: true + Value *string `json:"value"` +} + +// Validate validates this create change event change identities items0 +func (m *CreateChangeEventChangeIdentitiesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateChangeEventChangeIdentitiesItems0) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +func (m *CreateChangeEventChangeIdentitiesItems0) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create change event change identities items0 based on context it is used +func (m *CreateChangeEventChangeIdentitiesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateChangeEventChangeIdentitiesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateChangeEventChangeIdentitiesItems0) UnmarshalBinary(b []byte) error { + var res CreateChangeEventChangeIdentitiesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_change_identity.go b/models/create_change_identity.go new file mode 100644 index 0000000..2f90a84 --- /dev/null +++ b/models/create_change_identity.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateChangeIdentity Create an identity for the change entry +// +// swagger:model create_change_identity +type CreateChangeIdentity struct { + + // type + // Required: true + Type *string `json:"type"` + + // value + // Required: true + Value *string `json:"value"` +} + +// Validate validates this create change identity +func (m *CreateChangeIdentity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateChangeIdentity) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +func (m *CreateChangeIdentity) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create change identity based on context it is used +func (m *CreateChangeIdentity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateChangeIdentity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateChangeIdentity) UnmarshalBinary(b []byte) error { + var res CreateChangeIdentity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_checklist_template.go b/models/create_checklist_template.go new file mode 100644 index 0000000..7b9364f --- /dev/null +++ b/models/create_checklist_template.go @@ -0,0 +1,314 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateChecklistTemplate Creates a checklist template for the organization +// +// swagger:model create_checklist_template +type CreateChecklistTemplate struct { + + // An array of checks for the checklist template + // Required: true + Checks []*CreateChecklistTemplateChecksItems0 `json:"checks"` + + // Array of service IDs to attach checklist template to + ConnectedServices []*CreateChecklistTemplateConnectedServicesItems0 `json:"connected_services"` + + // description + Description string `json:"description,omitempty"` + + // name + // Required: true + Name *string `json:"name"` + + // The ID of the Team that owns the checklist template + TeamID string `json:"team_id,omitempty"` +} + +// Validate validates this create checklist template +func (m *CreateChecklistTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChecks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateConnectedServices(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateChecklistTemplate) validateChecks(formats strfmt.Registry) error { + + if err := validate.Required("checks", "body", m.Checks); err != nil { + return err + } + + for i := 0; i < len(m.Checks); i++ { + if swag.IsZero(m.Checks[i]) { // not required + continue + } + + if m.Checks[i] != nil { + if err := m.Checks[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("checks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("checks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateChecklistTemplate) validateConnectedServices(formats strfmt.Registry) error { + if swag.IsZero(m.ConnectedServices) { // not required + return nil + } + + for i := 0; i < len(m.ConnectedServices); i++ { + if swag.IsZero(m.ConnectedServices[i]) { // not required + continue + } + + if m.ConnectedServices[i] != nil { + if err := m.ConnectedServices[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("connected_services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("connected_services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateChecklistTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create checklist template based on the context it is used +func (m *CreateChecklistTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateChecks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateConnectedServices(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateChecklistTemplate) contextValidateChecks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Checks); i++ { + + if m.Checks[i] != nil { + if err := m.Checks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("checks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("checks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateChecklistTemplate) contextValidateConnectedServices(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ConnectedServices); i++ { + + if m.ConnectedServices[i] != nil { + if err := m.ConnectedServices[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("connected_services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("connected_services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateChecklistTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateChecklistTemplate) UnmarshalBinary(b []byte) error { + var res CreateChecklistTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateChecklistTemplateChecksItems0 create checklist template checks items0 +// +// swagger:model CreateChecklistTemplateChecksItems0 +type CreateChecklistTemplateChecksItems0 struct { + + // The description of the check + Description string `json:"description,omitempty"` + + // The name of the check + // Required: true + Name *string `json:"name"` +} + +// Validate validates this create checklist template checks items0 +func (m *CreateChecklistTemplateChecksItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateChecklistTemplateChecksItems0) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create checklist template checks items0 based on context it is used +func (m *CreateChecklistTemplateChecksItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateChecklistTemplateChecksItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateChecklistTemplateChecksItems0) UnmarshalBinary(b []byte) error { + var res CreateChecklistTemplateChecksItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateChecklistTemplateConnectedServicesItems0 create checklist template connected services items0 +// +// swagger:model CreateChecklistTemplateConnectedServicesItems0 +type CreateChecklistTemplateConnectedServicesItems0 struct { + + // id + // Required: true + ID *string `json:"id"` +} + +// Validate validates this create checklist template connected services items0 +func (m *CreateChecklistTemplateConnectedServicesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateChecklistTemplateConnectedServicesItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create checklist template connected services items0 based on context it is used +func (m *CreateChecklistTemplateConnectedServicesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateChecklistTemplateConnectedServicesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateChecklistTemplateConnectedServicesItems0) UnmarshalBinary(b []byte) error { + var res CreateChecklistTemplateConnectedServicesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_comment.go b/models/create_comment.go new file mode 100644 index 0000000..a2b102a --- /dev/null +++ b/models/create_comment.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateComment ALPHA - Creates a comment for a project +// +// swagger:model create_comment +type CreateComment struct { + + // Text body of comment + // Required: true + Body *string `json:"body"` +} + +// Validate validates this create comment +func (m *CreateComment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBody(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateComment) validateBody(formats strfmt.Registry) error { + + if err := validate.Required("body", "body", m.Body); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create comment based on context it is used +func (m *CreateComment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateComment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateComment) UnmarshalBinary(b []byte) error { + var res CreateComment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_comment_reaction.go b/models/create_comment_reaction.go new file mode 100644 index 0000000..4bd6d47 --- /dev/null +++ b/models/create_comment_reaction.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateCommentReaction ALPHA - Create a reaction on a comment +// +// swagger:model create_comment_reaction +type CreateCommentReaction struct { + + // CLDR short name of Unicode emojis + // Required: true + Reaction *string `json:"reaction"` +} + +// Validate validates this create comment reaction +func (m *CreateCommentReaction) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateReaction(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateCommentReaction) validateReaction(formats strfmt.Registry) error { + + if err := validate.Required("reaction", "body", m.Reaction); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create comment reaction based on context it is used +func (m *CreateCommentReaction) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateCommentReaction) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateCommentReaction) UnmarshalBinary(b []byte) error { + var res CreateCommentReaction + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_custom_field_definition.go b/models/create_custom_field_definition.go new file mode 100644 index 0000000..a3a5f87 --- /dev/null +++ b/models/create_custom_field_definition.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateCustomFieldDefinition Create a new custom field definition +// +// swagger:model create_custom_field_definition +type CreateCustomFieldDefinition struct { + + // description + Description string `json:"description,omitempty"` + + // display name + // Required: true + DisplayName *string `json:"display_name"` + + // field type + // Required: true + FieldType *string `json:"field_type"` + + // permissible values + PermissibleValues []string `json:"permissible_values"` + + // required + // Required: true + Required *bool `json:"required"` + + // An optional milestone ID to specify when the field should become required, if `required` is set to `true`. If not provided, required fields are always required. + RequiredAtMilestoneID string `json:"required_at_milestone_id,omitempty"` +} + +// Validate validates this create custom field definition +func (m *CreateCustomFieldDefinition) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDisplayName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFieldType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequired(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateCustomFieldDefinition) validateDisplayName(formats strfmt.Registry) error { + + if err := validate.Required("display_name", "body", m.DisplayName); err != nil { + return err + } + + return nil +} + +func (m *CreateCustomFieldDefinition) validateFieldType(formats strfmt.Registry) error { + + if err := validate.Required("field_type", "body", m.FieldType); err != nil { + return err + } + + return nil +} + +func (m *CreateCustomFieldDefinition) validateRequired(formats strfmt.Registry) error { + + if err := validate.Required("required", "body", m.Required); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create custom field definition based on context it is used +func (m *CreateCustomFieldDefinition) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateCustomFieldDefinition) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateCustomFieldDefinition) UnmarshalBinary(b []byte) error { + var res CreateCustomFieldDefinition + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_environment.go b/models/create_environment.go new file mode 100644 index 0000000..47fa17e --- /dev/null +++ b/models/create_environment.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateEnvironment Creates an environment for the organization +// +// swagger:model create_environment +type CreateEnvironment struct { + + // description + Description string `json:"description,omitempty"` + + // name + // Required: true + Name *string `json:"name"` +} + +// Validate validates this create environment +func (m *CreateEnvironment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateEnvironment) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create environment based on context it is used +func (m *CreateEnvironment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateEnvironment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateEnvironment) UnmarshalBinary(b []byte) error { + var res CreateEnvironment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_functionality.go b/models/create_functionality.go new file mode 100644 index 0000000..033c05a --- /dev/null +++ b/models/create_functionality.go @@ -0,0 +1,666 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateFunctionality Creates a functionality for the organization +// +// swagger:model create_functionality +type CreateFunctionality struct { + + // alert on add + AlertOnAdd bool `json:"alert_on_add,omitempty"` + + // auto add responding team + AutoAddRespondingTeam bool `json:"auto_add_responding_team,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // An array of external resources to attach to this service. + ExternalResources []*CreateFunctionalityExternalResourcesItems0 `json:"external_resources"` + + // A hash of label keys and values + Labels map[string]string `json:"labels,omitempty"` + + // An array of links to associate with this service + Links []*CreateFunctionalityLinksItems0 `json:"links"` + + // name + // Required: true + Name *string `json:"name"` + + // owner + Owner *CreateFunctionalityOwner `json:"owner,omitempty"` + + // services + Services []*CreateFunctionalityServicesItems0 `json:"services"` + + // An array of teams to attach to this service. + Teams []*CreateFunctionalityTeamsItems0 `json:"teams"` +} + +// Validate validates this create functionality +func (m *CreateFunctionality) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExternalResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLinks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOwner(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServices(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTeams(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateFunctionality) validateExternalResources(formats strfmt.Registry) error { + if swag.IsZero(m.ExternalResources) { // not required + return nil + } + + for i := 0; i < len(m.ExternalResources); i++ { + if swag.IsZero(m.ExternalResources[i]) { // not required + continue + } + + if m.ExternalResources[i] != nil { + if err := m.ExternalResources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateFunctionality) validateLinks(formats strfmt.Registry) error { + if swag.IsZero(m.Links) { // not required + return nil + } + + for i := 0; i < len(m.Links); i++ { + if swag.IsZero(m.Links[i]) { // not required + continue + } + + if m.Links[i] != nil { + if err := m.Links[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateFunctionality) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *CreateFunctionality) validateOwner(formats strfmt.Registry) error { + if swag.IsZero(m.Owner) { // not required + return nil + } + + if m.Owner != nil { + if err := m.Owner.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + +func (m *CreateFunctionality) validateServices(formats strfmt.Registry) error { + if swag.IsZero(m.Services) { // not required + return nil + } + + for i := 0; i < len(m.Services); i++ { + if swag.IsZero(m.Services[i]) { // not required + continue + } + + if m.Services[i] != nil { + if err := m.Services[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateFunctionality) validateTeams(formats strfmt.Registry) error { + if swag.IsZero(m.Teams) { // not required + return nil + } + + for i := 0; i < len(m.Teams); i++ { + if swag.IsZero(m.Teams[i]) { // not required + continue + } + + if m.Teams[i] != nil { + if err := m.Teams[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("teams" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("teams" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this create functionality based on the context it is used +func (m *CreateFunctionality) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateExternalResources(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOwner(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServices(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTeams(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateFunctionality) contextValidateExternalResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ExternalResources); i++ { + + if m.ExternalResources[i] != nil { + if err := m.ExternalResources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateFunctionality) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Links); i++ { + + if m.Links[i] != nil { + if err := m.Links[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateFunctionality) contextValidateOwner(ctx context.Context, formats strfmt.Registry) error { + + if m.Owner != nil { + if err := m.Owner.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + +func (m *CreateFunctionality) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Services); i++ { + + if m.Services[i] != nil { + if err := m.Services[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateFunctionality) contextValidateTeams(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Teams); i++ { + + if m.Teams[i] != nil { + if err := m.Teams[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("teams" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("teams" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateFunctionality) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateFunctionality) UnmarshalBinary(b []byte) error { + var res CreateFunctionality + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateFunctionalityExternalResourcesItems0 create functionality external resources items0 +// +// swagger:model CreateFunctionalityExternalResourcesItems0 +type CreateFunctionalityExternalResourcesItems0 struct { + + // The integration slug for the external resource. Can be one of: github, opsgenie, pager_duty, statuspage, victorops. Not required if the resource has already been imported. + ConnectionType string `json:"connection_type,omitempty"` + + // remote id + // Required: true + RemoteID *string `json:"remote_id"` +} + +// Validate validates this create functionality external resources items0 +func (m *CreateFunctionalityExternalResourcesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRemoteID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateFunctionalityExternalResourcesItems0) validateRemoteID(formats strfmt.Registry) error { + + if err := validate.Required("remote_id", "body", m.RemoteID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create functionality external resources items0 based on context it is used +func (m *CreateFunctionalityExternalResourcesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateFunctionalityExternalResourcesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateFunctionalityExternalResourcesItems0) UnmarshalBinary(b []byte) error { + var res CreateFunctionalityExternalResourcesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateFunctionalityLinksItems0 create functionality links items0 +// +// swagger:model CreateFunctionalityLinksItems0 +type CreateFunctionalityLinksItems0 struct { + + // URL + // Required: true + HrefURL *string `json:"href_url"` + + // An optional URL to an icon representing this link + IconURL string `json:"icon_url,omitempty"` + + // Short name used to display and identify this link + // Required: true + Name *string `json:"name"` +} + +// Validate validates this create functionality links items0 +func (m *CreateFunctionalityLinksItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHrefURL(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateFunctionalityLinksItems0) validateHrefURL(formats strfmt.Registry) error { + + if err := validate.Required("href_url", "body", m.HrefURL); err != nil { + return err + } + + return nil +} + +func (m *CreateFunctionalityLinksItems0) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create functionality links items0 based on context it is used +func (m *CreateFunctionalityLinksItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateFunctionalityLinksItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateFunctionalityLinksItems0) UnmarshalBinary(b []byte) error { + var res CreateFunctionalityLinksItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateFunctionalityOwner An object representing a Team that owns the service +// +// swagger:model CreateFunctionalityOwner +type CreateFunctionalityOwner struct { + + // id + // Required: true + ID *string `json:"id"` +} + +// Validate validates this create functionality owner +func (m *CreateFunctionalityOwner) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateFunctionalityOwner) validateID(formats strfmt.Registry) error { + + if err := validate.Required("owner"+"."+"id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create functionality owner based on context it is used +func (m *CreateFunctionalityOwner) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateFunctionalityOwner) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateFunctionalityOwner) UnmarshalBinary(b []byte) error { + var res CreateFunctionalityOwner + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateFunctionalityServicesItems0 create functionality services items0 +// +// swagger:model CreateFunctionalityServicesItems0 +type CreateFunctionalityServicesItems0 struct { + + // ID of a service + // Required: true + ID *string `json:"id"` +} + +// Validate validates this create functionality services items0 +func (m *CreateFunctionalityServicesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateFunctionalityServicesItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create functionality services items0 based on context it is used +func (m *CreateFunctionalityServicesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateFunctionalityServicesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateFunctionalityServicesItems0) UnmarshalBinary(b []byte) error { + var res CreateFunctionalityServicesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateFunctionalityTeamsItems0 create functionality teams items0 +// +// swagger:model CreateFunctionalityTeamsItems0 +type CreateFunctionalityTeamsItems0 struct { + + // id + // Required: true + ID *string `json:"id"` +} + +// Validate validates this create functionality teams items0 +func (m *CreateFunctionalityTeamsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateFunctionalityTeamsItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create functionality teams items0 based on context it is used +func (m *CreateFunctionalityTeamsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateFunctionalityTeamsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateFunctionalityTeamsItems0) UnmarshalBinary(b []byte) error { + var res CreateFunctionalityTeamsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_incident.go b/models/create_incident.go new file mode 100644 index 0000000..e91185c --- /dev/null +++ b/models/create_incident.go @@ -0,0 +1,523 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateIncident Create a new incident +// +// swagger:model create_incident +type CreateIncident struct { + + // List of alert IDs that this incident should be associated to + AlertIds []string `json:"alert_ids"` + + // An array of custom fields to set on the incident. + CustomFields []*CreateIncidentCustomFieldsItems0 `json:"custom_fields"` + + // customer impact summary + CustomerImpactSummary string `json:"customer_impact_summary,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // external links + ExternalLinks string `json:"external_links,omitempty"` + + // An array of impacted infrastructure + Impacts []*CreateIncidentImpactsItems0 `json:"impacts"` + + // The ID of the incident type to use as a template when creating the incident. This will copy values from the incident type unless they are being overridden via parameters in this request. + IncidentTypeID string `json:"incident_type_id,omitempty"` + + // Key:value pairs to track custom data for the incident + Labels interface{} `json:"labels,omitempty"` + + // An array of milestones to set on an incident. This can be used to create an already-resolved incident. + Milestones []*CreateIncidentMilestonesItems0 `json:"milestones"` + + // name + // Required: true + Name *string `json:"name"` + + // priority + Priority string `json:"priority,omitempty"` + + // restricted + Restricted bool `json:"restricted,omitempty"` + + // List of ids of Runbooks to attach to this incident. Foregoes any conditions these Runbooks may have guarding automatic attachment. + RunbookIds []string `json:"runbook_ids"` + + // severity + Severity string `json:"severity,omitempty"` + + // severity condition id + SeverityConditionID string `json:"severity_condition_id,omitempty"` + + // severity impact id + SeverityImpactID string `json:"severity_impact_id,omitempty"` + + // summary + Summary string `json:"summary,omitempty"` + + // List of tags for the incident + TagList []string `json:"tag_list"` + + // IDs of teams you wish to assign to this incident. + TeamIds []string `json:"team_ids"` +} + +// Validate validates this create incident +func (m *CreateIncident) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCustomFields(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImpacts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMilestones(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncident) validateCustomFields(formats strfmt.Registry) error { + if swag.IsZero(m.CustomFields) { // not required + return nil + } + + for i := 0; i < len(m.CustomFields); i++ { + if swag.IsZero(m.CustomFields[i]) { // not required + continue + } + + if m.CustomFields[i] != nil { + if err := m.CustomFields[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom_fields" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom_fields" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateIncident) validateImpacts(formats strfmt.Registry) error { + if swag.IsZero(m.Impacts) { // not required + return nil + } + + for i := 0; i < len(m.Impacts); i++ { + if swag.IsZero(m.Impacts[i]) { // not required + continue + } + + if m.Impacts[i] != nil { + if err := m.Impacts[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impacts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impacts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateIncident) validateMilestones(formats strfmt.Registry) error { + if swag.IsZero(m.Milestones) { // not required + return nil + } + + for i := 0; i < len(m.Milestones); i++ { + if swag.IsZero(m.Milestones[i]) { // not required + continue + } + + if m.Milestones[i] != nil { + if err := m.Milestones[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("milestones" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("milestones" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateIncident) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create incident based on the context it is used +func (m *CreateIncident) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCustomFields(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateImpacts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMilestones(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncident) contextValidateCustomFields(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.CustomFields); i++ { + + if m.CustomFields[i] != nil { + if err := m.CustomFields[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom_fields" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom_fields" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateIncident) contextValidateImpacts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Impacts); i++ { + + if m.Impacts[i] != nil { + if err := m.Impacts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impacts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impacts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateIncident) contextValidateMilestones(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Milestones); i++ { + + if m.Milestones[i] != nil { + if err := m.Milestones[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("milestones" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("milestones" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncident) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncident) UnmarshalBinary(b []byte) error { + var res CreateIncident + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateIncidentCustomFieldsItems0 create incident custom fields items0 +// +// swagger:model CreateIncidentCustomFieldsItems0 +type CreateIncidentCustomFieldsItems0 struct { + + // The ID of the custom field you wish to set. + // Required: true + FieldID *string `json:"field_id"` + + // The value you wish to set on the custom field if the type of the field accepts array values + ValueArray []string `json:"value_array"` + + // The value you wish to set on the custom field if the type of the field accepts string values + ValueString string `json:"value_string,omitempty"` +} + +// Validate validates this create incident custom fields items0 +func (m *CreateIncidentCustomFieldsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFieldID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentCustomFieldsItems0) validateFieldID(formats strfmt.Registry) error { + + if err := validate.Required("field_id", "body", m.FieldID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident custom fields items0 based on context it is used +func (m *CreateIncidentCustomFieldsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentCustomFieldsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentCustomFieldsItems0) UnmarshalBinary(b []byte) error { + var res CreateIncidentCustomFieldsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateIncidentImpactsItems0 create incident impacts items0 +// +// swagger:model CreateIncidentImpactsItems0 +type CreateIncidentImpactsItems0 struct { + + // The ID of the impact condition. Find these at /v1/severity_matrix/conditions + // Required: true + ConditionID *string `json:"condition_id"` + + // The ID of the impacted infrastructure + // Required: true + ID *string `json:"id"` + + // The type of impacted infrastructure. One of: environment, functionality, or service + // Required: true + Type *string `json:"type"` +} + +// Validate validates this create incident impacts items0 +func (m *CreateIncidentImpactsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConditionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentImpactsItems0) validateConditionID(formats strfmt.Registry) error { + + if err := validate.Required("condition_id", "body", m.ConditionID); err != nil { + return err + } + + return nil +} + +func (m *CreateIncidentImpactsItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *CreateIncidentImpactsItems0) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident impacts items0 based on context it is used +func (m *CreateIncidentImpactsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentImpactsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentImpactsItems0) UnmarshalBinary(b []byte) error { + var res CreateIncidentImpactsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateIncidentMilestonesItems0 create incident milestones items0 +// +// swagger:model CreateIncidentMilestonesItems0 +type CreateIncidentMilestonesItems0 struct { + + // An ISO8601 formatted string for when this milestone occurred. If you are removing a milestone, this field still needs to be set to some value + // Required: true + // Format: date-time + OccurredAt *strfmt.DateTime `json:"occurred_at"` + + // The type/slug of the milestone. Must be one of the currently configured milestones. + // Required: true + Type *string `json:"type"` +} + +// Validate validates this create incident milestones items0 +func (m *CreateIncidentMilestonesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOccurredAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentMilestonesItems0) validateOccurredAt(formats strfmt.Registry) error { + + if err := validate.Required("occurred_at", "body", m.OccurredAt); err != nil { + return err + } + + if err := validate.FormatOf("occurred_at", "body", "date-time", m.OccurredAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateIncidentMilestonesItems0) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident milestones items0 based on context it is used +func (m *CreateIncidentMilestonesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentMilestonesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentMilestonesItems0) UnmarshalBinary(b []byte) error { + var res CreateIncidentMilestonesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_incident_change_event.go b/models/create_incident_change_event.go new file mode 100644 index 0000000..9419dfc --- /dev/null +++ b/models/create_incident_change_event.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateIncidentChangeEvent Add a related change to an incident. Changes added to an incident can be causes, fixes, or suspects. To remove a change from an incident, the type field should be set to dismissed. +// +// swagger:model create_incident_change_event +type CreateIncidentChangeEvent struct { + + // The ID of the change event to associate + // Required: true + ChangeEventID *string `json:"change_event_id"` + + // type + // Required: true + // Enum: [caused fixed suspect dismissed] + Type *string `json:"type"` + + // A short description about why this change event is related + Why string `json:"why,omitempty"` +} + +// Validate validates this create incident change event +func (m *CreateIncidentChangeEvent) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChangeEventID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentChangeEvent) validateChangeEventID(formats strfmt.Registry) error { + + if err := validate.Required("change_event_id", "body", m.ChangeEventID); err != nil { + return err + } + + return nil +} + +var createIncidentChangeEventTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["caused","fixed","suspect","dismissed"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createIncidentChangeEventTypeTypePropEnum = append(createIncidentChangeEventTypeTypePropEnum, v) + } +} + +const ( + + // CreateIncidentChangeEventTypeCaused captures enum value "caused" + CreateIncidentChangeEventTypeCaused string = "caused" + + // CreateIncidentChangeEventTypeFixed captures enum value "fixed" + CreateIncidentChangeEventTypeFixed string = "fixed" + + // CreateIncidentChangeEventTypeSuspect captures enum value "suspect" + CreateIncidentChangeEventTypeSuspect string = "suspect" + + // CreateIncidentChangeEventTypeDismissed captures enum value "dismissed" + CreateIncidentChangeEventTypeDismissed string = "dismissed" +) + +// prop value enum +func (m *CreateIncidentChangeEvent) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createIncidentChangeEventTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateIncidentChangeEvent) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident change event based on context it is used +func (m *CreateIncidentChangeEvent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentChangeEvent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentChangeEvent) UnmarshalBinary(b []byte) error { + var res CreateIncidentChangeEvent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_incident_chat_message.go b/models/create_incident_chat_message.go new file mode 100644 index 0000000..fe5bd2d --- /dev/null +++ b/models/create_incident_chat_message.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateIncidentChatMessage Create a new generic chat message on an incident timeline. These are independent of any specific chat provider. +// +// swagger:model create_incident_chat_message +type CreateIncidentChatMessage struct { + + // body + // Required: true + Body *string `json:"body"` + + // ISO8601 timestamp for when the chat message occurred + // Format: date-time + OccurredAt strfmt.DateTime `json:"occurred_at,omitempty"` + + // vote direction + // Enum: [up down] + VoteDirection string `json:"vote_direction,omitempty"` +} + +// Validate validates this create incident chat message +func (m *CreateIncidentChatMessage) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBody(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOccurredAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVoteDirection(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentChatMessage) validateBody(formats strfmt.Registry) error { + + if err := validate.Required("body", "body", m.Body); err != nil { + return err + } + + return nil +} + +func (m *CreateIncidentChatMessage) validateOccurredAt(formats strfmt.Registry) error { + if swag.IsZero(m.OccurredAt) { // not required + return nil + } + + if err := validate.FormatOf("occurred_at", "body", "date-time", m.OccurredAt.String(), formats); err != nil { + return err + } + + return nil +} + +var createIncidentChatMessageTypeVoteDirectionPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["up","down"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createIncidentChatMessageTypeVoteDirectionPropEnum = append(createIncidentChatMessageTypeVoteDirectionPropEnum, v) + } +} + +const ( + + // CreateIncidentChatMessageVoteDirectionUp captures enum value "up" + CreateIncidentChatMessageVoteDirectionUp string = "up" + + // CreateIncidentChatMessageVoteDirectionDown captures enum value "down" + CreateIncidentChatMessageVoteDirectionDown string = "down" +) + +// prop value enum +func (m *CreateIncidentChatMessage) validateVoteDirectionEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createIncidentChatMessageTypeVoteDirectionPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateIncidentChatMessage) validateVoteDirection(formats strfmt.Registry) error { + if swag.IsZero(m.VoteDirection) { // not required + return nil + } + + // value enum + if err := m.validateVoteDirectionEnum("vote_direction", "body", m.VoteDirection); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident chat message based on context it is used +func (m *CreateIncidentChatMessage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentChatMessage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentChatMessage) UnmarshalBinary(b []byte) error { + var res CreateIncidentChatMessage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_incident_impact.go b/models/create_incident_impact.go new file mode 100644 index 0000000..d3619cd --- /dev/null +++ b/models/create_incident_impact.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateIncidentImpact Add impacted infrastructure to an incident +// +// swagger:model create_incident_impact +type CreateIncidentImpact struct { + + // condition id + ConditionID string `json:"condition_id,omitempty"` + + // id + // Required: true + ID *string `json:"id"` +} + +// Validate validates this create incident impact +func (m *CreateIncidentImpact) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentImpact) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident impact based on context it is used +func (m *CreateIncidentImpact) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentImpact) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentImpact) UnmarshalBinary(b []byte) error { + var res CreateIncidentImpact + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_incident_link.go b/models/create_incident_link.go new file mode 100644 index 0000000..1e794a1 --- /dev/null +++ b/models/create_incident_link.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateIncidentLink Allows adding adhoc links to an incident as an attachment +// +// swagger:model create_incident_link +type CreateIncidentLink struct { + + // display text + DisplayText string `json:"display_text,omitempty"` + + // href + // Required: true + Href *string `json:"href"` + + // icon url + IconURL string `json:"icon_url,omitempty"` +} + +// Validate validates this create incident link +func (m *CreateIncidentLink) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHref(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentLink) validateHref(formats strfmt.Registry) error { + + if err := validate.Required("href", "body", m.Href); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident link based on context it is used +func (m *CreateIncidentLink) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentLink) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentLink) UnmarshalBinary(b []byte) error { + var res CreateIncidentLink + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_incident_note.go b/models/create_incident_note.go new file mode 100644 index 0000000..7ff3a42 --- /dev/null +++ b/models/create_incident_note.go @@ -0,0 +1,281 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateIncidentNote Create a new note on for an incident. The visibility field on a note determines where it gets posted. +// +// swagger:model create_incident_note +type CreateIncidentNote struct { + + // body + // Required: true + Body *string `json:"body"` + + // ISO8601 timestamp for when the note occurred + // Format: date-time + OccurredAt strfmt.DateTime `json:"occurred_at,omitempty"` + + // status pages + StatusPages []*CreateIncidentNoteStatusPagesItems0 `json:"status_pages"` + + // visibility + // Enum: [private_to_org open_to_public internal_status_page] + Visibility *string `json:"visibility,omitempty"` +} + +// Validate validates this create incident note +func (m *CreateIncidentNote) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBody(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOccurredAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatusPages(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVisibility(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentNote) validateBody(formats strfmt.Registry) error { + + if err := validate.Required("body", "body", m.Body); err != nil { + return err + } + + return nil +} + +func (m *CreateIncidentNote) validateOccurredAt(formats strfmt.Registry) error { + if swag.IsZero(m.OccurredAt) { // not required + return nil + } + + if err := validate.FormatOf("occurred_at", "body", "date-time", m.OccurredAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateIncidentNote) validateStatusPages(formats strfmt.Registry) error { + if swag.IsZero(m.StatusPages) { // not required + return nil + } + + for i := 0; i < len(m.StatusPages); i++ { + if swag.IsZero(m.StatusPages[i]) { // not required + continue + } + + if m.StatusPages[i] != nil { + if err := m.StatusPages[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +var createIncidentNoteTypeVisibilityPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["private_to_org","open_to_public","internal_status_page"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createIncidentNoteTypeVisibilityPropEnum = append(createIncidentNoteTypeVisibilityPropEnum, v) + } +} + +const ( + + // CreateIncidentNoteVisibilityPrivateToOrg captures enum value "private_to_org" + CreateIncidentNoteVisibilityPrivateToOrg string = "private_to_org" + + // CreateIncidentNoteVisibilityOpenToPublic captures enum value "open_to_public" + CreateIncidentNoteVisibilityOpenToPublic string = "open_to_public" + + // CreateIncidentNoteVisibilityInternalStatusPage captures enum value "internal_status_page" + CreateIncidentNoteVisibilityInternalStatusPage string = "internal_status_page" +) + +// prop value enum +func (m *CreateIncidentNote) validateVisibilityEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createIncidentNoteTypeVisibilityPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateIncidentNote) validateVisibility(formats strfmt.Registry) error { + if swag.IsZero(m.Visibility) { // not required + return nil + } + + // value enum + if err := m.validateVisibilityEnum("visibility", "body", *m.Visibility); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create incident note based on the context it is used +func (m *CreateIncidentNote) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStatusPages(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentNote) contextValidateStatusPages(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.StatusPages); i++ { + + if m.StatusPages[i] != nil { + if err := m.StatusPages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentNote) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentNote) UnmarshalBinary(b []byte) error { + var res CreateIncidentNote + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateIncidentNoteStatusPagesItems0 create incident note status pages items0 +// +// swagger:model CreateIncidentNoteStatusPagesItems0 +type CreateIncidentNoteStatusPagesItems0 struct { + + // id + // Required: true + ID *string `json:"id"` + + // integration slug + // Required: true + IntegrationSlug *string `json:"integration_slug"` +} + +// Validate validates this create incident note status pages items0 +func (m *CreateIncidentNoteStatusPagesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIntegrationSlug(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentNoteStatusPagesItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *CreateIncidentNoteStatusPagesItems0) validateIntegrationSlug(formats strfmt.Registry) error { + + if err := validate.Required("integration_slug", "body", m.IntegrationSlug); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident note status pages items0 based on context it is used +func (m *CreateIncidentNoteStatusPagesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentNoteStatusPagesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentNoteStatusPagesItems0) UnmarshalBinary(b []byte) error { + var res CreateIncidentNoteStatusPagesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_incident_role.go b/models/create_incident_role.go new file mode 100644 index 0000000..c437289 --- /dev/null +++ b/models/create_incident_role.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateIncidentRole Create a new incident role +// +// swagger:model create_incident_role +type CreateIncidentRole struct { + + // description + Description string `json:"description,omitempty"` + + // name + // Required: true + Name *string `json:"name"` + + // summary + // Required: true + Summary *string `json:"summary"` +} + +// Validate validates this create incident role +func (m *CreateIncidentRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSummary(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentRole) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *CreateIncidentRole) validateSummary(formats strfmt.Registry) error { + + if err := validate.Required("summary", "body", m.Summary); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident role based on context it is used +func (m *CreateIncidentRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentRole) UnmarshalBinary(b []byte) error { + var res CreateIncidentRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_incident_role_assignment.go b/models/create_incident_role_assignment.go new file mode 100644 index 0000000..7aac8a9 --- /dev/null +++ b/models/create_incident_role_assignment.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateIncidentRoleAssignment Assign a role to a user for this incident +// +// swagger:model create_incident_role_assignment +type CreateIncidentRoleAssignment struct { + + // The Incident Role ID to assign the role to + // Required: true + IncidentRoleID *string `json:"incident_role_id"` + + // The user ID to assign the role to + // Required: true + UserID *string `json:"user_id"` +} + +// Validate validates this create incident role assignment +func (m *CreateIncidentRoleAssignment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIncidentRoleID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentRoleAssignment) validateIncidentRoleID(formats strfmt.Registry) error { + + if err := validate.Required("incident_role_id", "body", m.IncidentRoleID); err != nil { + return err + } + + return nil +} + +func (m *CreateIncidentRoleAssignment) validateUserID(formats strfmt.Registry) error { + + if err := validate.Required("user_id", "body", m.UserID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident role assignment based on context it is used +func (m *CreateIncidentRoleAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentRoleAssignment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentRoleAssignment) UnmarshalBinary(b []byte) error { + var res CreateIncidentRoleAssignment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_incident_status_page.go b/models/create_incident_status_page.go new file mode 100644 index 0000000..17184e4 --- /dev/null +++ b/models/create_incident_status_page.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateIncidentStatusPage Add a status page to an incident. +// +// swagger:model create_incident_status_page +type CreateIncidentStatusPage struct { + + // integration id + // Required: true + IntegrationID *string `json:"integration_id"` + + // integration slug + // Required: true + IntegrationSlug *string `json:"integration_slug"` + + // title + Title string `json:"title,omitempty"` +} + +// Validate validates this create incident status page +func (m *CreateIncidentStatusPage) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIntegrationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIntegrationSlug(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentStatusPage) validateIntegrationID(formats strfmt.Registry) error { + + if err := validate.Required("integration_id", "body", m.IntegrationID); err != nil { + return err + } + + return nil +} + +func (m *CreateIncidentStatusPage) validateIntegrationSlug(formats strfmt.Registry) error { + + if err := validate.Required("integration_slug", "body", m.IntegrationSlug); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident status page based on context it is used +func (m *CreateIncidentStatusPage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentStatusPage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentStatusPage) UnmarshalBinary(b []byte) error { + var res CreateIncidentStatusPage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_incident_task.go b/models/create_incident_task.go new file mode 100644 index 0000000..f66ae72 --- /dev/null +++ b/models/create_incident_task.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateIncidentTask Create a task +// +// swagger:model create_incident_task +type CreateIncidentTask struct { + + // The ID of the user assigned to the task. + AssigneeID string `json:"assignee_id,omitempty"` + + // A description of what the task is for. + Description string `json:"description,omitempty"` + + // The due date of the task. Relative values are supported such as '5m' + DueAt string `json:"due_at,omitempty"` + + // The state of the task. One of: open, in_progress, cancelled, done + State string `json:"state,omitempty"` + + // The title of the task. + // Required: true + Title *string `json:"title"` +} + +// Validate validates this create incident task +func (m *CreateIncidentTask) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTitle(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentTask) validateTitle(formats strfmt.Registry) error { + + if err := validate.Required("title", "body", m.Title); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident task based on context it is used +func (m *CreateIncidentTask) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentTask) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentTask) UnmarshalBinary(b []byte) error { + var res CreateIncidentTask + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_incident_task_list.go b/models/create_incident_task_list.go new file mode 100644 index 0000000..ca9d16b --- /dev/null +++ b/models/create_incident_task_list.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateIncidentTaskList Add all tasks from list to incident +// +// swagger:model create_incident_task_list +type CreateIncidentTaskList struct { + + // The ID of the user assigned to the tasks in this list. + AssigneeID string `json:"assignee_id,omitempty"` + + // The id of the task list. + // Required: true + TaskListID *string `json:"task_list_id"` +} + +// Validate validates this create incident task list +func (m *CreateIncidentTaskList) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaskListID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentTaskList) validateTaskListID(formats strfmt.Registry) error { + + if err := validate.Required("task_list_id", "body", m.TaskListID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident task list based on context it is used +func (m *CreateIncidentTaskList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentTaskList) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentTaskList) UnmarshalBinary(b []byte) error { + var res CreateIncidentTaskList + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_incident_team_assignment.go b/models/create_incident_team_assignment.go new file mode 100644 index 0000000..65cf0ed --- /dev/null +++ b/models/create_incident_team_assignment.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateIncidentTeamAssignment Assign a team for this incident +// +// swagger:model create_incident_team_assignment +type CreateIncidentTeamAssignment struct { + + // The team ID to associate to the incident + // Required: true + TeamID *string `json:"team_id"` +} + +// Validate validates this create incident team assignment +func (m *CreateIncidentTeamAssignment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTeamID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentTeamAssignment) validateTeamID(formats strfmt.Registry) error { + + if err := validate.Required("team_id", "body", m.TeamID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident team assignment based on context it is used +func (m *CreateIncidentTeamAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentTeamAssignment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentTeamAssignment) UnmarshalBinary(b []byte) error { + var res CreateIncidentTeamAssignment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_incident_type.go b/models/create_incident_type.go new file mode 100644 index 0000000..1b0d7ed --- /dev/null +++ b/models/create_incident_type.go @@ -0,0 +1,326 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateIncidentType Create a new incident type +// +// swagger:model create_incident_type +type CreateIncidentType struct { + + // name + // Required: true + Name *string `json:"name"` + + // template + // Required: true + Template *CreateIncidentTypeTemplate `json:"template"` +} + +// Validate validates this create incident type +func (m *CreateIncidentType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTemplate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentType) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *CreateIncidentType) validateTemplate(formats strfmt.Registry) error { + + if err := validate.Required("template", "body", m.Template); err != nil { + return err + } + + if m.Template != nil { + if err := m.Template.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("template") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create incident type based on the context it is used +func (m *CreateIncidentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTemplate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentType) contextValidateTemplate(ctx context.Context, formats strfmt.Registry) error { + + if m.Template != nil { + if err := m.Template.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("template") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentType) UnmarshalBinary(b []byte) error { + var res CreateIncidentType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateIncidentTypeTemplate create incident type template +// +// swagger:model CreateIncidentTypeTemplate +type CreateIncidentTypeTemplate struct { + + // customer impact summary + CustomerImpactSummary string `json:"customer_impact_summary,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // An array of impact/condition combinations + Impacts []*CreateIncidentTypeTemplateImpactsItems0 `json:"impacts"` + + // A labels hash of keys and values + Labels map[string]string `json:"labels,omitempty"` + + // priority + Priority string `json:"priority,omitempty"` + + // private incident + PrivateIncident bool `json:"private_incident,omitempty"` + + // List of ids of Runbooks to attach to incidents created from this type + RunbookIds []string `json:"runbook_ids"` + + // severity + Severity string `json:"severity,omitempty"` + + // List of tags for the incident + TagList []string `json:"tag_list"` + + // List of ids of teams to be assigned to incidents + TeamIds []string `json:"team_ids"` +} + +// Validate validates this create incident type template +func (m *CreateIncidentTypeTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImpacts(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentTypeTemplate) validateImpacts(formats strfmt.Registry) error { + if swag.IsZero(m.Impacts) { // not required + return nil + } + + for i := 0; i < len(m.Impacts); i++ { + if swag.IsZero(m.Impacts[i]) { // not required + continue + } + + if m.Impacts[i] != nil { + if err := m.Impacts[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template" + "." + "impacts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("template" + "." + "impacts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this create incident type template based on the context it is used +func (m *CreateIncidentTypeTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateImpacts(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentTypeTemplate) contextValidateImpacts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Impacts); i++ { + + if m.Impacts[i] != nil { + if err := m.Impacts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template" + "." + "impacts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("template" + "." + "impacts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentTypeTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentTypeTemplate) UnmarshalBinary(b []byte) error { + var res CreateIncidentTypeTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateIncidentTypeTemplateImpactsItems0 create incident type template impacts items0 +// +// swagger:model CreateIncidentTypeTemplateImpactsItems0 +type CreateIncidentTypeTemplateImpactsItems0 struct { + + // The id of the condition + // Required: true + ConditionID *string `json:"condition_id"` + + // The id of impact + // Required: true + ID *string `json:"id"` +} + +// Validate validates this create incident type template impacts items0 +func (m *CreateIncidentTypeTemplateImpactsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConditionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateIncidentTypeTemplateImpactsItems0) validateConditionID(formats strfmt.Registry) error { + + if err := validate.Required("condition_id", "body", m.ConditionID); err != nil { + return err + } + + return nil +} + +func (m *CreateIncidentTypeTemplateImpactsItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create incident type template impacts items0 based on context it is used +func (m *CreateIncidentTypeTemplateImpactsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateIncidentTypeTemplateImpactsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateIncidentTypeTemplateImpactsItems0) UnmarshalBinary(b []byte) error { + var res CreateIncidentTypeTemplateImpactsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_nunc_subscription.go b/models/create_nunc_subscription.go new file mode 100644 index 0000000..2d0e032 --- /dev/null +++ b/models/create_nunc_subscription.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateNuncSubscription Subscribe to status page updates +// +// swagger:model create_nunc_subscription +type CreateNuncSubscription struct { + + // email + // Required: true + Email *string `json:"email"` +} + +// Validate validates this create nunc subscription +func (m *CreateNuncSubscription) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateNuncSubscription) validateEmail(formats strfmt.Registry) error { + + if err := validate.Required("email", "body", m.Email); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create nunc subscription based on context it is used +func (m *CreateNuncSubscription) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateNuncSubscription) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateNuncSubscription) UnmarshalBinary(b []byte) error { + var res CreateNuncSubscription + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_on_call_shift.go b/models/create_on_call_shift.go new file mode 100644 index 0000000..e19a2f1 --- /dev/null +++ b/models/create_on_call_shift.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateOnCallShift Create a Signals on-call shift in a schedule. +// +// swagger:model create_on_call_shift +type CreateOnCallShift struct { + + // The end time of the shift in ISO8601 format. + // Required: true + EndTime *string `json:"end_time"` + + // The start time of the shift in ISO8601 format. + // Required: true + StartTime *string `json:"start_time"` + + // The ID of the user who is on-call for the shift. If not provided, the shift will be unassigned. + UserID string `json:"user_id,omitempty"` +} + +// Validate validates this create on call shift +func (m *CreateOnCallShift) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEndTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartTime(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateOnCallShift) validateEndTime(formats strfmt.Registry) error { + + if err := validate.Required("end_time", "body", m.EndTime); err != nil { + return err + } + + return nil +} + +func (m *CreateOnCallShift) validateStartTime(formats strfmt.Registry) error { + + if err := validate.Required("start_time", "body", m.StartTime); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create on call shift based on context it is used +func (m *CreateOnCallShift) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateOnCallShift) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateOnCallShift) UnmarshalBinary(b []byte) error { + var res CreateOnCallShift + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_post_mortem_reason.go b/models/create_post_mortem_reason.go new file mode 100644 index 0000000..e16f031 --- /dev/null +++ b/models/create_post_mortem_reason.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreatePostMortemReason Add a new contributing factor to an incident +// +// swagger:model create_post_mortem_reason +type CreatePostMortemReason struct { + + // summary + // Required: true + Summary *string `json:"summary"` +} + +// Validate validates this create post mortem reason +func (m *CreatePostMortemReason) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSummary(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreatePostMortemReason) validateSummary(formats strfmt.Registry) error { + + if err := validate.Required("summary", "body", m.Summary); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create post mortem reason based on context it is used +func (m *CreatePostMortemReason) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreatePostMortemReason) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreatePostMortemReason) UnmarshalBinary(b []byte) error { + var res CreatePostMortemReason + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_post_mortem_report.go b/models/create_post_mortem_report.go new file mode 100644 index 0000000..b1d53cc --- /dev/null +++ b/models/create_post_mortem_report.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreatePostMortemReport Create a report +// +// swagger:model create_post_mortem_report +type CreatePostMortemReport struct { + + // incident id + // Required: true + IncidentID *string `json:"incident_id"` +} + +// Validate validates this create post mortem report +func (m *CreatePostMortemReport) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIncidentID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreatePostMortemReport) validateIncidentID(formats strfmt.Registry) error { + + if err := validate.Required("incident_id", "body", m.IncidentID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create post mortem report based on context it is used +func (m *CreatePostMortemReport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreatePostMortemReport) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreatePostMortemReport) UnmarshalBinary(b []byte) error { + var res CreatePostMortemReport + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_priority.go b/models/create_priority.go new file mode 100644 index 0000000..ab95f25 --- /dev/null +++ b/models/create_priority.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreatePriority Create a new priority +// +// swagger:model create_priority +type CreatePriority struct { + + // default + Default bool `json:"default,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // slug + // Required: true + Slug *string `json:"slug"` +} + +// Validate validates this create priority +func (m *CreatePriority) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSlug(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreatePriority) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create priority based on context it is used +func (m *CreatePriority) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreatePriority) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreatePriority) UnmarshalBinary(b []byte) error { + var res CreatePriority + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_runbook.go b/models/create_runbook.go new file mode 100644 index 0000000..931e952 --- /dev/null +++ b/models/create_runbook.go @@ -0,0 +1,595 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateRunbook Create a new runbook for use with incidents. +// +// swagger:model create_runbook +type CreateRunbook struct { + + // attachment rule + AttachmentRule *CreateRunbookAttachmentRule `json:"attachment_rule,omitempty"` + + // Whether or not this runbook should be automatically attached to restricted incidents. Note that setting this to `true` will prevent it from being attached to public incidents, even manually. Defaults to `false`. + AutoAttachToRestrictedIncidents bool `json:"auto_attach_to_restricted_incidents,omitempty"` + + // A longer description about the Runbook. Supports markdown format + Description string `json:"description,omitempty"` + + // name + // Required: true + Name *string `json:"name"` + + // owner + Owner *CreateRunbookOwner `json:"owner,omitempty"` + + // steps + Steps []*CreateRunbookStepsItems0 `json:"steps"` + + // Deprecated. Use description + Summary string `json:"summary,omitempty"` + + // Whether or not this runbook is a tutorial runbook + Tutorial bool `json:"tutorial,omitempty"` + + // Deprecated, but still required. Please just use 'incident' + // Required: true + // Enum: [incident general infrastructure incident_role] + Type *string `json:"type"` +} + +// Validate validates this create runbook +func (m *CreateRunbook) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAttachmentRule(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOwner(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSteps(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateRunbook) validateAttachmentRule(formats strfmt.Registry) error { + if swag.IsZero(m.AttachmentRule) { // not required + return nil + } + + if m.AttachmentRule != nil { + if err := m.AttachmentRule.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attachment_rule") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("attachment_rule") + } + return err + } + } + + return nil +} + +func (m *CreateRunbook) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *CreateRunbook) validateOwner(formats strfmt.Registry) error { + if swag.IsZero(m.Owner) { // not required + return nil + } + + if m.Owner != nil { + if err := m.Owner.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + +func (m *CreateRunbook) validateSteps(formats strfmt.Registry) error { + if swag.IsZero(m.Steps) { // not required + return nil + } + + for i := 0; i < len(m.Steps); i++ { + if swag.IsZero(m.Steps[i]) { // not required + continue + } + + if m.Steps[i] != nil { + if err := m.Steps[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("steps" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("steps" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +var createRunbookTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["incident","general","infrastructure","incident_role"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createRunbookTypeTypePropEnum = append(createRunbookTypeTypePropEnum, v) + } +} + +const ( + + // CreateRunbookTypeIncident captures enum value "incident" + CreateRunbookTypeIncident string = "incident" + + // CreateRunbookTypeGeneral captures enum value "general" + CreateRunbookTypeGeneral string = "general" + + // CreateRunbookTypeInfrastructure captures enum value "infrastructure" + CreateRunbookTypeInfrastructure string = "infrastructure" + + // CreateRunbookTypeIncidentRole captures enum value "incident_role" + CreateRunbookTypeIncidentRole string = "incident_role" +) + +// prop value enum +func (m *CreateRunbook) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createRunbookTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateRunbook) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create runbook based on the context it is used +func (m *CreateRunbook) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAttachmentRule(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOwner(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSteps(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateRunbook) contextValidateAttachmentRule(ctx context.Context, formats strfmt.Registry) error { + + if m.AttachmentRule != nil { + if err := m.AttachmentRule.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attachment_rule") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("attachment_rule") + } + return err + } + } + + return nil +} + +func (m *CreateRunbook) contextValidateOwner(ctx context.Context, formats strfmt.Registry) error { + + if m.Owner != nil { + if err := m.Owner.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + +func (m *CreateRunbook) contextValidateSteps(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Steps); i++ { + + if m.Steps[i] != nil { + if err := m.Steps[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("steps" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("steps" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateRunbook) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateRunbook) UnmarshalBinary(b []byte) error { + var res CreateRunbook + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateRunbookAttachmentRule create runbook attachment rule +// +// swagger:model CreateRunbookAttachmentRule +type CreateRunbookAttachmentRule struct { + + // The JSON logic for the attaching the runbook + // Required: true + Logic *string `json:"logic"` + + // The user data for the rule + UserData string `json:"user_data,omitempty"` +} + +// Validate validates this create runbook attachment rule +func (m *CreateRunbookAttachmentRule) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLogic(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateRunbookAttachmentRule) validateLogic(formats strfmt.Registry) error { + + if err := validate.Required("attachment_rule"+"."+"logic", "body", m.Logic); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create runbook attachment rule based on context it is used +func (m *CreateRunbookAttachmentRule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateRunbookAttachmentRule) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateRunbookAttachmentRule) UnmarshalBinary(b []byte) error { + var res CreateRunbookAttachmentRule + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateRunbookOwner An object representing a Team that owns the runbook +// +// swagger:model CreateRunbookOwner +type CreateRunbookOwner struct { + + // id + // Required: true + ID *string `json:"id"` +} + +// Validate validates this create runbook owner +func (m *CreateRunbookOwner) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateRunbookOwner) validateID(formats strfmt.Registry) error { + + if err := validate.Required("owner"+"."+"id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create runbook owner based on context it is used +func (m *CreateRunbookOwner) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateRunbookOwner) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateRunbookOwner) UnmarshalBinary(b []byte) error { + var res CreateRunbookOwner + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateRunbookStepsItems0 create runbook steps items0 +// +// swagger:model CreateRunbookStepsItems0 +type CreateRunbookStepsItems0 struct { + + // ID of action to use for this step. + // Required: true + ActionID *string `json:"action_id"` + + // Name for step + // Required: true + Name *string `json:"name"` + + // rule + Rule *CreateRunbookStepsItems0Rule `json:"rule,omitempty"` +} + +// Validate validates this create runbook steps items0 +func (m *CreateRunbookStepsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRule(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateRunbookStepsItems0) validateActionID(formats strfmt.Registry) error { + + if err := validate.Required("action_id", "body", m.ActionID); err != nil { + return err + } + + return nil +} + +func (m *CreateRunbookStepsItems0) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *CreateRunbookStepsItems0) validateRule(formats strfmt.Registry) error { + if swag.IsZero(m.Rule) { // not required + return nil + } + + if m.Rule != nil { + if err := m.Rule.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rule") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create runbook steps items0 based on the context it is used +func (m *CreateRunbookStepsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRule(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateRunbookStepsItems0) contextValidateRule(ctx context.Context, formats strfmt.Registry) error { + + if m.Rule != nil { + if err := m.Rule.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rule") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateRunbookStepsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateRunbookStepsItems0) UnmarshalBinary(b []byte) error { + var res CreateRunbookStepsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateRunbookStepsItems0Rule create runbook steps items0 rule +// +// swagger:model CreateRunbookStepsItems0Rule +type CreateRunbookStepsItems0Rule struct { + + // The JSON logic for the rule + // Required: true + Logic *string `json:"logic"` + + // The user data for the rule + UserData string `json:"user_data,omitempty"` +} + +// Validate validates this create runbook steps items0 rule +func (m *CreateRunbookStepsItems0Rule) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLogic(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateRunbookStepsItems0Rule) validateLogic(formats strfmt.Registry) error { + + if err := validate.Required("rule"+"."+"logic", "body", m.Logic); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create runbook steps items0 rule based on context it is used +func (m *CreateRunbookStepsItems0Rule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateRunbookStepsItems0Rule) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateRunbookStepsItems0Rule) UnmarshalBinary(b []byte) error { + var res CreateRunbookStepsItems0Rule + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_runbook_execution.go b/models/create_runbook_execution.go new file mode 100644 index 0000000..02bba79 --- /dev/null +++ b/models/create_runbook_execution.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateRunbookExecution Attaches a runbook to an incident and executes it +// +// swagger:model create_runbook_execution +type CreateRunbookExecution struct { + + // The incident to attach the runbook to. Format must be: `incident/${incidentId}` + // Required: true + ExecuteFor *string `json:"execute_for"` + + // ID of runbook to attach + // Required: true + RunbookID *string `json:"runbook_id"` +} + +// Validate validates this create runbook execution +func (m *CreateRunbookExecution) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExecuteFor(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRunbookID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateRunbookExecution) validateExecuteFor(formats strfmt.Registry) error { + + if err := validate.Required("execute_for", "body", m.ExecuteFor); err != nil { + return err + } + + return nil +} + +func (m *CreateRunbookExecution) validateRunbookID(formats strfmt.Registry) error { + + if err := validate.Required("runbook_id", "body", m.RunbookID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create runbook execution based on context it is used +func (m *CreateRunbookExecution) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateRunbookExecution) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateRunbookExecution) UnmarshalBinary(b []byte) error { + var res CreateRunbookExecution + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_saved_search.go b/models/create_saved_search.go new file mode 100644 index 0000000..2d3105c --- /dev/null +++ b/models/create_saved_search.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateSavedSearch Create a new saved search for a particular resource type +// +// swagger:model create_saved_search +type CreateSavedSearch struct { + + // filter values + // Required: true + FilterValues interface{} `json:"filter_values"` + + // is private + IsPrivate bool `json:"is_private,omitempty"` + + // name + // Required: true + Name *string `json:"name"` +} + +// Validate validates this create saved search +func (m *CreateSavedSearch) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFilterValues(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateSavedSearch) validateFilterValues(formats strfmt.Registry) error { + + if m.FilterValues == nil { + return errors.Required("filter_values", "body", nil) + } + + return nil +} + +func (m *CreateSavedSearch) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create saved search based on context it is used +func (m *CreateSavedSearch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateSavedSearch) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateSavedSearch) UnmarshalBinary(b []byte) error { + var res CreateSavedSearch + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_scheduled_maintenance.go b/models/create_scheduled_maintenance.go new file mode 100644 index 0000000..a2fd4cc --- /dev/null +++ b/models/create_scheduled_maintenance.go @@ -0,0 +1,393 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateScheduledMaintenance Create a new scheduled maintenance event +// +// swagger:model create_scheduled_maintenance +type CreateScheduledMaintenance struct { + + // description + Description string `json:"description,omitempty"` + + // ISO8601 timestamp for the end time of the scheduled maintenance + // Required: true + // Format: date-time + EndsAt *strfmt.DateTime `json:"ends_at"` + + // An array of impact/condition combinations + Impacts []*CreateScheduledMaintenanceImpactsItems0 `json:"impacts"` + + // A json object of label keys and values + Labels map[string]string `json:"labels,omitempty"` + + // name + // Required: true + Name *string `json:"name"` + + // ISO8601 timestamp for the start time of the scheduled maintenance + // Required: true + // Format: date-time + StartsAt *strfmt.DateTime `json:"starts_at"` + + // An array of status pages to display this maintenance on + StatusPages []*CreateScheduledMaintenanceStatusPagesItems0 `json:"status_pages"` + + // summary + Summary string `json:"summary,omitempty"` +} + +// Validate validates this create scheduled maintenance +func (m *CreateScheduledMaintenance) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEndsAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImpacts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartsAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatusPages(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateScheduledMaintenance) validateEndsAt(formats strfmt.Registry) error { + + if err := validate.Required("ends_at", "body", m.EndsAt); err != nil { + return err + } + + if err := validate.FormatOf("ends_at", "body", "date-time", m.EndsAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateScheduledMaintenance) validateImpacts(formats strfmt.Registry) error { + if swag.IsZero(m.Impacts) { // not required + return nil + } + + for i := 0; i < len(m.Impacts); i++ { + if swag.IsZero(m.Impacts[i]) { // not required + continue + } + + if m.Impacts[i] != nil { + if err := m.Impacts[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impacts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impacts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateScheduledMaintenance) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *CreateScheduledMaintenance) validateStartsAt(formats strfmt.Registry) error { + + if err := validate.Required("starts_at", "body", m.StartsAt); err != nil { + return err + } + + if err := validate.FormatOf("starts_at", "body", "date-time", m.StartsAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateScheduledMaintenance) validateStatusPages(formats strfmt.Registry) error { + if swag.IsZero(m.StatusPages) { // not required + return nil + } + + for i := 0; i < len(m.StatusPages); i++ { + if swag.IsZero(m.StatusPages[i]) { // not required + continue + } + + if m.StatusPages[i] != nil { + if err := m.StatusPages[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this create scheduled maintenance based on the context it is used +func (m *CreateScheduledMaintenance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateImpacts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatusPages(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateScheduledMaintenance) contextValidateImpacts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Impacts); i++ { + + if m.Impacts[i] != nil { + if err := m.Impacts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impacts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impacts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateScheduledMaintenance) contextValidateStatusPages(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.StatusPages); i++ { + + if m.StatusPages[i] != nil { + if err := m.StatusPages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateScheduledMaintenance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateScheduledMaintenance) UnmarshalBinary(b []byte) error { + var res CreateScheduledMaintenance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateScheduledMaintenanceImpactsItems0 create scheduled maintenance impacts items0 +// +// swagger:model CreateScheduledMaintenanceImpactsItems0 +type CreateScheduledMaintenanceImpactsItems0 struct { + + // The id of the condition + // Required: true + ConditionID *string `json:"condition_id"` + + // The id of impact + // Required: true + ID *string `json:"id"` + + // The type of impact + // Required: true + Type *string `json:"type"` +} + +// Validate validates this create scheduled maintenance impacts items0 +func (m *CreateScheduledMaintenanceImpactsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConditionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateScheduledMaintenanceImpactsItems0) validateConditionID(formats strfmt.Registry) error { + + if err := validate.Required("condition_id", "body", m.ConditionID); err != nil { + return err + } + + return nil +} + +func (m *CreateScheduledMaintenanceImpactsItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *CreateScheduledMaintenanceImpactsItems0) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create scheduled maintenance impacts items0 based on context it is used +func (m *CreateScheduledMaintenanceImpactsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateScheduledMaintenanceImpactsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateScheduledMaintenanceImpactsItems0) UnmarshalBinary(b []byte) error { + var res CreateScheduledMaintenanceImpactsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateScheduledMaintenanceStatusPagesItems0 create scheduled maintenance status pages items0 +// +// swagger:model CreateScheduledMaintenanceStatusPagesItems0 +type CreateScheduledMaintenanceStatusPagesItems0 struct { + + // The UUID of the status page to display this maintenance on + // Required: true + ConnectionID *string `json:"connection_id"` + + // The slug identifying the type of status page + IntegrationSlug string `json:"integration_slug,omitempty"` +} + +// Validate validates this create scheduled maintenance status pages items0 +func (m *CreateScheduledMaintenanceStatusPagesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConnectionID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateScheduledMaintenanceStatusPagesItems0) validateConnectionID(formats strfmt.Registry) error { + + if err := validate.Required("connection_id", "body", m.ConnectionID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create scheduled maintenance status pages items0 based on context it is used +func (m *CreateScheduledMaintenanceStatusPagesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateScheduledMaintenanceStatusPagesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateScheduledMaintenanceStatusPagesItems0) UnmarshalBinary(b []byte) error { + var res CreateScheduledMaintenanceStatusPagesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_scim_group.go b/models/create_scim_group.go new file mode 100644 index 0000000..d4f0527 --- /dev/null +++ b/models/create_scim_group.go @@ -0,0 +1,192 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateScimGroup SCIM endpoint to create a new Team (Colloquial for Group in the SCIM protocol). Any members defined in the payload will be assigned to the team with no defined role. +// +// swagger:model create_scim_group +type CreateScimGroup struct { + + // The name of the team being created + // Required: true + DisplayName *string `json:"displayName"` + + // members + // Required: true + Members []*CreateScimGroupMembersItems0 `json:"members"` +} + +// Validate validates this create scim group +func (m *CreateScimGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDisplayName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMembers(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateScimGroup) validateDisplayName(formats strfmt.Registry) error { + + if err := validate.Required("displayName", "body", m.DisplayName); err != nil { + return err + } + + return nil +} + +func (m *CreateScimGroup) validateMembers(formats strfmt.Registry) error { + + if err := validate.Required("members", "body", m.Members); err != nil { + return err + } + + for i := 0; i < len(m.Members); i++ { + if swag.IsZero(m.Members[i]) { // not required + continue + } + + if m.Members[i] != nil { + if err := m.Members[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("members" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("members" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this create scim group based on the context it is used +func (m *CreateScimGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMembers(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateScimGroup) contextValidateMembers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Members); i++ { + + if m.Members[i] != nil { + if err := m.Members[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("members" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("members" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateScimGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateScimGroup) UnmarshalBinary(b []byte) error { + var res CreateScimGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateScimGroupMembersItems0 create scim group members items0 +// +// swagger:model CreateScimGroupMembersItems0 +type CreateScimGroupMembersItems0 struct { + + // String that represents the user's UUID to assign to the team + // Required: true + Value *string `json:"value"` +} + +// Validate validates this create scim group members items0 +func (m *CreateScimGroupMembersItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateScimGroupMembersItems0) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create scim group members items0 based on context it is used +func (m *CreateScimGroupMembersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateScimGroupMembersItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateScimGroupMembersItems0) UnmarshalBinary(b []byte) error { + var res CreateScimGroupMembersItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_scim_user.go b/models/create_scim_user.go new file mode 100644 index 0000000..d1dfae4 --- /dev/null +++ b/models/create_scim_user.go @@ -0,0 +1,336 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateScimUser SCIM endpoint to create and provision a new User. This endpoint will provision the User, which allows them to accept their account throught their IDP or via the Forgot Password flow. +// +// swagger:model create_scim_user +type CreateScimUser struct { + + // Email addresses for the User + // Required: true + Emails []*CreateScimUserEmailsItems0 `json:"emails"` + + // name + // Required: true + Name *CreateScimUserName `json:"name"` + + // This attribute is intended to be used as a means to set, replace, or compare (i.e., filter for equality) a password + Password string `json:"password,omitempty"` + + // Roles for the User. Options are owner, member, collaborator, or viewer. Roles may be specified as strings or SCIM role objects. + Roles interface{} `json:"roles,omitempty"` + + // A service provider's unique identifier for the user + // Required: true + UserName *string `json:"userName"` +} + +// Validate validates this create scim user +func (m *CreateScimUser) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEmails(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateScimUser) validateEmails(formats strfmt.Registry) error { + + if err := validate.Required("emails", "body", m.Emails); err != nil { + return err + } + + for i := 0; i < len(m.Emails); i++ { + if swag.IsZero(m.Emails[i]) { // not required + continue + } + + if m.Emails[i] != nil { + if err := m.Emails[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emails" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emails" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateScimUser) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if m.Name != nil { + if err := m.Name.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("name") + } + return err + } + } + + return nil +} + +func (m *CreateScimUser) validateUserName(formats strfmt.Registry) error { + + if err := validate.Required("userName", "body", m.UserName); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create scim user based on the context it is used +func (m *CreateScimUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEmails(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateName(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateScimUser) contextValidateEmails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Emails); i++ { + + if m.Emails[i] != nil { + if err := m.Emails[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emails" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emails" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateScimUser) contextValidateName(ctx context.Context, formats strfmt.Registry) error { + + if m.Name != nil { + if err := m.Name.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("name") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateScimUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateScimUser) UnmarshalBinary(b []byte) error { + var res CreateScimUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateScimUserEmailsItems0 create scim user emails items0 +// +// swagger:model CreateScimUserEmailsItems0 +type CreateScimUserEmailsItems0 struct { + + // Boolean which signifies if an email is intended as the primary email for the User + // Required: true + Primary *bool `json:"primary"` + + // String that represents an email address for the User + // Required: true + Value *string `json:"value"` +} + +// Validate validates this create scim user emails items0 +func (m *CreateScimUserEmailsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePrimary(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateScimUserEmailsItems0) validatePrimary(formats strfmt.Registry) error { + + if err := validate.Required("primary", "body", m.Primary); err != nil { + return err + } + + return nil +} + +func (m *CreateScimUserEmailsItems0) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create scim user emails items0 based on context it is used +func (m *CreateScimUserEmailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateScimUserEmailsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateScimUserEmailsItems0) UnmarshalBinary(b []byte) error { + var res CreateScimUserEmailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateScimUserName The components of the user's name +// +// swagger:model CreateScimUserName +type CreateScimUserName struct { + + // The family name of the User, or last name in most Western languages + // Required: true + FamilyName *string `json:"familyName"` + + // The given name of the User, or first name in most Western languages + // Required: true + GivenName *string `json:"givenName"` +} + +// Validate validates this create scim user name +func (m *CreateScimUserName) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFamilyName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGivenName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateScimUserName) validateFamilyName(formats strfmt.Registry) error { + + if err := validate.Required("name"+"."+"familyName", "body", m.FamilyName); err != nil { + return err + } + + return nil +} + +func (m *CreateScimUserName) validateGivenName(formats strfmt.Registry) error { + + if err := validate.Required("name"+"."+"givenName", "body", m.GivenName); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create scim user name based on context it is used +func (m *CreateScimUserName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateScimUserName) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateScimUserName) UnmarshalBinary(b []byte) error { + var res CreateScimUserName + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_service.go b/models/create_service.go new file mode 100644 index 0000000..1a15f4a --- /dev/null +++ b/models/create_service.go @@ -0,0 +1,692 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateService Creates a service for the organization, you may also create or attach functionalities to the service on create. +// +// swagger:model create_service +type CreateService struct { + + // alert on add + AlertOnAdd bool `json:"alert_on_add,omitempty"` + + // auto add responding team + AutoAddRespondingTeam bool `json:"auto_add_responding_team,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // An array of external resources to attach to this service. + ExternalResources []*CreateServiceExternalResourcesItems0 `json:"external_resources"` + + // An array of functionalities + Functionalities []*CreateServiceFunctionalitiesItems0 `json:"functionalities"` + + // A hash of label keys and values + Labels map[string]string `json:"labels,omitempty"` + + // An array of links to associate with this service + Links []*CreateServiceLinksItems0 `json:"links"` + + // name + // Required: true + Name *string `json:"name"` + + // owner + Owner *CreateServiceOwner `json:"owner,omitempty"` + + // Integer representing service tier. Lower values represent higher criticality. If not specified the default value will be 5. + // Enum: [0 1 2 3 4 5] + ServiceTier int32 `json:"service_tier,omitempty"` + + // An array of teams to attach to this service. + Teams []*CreateServiceTeamsItems0 `json:"teams"` +} + +// Validate validates this create service +func (m *CreateService) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExternalResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFunctionalities(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLinks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOwner(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceTier(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTeams(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateService) validateExternalResources(formats strfmt.Registry) error { + if swag.IsZero(m.ExternalResources) { // not required + return nil + } + + for i := 0; i < len(m.ExternalResources); i++ { + if swag.IsZero(m.ExternalResources[i]) { // not required + continue + } + + if m.ExternalResources[i] != nil { + if err := m.ExternalResources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateService) validateFunctionalities(formats strfmt.Registry) error { + if swag.IsZero(m.Functionalities) { // not required + return nil + } + + for i := 0; i < len(m.Functionalities); i++ { + if swag.IsZero(m.Functionalities[i]) { // not required + continue + } + + if m.Functionalities[i] != nil { + if err := m.Functionalities[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("functionalities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("functionalities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateService) validateLinks(formats strfmt.Registry) error { + if swag.IsZero(m.Links) { // not required + return nil + } + + for i := 0; i < len(m.Links); i++ { + if swag.IsZero(m.Links[i]) { // not required + continue + } + + if m.Links[i] != nil { + if err := m.Links[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateService) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *CreateService) validateOwner(formats strfmt.Registry) error { + if swag.IsZero(m.Owner) { // not required + return nil + } + + if m.Owner != nil { + if err := m.Owner.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + +var createServiceTypeServiceTierPropEnum []interface{} + +func init() { + var res []int32 + if err := json.Unmarshal([]byte(`[0,1,2,3,4,5]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createServiceTypeServiceTierPropEnum = append(createServiceTypeServiceTierPropEnum, v) + } +} + +// prop value enum +func (m *CreateService) validateServiceTierEnum(path, location string, value int32) error { + if err := validate.EnumCase(path, location, value, createServiceTypeServiceTierPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateService) validateServiceTier(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceTier) { // not required + return nil + } + + // value enum + if err := m.validateServiceTierEnum("service_tier", "body", m.ServiceTier); err != nil { + return err + } + + return nil +} + +func (m *CreateService) validateTeams(formats strfmt.Registry) error { + if swag.IsZero(m.Teams) { // not required + return nil + } + + for i := 0; i < len(m.Teams); i++ { + if swag.IsZero(m.Teams[i]) { // not required + continue + } + + if m.Teams[i] != nil { + if err := m.Teams[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("teams" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("teams" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this create service based on the context it is used +func (m *CreateService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateExternalResources(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFunctionalities(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOwner(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTeams(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateService) contextValidateExternalResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ExternalResources); i++ { + + if m.ExternalResources[i] != nil { + if err := m.ExternalResources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateService) contextValidateFunctionalities(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Functionalities); i++ { + + if m.Functionalities[i] != nil { + if err := m.Functionalities[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("functionalities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("functionalities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateService) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Links); i++ { + + if m.Links[i] != nil { + if err := m.Links[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateService) contextValidateOwner(ctx context.Context, formats strfmt.Registry) error { + + if m.Owner != nil { + if err := m.Owner.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + +func (m *CreateService) contextValidateTeams(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Teams); i++ { + + if m.Teams[i] != nil { + if err := m.Teams[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("teams" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("teams" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateService) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateService) UnmarshalBinary(b []byte) error { + var res CreateService + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateServiceExternalResourcesItems0 create service external resources items0 +// +// swagger:model CreateServiceExternalResourcesItems0 +type CreateServiceExternalResourcesItems0 struct { + + // The integration slug for the external resource. Can be one of: github, opsgenie, pager_duty, victorops. Not required if the resource has already been imported. + ConnectionType string `json:"connection_type,omitempty"` + + // remote id + // Required: true + RemoteID *string `json:"remote_id"` +} + +// Validate validates this create service external resources items0 +func (m *CreateServiceExternalResourcesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRemoteID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateServiceExternalResourcesItems0) validateRemoteID(formats strfmt.Registry) error { + + if err := validate.Required("remote_id", "body", m.RemoteID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create service external resources items0 based on context it is used +func (m *CreateServiceExternalResourcesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateServiceExternalResourcesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateServiceExternalResourcesItems0) UnmarshalBinary(b []byte) error { + var res CreateServiceExternalResourcesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateServiceFunctionalitiesItems0 create service functionalities items0 +// +// swagger:model CreateServiceFunctionalitiesItems0 +type CreateServiceFunctionalitiesItems0 struct { + + // If you are trying to reuse a functionality, you may set the ID to attach it to the service + ID string `json:"id,omitempty"` + + // If you are trying to create a new functionality and attach it to this service, set the summary key + Summary string `json:"summary,omitempty"` +} + +// Validate validates this create service functionalities items0 +func (m *CreateServiceFunctionalitiesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this create service functionalities items0 based on context it is used +func (m *CreateServiceFunctionalitiesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateServiceFunctionalitiesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateServiceFunctionalitiesItems0) UnmarshalBinary(b []byte) error { + var res CreateServiceFunctionalitiesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateServiceLinksItems0 create service links items0 +// +// swagger:model CreateServiceLinksItems0 +type CreateServiceLinksItems0 struct { + + // URL + // Required: true + HrefURL *string `json:"href_url"` + + // An optional URL to an icon representing this link + IconURL string `json:"icon_url,omitempty"` + + // Short name used to display and identify this link + // Required: true + Name *string `json:"name"` +} + +// Validate validates this create service links items0 +func (m *CreateServiceLinksItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHrefURL(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateServiceLinksItems0) validateHrefURL(formats strfmt.Registry) error { + + if err := validate.Required("href_url", "body", m.HrefURL); err != nil { + return err + } + + return nil +} + +func (m *CreateServiceLinksItems0) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create service links items0 based on context it is used +func (m *CreateServiceLinksItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateServiceLinksItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateServiceLinksItems0) UnmarshalBinary(b []byte) error { + var res CreateServiceLinksItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateServiceOwner An object representing a Team that owns the service +// +// swagger:model CreateServiceOwner +type CreateServiceOwner struct { + + // id + // Required: true + ID *string `json:"id"` +} + +// Validate validates this create service owner +func (m *CreateServiceOwner) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateServiceOwner) validateID(formats strfmt.Registry) error { + + if err := validate.Required("owner"+"."+"id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create service owner based on context it is used +func (m *CreateServiceOwner) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateServiceOwner) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateServiceOwner) UnmarshalBinary(b []byte) error { + var res CreateServiceOwner + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateServiceTeamsItems0 create service teams items0 +// +// swagger:model CreateServiceTeamsItems0 +type CreateServiceTeamsItems0 struct { + + // id + // Required: true + ID *string `json:"id"` +} + +// Validate validates this create service teams items0 +func (m *CreateServiceTeamsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateServiceTeamsItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create service teams items0 based on context it is used +func (m *CreateServiceTeamsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateServiceTeamsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateServiceTeamsItems0) UnmarshalBinary(b []byte) error { + var res CreateServiceTeamsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_service_checklist_response.go b/models/create_service_checklist_response.go new file mode 100644 index 0000000..9342a42 --- /dev/null +++ b/models/create_service_checklist_response.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateServiceChecklistResponse Creates a response for a checklist item +// +// swagger:model create_service_checklist_response +type CreateServiceChecklistResponse struct { + + // check id + // Required: true + CheckID *string `json:"check_id"` + + // Status of the check. 'true' if it's complete, 'false' if incomplete, or blank if not yet interacted with + // Required: true + Status *bool `json:"status"` +} + +// Validate validates this create service checklist response +func (m *CreateServiceChecklistResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCheckID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateServiceChecklistResponse) validateCheckID(formats strfmt.Registry) error { + + if err := validate.Required("check_id", "body", m.CheckID); err != nil { + return err + } + + return nil +} + +func (m *CreateServiceChecklistResponse) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create service checklist response based on context it is used +func (m *CreateServiceChecklistResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateServiceChecklistResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateServiceChecklistResponse) UnmarshalBinary(b []byte) error { + var res CreateServiceChecklistResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_service_dependency.go b/models/create_service_dependency.go new file mode 100644 index 0000000..ccef8f9 --- /dev/null +++ b/models/create_service_dependency.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateServiceDependency Creates a service dependency relationship between two services +// +// swagger:model create_service_dependency +type CreateServiceDependency struct { + + // connected service id + // Required: true + ConnectedServiceID *string `json:"connected_service_id"` + + // A note to describe the service dependency relationship + Notes string `json:"notes,omitempty"` + + // service id + // Required: true + ServiceID *string `json:"service_id"` +} + +// Validate validates this create service dependency +func (m *CreateServiceDependency) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConnectedServiceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateServiceDependency) validateConnectedServiceID(formats strfmt.Registry) error { + + if err := validate.Required("connected_service_id", "body", m.ConnectedServiceID); err != nil { + return err + } + + return nil +} + +func (m *CreateServiceDependency) validateServiceID(formats strfmt.Registry) error { + + if err := validate.Required("service_id", "body", m.ServiceID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create service dependency based on context it is used +func (m *CreateServiceDependency) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateServiceDependency) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateServiceDependency) UnmarshalBinary(b []byte) error { + var res CreateServiceDependency + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_service_links.go b/models/create_service_links.go new file mode 100644 index 0000000..f44eb7c --- /dev/null +++ b/models/create_service_links.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateServiceLinks Creates a service with the appropriate integration for each external service ID passed +// +// swagger:model create_service_links +type CreateServiceLinks struct { + + // ID for the integration. This can be found by going to the edit page for the integration + // Required: true + ConnectionID *string `json:"connection_id"` + + // ID of the service + // Required: true + ExternalServiceIds *string `json:"external_service_ids"` + + // The name of the service + // Required: true + // Enum: [pager_duty opsgenie victorops] + Integration *string `json:"integration"` +} + +// Validate validates this create service links +func (m *CreateServiceLinks) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConnectionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExternalServiceIds(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIntegration(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateServiceLinks) validateConnectionID(formats strfmt.Registry) error { + + if err := validate.Required("connection_id", "body", m.ConnectionID); err != nil { + return err + } + + return nil +} + +func (m *CreateServiceLinks) validateExternalServiceIds(formats strfmt.Registry) error { + + if err := validate.Required("external_service_ids", "body", m.ExternalServiceIds); err != nil { + return err + } + + return nil +} + +var createServiceLinksTypeIntegrationPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["pager_duty","opsgenie","victorops"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createServiceLinksTypeIntegrationPropEnum = append(createServiceLinksTypeIntegrationPropEnum, v) + } +} + +const ( + + // CreateServiceLinksIntegrationPagerDuty captures enum value "pager_duty" + CreateServiceLinksIntegrationPagerDuty string = "pager_duty" + + // CreateServiceLinksIntegrationOpsgenie captures enum value "opsgenie" + CreateServiceLinksIntegrationOpsgenie string = "opsgenie" + + // CreateServiceLinksIntegrationVictorops captures enum value "victorops" + CreateServiceLinksIntegrationVictorops string = "victorops" +) + +// prop value enum +func (m *CreateServiceLinks) validateIntegrationEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createServiceLinksTypeIntegrationPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateServiceLinks) validateIntegration(formats strfmt.Registry) error { + + if err := validate.Required("integration", "body", m.Integration); err != nil { + return err + } + + // value enum + if err := m.validateIntegrationEnum("integration", "body", *m.Integration); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create service links based on context it is used +func (m *CreateServiceLinks) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateServiceLinks) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateServiceLinks) UnmarshalBinary(b []byte) error { + var res CreateServiceLinks + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_severity.go b/models/create_severity.go new file mode 100644 index 0000000..ed4f8fa --- /dev/null +++ b/models/create_severity.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateSeverity Create a new severity +// +// swagger:model create_severity +type CreateSeverity struct { + + // color + // Enum: [red orange yellow blue teal grey] + Color string `json:"color,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // position + Position int32 `json:"position,omitempty"` + + // slug + // Required: true + Slug *string `json:"slug"` +} + +// Validate validates this create severity +func (m *CreateSeverity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateColor(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var createSeverityTypeColorPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["red","orange","yellow","blue","teal","grey"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createSeverityTypeColorPropEnum = append(createSeverityTypeColorPropEnum, v) + } +} + +const ( + + // CreateSeverityColorRed captures enum value "red" + CreateSeverityColorRed string = "red" + + // CreateSeverityColorOrange captures enum value "orange" + CreateSeverityColorOrange string = "orange" + + // CreateSeverityColorYellow captures enum value "yellow" + CreateSeverityColorYellow string = "yellow" + + // CreateSeverityColorBlue captures enum value "blue" + CreateSeverityColorBlue string = "blue" + + // CreateSeverityColorTeal captures enum value "teal" + CreateSeverityColorTeal string = "teal" + + // CreateSeverityColorGrey captures enum value "grey" + CreateSeverityColorGrey string = "grey" +) + +// prop value enum +func (m *CreateSeverity) validateColorEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createSeverityTypeColorPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateSeverity) validateColor(formats strfmt.Registry) error { + if swag.IsZero(m.Color) { // not required + return nil + } + + // value enum + if err := m.validateColorEnum("color", "body", m.Color); err != nil { + return err + } + + return nil +} + +func (m *CreateSeverity) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create severity based on context it is used +func (m *CreateSeverity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateSeverity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateSeverity) UnmarshalBinary(b []byte) error { + var res CreateSeverity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_severity_matrix_condition.go b/models/create_severity_matrix_condition.go new file mode 100644 index 0000000..ad36f92 --- /dev/null +++ b/models/create_severity_matrix_condition.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateSeverityMatrixCondition Create a new condition +// +// swagger:model create_severity_matrix_condition +type CreateSeverityMatrixCondition struct { + + // name + // Required: true + Name *string `json:"name"` + + // Position is used to determine ordering of conditions in API responses and dropdowns. The condition with the lowest position (typically 0) will be considered the Default Condition + Position int32 `json:"position,omitempty"` +} + +// Validate validates this create severity matrix condition +func (m *CreateSeverityMatrixCondition) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateSeverityMatrixCondition) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create severity matrix condition based on context it is used +func (m *CreateSeverityMatrixCondition) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateSeverityMatrixCondition) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateSeverityMatrixCondition) UnmarshalBinary(b []byte) error { + var res CreateSeverityMatrixCondition + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_severity_matrix_impact.go b/models/create_severity_matrix_impact.go new file mode 100644 index 0000000..fb89dfb --- /dev/null +++ b/models/create_severity_matrix_impact.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateSeverityMatrixImpact Create a new impact +// +// swagger:model create_severity_matrix_impact +type CreateSeverityMatrixImpact struct { + + // affects id + // Required: true + AffectsID *string `json:"affects_id"` + + // affects type + // Required: true + AffectsType *string `json:"affects_type"` + + // position + Position int32 `json:"position,omitempty"` +} + +// Validate validates this create severity matrix impact +func (m *CreateSeverityMatrixImpact) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAffectsID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAffectsType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateSeverityMatrixImpact) validateAffectsID(formats strfmt.Registry) error { + + if err := validate.Required("affects_id", "body", m.AffectsID); err != nil { + return err + } + + return nil +} + +func (m *CreateSeverityMatrixImpact) validateAffectsType(formats strfmt.Registry) error { + + if err := validate.Required("affects_type", "body", m.AffectsType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create severity matrix impact based on context it is used +func (m *CreateSeverityMatrixImpact) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateSeverityMatrixImpact) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateSeverityMatrixImpact) UnmarshalBinary(b []byte) error { + var res CreateSeverityMatrixImpact + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_signals_email_target.go b/models/create_signals_email_target.go new file mode 100644 index 0000000..ced40c0 --- /dev/null +++ b/models/create_signals_email_target.go @@ -0,0 +1,317 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateSignalsEmailTarget Create a Signals email target for a team. +// +// swagger:model create_signals_email_target +type CreateSignalsEmailTarget struct { + + // A list of email addresses that are allowed to send events to the target. Must be exact match. + AllowedSenders []string `json:"allowed_senders"` + + // A detailed description of the email target. + Description string `json:"description,omitempty"` + + // The CEL expression that defines the level of an incoming email that is sent to the target. + LevelCel string `json:"level_cel,omitempty"` + + // The email target's name. + // Required: true + Name *string `json:"name"` + + // Whether or not all rules must match, or if only one rule must match. + // Enum: [all any] + RuleMatchingStrategy string `json:"rule_matching_strategy,omitempty"` + + // A list of CEL expressions that should be evaluated and matched to determine if the target should be notified. + Rules []string `json:"rules"` + + // The email address that will be listening to events. + Slug string `json:"slug,omitempty"` + + // The CEL expression that defines the status of an incoming email that is sent to the target. + StatusCel string `json:"status_cel,omitempty"` + + // target + Target *CreateSignalsEmailTargetTarget `json:"target,omitempty"` +} + +// Validate validates this create signals email target +func (m *CreateSignalsEmailTarget) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRuleMatchingStrategy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTarget(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateSignalsEmailTarget) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +var createSignalsEmailTargetTypeRuleMatchingStrategyPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["all","any"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createSignalsEmailTargetTypeRuleMatchingStrategyPropEnum = append(createSignalsEmailTargetTypeRuleMatchingStrategyPropEnum, v) + } +} + +const ( + + // CreateSignalsEmailTargetRuleMatchingStrategyAll captures enum value "all" + CreateSignalsEmailTargetRuleMatchingStrategyAll string = "all" + + // CreateSignalsEmailTargetRuleMatchingStrategyAny captures enum value "any" + CreateSignalsEmailTargetRuleMatchingStrategyAny string = "any" +) + +// prop value enum +func (m *CreateSignalsEmailTarget) validateRuleMatchingStrategyEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createSignalsEmailTargetTypeRuleMatchingStrategyPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateSignalsEmailTarget) validateRuleMatchingStrategy(formats strfmt.Registry) error { + if swag.IsZero(m.RuleMatchingStrategy) { // not required + return nil + } + + // value enum + if err := m.validateRuleMatchingStrategyEnum("rule_matching_strategy", "body", m.RuleMatchingStrategy); err != nil { + return err + } + + return nil +} + +func (m *CreateSignalsEmailTarget) validateTarget(formats strfmt.Registry) error { + if swag.IsZero(m.Target) { // not required + return nil + } + + if m.Target != nil { + if err := m.Target.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("target") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("target") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create signals email target based on the context it is used +func (m *CreateSignalsEmailTarget) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTarget(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateSignalsEmailTarget) contextValidateTarget(ctx context.Context, formats strfmt.Registry) error { + + if m.Target != nil { + if err := m.Target.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("target") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("target") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateSignalsEmailTarget) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateSignalsEmailTarget) UnmarshalBinary(b []byte) error { + var res CreateSignalsEmailTarget + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateSignalsEmailTargetTarget The target that the email target will notify. This object must contain a `type` +// field that specifies the type of target and an `id` field that specifies the ID of +// the target. The `type` field must be one of "escalation_policy", "on_call_schedule", +// "team", "user", or "slack_channel". +// +// swagger:model CreateSignalsEmailTargetTarget +type CreateSignalsEmailTargetTarget struct { + + // The ID of the target that the inbound email will notify when matched. + // Required: true + ID *string `json:"id"` + + // The type of target that the inbound email will notify when matched. + // Required: true + // Enum: [Team EntireTeam EscalationPolicy OnCallSchedule User SlackChannel Webhook] + Type *string `json:"type"` +} + +// Validate validates this create signals email target target +func (m *CreateSignalsEmailTargetTarget) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateSignalsEmailTargetTarget) validateID(formats strfmt.Registry) error { + + if err := validate.Required("target"+"."+"id", "body", m.ID); err != nil { + return err + } + + return nil +} + +var createSignalsEmailTargetTargetTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Team","EntireTeam","EscalationPolicy","OnCallSchedule","User","SlackChannel","Webhook"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createSignalsEmailTargetTargetTypeTypePropEnum = append(createSignalsEmailTargetTargetTypeTypePropEnum, v) + } +} + +const ( + + // CreateSignalsEmailTargetTargetTypeTeam captures enum value "Team" + CreateSignalsEmailTargetTargetTypeTeam string = "Team" + + // CreateSignalsEmailTargetTargetTypeEntireTeam captures enum value "EntireTeam" + CreateSignalsEmailTargetTargetTypeEntireTeam string = "EntireTeam" + + // CreateSignalsEmailTargetTargetTypeEscalationPolicy captures enum value "EscalationPolicy" + CreateSignalsEmailTargetTargetTypeEscalationPolicy string = "EscalationPolicy" + + // CreateSignalsEmailTargetTargetTypeOnCallSchedule captures enum value "OnCallSchedule" + CreateSignalsEmailTargetTargetTypeOnCallSchedule string = "OnCallSchedule" + + // CreateSignalsEmailTargetTargetTypeUser captures enum value "User" + CreateSignalsEmailTargetTargetTypeUser string = "User" + + // CreateSignalsEmailTargetTargetTypeSlackChannel captures enum value "SlackChannel" + CreateSignalsEmailTargetTargetTypeSlackChannel string = "SlackChannel" + + // CreateSignalsEmailTargetTargetTypeWebhook captures enum value "Webhook" + CreateSignalsEmailTargetTargetTypeWebhook string = "Webhook" +) + +// prop value enum +func (m *CreateSignalsEmailTargetTarget) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createSignalsEmailTargetTargetTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateSignalsEmailTargetTarget) validateType(formats strfmt.Registry) error { + + if err := validate.Required("target"+"."+"type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("target"+"."+"type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create signals email target target based on context it is used +func (m *CreateSignalsEmailTargetTarget) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateSignalsEmailTargetTarget) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateSignalsEmailTargetTarget) UnmarshalBinary(b []byte) error { + var res CreateSignalsEmailTargetTarget + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_signals_webhook_target.go b/models/create_signals_webhook_target.go new file mode 100644 index 0000000..7d1f48f --- /dev/null +++ b/models/create_signals_webhook_target.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateSignalsWebhookTarget Create a Signals webhook target. +// +// swagger:model create_signals_webhook_target +type CreateSignalsWebhookTarget struct { + + // An optional detailed description of the webhook target. + Description string `json:"description,omitempty"` + + // The webhook target's name. + // Required: true + Name *string `json:"name"` + + // An optional secret we will provide in the `FH-Signature` header + // when sending a payload to the webhook target. This key will not be + // shown in any response once configured. + // + SigningKey string `json:"signing_key,omitempty"` + + // The URL that the webhook target will notify. + // Required: true + URL *string `json:"url"` +} + +// Validate validates this create signals webhook target +func (m *CreateSignalsWebhookTarget) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateSignalsWebhookTarget) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *CreateSignalsWebhookTarget) validateURL(formats strfmt.Registry) error { + + if err := validate.Required("url", "body", m.URL); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create signals webhook target based on context it is used +func (m *CreateSignalsWebhookTarget) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateSignalsWebhookTarget) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateSignalsWebhookTarget) UnmarshalBinary(b []byte) error { + var res CreateSignalsWebhookTarget + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_status_update_template.go b/models/create_status_update_template.go new file mode 100644 index 0000000..926a8d3 --- /dev/null +++ b/models/create_status_update_template.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateStatusUpdateTemplate Create a status update template for your organization +// +// swagger:model create_status_update_template +type CreateStatusUpdateTemplate struct { + + // body + // Required: true + Body *string `json:"body"` + + // name + // Required: true + Name *string `json:"name"` +} + +// Validate validates this create status update template +func (m *CreateStatusUpdateTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBody(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateStatusUpdateTemplate) validateBody(formats strfmt.Registry) error { + + if err := validate.Required("body", "body", m.Body); err != nil { + return err + } + + return nil +} + +func (m *CreateStatusUpdateTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create status update template based on context it is used +func (m *CreateStatusUpdateTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateStatusUpdateTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateStatusUpdateTemplate) UnmarshalBinary(b []byte) error { + var res CreateStatusUpdateTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_task_list.go b/models/create_task_list.go new file mode 100644 index 0000000..59ea7ca --- /dev/null +++ b/models/create_task_list.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateTaskList Creates a new task list +// +// swagger:model create_task_list +type CreateTaskList struct { + + // description + Description string `json:"description,omitempty"` + + // name + // Required: true + Name *string `json:"name"` + + // task list items + // Required: true + TaskListItems []*CreateTaskListTaskListItemsItems0 `json:"task_list_items"` +} + +// Validate validates this create task list +func (m *CreateTaskList) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaskListItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTaskList) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *CreateTaskList) validateTaskListItems(formats strfmt.Registry) error { + + if err := validate.Required("task_list_items", "body", m.TaskListItems); err != nil { + return err + } + + for i := 0; i < len(m.TaskListItems); i++ { + if swag.IsZero(m.TaskListItems[i]) { // not required + continue + } + + if m.TaskListItems[i] != nil { + if err := m.TaskListItems[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("task_list_items" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("task_list_items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this create task list based on the context it is used +func (m *CreateTaskList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTaskListItems(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTaskList) contextValidateTaskListItems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TaskListItems); i++ { + + if m.TaskListItems[i] != nil { + if err := m.TaskListItems[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("task_list_items" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("task_list_items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTaskList) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTaskList) UnmarshalBinary(b []byte) error { + var res CreateTaskList + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTaskListTaskListItemsItems0 create task list task list items items0 +// +// swagger:model CreateTaskListTaskListItemsItems0 +type CreateTaskListTaskListItemsItems0 struct { + + // A long-form description for the task if additional context is helpful + Description string `json:"description,omitempty"` + + // A summary of the task + // Required: true + Summary *string `json:"summary"` +} + +// Validate validates this create task list task list items items0 +func (m *CreateTaskListTaskListItemsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSummary(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTaskListTaskListItemsItems0) validateSummary(formats strfmt.Registry) error { + + if err := validate.Required("summary", "body", m.Summary); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create task list task list items items0 based on context it is used +func (m *CreateTaskListTaskListItemsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTaskListTaskListItemsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTaskListTaskListItemsItems0) UnmarshalBinary(b []byte) error { + var res CreateTaskListTaskListItemsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_team.go b/models/create_team.go new file mode 100644 index 0000000..6e7c249 --- /dev/null +++ b/models/create_team.go @@ -0,0 +1,306 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateTeam Create a new team +// +// swagger:model create_team +type CreateTeam struct { + + // description + Description string `json:"description,omitempty"` + + // memberships + Memberships []*CreateTeamMembershipsItems0 `json:"memberships"` + + // ms teams channel + MsTeamsChannel *CreateTeamMsTeamsChannel `json:"ms_teams_channel,omitempty"` + + // name + // Required: true + Name *string `json:"name"` + + // The Slack channel ID associated with this team. This may be the reference in FireHydrant's system (i.e. UUID) or the ID value from Slack (e.g. C1234567890). + // + SlackChannelID string `json:"slack_channel_id,omitempty"` + + // slug + Slug string `json:"slug,omitempty"` +} + +// Validate validates this create team +func (m *CreateTeam) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMemberships(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMsTeamsChannel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeam) validateMemberships(formats strfmt.Registry) error { + if swag.IsZero(m.Memberships) { // not required + return nil + } + + for i := 0; i < len(m.Memberships); i++ { + if swag.IsZero(m.Memberships[i]) { // not required + continue + } + + if m.Memberships[i] != nil { + if err := m.Memberships[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("memberships" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("memberships" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateTeam) validateMsTeamsChannel(formats strfmt.Registry) error { + if swag.IsZero(m.MsTeamsChannel) { // not required + return nil + } + + if m.MsTeamsChannel != nil { + if err := m.MsTeamsChannel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ms_teams_channel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ms_teams_channel") + } + return err + } + } + + return nil +} + +func (m *CreateTeam) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create team based on the context it is used +func (m *CreateTeam) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMemberships(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMsTeamsChannel(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeam) contextValidateMemberships(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Memberships); i++ { + + if m.Memberships[i] != nil { + if err := m.Memberships[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("memberships" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("memberships" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateTeam) contextValidateMsTeamsChannel(ctx context.Context, formats strfmt.Registry) error { + + if m.MsTeamsChannel != nil { + if err := m.MsTeamsChannel.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ms_teams_channel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ms_teams_channel") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeam) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeam) UnmarshalBinary(b []byte) error { + var res CreateTeam + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamMembershipsItems0 create team memberships items0 +// +// swagger:model CreateTeamMembershipsItems0 +type CreateTeamMembershipsItems0 struct { + + // An incident role ID that this user will automatically assigned if this team is assigned to an incident + IncidentRoleID string `json:"incident_role_id,omitempty"` + + // schedule id + ScheduleID string `json:"schedule_id,omitempty"` + + // user id + UserID string `json:"user_id,omitempty"` +} + +// Validate validates this create team memberships items0 +func (m *CreateTeamMembershipsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this create team memberships items0 based on context it is used +func (m *CreateTeamMembershipsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamMembershipsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamMembershipsItems0) UnmarshalBinary(b []byte) error { + var res CreateTeamMembershipsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamMsTeamsChannel MS Teams channel identity for channel associated with this team +// +// swagger:model CreateTeamMsTeamsChannel +type CreateTeamMsTeamsChannel struct { + + // channel id + // Required: true + ChannelID *string `json:"channel_id"` + + // ms team id + // Required: true + MsTeamID *string `json:"ms_team_id"` +} + +// Validate validates this create team ms teams channel +func (m *CreateTeamMsTeamsChannel) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChannelID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMsTeamID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamMsTeamsChannel) validateChannelID(formats strfmt.Registry) error { + + if err := validate.Required("ms_teams_channel"+"."+"channel_id", "body", m.ChannelID); err != nil { + return err + } + + return nil +} + +func (m *CreateTeamMsTeamsChannel) validateMsTeamID(formats strfmt.Registry) error { + + if err := validate.Required("ms_teams_channel"+"."+"ms_team_id", "body", m.MsTeamID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create team ms teams channel based on context it is used +func (m *CreateTeamMsTeamsChannel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamMsTeamsChannel) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamMsTeamsChannel) UnmarshalBinary(b []byte) error { + var res CreateTeamMsTeamsChannel + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_team_escalation_policy.go b/models/create_team_escalation_policy.go new file mode 100644 index 0000000..77525ce --- /dev/null +++ b/models/create_team_escalation_policy.go @@ -0,0 +1,1427 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateTeamEscalationPolicy Create a Signals escalation policy for a team. +// +// swagger:model create_team_escalation_policy +type CreateTeamEscalationPolicy struct { + + // Whether this escalation policy should be the default for the team. + Default *bool `json:"default,omitempty"` + + // A detailed description of the escalation policy. + Description string `json:"description,omitempty"` + + // handoff step + HandoffStep *CreateTeamEscalationPolicyHandoffStep `json:"handoff_step,omitempty"` + + // The escalation policy's name. + // Required: true + Name *string `json:"name"` + + // prioritized settings + PrioritizedSettings *CreateTeamEscalationPolicyPrioritizedSettings `json:"prioritized_settings,omitempty"` + + // The number of times that the escalation policy should repeat before an alert is dropped. + Repetitions int32 `json:"repetitions,omitempty"` + + // The strategy for handling steps in the escalation policy. Can be "static" or "dynamic_by_priority". + StepStrategy string `json:"step_strategy,omitempty"` + + // A list of steps that define how an alert should escalate through the policy. + // Required: true + Steps []*CreateTeamEscalationPolicyStepsItems0 `json:"steps"` +} + +// Validate validates this create team escalation policy +func (m *CreateTeamEscalationPolicy) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHandoffStep(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrioritizedSettings(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSteps(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicy) validateHandoffStep(formats strfmt.Registry) error { + if swag.IsZero(m.HandoffStep) { // not required + return nil + } + + if m.HandoffStep != nil { + if err := m.HandoffStep.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("handoff_step") + } + return err + } + } + + return nil +} + +func (m *CreateTeamEscalationPolicy) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *CreateTeamEscalationPolicy) validatePrioritizedSettings(formats strfmt.Registry) error { + if swag.IsZero(m.PrioritizedSettings) { // not required + return nil + } + + if m.PrioritizedSettings != nil { + if err := m.PrioritizedSettings.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings") + } + return err + } + } + + return nil +} + +func (m *CreateTeamEscalationPolicy) validateSteps(formats strfmt.Registry) error { + + if err := validate.Required("steps", "body", m.Steps); err != nil { + return err + } + + for i := 0; i < len(m.Steps); i++ { + if swag.IsZero(m.Steps[i]) { // not required + continue + } + + if m.Steps[i] != nil { + if err := m.Steps[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("steps" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("steps" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this create team escalation policy based on the context it is used +func (m *CreateTeamEscalationPolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHandoffStep(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrioritizedSettings(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSteps(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicy) contextValidateHandoffStep(ctx context.Context, formats strfmt.Registry) error { + + if m.HandoffStep != nil { + if err := m.HandoffStep.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("handoff_step") + } + return err + } + } + + return nil +} + +func (m *CreateTeamEscalationPolicy) contextValidatePrioritizedSettings(ctx context.Context, formats strfmt.Registry) error { + + if m.PrioritizedSettings != nil { + if err := m.PrioritizedSettings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings") + } + return err + } + } + + return nil +} + +func (m *CreateTeamEscalationPolicy) contextValidateSteps(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Steps); i++ { + + if m.Steps[i] != nil { + if err := m.Steps[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("steps" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("steps" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamEscalationPolicy) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamEscalationPolicy) UnmarshalBinary(b []byte) error { + var res CreateTeamEscalationPolicy + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamEscalationPolicyHandoffStep A step that defines where an alert should be sent when the policy is exhausted and the alert is still unacknowledged. +// +// swagger:model CreateTeamEscalationPolicyHandoffStep +type CreateTeamEscalationPolicyHandoffStep struct { + + // The ID of the target to which the policy will hand off. + // Required: true + TargetID *string `json:"target_id"` + + // The type of target to which the policy will hand off. + // Required: true + // Enum: [EscalationPolicy Team] + TargetType *string `json:"target_type"` +} + +// Validate validates this create team escalation policy handoff step +func (m *CreateTeamEscalationPolicyHandoffStep) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTargetID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicyHandoffStep) validateTargetID(formats strfmt.Registry) error { + + if err := validate.Required("handoff_step"+"."+"target_id", "body", m.TargetID); err != nil { + return err + } + + return nil +} + +var createTeamEscalationPolicyHandoffStepTypeTargetTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["EscalationPolicy","Team"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createTeamEscalationPolicyHandoffStepTypeTargetTypePropEnum = append(createTeamEscalationPolicyHandoffStepTypeTargetTypePropEnum, v) + } +} + +const ( + + // CreateTeamEscalationPolicyHandoffStepTargetTypeEscalationPolicy captures enum value "EscalationPolicy" + CreateTeamEscalationPolicyHandoffStepTargetTypeEscalationPolicy string = "EscalationPolicy" + + // CreateTeamEscalationPolicyHandoffStepTargetTypeTeam captures enum value "Team" + CreateTeamEscalationPolicyHandoffStepTargetTypeTeam string = "Team" +) + +// prop value enum +func (m *CreateTeamEscalationPolicyHandoffStep) validateTargetTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createTeamEscalationPolicyHandoffStepTypeTargetTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateTeamEscalationPolicyHandoffStep) validateTargetType(formats strfmt.Registry) error { + + if err := validate.Required("handoff_step"+"."+"target_type", "body", m.TargetType); err != nil { + return err + } + + // value enum + if err := m.validateTargetTypeEnum("handoff_step"+"."+"target_type", "body", *m.TargetType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create team escalation policy handoff step based on context it is used +func (m *CreateTeamEscalationPolicyHandoffStep) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyHandoffStep) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyHandoffStep) UnmarshalBinary(b []byte) error { + var res CreateTeamEscalationPolicyHandoffStep + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamEscalationPolicyPrioritizedSettings Priority-specific settings for dynamic escalation policies +// +// swagger:model CreateTeamEscalationPolicyPrioritizedSettings +type CreateTeamEscalationPolicyPrioritizedSettings struct { + + // high + High *CreateTeamEscalationPolicyPrioritizedSettingsHigh `json:"high,omitempty"` + + // low + Low *CreateTeamEscalationPolicyPrioritizedSettingsLow `json:"low,omitempty"` + + // medium + Medium *CreateTeamEscalationPolicyPrioritizedSettingsMedium `json:"medium,omitempty"` +} + +// Validate validates this create team escalation policy prioritized settings +func (m *CreateTeamEscalationPolicyPrioritizedSettings) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHigh(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLow(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMedium(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettings) validateHigh(formats strfmt.Registry) error { + if swag.IsZero(m.High) { // not required + return nil + } + + if m.High != nil { + if err := m.High.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "high") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "high") + } + return err + } + } + + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettings) validateLow(formats strfmt.Registry) error { + if swag.IsZero(m.Low) { // not required + return nil + } + + if m.Low != nil { + if err := m.Low.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "low") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "low") + } + return err + } + } + + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettings) validateMedium(formats strfmt.Registry) error { + if swag.IsZero(m.Medium) { // not required + return nil + } + + if m.Medium != nil { + if err := m.Medium.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "medium") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "medium") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create team escalation policy prioritized settings based on the context it is used +func (m *CreateTeamEscalationPolicyPrioritizedSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHigh(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLow(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMedium(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettings) contextValidateHigh(ctx context.Context, formats strfmt.Registry) error { + + if m.High != nil { + if err := m.High.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "high") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "high") + } + return err + } + } + + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettings) contextValidateLow(ctx context.Context, formats strfmt.Registry) error { + + if m.Low != nil { + if err := m.Low.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "low") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "low") + } + return err + } + } + + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettings) contextValidateMedium(ctx context.Context, formats strfmt.Registry) error { + + if m.Medium != nil { + if err := m.Medium.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "medium") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "medium") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyPrioritizedSettings) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyPrioritizedSettings) UnmarshalBinary(b []byte) error { + var res CreateTeamEscalationPolicyPrioritizedSettings + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamEscalationPolicyPrioritizedSettingsHigh Settings for HIGH priority alerts +// +// swagger:model CreateTeamEscalationPolicyPrioritizedSettingsHigh +type CreateTeamEscalationPolicyPrioritizedSettingsHigh struct { + + // handoff step + HandoffStep *CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep `json:"handoff_step,omitempty"` + + // Number of repetitions for HIGH priority alerts + Repetitions int32 `json:"repetitions,omitempty"` +} + +// Validate validates this create team escalation policy prioritized settings high +func (m *CreateTeamEscalationPolicyPrioritizedSettingsHigh) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHandoffStep(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettingsHigh) validateHandoffStep(formats strfmt.Registry) error { + if swag.IsZero(m.HandoffStep) { // not required + return nil + } + + if m.HandoffStep != nil { + if err := m.HandoffStep.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "high" + "." + "handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "high" + "." + "handoff_step") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create team escalation policy prioritized settings high based on the context it is used +func (m *CreateTeamEscalationPolicyPrioritizedSettingsHigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHandoffStep(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettingsHigh) contextValidateHandoffStep(ctx context.Context, formats strfmt.Registry) error { + + if m.HandoffStep != nil { + if err := m.HandoffStep.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "high" + "." + "handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "high" + "." + "handoff_step") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyPrioritizedSettingsHigh) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyPrioritizedSettingsHigh) UnmarshalBinary(b []byte) error { + var res CreateTeamEscalationPolicyPrioritizedSettingsHigh + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep Handoff step for HIGH priority alerts +// +// swagger:model CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep +type CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep struct { + + // target id + // Required: true + TargetID *string `json:"target_id"` + + // target type + // Required: true + // Enum: [EscalationPolicy Team] + TargetType *string `json:"target_type"` +} + +// Validate validates this create team escalation policy prioritized settings high handoff step +func (m *CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTargetID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep) validateTargetID(formats strfmt.Registry) error { + + if err := validate.Required("prioritized_settings"+"."+"high"+"."+"handoff_step"+"."+"target_id", "body", m.TargetID); err != nil { + return err + } + + return nil +} + +var createTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTypeTargetTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["EscalationPolicy","Team"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTypeTargetTypePropEnum = append(createTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTypeTargetTypePropEnum, v) + } +} + +const ( + + // CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTargetTypeEscalationPolicy captures enum value "EscalationPolicy" + CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTargetTypeEscalationPolicy string = "EscalationPolicy" + + // CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTargetTypeTeam captures enum value "Team" + CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTargetTypeTeam string = "Team" +) + +// prop value enum +func (m *CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep) validateTargetTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTypeTargetTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep) validateTargetType(formats strfmt.Registry) error { + + if err := validate.Required("prioritized_settings"+"."+"high"+"."+"handoff_step"+"."+"target_type", "body", m.TargetType); err != nil { + return err + } + + // value enum + if err := m.validateTargetTypeEnum("prioritized_settings"+"."+"high"+"."+"handoff_step"+"."+"target_type", "body", *m.TargetType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create team escalation policy prioritized settings high handoff step based on context it is used +func (m *CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep) UnmarshalBinary(b []byte) error { + var res CreateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamEscalationPolicyPrioritizedSettingsLow Settings for LOW priority alerts +// +// swagger:model CreateTeamEscalationPolicyPrioritizedSettingsLow +type CreateTeamEscalationPolicyPrioritizedSettingsLow struct { + + // handoff step + HandoffStep *CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep `json:"handoff_step,omitempty"` + + // Number of repetitions for LOW priority alerts + Repetitions int32 `json:"repetitions,omitempty"` +} + +// Validate validates this create team escalation policy prioritized settings low +func (m *CreateTeamEscalationPolicyPrioritizedSettingsLow) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHandoffStep(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettingsLow) validateHandoffStep(formats strfmt.Registry) error { + if swag.IsZero(m.HandoffStep) { // not required + return nil + } + + if m.HandoffStep != nil { + if err := m.HandoffStep.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "low" + "." + "handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "low" + "." + "handoff_step") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create team escalation policy prioritized settings low based on the context it is used +func (m *CreateTeamEscalationPolicyPrioritizedSettingsLow) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHandoffStep(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettingsLow) contextValidateHandoffStep(ctx context.Context, formats strfmt.Registry) error { + + if m.HandoffStep != nil { + if err := m.HandoffStep.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "low" + "." + "handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "low" + "." + "handoff_step") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyPrioritizedSettingsLow) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyPrioritizedSettingsLow) UnmarshalBinary(b []byte) error { + var res CreateTeamEscalationPolicyPrioritizedSettingsLow + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep Handoff step for LOW priority alerts +// +// swagger:model CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep +type CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep struct { + + // target id + // Required: true + TargetID *string `json:"target_id"` + + // target type + // Required: true + // Enum: [EscalationPolicy Team] + TargetType *string `json:"target_type"` +} + +// Validate validates this create team escalation policy prioritized settings low handoff step +func (m *CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTargetID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep) validateTargetID(formats strfmt.Registry) error { + + if err := validate.Required("prioritized_settings"+"."+"low"+"."+"handoff_step"+"."+"target_id", "body", m.TargetID); err != nil { + return err + } + + return nil +} + +var createTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTypeTargetTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["EscalationPolicy","Team"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTypeTargetTypePropEnum = append(createTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTypeTargetTypePropEnum, v) + } +} + +const ( + + // CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTargetTypeEscalationPolicy captures enum value "EscalationPolicy" + CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTargetTypeEscalationPolicy string = "EscalationPolicy" + + // CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTargetTypeTeam captures enum value "Team" + CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTargetTypeTeam string = "Team" +) + +// prop value enum +func (m *CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep) validateTargetTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTypeTargetTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep) validateTargetType(formats strfmt.Registry) error { + + if err := validate.Required("prioritized_settings"+"."+"low"+"."+"handoff_step"+"."+"target_type", "body", m.TargetType); err != nil { + return err + } + + // value enum + if err := m.validateTargetTypeEnum("prioritized_settings"+"."+"low"+"."+"handoff_step"+"."+"target_type", "body", *m.TargetType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create team escalation policy prioritized settings low handoff step based on context it is used +func (m *CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep) UnmarshalBinary(b []byte) error { + var res CreateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamEscalationPolicyPrioritizedSettingsMedium Settings for MEDIUM priority alerts +// +// swagger:model CreateTeamEscalationPolicyPrioritizedSettingsMedium +type CreateTeamEscalationPolicyPrioritizedSettingsMedium struct { + + // handoff step + HandoffStep *CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep `json:"handoff_step,omitempty"` + + // Number of repetitions for MEDIUM priority alerts + Repetitions int32 `json:"repetitions,omitempty"` +} + +// Validate validates this create team escalation policy prioritized settings medium +func (m *CreateTeamEscalationPolicyPrioritizedSettingsMedium) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHandoffStep(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettingsMedium) validateHandoffStep(formats strfmt.Registry) error { + if swag.IsZero(m.HandoffStep) { // not required + return nil + } + + if m.HandoffStep != nil { + if err := m.HandoffStep.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "medium" + "." + "handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "medium" + "." + "handoff_step") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create team escalation policy prioritized settings medium based on the context it is used +func (m *CreateTeamEscalationPolicyPrioritizedSettingsMedium) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHandoffStep(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettingsMedium) contextValidateHandoffStep(ctx context.Context, formats strfmt.Registry) error { + + if m.HandoffStep != nil { + if err := m.HandoffStep.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "medium" + "." + "handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "medium" + "." + "handoff_step") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyPrioritizedSettingsMedium) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyPrioritizedSettingsMedium) UnmarshalBinary(b []byte) error { + var res CreateTeamEscalationPolicyPrioritizedSettingsMedium + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep Handoff step for MEDIUM priority alerts +// +// swagger:model CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep +type CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep struct { + + // target id + // Required: true + TargetID *string `json:"target_id"` + + // target type + // Required: true + // Enum: [EscalationPolicy Team] + TargetType *string `json:"target_type"` +} + +// Validate validates this create team escalation policy prioritized settings medium handoff step +func (m *CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTargetID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep) validateTargetID(formats strfmt.Registry) error { + + if err := validate.Required("prioritized_settings"+"."+"medium"+"."+"handoff_step"+"."+"target_id", "body", m.TargetID); err != nil { + return err + } + + return nil +} + +var createTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTypeTargetTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["EscalationPolicy","Team"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTypeTargetTypePropEnum = append(createTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTypeTargetTypePropEnum, v) + } +} + +const ( + + // CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTargetTypeEscalationPolicy captures enum value "EscalationPolicy" + CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTargetTypeEscalationPolicy string = "EscalationPolicy" + + // CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTargetTypeTeam captures enum value "Team" + CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTargetTypeTeam string = "Team" +) + +// prop value enum +func (m *CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep) validateTargetTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTypeTargetTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep) validateTargetType(formats strfmt.Registry) error { + + if err := validate.Required("prioritized_settings"+"."+"medium"+"."+"handoff_step"+"."+"target_type", "body", m.TargetType); err != nil { + return err + } + + // value enum + if err := m.validateTargetTypeEnum("prioritized_settings"+"."+"medium"+"."+"handoff_step"+"."+"target_type", "body", *m.TargetType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create team escalation policy prioritized settings medium handoff step based on context it is used +func (m *CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep) UnmarshalBinary(b []byte) error { + var res CreateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamEscalationPolicyStepsItems0 create team escalation policy steps items0 +// +// swagger:model CreateTeamEscalationPolicyStepsItems0 +type CreateTeamEscalationPolicyStepsItems0 struct { + + // The round robin configuration for the step. One of 'unspecified', 'round_robin_by_alert', or 'round_robin_by_escalation_policy'. + // Enum: [unspecified round_robin_by_alert round_robin_by_escalation_policy] + DistributionType string `json:"distribution_type,omitempty"` + + // A list of priorities (HIGH, MEDIUM, LOW) to which the step applies when using a dynamic escalation policy. + Priorities []string `json:"priorities"` + + // A list of targets that the step will notify. You can specify up to 15 targets per step. + // Required: true + Targets []*CreateTeamEscalationPolicyStepsItems0TargetsItems0 `json:"targets"` + + // An ISO8601 duration string specifying how long to wait before moving on to the next step. For the last step, this value specifies how long to wait before the escalation policy should repeat, if it repeats. + // Required: true + Timeout *string `json:"timeout"` +} + +// Validate validates this create team escalation policy steps items0 +func (m *CreateTeamEscalationPolicyStepsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDistributionType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeout(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var createTeamEscalationPolicyStepsItems0TypeDistributionTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["unspecified","round_robin_by_alert","round_robin_by_escalation_policy"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createTeamEscalationPolicyStepsItems0TypeDistributionTypePropEnum = append(createTeamEscalationPolicyStepsItems0TypeDistributionTypePropEnum, v) + } +} + +const ( + + // CreateTeamEscalationPolicyStepsItems0DistributionTypeUnspecified captures enum value "unspecified" + CreateTeamEscalationPolicyStepsItems0DistributionTypeUnspecified string = "unspecified" + + // CreateTeamEscalationPolicyStepsItems0DistributionTypeRoundRobinByAlert captures enum value "round_robin_by_alert" + CreateTeamEscalationPolicyStepsItems0DistributionTypeRoundRobinByAlert string = "round_robin_by_alert" + + // CreateTeamEscalationPolicyStepsItems0DistributionTypeRoundRobinByEscalationPolicy captures enum value "round_robin_by_escalation_policy" + CreateTeamEscalationPolicyStepsItems0DistributionTypeRoundRobinByEscalationPolicy string = "round_robin_by_escalation_policy" +) + +// prop value enum +func (m *CreateTeamEscalationPolicyStepsItems0) validateDistributionTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createTeamEscalationPolicyStepsItems0TypeDistributionTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateTeamEscalationPolicyStepsItems0) validateDistributionType(formats strfmt.Registry) error { + if swag.IsZero(m.DistributionType) { // not required + return nil + } + + // value enum + if err := m.validateDistributionTypeEnum("distribution_type", "body", m.DistributionType); err != nil { + return err + } + + return nil +} + +func (m *CreateTeamEscalationPolicyStepsItems0) validateTargets(formats strfmt.Registry) error { + + if err := validate.Required("targets", "body", m.Targets); err != nil { + return err + } + + for i := 0; i < len(m.Targets); i++ { + if swag.IsZero(m.Targets[i]) { // not required + continue + } + + if m.Targets[i] != nil { + if err := m.Targets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("targets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("targets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateTeamEscalationPolicyStepsItems0) validateTimeout(formats strfmt.Registry) error { + + if err := validate.Required("timeout", "body", m.Timeout); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create team escalation policy steps items0 based on the context it is used +func (m *CreateTeamEscalationPolicyStepsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTargets(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicyStepsItems0) contextValidateTargets(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Targets); i++ { + + if m.Targets[i] != nil { + if err := m.Targets[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("targets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("targets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyStepsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyStepsItems0) UnmarshalBinary(b []byte) error { + var res CreateTeamEscalationPolicyStepsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamEscalationPolicyStepsItems0TargetsItems0 create team escalation policy steps items0 targets items0 +// +// swagger:model CreateTeamEscalationPolicyStepsItems0TargetsItems0 +type CreateTeamEscalationPolicyStepsItems0TargetsItems0 struct { + + // The ID of the target that the step will notify. + // Required: true + ID *string `json:"id"` + + // The type of target that the step will notify. + // Required: true + // Enum: [OnCallSchedule User SlackChannel EntireTeam Webhook] + Type *string `json:"type"` +} + +// Validate validates this create team escalation policy steps items0 targets items0 +func (m *CreateTeamEscalationPolicyStepsItems0TargetsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamEscalationPolicyStepsItems0TargetsItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +var createTeamEscalationPolicyStepsItems0TargetsItems0TypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["OnCallSchedule","User","SlackChannel","EntireTeam","Webhook"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createTeamEscalationPolicyStepsItems0TargetsItems0TypeTypePropEnum = append(createTeamEscalationPolicyStepsItems0TargetsItems0TypeTypePropEnum, v) + } +} + +const ( + + // CreateTeamEscalationPolicyStepsItems0TargetsItems0TypeOnCallSchedule captures enum value "OnCallSchedule" + CreateTeamEscalationPolicyStepsItems0TargetsItems0TypeOnCallSchedule string = "OnCallSchedule" + + // CreateTeamEscalationPolicyStepsItems0TargetsItems0TypeUser captures enum value "User" + CreateTeamEscalationPolicyStepsItems0TargetsItems0TypeUser string = "User" + + // CreateTeamEscalationPolicyStepsItems0TargetsItems0TypeSlackChannel captures enum value "SlackChannel" + CreateTeamEscalationPolicyStepsItems0TargetsItems0TypeSlackChannel string = "SlackChannel" + + // CreateTeamEscalationPolicyStepsItems0TargetsItems0TypeEntireTeam captures enum value "EntireTeam" + CreateTeamEscalationPolicyStepsItems0TargetsItems0TypeEntireTeam string = "EntireTeam" + + // CreateTeamEscalationPolicyStepsItems0TargetsItems0TypeWebhook captures enum value "Webhook" + CreateTeamEscalationPolicyStepsItems0TargetsItems0TypeWebhook string = "Webhook" +) + +// prop value enum +func (m *CreateTeamEscalationPolicyStepsItems0TargetsItems0) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createTeamEscalationPolicyStepsItems0TargetsItems0TypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateTeamEscalationPolicyStepsItems0TargetsItems0) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create team escalation policy steps items0 targets items0 based on context it is used +func (m *CreateTeamEscalationPolicyStepsItems0TargetsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyStepsItems0TargetsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamEscalationPolicyStepsItems0TargetsItems0) UnmarshalBinary(b []byte) error { + var res CreateTeamEscalationPolicyStepsItems0TargetsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_team_on_call_schedule.go b/models/create_team_on_call_schedule.go new file mode 100644 index 0000000..4b623c2 --- /dev/null +++ b/models/create_team_on_call_schedule.go @@ -0,0 +1,684 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateTeamOnCallSchedule Create a Signals on-call schedule for a team. +// +// swagger:model create_team_on_call_schedule +type CreateTeamOnCallSchedule struct { + + // A hex color code that will be used to represent the schedule in the UI and iCal subscriptions. + Color string `json:"color,omitempty"` + + // A detailed description of the on-call schedule. + Description string `json:"description,omitempty"` + + // This parameter is deprecated; use `members` instead. + MemberIds []string `json:"member_ids"` + + // An ordered list of objects that specify members of the on-call schedule's rotation. + Members []*CreateTeamOnCallScheduleMembersItems0 `json:"members"` + + // The on-call schedule's name. + // Required: true + Name *string `json:"name"` + + // A list of objects that restrict the schedule to speccific on-call periods. + Restrictions []*CreateTeamOnCallScheduleRestrictionsItems0 `json:"restrictions"` + + // The ID of a Slack user group for syncing purposes. If provided, we will automatically sync whoever is on call to the user group in Slack. + SlackUserGroupID string `json:"slack_user_group_id,omitempty"` + + // An ISO8601 time string specifying when the schedule's first shift should start. This value is only used if the schedule's strategy is "custom". + StartTime string `json:"start_time,omitempty"` + + // strategy + // Required: true + Strategy *CreateTeamOnCallScheduleStrategy `json:"strategy"` + + // The time zone in which the on-call schedule operates. This value must be a valid IANA time zone name. + // Required: true + TimeZone *string `json:"time_zone"` +} + +// Validate validates this create team on call schedule +func (m *CreateTeamOnCallSchedule) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMembers(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRestrictions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStrategy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeZone(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamOnCallSchedule) validateMembers(formats strfmt.Registry) error { + if swag.IsZero(m.Members) { // not required + return nil + } + + for i := 0; i < len(m.Members); i++ { + if swag.IsZero(m.Members[i]) { // not required + continue + } + + if m.Members[i] != nil { + if err := m.Members[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("members" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("members" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateTeamOnCallSchedule) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *CreateTeamOnCallSchedule) validateRestrictions(formats strfmt.Registry) error { + if swag.IsZero(m.Restrictions) { // not required + return nil + } + + for i := 0; i < len(m.Restrictions); i++ { + if swag.IsZero(m.Restrictions[i]) { // not required + continue + } + + if m.Restrictions[i] != nil { + if err := m.Restrictions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("restrictions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("restrictions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateTeamOnCallSchedule) validateStrategy(formats strfmt.Registry) error { + + if err := validate.Required("strategy", "body", m.Strategy); err != nil { + return err + } + + if m.Strategy != nil { + if err := m.Strategy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("strategy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("strategy") + } + return err + } + } + + return nil +} + +func (m *CreateTeamOnCallSchedule) validateTimeZone(formats strfmt.Registry) error { + + if err := validate.Required("time_zone", "body", m.TimeZone); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create team on call schedule based on the context it is used +func (m *CreateTeamOnCallSchedule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMembers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRestrictions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStrategy(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTeamOnCallSchedule) contextValidateMembers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Members); i++ { + + if m.Members[i] != nil { + if err := m.Members[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("members" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("members" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateTeamOnCallSchedule) contextValidateRestrictions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Restrictions); i++ { + + if m.Restrictions[i] != nil { + if err := m.Restrictions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("restrictions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("restrictions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateTeamOnCallSchedule) contextValidateStrategy(ctx context.Context, formats strfmt.Registry) error { + + if m.Strategy != nil { + if err := m.Strategy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("strategy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("strategy") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamOnCallSchedule) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamOnCallSchedule) UnmarshalBinary(b []byte) error { + var res CreateTeamOnCallSchedule + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamOnCallScheduleMembersItems0 create team on call schedule members items0 +// +// swagger:model CreateTeamOnCallScheduleMembersItems0 +type CreateTeamOnCallScheduleMembersItems0 struct { + + // The ID of a user who should be added to the schedule's rotation. You can add a user to the schedule + // multiple times to construct more complex rotations, and you can specify a `null` user ID to create + // unassigned slots in the rotation. + // + UserID string `json:"user_id,omitempty"` +} + +// Validate validates this create team on call schedule members items0 +func (m *CreateTeamOnCallScheduleMembersItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this create team on call schedule members items0 based on context it is used +func (m *CreateTeamOnCallScheduleMembersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamOnCallScheduleMembersItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamOnCallScheduleMembersItems0) UnmarshalBinary(b []byte) error { + var res CreateTeamOnCallScheduleMembersItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamOnCallScheduleRestrictionsItems0 create team on call schedule restrictions items0 +// +// swagger:model CreateTeamOnCallScheduleRestrictionsItems0 +type CreateTeamOnCallScheduleRestrictionsItems0 struct { + + // The day of the week on which the restriction should end, as its long-form name (e.g. "monday", "tuesday", etc). + // Required: true + // Enum: [monday tuesday wednesday thursday friday saturday sunday] + EndDay *string `json:"end_day"` + + // An ISO8601 time string specifying when the restriction should end. + // Required: true + EndTime *string `json:"end_time"` + + // The day of the week on which the restriction should start, as its long-form name (e.g. "monday", "tuesday", etc). + // Required: true + // Enum: [monday tuesday wednesday thursday friday saturday sunday] + StartDay *string `json:"start_day"` + + // An ISO8601 time string specifying when the restriction should start. + // Required: true + StartTime *string `json:"start_time"` +} + +// Validate validates this create team on call schedule restrictions items0 +func (m *CreateTeamOnCallScheduleRestrictionsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEndDay(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEndTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartDay(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartTime(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var createTeamOnCallScheduleRestrictionsItems0TypeEndDayPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createTeamOnCallScheduleRestrictionsItems0TypeEndDayPropEnum = append(createTeamOnCallScheduleRestrictionsItems0TypeEndDayPropEnum, v) + } +} + +const ( + + // CreateTeamOnCallScheduleRestrictionsItems0EndDayMonday captures enum value "monday" + CreateTeamOnCallScheduleRestrictionsItems0EndDayMonday string = "monday" + + // CreateTeamOnCallScheduleRestrictionsItems0EndDayTuesday captures enum value "tuesday" + CreateTeamOnCallScheduleRestrictionsItems0EndDayTuesday string = "tuesday" + + // CreateTeamOnCallScheduleRestrictionsItems0EndDayWednesday captures enum value "wednesday" + CreateTeamOnCallScheduleRestrictionsItems0EndDayWednesday string = "wednesday" + + // CreateTeamOnCallScheduleRestrictionsItems0EndDayThursday captures enum value "thursday" + CreateTeamOnCallScheduleRestrictionsItems0EndDayThursday string = "thursday" + + // CreateTeamOnCallScheduleRestrictionsItems0EndDayFriday captures enum value "friday" + CreateTeamOnCallScheduleRestrictionsItems0EndDayFriday string = "friday" + + // CreateTeamOnCallScheduleRestrictionsItems0EndDaySaturday captures enum value "saturday" + CreateTeamOnCallScheduleRestrictionsItems0EndDaySaturday string = "saturday" + + // CreateTeamOnCallScheduleRestrictionsItems0EndDaySunday captures enum value "sunday" + CreateTeamOnCallScheduleRestrictionsItems0EndDaySunday string = "sunday" +) + +// prop value enum +func (m *CreateTeamOnCallScheduleRestrictionsItems0) validateEndDayEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createTeamOnCallScheduleRestrictionsItems0TypeEndDayPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateTeamOnCallScheduleRestrictionsItems0) validateEndDay(formats strfmt.Registry) error { + + if err := validate.Required("end_day", "body", m.EndDay); err != nil { + return err + } + + // value enum + if err := m.validateEndDayEnum("end_day", "body", *m.EndDay); err != nil { + return err + } + + return nil +} + +func (m *CreateTeamOnCallScheduleRestrictionsItems0) validateEndTime(formats strfmt.Registry) error { + + if err := validate.Required("end_time", "body", m.EndTime); err != nil { + return err + } + + return nil +} + +var createTeamOnCallScheduleRestrictionsItems0TypeStartDayPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createTeamOnCallScheduleRestrictionsItems0TypeStartDayPropEnum = append(createTeamOnCallScheduleRestrictionsItems0TypeStartDayPropEnum, v) + } +} + +const ( + + // CreateTeamOnCallScheduleRestrictionsItems0StartDayMonday captures enum value "monday" + CreateTeamOnCallScheduleRestrictionsItems0StartDayMonday string = "monday" + + // CreateTeamOnCallScheduleRestrictionsItems0StartDayTuesday captures enum value "tuesday" + CreateTeamOnCallScheduleRestrictionsItems0StartDayTuesday string = "tuesday" + + // CreateTeamOnCallScheduleRestrictionsItems0StartDayWednesday captures enum value "wednesday" + CreateTeamOnCallScheduleRestrictionsItems0StartDayWednesday string = "wednesday" + + // CreateTeamOnCallScheduleRestrictionsItems0StartDayThursday captures enum value "thursday" + CreateTeamOnCallScheduleRestrictionsItems0StartDayThursday string = "thursday" + + // CreateTeamOnCallScheduleRestrictionsItems0StartDayFriday captures enum value "friday" + CreateTeamOnCallScheduleRestrictionsItems0StartDayFriday string = "friday" + + // CreateTeamOnCallScheduleRestrictionsItems0StartDaySaturday captures enum value "saturday" + CreateTeamOnCallScheduleRestrictionsItems0StartDaySaturday string = "saturday" + + // CreateTeamOnCallScheduleRestrictionsItems0StartDaySunday captures enum value "sunday" + CreateTeamOnCallScheduleRestrictionsItems0StartDaySunday string = "sunday" +) + +// prop value enum +func (m *CreateTeamOnCallScheduleRestrictionsItems0) validateStartDayEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createTeamOnCallScheduleRestrictionsItems0TypeStartDayPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateTeamOnCallScheduleRestrictionsItems0) validateStartDay(formats strfmt.Registry) error { + + if err := validate.Required("start_day", "body", m.StartDay); err != nil { + return err + } + + // value enum + if err := m.validateStartDayEnum("start_day", "body", *m.StartDay); err != nil { + return err + } + + return nil +} + +func (m *CreateTeamOnCallScheduleRestrictionsItems0) validateStartTime(formats strfmt.Registry) error { + + if err := validate.Required("start_time", "body", m.StartTime); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create team on call schedule restrictions items0 based on context it is used +func (m *CreateTeamOnCallScheduleRestrictionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamOnCallScheduleRestrictionsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamOnCallScheduleRestrictionsItems0) UnmarshalBinary(b []byte) error { + var res CreateTeamOnCallScheduleRestrictionsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CreateTeamOnCallScheduleStrategy An object that specifies how the schedule's on-call shifts should be generated. +// +// swagger:model CreateTeamOnCallScheduleStrategy +type CreateTeamOnCallScheduleStrategy struct { + + // The day of the week on which on-call shifts should hand off, as its long-form name (e.g. "monday", "tuesday", etc). This value is only used if the strategy type is "weekly". + // Enum: [monday tuesday wednesday thursday friday saturday sunday] + HandoffDay string `json:"handoff_day,omitempty"` + + // An ISO8601 time string specifying when on-call shifts should hand off. This value is only used if the strategy type is "daily" or "weekly". + HandoffTime string `json:"handoff_time,omitempty"` + + // An ISO8601 duration string specifying how long each shift should last. This value is only used if the strategy type is "custom". + ShiftDuration string `json:"shift_duration,omitempty"` + + // The type of strategy. Must be one of "daily", "weekly", or "custom". + // Required: true + // Enum: [daily weekly custom] + Type *string `json:"type"` +} + +// Validate validates this create team on call schedule strategy +func (m *CreateTeamOnCallScheduleStrategy) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHandoffDay(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var createTeamOnCallScheduleStrategyTypeHandoffDayPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createTeamOnCallScheduleStrategyTypeHandoffDayPropEnum = append(createTeamOnCallScheduleStrategyTypeHandoffDayPropEnum, v) + } +} + +const ( + + // CreateTeamOnCallScheduleStrategyHandoffDayMonday captures enum value "monday" + CreateTeamOnCallScheduleStrategyHandoffDayMonday string = "monday" + + // CreateTeamOnCallScheduleStrategyHandoffDayTuesday captures enum value "tuesday" + CreateTeamOnCallScheduleStrategyHandoffDayTuesday string = "tuesday" + + // CreateTeamOnCallScheduleStrategyHandoffDayWednesday captures enum value "wednesday" + CreateTeamOnCallScheduleStrategyHandoffDayWednesday string = "wednesday" + + // CreateTeamOnCallScheduleStrategyHandoffDayThursday captures enum value "thursday" + CreateTeamOnCallScheduleStrategyHandoffDayThursday string = "thursday" + + // CreateTeamOnCallScheduleStrategyHandoffDayFriday captures enum value "friday" + CreateTeamOnCallScheduleStrategyHandoffDayFriday string = "friday" + + // CreateTeamOnCallScheduleStrategyHandoffDaySaturday captures enum value "saturday" + CreateTeamOnCallScheduleStrategyHandoffDaySaturday string = "saturday" + + // CreateTeamOnCallScheduleStrategyHandoffDaySunday captures enum value "sunday" + CreateTeamOnCallScheduleStrategyHandoffDaySunday string = "sunday" +) + +// prop value enum +func (m *CreateTeamOnCallScheduleStrategy) validateHandoffDayEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createTeamOnCallScheduleStrategyTypeHandoffDayPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateTeamOnCallScheduleStrategy) validateHandoffDay(formats strfmt.Registry) error { + if swag.IsZero(m.HandoffDay) { // not required + return nil + } + + // value enum + if err := m.validateHandoffDayEnum("strategy"+"."+"handoff_day", "body", m.HandoffDay); err != nil { + return err + } + + return nil +} + +var createTeamOnCallScheduleStrategyTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["daily","weekly","custom"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createTeamOnCallScheduleStrategyTypeTypePropEnum = append(createTeamOnCallScheduleStrategyTypeTypePropEnum, v) + } +} + +const ( + + // CreateTeamOnCallScheduleStrategyTypeDaily captures enum value "daily" + CreateTeamOnCallScheduleStrategyTypeDaily string = "daily" + + // CreateTeamOnCallScheduleStrategyTypeWeekly captures enum value "weekly" + CreateTeamOnCallScheduleStrategyTypeWeekly string = "weekly" + + // CreateTeamOnCallScheduleStrategyTypeCustom captures enum value "custom" + CreateTeamOnCallScheduleStrategyTypeCustom string = "custom" +) + +// prop value enum +func (m *CreateTeamOnCallScheduleStrategy) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createTeamOnCallScheduleStrategyTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateTeamOnCallScheduleStrategy) validateType(formats strfmt.Registry) error { + + if err := validate.Required("strategy"+"."+"type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("strategy"+"."+"type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create team on call schedule strategy based on context it is used +func (m *CreateTeamOnCallScheduleStrategy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamOnCallScheduleStrategy) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamOnCallScheduleStrategy) UnmarshalBinary(b []byte) error { + var res CreateTeamOnCallScheduleStrategy + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_team_signal_rule.go b/models/create_team_signal_rule.go new file mode 100644 index 0000000..4777fe0 --- /dev/null +++ b/models/create_team_signal_rule.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateTeamSignalRule Create a Signals rule for a team. +// +// swagger:model create_team_signal_rule +type CreateTeamSignalRule struct { + + // Determines when an incident should be created when this rule is matched + // Enum: [WHEN_UNSPECIFIED WHEN_ALWAYS] + CreateIncidentConditionWhen string `json:"create_incident_condition_when,omitempty"` + + // The amount of time alerts created from this rule will be deduplicated + DeduplicationExpiry string `json:"deduplication_expiry,omitempty"` + + // The CEL expression that defines the rule. + // Required: true + Expression *string `json:"expression"` + + // The ID of an incident type that should be used when an alert is promoted to an incident + IncidentTypeID string `json:"incident_type_id,omitempty"` + + // The rule's name. + // Required: true + Name *string `json:"name"` + + // A notification priority that will be set on the resulting alert (default: HIGH) + // Enum: [HIGH MEDIUM LOW ] + NotificationPriorityOverride string `json:"notification_priority_override,omitempty"` + + // The ID of the target that the rule will notify when matched. + // Required: true + TargetID *string `json:"target_id"` + + // The type of target that the rule will notify when matched. + // Required: true + // Enum: [EscalationPolicy OnCallSchedule User Webhook SlackChannel] + TargetType *string `json:"target_type"` +} + +// Validate validates this create team signal rule +func (m *CreateTeamSignalRule) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreateIncidentConditionWhen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExpression(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNotificationPriorityOverride(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var createTeamSignalRuleTypeCreateIncidentConditionWhenPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["WHEN_UNSPECIFIED","WHEN_ALWAYS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createTeamSignalRuleTypeCreateIncidentConditionWhenPropEnum = append(createTeamSignalRuleTypeCreateIncidentConditionWhenPropEnum, v) + } +} + +const ( + + // CreateTeamSignalRuleCreateIncidentConditionWhenWHENUNSPECIFIED captures enum value "WHEN_UNSPECIFIED" + CreateTeamSignalRuleCreateIncidentConditionWhenWHENUNSPECIFIED string = "WHEN_UNSPECIFIED" + + // CreateTeamSignalRuleCreateIncidentConditionWhenWHENALWAYS captures enum value "WHEN_ALWAYS" + CreateTeamSignalRuleCreateIncidentConditionWhenWHENALWAYS string = "WHEN_ALWAYS" +) + +// prop value enum +func (m *CreateTeamSignalRule) validateCreateIncidentConditionWhenEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createTeamSignalRuleTypeCreateIncidentConditionWhenPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateTeamSignalRule) validateCreateIncidentConditionWhen(formats strfmt.Registry) error { + if swag.IsZero(m.CreateIncidentConditionWhen) { // not required + return nil + } + + // value enum + if err := m.validateCreateIncidentConditionWhenEnum("create_incident_condition_when", "body", m.CreateIncidentConditionWhen); err != nil { + return err + } + + return nil +} + +func (m *CreateTeamSignalRule) validateExpression(formats strfmt.Registry) error { + + if err := validate.Required("expression", "body", m.Expression); err != nil { + return err + } + + return nil +} + +func (m *CreateTeamSignalRule) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +var createTeamSignalRuleTypeNotificationPriorityOverridePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["HIGH","MEDIUM","LOW",""]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createTeamSignalRuleTypeNotificationPriorityOverridePropEnum = append(createTeamSignalRuleTypeNotificationPriorityOverridePropEnum, v) + } +} + +const ( + + // CreateTeamSignalRuleNotificationPriorityOverrideHIGH captures enum value "HIGH" + CreateTeamSignalRuleNotificationPriorityOverrideHIGH string = "HIGH" + + // CreateTeamSignalRuleNotificationPriorityOverrideMEDIUM captures enum value "MEDIUM" + CreateTeamSignalRuleNotificationPriorityOverrideMEDIUM string = "MEDIUM" + + // CreateTeamSignalRuleNotificationPriorityOverrideLOW captures enum value "LOW" + CreateTeamSignalRuleNotificationPriorityOverrideLOW string = "LOW" + + // CreateTeamSignalRuleNotificationPriorityOverrideEmpty captures enum value "" + CreateTeamSignalRuleNotificationPriorityOverrideEmpty string = "" +) + +// prop value enum +func (m *CreateTeamSignalRule) validateNotificationPriorityOverrideEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createTeamSignalRuleTypeNotificationPriorityOverridePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateTeamSignalRule) validateNotificationPriorityOverride(formats strfmt.Registry) error { + if swag.IsZero(m.NotificationPriorityOverride) { // not required + return nil + } + + // value enum + if err := m.validateNotificationPriorityOverrideEnum("notification_priority_override", "body", m.NotificationPriorityOverride); err != nil { + return err + } + + return nil +} + +func (m *CreateTeamSignalRule) validateTargetID(formats strfmt.Registry) error { + + if err := validate.Required("target_id", "body", m.TargetID); err != nil { + return err + } + + return nil +} + +var createTeamSignalRuleTypeTargetTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["EscalationPolicy","OnCallSchedule","User","Webhook","SlackChannel"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createTeamSignalRuleTypeTargetTypePropEnum = append(createTeamSignalRuleTypeTargetTypePropEnum, v) + } +} + +const ( + + // CreateTeamSignalRuleTargetTypeEscalationPolicy captures enum value "EscalationPolicy" + CreateTeamSignalRuleTargetTypeEscalationPolicy string = "EscalationPolicy" + + // CreateTeamSignalRuleTargetTypeOnCallSchedule captures enum value "OnCallSchedule" + CreateTeamSignalRuleTargetTypeOnCallSchedule string = "OnCallSchedule" + + // CreateTeamSignalRuleTargetTypeUser captures enum value "User" + CreateTeamSignalRuleTargetTypeUser string = "User" + + // CreateTeamSignalRuleTargetTypeWebhook captures enum value "Webhook" + CreateTeamSignalRuleTargetTypeWebhook string = "Webhook" + + // CreateTeamSignalRuleTargetTypeSlackChannel captures enum value "SlackChannel" + CreateTeamSignalRuleTargetTypeSlackChannel string = "SlackChannel" +) + +// prop value enum +func (m *CreateTeamSignalRule) validateTargetTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createTeamSignalRuleTypeTargetTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateTeamSignalRule) validateTargetType(formats strfmt.Registry) error { + + if err := validate.Required("target_type", "body", m.TargetType); err != nil { + return err + } + + // value enum + if err := m.validateTargetTypeEnum("target_type", "body", *m.TargetType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create team signal rule based on context it is used +func (m *CreateTeamSignalRule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTeamSignalRule) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTeamSignalRule) UnmarshalBinary(b []byte) error { + var res CreateTeamSignalRule + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_ticket.go b/models/create_ticket.go new file mode 100644 index 0000000..da7d1b7 --- /dev/null +++ b/models/create_ticket.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateTicket Creates a ticket for a project +// +// swagger:model create_ticket +type CreateTicket struct { + + // description + Description string `json:"description,omitempty"` + + // priority id + PriorityID string `json:"priority_id,omitempty"` + + // project id + ProjectID string `json:"project_id,omitempty"` + + // Which incident this ticket is related to, in the format of 'incident/UUID' + RelatedTo string `json:"related_to,omitempty"` + + // The remote URL for an existing ticket in a supported and configured ticketing integration + RemoteURL string `json:"remote_url,omitempty"` + + // state + State string `json:"state,omitempty"` + + // summary + // Required: true + Summary *string `json:"summary"` + + // List of tags for the ticket + TagList []string `json:"tag_list"` + + // type + Type string `json:"type,omitempty"` +} + +// Validate validates this create ticket +func (m *CreateTicket) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSummary(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTicket) validateSummary(formats strfmt.Registry) error { + + if err := validate.Required("summary", "body", m.Summary); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create ticket based on context it is used +func (m *CreateTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTicket) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTicket) UnmarshalBinary(b []byte) error { + var res CreateTicket + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_ticketing_priority.go b/models/create_ticketing_priority.go new file mode 100644 index 0000000..6b9c926 --- /dev/null +++ b/models/create_ticketing_priority.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateTicketingPriority Create a single ticketing priority +// +// swagger:model create_ticketing_priority +type CreateTicketingPriority struct { + + // name + // Required: true + Name *string `json:"name"` + + // The position that this priority should take in your list of priorities. Priorities should be ordered from highest to lowest, with the highest priority at 0. If a position isn't specified, the new priority will be added to the end of the list; if another priority already exists at the specified position, that priority and all priorities following it will automatically be moved down the list to make room for the new priority. + Position int32 `json:"position,omitempty"` +} + +// Validate validates this create ticketing priority +func (m *CreateTicketingPriority) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateTicketingPriority) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create ticketing priority based on context it is used +func (m *CreateTicketingPriority) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateTicketingPriority) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateTicketingPriority) UnmarshalBinary(b []byte) error { + var res CreateTicketingPriority + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/create_webhook.go b/models/create_webhook.go new file mode 100644 index 0000000..18a681f --- /dev/null +++ b/models/create_webhook.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateWebhook Create a new webhook +// +// swagger:model create_webhook +type CreateWebhook struct { + + // url + // Required: true + URL *string `json:"url"` +} + +// Validate validates this create webhook +func (m *CreateWebhook) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateWebhook) validateURL(formats strfmt.Registry) error { + + if err := validate.Required("url", "body", m.URL); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create webhook based on context it is used +func (m *CreateWebhook) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateWebhook) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateWebhook) UnmarshalBinary(b []byte) error { + var res CreateWebhook + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/debug_signals_expression.go b/models/debug_signals_expression.go new file mode 100644 index 0000000..ae0aad9 --- /dev/null +++ b/models/debug_signals_expression.go @@ -0,0 +1,395 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DebugSignalsExpression Debug Signals expressions +// +// swagger:model debug_signals_expression +type DebugSignalsExpression struct { + + // CEL expression + // Required: true + Expression *string `json:"expression"` + + // List of signals to evaluate rule expression against + // Required: true + Signals []*DebugSignalsExpressionSignalsItems0 `json:"signals"` +} + +// Validate validates this debug signals expression +func (m *DebugSignalsExpression) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExpression(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSignals(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DebugSignalsExpression) validateExpression(formats strfmt.Registry) error { + + if err := validate.Required("expression", "body", m.Expression); err != nil { + return err + } + + return nil +} + +func (m *DebugSignalsExpression) validateSignals(formats strfmt.Registry) error { + + if err := validate.Required("signals", "body", m.Signals); err != nil { + return err + } + + for i := 0; i < len(m.Signals); i++ { + if swag.IsZero(m.Signals[i]) { // not required + continue + } + + if m.Signals[i] != nil { + if err := m.Signals[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("signals" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("signals" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this debug signals expression based on the context it is used +func (m *DebugSignalsExpression) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSignals(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DebugSignalsExpression) contextValidateSignals(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Signals); i++ { + + if m.Signals[i] != nil { + if err := m.Signals[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("signals" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("signals" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DebugSignalsExpression) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DebugSignalsExpression) UnmarshalBinary(b []byte) error { + var res DebugSignalsExpression + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DebugSignalsExpressionSignalsItems0 debug signals expression signals items0 +// +// swagger:model DebugSignalsExpressionSignalsItems0 +type DebugSignalsExpressionSignalsItems0 struct { + + // annotations + Annotations interface{} `json:"annotations,omitempty"` + + // body + Body string `json:"body,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // images + Images []*DebugSignalsExpressionSignalsItems0ImagesItems0 `json:"images"` + + // level + Level string `json:"level,omitempty"` + + // links + Links []*DebugSignalsExpressionSignalsItems0LinksItems0 `json:"links"` + + // organization id + OrganizationID string `json:"organization_id,omitempty"` + + // summary + Summary string `json:"summary,omitempty"` + + // tags + Tags []string `json:"tags"` +} + +// Validate validates this debug signals expression signals items0 +func (m *DebugSignalsExpressionSignalsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImages(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLinks(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DebugSignalsExpressionSignalsItems0) validateImages(formats strfmt.Registry) error { + if swag.IsZero(m.Images) { // not required + return nil + } + + for i := 0; i < len(m.Images); i++ { + if swag.IsZero(m.Images[i]) { // not required + continue + } + + if m.Images[i] != nil { + if err := m.Images[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("images" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("images" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DebugSignalsExpressionSignalsItems0) validateLinks(formats strfmt.Registry) error { + if swag.IsZero(m.Links) { // not required + return nil + } + + for i := 0; i < len(m.Links); i++ { + if swag.IsZero(m.Links[i]) { // not required + continue + } + + if m.Links[i] != nil { + if err := m.Links[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this debug signals expression signals items0 based on the context it is used +func (m *DebugSignalsExpressionSignalsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateImages(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DebugSignalsExpressionSignalsItems0) contextValidateImages(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Images); i++ { + + if m.Images[i] != nil { + if err := m.Images[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("images" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("images" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DebugSignalsExpressionSignalsItems0) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Links); i++ { + + if m.Links[i] != nil { + if err := m.Links[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DebugSignalsExpressionSignalsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DebugSignalsExpressionSignalsItems0) UnmarshalBinary(b []byte) error { + var res DebugSignalsExpressionSignalsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DebugSignalsExpressionSignalsItems0ImagesItems0 debug signals expression signals items0 images items0 +// +// swagger:model DebugSignalsExpressionSignalsItems0ImagesItems0 +type DebugSignalsExpressionSignalsItems0ImagesItems0 struct { + + // alt + Alt string `json:"alt,omitempty"` + + // src + Src string `json:"src,omitempty"` +} + +// Validate validates this debug signals expression signals items0 images items0 +func (m *DebugSignalsExpressionSignalsItems0ImagesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this debug signals expression signals items0 images items0 based on context it is used +func (m *DebugSignalsExpressionSignalsItems0ImagesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DebugSignalsExpressionSignalsItems0ImagesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DebugSignalsExpressionSignalsItems0ImagesItems0) UnmarshalBinary(b []byte) error { + var res DebugSignalsExpressionSignalsItems0ImagesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DebugSignalsExpressionSignalsItems0LinksItems0 debug signals expression signals items0 links items0 +// +// swagger:model DebugSignalsExpressionSignalsItems0LinksItems0 +type DebugSignalsExpressionSignalsItems0LinksItems0 struct { + + // href + Href string `json:"href,omitempty"` + + // text + Text string `json:"text,omitempty"` +} + +// Validate validates this debug signals expression signals items0 links items0 +func (m *DebugSignalsExpressionSignalsItems0LinksItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this debug signals expression signals items0 links items0 based on context it is used +func (m *DebugSignalsExpressionSignalsItems0LinksItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DebugSignalsExpressionSignalsItems0LinksItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DebugSignalsExpressionSignalsItems0LinksItems0) UnmarshalBinary(b []byte) error { + var res DebugSignalsExpressionSignalsItems0LinksItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/ingest_catalog_data.go b/models/ingest_catalog_data.go new file mode 100644 index 0000000..da39c90 --- /dev/null +++ b/models/ingest_catalog_data.go @@ -0,0 +1,127 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IngestCatalogData Accepts catalog data in the configured format and asyncronously processes the data to incorporate changes into service catalog. +// +// swagger:model ingest_catalog_data +type IngestCatalogData struct { + + // Service data + // Required: true + Data *string `json:"data"` + + // Encoding for submitted data + // Required: true + // Enum: [text/yaml application/x-yaml application/json] + Encoding *string `json:"encoding"` +} + +// Validate validates this ingest catalog data +func (m *IngestCatalogData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEncoding(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IngestCatalogData) validateData(formats strfmt.Registry) error { + + if err := validate.Required("data", "body", m.Data); err != nil { + return err + } + + return nil +} + +var ingestCatalogDataTypeEncodingPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["text/yaml","application/x-yaml","application/json"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + ingestCatalogDataTypeEncodingPropEnum = append(ingestCatalogDataTypeEncodingPropEnum, v) + } +} + +const ( + + // IngestCatalogDataEncodingTextYaml captures enum value "text/yaml" + IngestCatalogDataEncodingTextYaml string = "text/yaml" + + // IngestCatalogDataEncodingApplicationxDashYaml captures enum value "application/x-yaml" + IngestCatalogDataEncodingApplicationxDashYaml string = "application/x-yaml" + + // IngestCatalogDataEncodingApplicationJSON captures enum value "application/json" + IngestCatalogDataEncodingApplicationJSON string = "application/json" +) + +// prop value enum +func (m *IngestCatalogData) validateEncodingEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, ingestCatalogDataTypeEncodingPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *IngestCatalogData) validateEncoding(formats strfmt.Registry) error { + + if err := validate.Required("encoding", "body", m.Encoding); err != nil { + return err + } + + // value enum + if err := m.validateEncodingEnum("encoding", "body", *m.Encoding); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this ingest catalog data based on context it is used +func (m *IngestCatalogData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *IngestCatalogData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IngestCatalogData) UnmarshalBinary(b []byte) error { + var res IngestCatalogData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/patch_scim_user.go b/models/patch_scim_user.go new file mode 100644 index 0000000..58ef5c6 --- /dev/null +++ b/models/patch_scim_user.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PatchScimUser PATCH SCIM endpoint to update a User. This endpoint is used to update a resource's attributes. +// +// swagger:model patch_scim_user +type PatchScimUser struct { + + // An array of operations to perform on the user + // Required: true + Operations []*PatchScimUserOperationsItems0 `json:"Operations"` + + // An optional trail to log the request + Trail string `json:"trail,omitempty"` +} + +// Validate validates this patch scim user +func (m *PatchScimUser) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOperations(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PatchScimUser) validateOperations(formats strfmt.Registry) error { + + if err := validate.Required("Operations", "body", m.Operations); err != nil { + return err + } + + for i := 0; i < len(m.Operations); i++ { + if swag.IsZero(m.Operations[i]) { // not required + continue + } + + if m.Operations[i] != nil { + if err := m.Operations[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Operations" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Operations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this patch scim user based on the context it is used +func (m *PatchScimUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateOperations(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PatchScimUser) contextValidateOperations(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Operations); i++ { + + if m.Operations[i] != nil { + if err := m.Operations[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Operations" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Operations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PatchScimUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PatchScimUser) UnmarshalBinary(b []byte) error { + var res PatchScimUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PatchScimUserOperationsItems0 patch scim user operations items0 +// +// swagger:model PatchScimUserOperationsItems0 +type PatchScimUserOperationsItems0 struct { + + // The operation to perform on the user. Options are add, remove, replace + // Required: true + Op *string `json:"op"` + + // The path to the attribute to be modified + // Required: true + Path *string `json:"path"` +} + +// Validate validates this patch scim user operations items0 +func (m *PatchScimUserOperationsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOp(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePath(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PatchScimUserOperationsItems0) validateOp(formats strfmt.Registry) error { + + if err := validate.Required("op", "body", m.Op); err != nil { + return err + } + + return nil +} + +func (m *PatchScimUserOperationsItems0) validatePath(formats strfmt.Registry) error { + + if err := validate.Required("path", "body", m.Path); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this patch scim user operations items0 based on context it is used +func (m *PatchScimUserOperationsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PatchScimUserOperationsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PatchScimUserOperationsItems0) UnmarshalBinary(b []byte) error { + var res PatchScimUserOperationsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/publish_post_mortem_report.go b/models/publish_post_mortem_report.go new file mode 100644 index 0000000..a174a8a --- /dev/null +++ b/models/publish_post_mortem_report.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PublishPostMortemReport Marks an incident retrospective as published and emails all of the participants in the report the summary +// +// swagger:model publish_post_mortem_report +type PublishPostMortemReport struct { + + // publish + // Enum: [true] + Publish string `json:"publish,omitempty"` + + // An array of team IDs with whom to share the report + TeamIds []string `json:"team_ids"` + + // An array of user IDs with whom to share the report + UserIds []string `json:"user_ids"` +} + +// Validate validates this publish post mortem report +func (m *PublishPostMortemReport) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePublish(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var publishPostMortemReportTypePublishPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["true"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + publishPostMortemReportTypePublishPropEnum = append(publishPostMortemReportTypePublishPropEnum, v) + } +} + +const ( + + // PublishPostMortemReportPublishTrue captures enum value "true" + PublishPostMortemReportPublishTrue string = "true" +) + +// prop value enum +func (m *PublishPostMortemReport) validatePublishEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, publishPostMortemReportTypePublishPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *PublishPostMortemReport) validatePublish(formats strfmt.Registry) error { + if swag.IsZero(m.Publish) { // not required + return nil + } + + // value enum + if err := m.validatePublishEnum("publish", "body", m.Publish); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this publish post mortem report based on context it is used +func (m *PublishPostMortemReport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PublishPostMortemReport) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PublishPostMortemReport) UnmarshalBinary(b []byte) error { + var res PublishPostMortemReport + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/reorder_post_mortem_reasons.go b/models/reorder_post_mortem_reasons.go new file mode 100644 index 0000000..ef024c2 --- /dev/null +++ b/models/reorder_post_mortem_reasons.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ReorderPostMortemReasons Update the order of contributing factors in a retrospective report +// +// swagger:model reorder_post_mortem_reasons +type ReorderPostMortemReasons struct { + + // new position + // Required: true + NewPosition *int32 `json:"new_position"` + + // old position + // Required: true + OldPosition *int32 `json:"old_position"` +} + +// Validate validates this reorder post mortem reasons +func (m *ReorderPostMortemReasons) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNewPosition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOldPosition(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReorderPostMortemReasons) validateNewPosition(formats strfmt.Registry) error { + + if err := validate.Required("new_position", "body", m.NewPosition); err != nil { + return err + } + + return nil +} + +func (m *ReorderPostMortemReasons) validateOldPosition(formats strfmt.Registry) error { + + if err := validate.Required("old_position", "body", m.OldPosition); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this reorder post mortem reasons based on context it is used +func (m *ReorderPostMortemReasons) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ReorderPostMortemReasons) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReorderPostMortemReasons) UnmarshalBinary(b []byte) error { + var res ReorderPostMortemReasons + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_aws_cloudtrail_batch.go b/models/update_aws_cloudtrail_batch.go new file mode 100644 index 0000000..ef7ca76 --- /dev/null +++ b/models/update_aws_cloudtrail_batch.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateAwsCloudtrailBatch Update a CloudTrail batch with new information. +// +// swagger:model update_aws_cloudtrail_batch +type UpdateAwsCloudtrailBatch struct { + + // ends at + // Format: date-time + EndsAt strfmt.DateTime `json:"ends_at,omitempty"` + + // error + Error string `json:"error,omitempty"` + + // events created + EventsCreated int32 `json:"events_created,omitempty"` + + // status + Status string `json:"status,omitempty"` +} + +// Validate validates this update aws cloudtrail batch +func (m *UpdateAwsCloudtrailBatch) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEndsAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateAwsCloudtrailBatch) validateEndsAt(formats strfmt.Registry) error { + if swag.IsZero(m.EndsAt) { // not required + return nil + } + + if err := validate.FormatOf("ends_at", "body", "date-time", m.EndsAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update aws cloudtrail batch based on context it is used +func (m *UpdateAwsCloudtrailBatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateAwsCloudtrailBatch) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateAwsCloudtrailBatch) UnmarshalBinary(b []byte) error { + var res UpdateAwsCloudtrailBatch + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_aws_connection.go b/models/update_aws_connection.go new file mode 100644 index 0000000..ed6ae7e --- /dev/null +++ b/models/update_aws_connection.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateAwsConnection Update the AWS connection with the provided data. +// +// swagger:model update_aws_connection +type UpdateAwsConnection struct { + + // aws account id + AwsAccountID string `json:"aws_account_id,omitempty"` + + // connection status + ConnectionStatus string `json:"connection_status,omitempty"` + + // target arn + TargetArn string `json:"target_arn,omitempty"` +} + +// Validate validates this update aws connection +func (m *UpdateAwsConnection) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update aws connection based on context it is used +func (m *UpdateAwsConnection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateAwsConnection) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateAwsConnection) UnmarshalBinary(b []byte) error { + var res UpdateAwsConnection + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_change.go b/models/update_change.go new file mode 100644 index 0000000..42e2905 --- /dev/null +++ b/models/update_change.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateChange Update a change entry +// +// swagger:model update_change +type UpdateChange struct { + + // description + Description string `json:"description,omitempty"` + + // labels + Labels map[string]string `json:"labels,omitempty"` + + // summary + Summary string `json:"summary,omitempty"` +} + +// Validate validates this update change +func (m *UpdateChange) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update change based on context it is used +func (m *UpdateChange) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateChange) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateChange) UnmarshalBinary(b []byte) error { + var res UpdateChange + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_change_event.go b/models/update_change_event.go new file mode 100644 index 0000000..2cab6cc --- /dev/null +++ b/models/update_change_event.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateChangeEvent Update a change event +// +// swagger:model update_change_event +type UpdateChangeEvent struct { + + // JSON objects representing attachments, see attachments documentation for the schema + Attachments []*UpdateChangeEventAttachmentsItems0 `json:"attachments"` + + // description + Description string `json:"description,omitempty"` + + // ends at + // Format: date-time + EndsAt strfmt.DateTime `json:"ends_at,omitempty"` + + // An array of environment IDs (setting this will overwrite the current environments) + Environments []string `json:"environments"` + + // labels + Labels map[string]string `json:"labels,omitempty"` + + // An array of service IDs (setting this will overwrite the current services) + Services []string `json:"services"` + + // starts at + // Format: date-time + StartsAt strfmt.DateTime `json:"starts_at,omitempty"` + + // summary + Summary string `json:"summary,omitempty"` +} + +// Validate validates this update change event +func (m *UpdateChangeEvent) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAttachments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEndsAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartsAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateChangeEvent) validateAttachments(formats strfmt.Registry) error { + if swag.IsZero(m.Attachments) { // not required + return nil + } + + for i := 0; i < len(m.Attachments); i++ { + if swag.IsZero(m.Attachments[i]) { // not required + continue + } + + if m.Attachments[i] != nil { + if err := m.Attachments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attachments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("attachments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateChangeEvent) validateEndsAt(formats strfmt.Registry) error { + if swag.IsZero(m.EndsAt) { // not required + return nil + } + + if err := validate.FormatOf("ends_at", "body", "date-time", m.EndsAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateChangeEvent) validateStartsAt(formats strfmt.Registry) error { + if swag.IsZero(m.StartsAt) { // not required + return nil + } + + if err := validate.FormatOf("starts_at", "body", "date-time", m.StartsAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update change event based on the context it is used +func (m *UpdateChangeEvent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAttachments(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateChangeEvent) contextValidateAttachments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Attachments); i++ { + + if m.Attachments[i] != nil { + if err := m.Attachments[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attachments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("attachments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateChangeEvent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateChangeEvent) UnmarshalBinary(b []byte) error { + var res UpdateChangeEvent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateChangeEventAttachmentsItems0 update change event attachments items0 +// +// swagger:model UpdateChangeEventAttachmentsItems0 +type UpdateChangeEventAttachmentsItems0 struct { + + // type + // Required: true + // Enum: [link] + Type *string `json:"type"` +} + +// Validate validates this update change event attachments items0 +func (m *UpdateChangeEventAttachmentsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var updateChangeEventAttachmentsItems0TypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["link"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateChangeEventAttachmentsItems0TypeTypePropEnum = append(updateChangeEventAttachmentsItems0TypeTypePropEnum, v) + } +} + +const ( + + // UpdateChangeEventAttachmentsItems0TypeLink captures enum value "link" + UpdateChangeEventAttachmentsItems0TypeLink string = "link" +) + +// prop value enum +func (m *UpdateChangeEventAttachmentsItems0) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateChangeEventAttachmentsItems0TypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateChangeEventAttachmentsItems0) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update change event attachments items0 based on context it is used +func (m *UpdateChangeEventAttachmentsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateChangeEventAttachmentsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateChangeEventAttachmentsItems0) UnmarshalBinary(b []byte) error { + var res UpdateChangeEventAttachmentsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_change_identity.go b/models/update_change_identity.go new file mode 100644 index 0000000..3a17ddb --- /dev/null +++ b/models/update_change_identity.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateChangeIdentity Update an identity for the change entry +// +// swagger:model update_change_identity +type UpdateChangeIdentity struct { + + // type + // Required: true + Type *string `json:"type"` + + // value + // Required: true + Value *string `json:"value"` +} + +// Validate validates this update change identity +func (m *UpdateChangeIdentity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateChangeIdentity) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +func (m *UpdateChangeIdentity) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update change identity based on context it is used +func (m *UpdateChangeIdentity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateChangeIdentity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateChangeIdentity) UnmarshalBinary(b []byte) error { + var res UpdateChangeIdentity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_checklist_template.go b/models/update_checklist_template.go new file mode 100644 index 0000000..98becf0 --- /dev/null +++ b/models/update_checklist_template.go @@ -0,0 +1,307 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateChecklistTemplate Update a checklist templates attributes +// +// swagger:model update_checklist_template +type UpdateChecklistTemplate struct { + + // An array of checks for the checklist template + Checks []*UpdateChecklistTemplateChecksItems0 `json:"checks"` + + // Array of service IDs to attach checklist template to + ConnectedServices []*UpdateChecklistTemplateConnectedServicesItems0 `json:"connected_services"` + + // description + Description string `json:"description,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // If set to true, any services tagged on the checklist that are not included in the given array will be removed. Set this to true if you want to do a replacement operation for the services + RemoveRemainingConnectedServices bool `json:"remove_remaining_connected_services,omitempty"` + + // The ID of the Team that owns the checklist template + TeamID string `json:"team_id,omitempty"` +} + +// Validate validates this update checklist template +func (m *UpdateChecklistTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChecks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateConnectedServices(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateChecklistTemplate) validateChecks(formats strfmt.Registry) error { + if swag.IsZero(m.Checks) { // not required + return nil + } + + for i := 0; i < len(m.Checks); i++ { + if swag.IsZero(m.Checks[i]) { // not required + continue + } + + if m.Checks[i] != nil { + if err := m.Checks[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("checks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("checks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateChecklistTemplate) validateConnectedServices(formats strfmt.Registry) error { + if swag.IsZero(m.ConnectedServices) { // not required + return nil + } + + for i := 0; i < len(m.ConnectedServices); i++ { + if swag.IsZero(m.ConnectedServices[i]) { // not required + continue + } + + if m.ConnectedServices[i] != nil { + if err := m.ConnectedServices[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("connected_services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("connected_services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update checklist template based on the context it is used +func (m *UpdateChecklistTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateChecks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateConnectedServices(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateChecklistTemplate) contextValidateChecks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Checks); i++ { + + if m.Checks[i] != nil { + if err := m.Checks[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("checks" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("checks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateChecklistTemplate) contextValidateConnectedServices(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ConnectedServices); i++ { + + if m.ConnectedServices[i] != nil { + if err := m.ConnectedServices[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("connected_services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("connected_services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateChecklistTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateChecklistTemplate) UnmarshalBinary(b []byte) error { + var res UpdateChecklistTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateChecklistTemplateChecksItems0 update checklist template checks items0 +// +// swagger:model UpdateChecklistTemplateChecksItems0 +type UpdateChecklistTemplateChecksItems0 struct { + + // The description of the check + Description string `json:"description,omitempty"` + + // Specify the check ID when updating an already existing check + ID string `json:"id,omitempty"` + + // The name of the check + // Required: true + Name *string `json:"name"` +} + +// Validate validates this update checklist template checks items0 +func (m *UpdateChecklistTemplateChecksItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateChecklistTemplateChecksItems0) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update checklist template checks items0 based on context it is used +func (m *UpdateChecklistTemplateChecksItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateChecklistTemplateChecksItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateChecklistTemplateChecksItems0) UnmarshalBinary(b []byte) error { + var res UpdateChecklistTemplateChecksItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateChecklistTemplateConnectedServicesItems0 update checklist template connected services items0 +// +// swagger:model UpdateChecklistTemplateConnectedServicesItems0 +type UpdateChecklistTemplateConnectedServicesItems0 struct { + + // id + // Required: true + ID *string `json:"id"` + + // Set to `true` to remove checklist from service + Remove bool `json:"remove,omitempty"` +} + +// Validate validates this update checklist template connected services items0 +func (m *UpdateChecklistTemplateConnectedServicesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateChecklistTemplateConnectedServicesItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update checklist template connected services items0 based on context it is used +func (m *UpdateChecklistTemplateConnectedServicesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateChecklistTemplateConnectedServicesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateChecklistTemplateConnectedServicesItems0) UnmarshalBinary(b []byte) error { + var res UpdateChecklistTemplateConnectedServicesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_comment.go b/models/update_comment.go new file mode 100644 index 0000000..2f06666 --- /dev/null +++ b/models/update_comment.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateComment ALPHA - Update a comment's attributes +// +// swagger:model update_comment +type UpdateComment struct { + + // Text body of comment + Body string `json:"body,omitempty"` +} + +// Validate validates this update comment +func (m *UpdateComment) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update comment based on context it is used +func (m *UpdateComment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateComment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateComment) UnmarshalBinary(b []byte) error { + var res UpdateComment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_custom_field_definition.go b/models/update_custom_field_definition.go new file mode 100644 index 0000000..40ff9e8 --- /dev/null +++ b/models/update_custom_field_definition.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateCustomFieldDefinition Update a single custom field definition +// +// swagger:model update_custom_field_definition +type UpdateCustomFieldDefinition struct { + + // description + Description string `json:"description,omitempty"` + + // display name + DisplayName string `json:"display_name,omitempty"` + + // permissible values + PermissibleValues []string `json:"permissible_values"` + + // required + Required bool `json:"required,omitempty"` + + // An optional milestone ID to specify when the field should become required, if `required` is set to `true`. If not provided, required fields are always required. + RequiredAtMilestoneID string `json:"required_at_milestone_id,omitempty"` +} + +// Validate validates this update custom field definition +func (m *UpdateCustomFieldDefinition) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update custom field definition based on context it is used +func (m *UpdateCustomFieldDefinition) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateCustomFieldDefinition) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateCustomFieldDefinition) UnmarshalBinary(b []byte) error { + var res UpdateCustomFieldDefinition + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_environment.go b/models/update_environment.go new file mode 100644 index 0000000..e2fb164 --- /dev/null +++ b/models/update_environment.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateEnvironment Update a environments attributes +// +// swagger:model update_environment +type UpdateEnvironment struct { + + // description + Description string `json:"description,omitempty"` + + // name + // Required: true + Name *string `json:"name"` +} + +// Validate validates this update environment +func (m *UpdateEnvironment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateEnvironment) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update environment based on context it is used +func (m *UpdateEnvironment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateEnvironment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateEnvironment) UnmarshalBinary(b []byte) error { + var res UpdateEnvironment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_functionality.go b/models/update_functionality.go new file mode 100644 index 0000000..731e5b2 --- /dev/null +++ b/models/update_functionality.go @@ -0,0 +1,679 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateFunctionality Update a functionalities attributes +// +// swagger:model update_functionality +type UpdateFunctionality struct { + + // alert on add + AlertOnAdd bool `json:"alert_on_add,omitempty"` + + // auto add responding team + AutoAddRespondingTeam bool `json:"auto_add_responding_team,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // An array of external resources to attach to this service. + ExternalResources []*UpdateFunctionalityExternalResourcesItems0 `json:"external_resources"` + + // A hash of label keys and values + Labels map[string]string `json:"labels,omitempty"` + + // An array of links to associate with this functionality. This will remove all links not present in the patch. Only acts if 'links' key is included in the payload. + Links []*UpdateFunctionalityLinksItems0 `json:"links"` + + // name + Name string `json:"name,omitempty"` + + // owner + Owner *UpdateFunctionalityOwner `json:"owner,omitempty"` + + // If you are trying to remove a team as an owner from a functionality, set this to 'true' + RemoveOwner bool `json:"remove_owner,omitempty"` + + // If set to true, any external_resources tagged on the service that are not included in the given array will be removed. Set this to true if you want to do a replacement operation for the external_resources + RemoveRemainingExternalResources bool `json:"remove_remaining_external_resources,omitempty"` + + // Set this to true if you want to remove all of the services that are not included in the services array from the functionality + RemoveRemainingServices *bool `json:"remove_remaining_services,omitempty"` + + // If set to true, any teams tagged on the service that are not included in the given array will be removed. Set this to true if you want to do a replacement operation for the teams + RemoveRemainingTeams bool `json:"remove_remaining_teams,omitempty"` + + // services + Services []*UpdateFunctionalityServicesItems0 `json:"services"` + + // An array of teams to attach to this functionality. + Teams []*UpdateFunctionalityTeamsItems0 `json:"teams"` +} + +// Validate validates this update functionality +func (m *UpdateFunctionality) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExternalResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLinks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOwner(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServices(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTeams(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateFunctionality) validateExternalResources(formats strfmt.Registry) error { + if swag.IsZero(m.ExternalResources) { // not required + return nil + } + + for i := 0; i < len(m.ExternalResources); i++ { + if swag.IsZero(m.ExternalResources[i]) { // not required + continue + } + + if m.ExternalResources[i] != nil { + if err := m.ExternalResources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateFunctionality) validateLinks(formats strfmt.Registry) error { + if swag.IsZero(m.Links) { // not required + return nil + } + + for i := 0; i < len(m.Links); i++ { + if swag.IsZero(m.Links[i]) { // not required + continue + } + + if m.Links[i] != nil { + if err := m.Links[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateFunctionality) validateOwner(formats strfmt.Registry) error { + if swag.IsZero(m.Owner) { // not required + return nil + } + + if m.Owner != nil { + if err := m.Owner.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + +func (m *UpdateFunctionality) validateServices(formats strfmt.Registry) error { + if swag.IsZero(m.Services) { // not required + return nil + } + + for i := 0; i < len(m.Services); i++ { + if swag.IsZero(m.Services[i]) { // not required + continue + } + + if m.Services[i] != nil { + if err := m.Services[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateFunctionality) validateTeams(formats strfmt.Registry) error { + if swag.IsZero(m.Teams) { // not required + return nil + } + + for i := 0; i < len(m.Teams); i++ { + if swag.IsZero(m.Teams[i]) { // not required + continue + } + + if m.Teams[i] != nil { + if err := m.Teams[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("teams" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("teams" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update functionality based on the context it is used +func (m *UpdateFunctionality) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateExternalResources(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOwner(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServices(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTeams(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateFunctionality) contextValidateExternalResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ExternalResources); i++ { + + if m.ExternalResources[i] != nil { + if err := m.ExternalResources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateFunctionality) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Links); i++ { + + if m.Links[i] != nil { + if err := m.Links[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateFunctionality) contextValidateOwner(ctx context.Context, formats strfmt.Registry) error { + + if m.Owner != nil { + if err := m.Owner.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + +func (m *UpdateFunctionality) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Services); i++ { + + if m.Services[i] != nil { + if err := m.Services[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateFunctionality) contextValidateTeams(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Teams); i++ { + + if m.Teams[i] != nil { + if err := m.Teams[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("teams" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("teams" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateFunctionality) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateFunctionality) UnmarshalBinary(b []byte) error { + var res UpdateFunctionality + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateFunctionalityExternalResourcesItems0 update functionality external resources items0 +// +// swagger:model UpdateFunctionalityExternalResourcesItems0 +type UpdateFunctionalityExternalResourcesItems0 struct { + + // The integration slug for the external resource. Can be one of: github, opsgenie, pager_duty, statuspage, victorops. Not required if the resource has already been imported. + ConnectionType string `json:"connection_type,omitempty"` + + // remote id + // Required: true + RemoteID *string `json:"remote_id"` + + // If you are trying to remove an external resource from a service, set this to 'true'. + Remove bool `json:"remove,omitempty"` +} + +// Validate validates this update functionality external resources items0 +func (m *UpdateFunctionalityExternalResourcesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRemoteID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateFunctionalityExternalResourcesItems0) validateRemoteID(formats strfmt.Registry) error { + + if err := validate.Required("remote_id", "body", m.RemoteID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update functionality external resources items0 based on context it is used +func (m *UpdateFunctionalityExternalResourcesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateFunctionalityExternalResourcesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateFunctionalityExternalResourcesItems0) UnmarshalBinary(b []byte) error { + var res UpdateFunctionalityExternalResourcesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateFunctionalityLinksItems0 update functionality links items0 +// +// swagger:model UpdateFunctionalityLinksItems0 +type UpdateFunctionalityLinksItems0 struct { + + // URL + // Required: true + HrefURL *string `json:"href_url"` + + // An optional URL to an icon representing this link + IconURL string `json:"icon_url,omitempty"` + + // If updating an existing link, specify it's id. + ID string `json:"id,omitempty"` + + // Short name used to display and identify this link + // Required: true + Name *string `json:"name"` + + // If you are trying to remove a link, set this to 'true' + Remove bool `json:"remove,omitempty"` +} + +// Validate validates this update functionality links items0 +func (m *UpdateFunctionalityLinksItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHrefURL(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateFunctionalityLinksItems0) validateHrefURL(formats strfmt.Registry) error { + + if err := validate.Required("href_url", "body", m.HrefURL); err != nil { + return err + } + + return nil +} + +func (m *UpdateFunctionalityLinksItems0) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update functionality links items0 based on context it is used +func (m *UpdateFunctionalityLinksItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateFunctionalityLinksItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateFunctionalityLinksItems0) UnmarshalBinary(b []byte) error { + var res UpdateFunctionalityLinksItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateFunctionalityOwner An object representing a Team that owns the functionality +// +// swagger:model UpdateFunctionalityOwner +type UpdateFunctionalityOwner struct { + + // id + // Required: true + ID *string `json:"id"` +} + +// Validate validates this update functionality owner +func (m *UpdateFunctionalityOwner) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateFunctionalityOwner) validateID(formats strfmt.Registry) error { + + if err := validate.Required("owner"+"."+"id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update functionality owner based on context it is used +func (m *UpdateFunctionalityOwner) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateFunctionalityOwner) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateFunctionalityOwner) UnmarshalBinary(b []byte) error { + var res UpdateFunctionalityOwner + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateFunctionalityServicesItems0 update functionality services items0 +// +// swagger:model UpdateFunctionalityServicesItems0 +type UpdateFunctionalityServicesItems0 struct { + + // ID of a service + // Required: true + ID *string `json:"id"` + + // Set to true if you want to remove the given service from the functionality + Remove bool `json:"remove,omitempty"` +} + +// Validate validates this update functionality services items0 +func (m *UpdateFunctionalityServicesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateFunctionalityServicesItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update functionality services items0 based on context it is used +func (m *UpdateFunctionalityServicesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateFunctionalityServicesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateFunctionalityServicesItems0) UnmarshalBinary(b []byte) error { + var res UpdateFunctionalityServicesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateFunctionalityTeamsItems0 update functionality teams items0 +// +// swagger:model UpdateFunctionalityTeamsItems0 +type UpdateFunctionalityTeamsItems0 struct { + + // id + // Required: true + ID *string `json:"id"` + + // If you are trying to remove a team from a functionality, set this to 'true' + Remove bool `json:"remove,omitempty"` +} + +// Validate validates this update functionality teams items0 +func (m *UpdateFunctionalityTeamsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateFunctionalityTeamsItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update functionality teams items0 based on context it is used +func (m *UpdateFunctionalityTeamsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateFunctionalityTeamsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateFunctionalityTeamsItems0) UnmarshalBinary(b []byte) error { + var res UpdateFunctionalityTeamsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_incident.go b/models/update_incident.go new file mode 100644 index 0000000..34f82af --- /dev/null +++ b/models/update_incident.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateIncident Updates an incident with provided parameters +// +// swagger:model update_incident +type UpdateIncident struct { + + // customer impact summary + CustomerImpactSummary string `json:"customer_impact_summary,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // Key:value pairs to track custom data for the incident + Labels interface{} `json:"labels,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // priority + Priority string `json:"priority,omitempty"` + + // severity + Severity string `json:"severity,omitempty"` + + // severity condition id + SeverityConditionID string `json:"severity_condition_id,omitempty"` + + // severity impact id + SeverityImpactID string `json:"severity_impact_id,omitempty"` + + // summary + Summary string `json:"summary,omitempty"` + + // List of tags for the incident + TagList []string `json:"tag_list"` +} + +// Validate validates this update incident +func (m *UpdateIncident) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update incident based on context it is used +func (m *UpdateIncident) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncident) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncident) UnmarshalBinary(b []byte) error { + var res UpdateIncident + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_incident_alert_primary.go b/models/update_incident_alert_primary.go new file mode 100644 index 0000000..3ee67c9 --- /dev/null +++ b/models/update_incident_alert_primary.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateIncidentAlertPrimary Setting an alert as primary will overwrite milestone times in the FireHydrant incident with times included in the primary alert. Services attached to the primary alert will also be automatically added to the incident. +// +// swagger:model update_incident_alert_primary +type UpdateIncidentAlertPrimary struct { + + // primary + // Required: true + Primary *bool `json:"primary"` +} + +// Validate validates this update incident alert primary +func (m *UpdateIncidentAlertPrimary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePrimary(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentAlertPrimary) validatePrimary(formats strfmt.Registry) error { + + if err := validate.Required("primary", "body", m.Primary); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update incident alert primary based on context it is used +func (m *UpdateIncidentAlertPrimary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentAlertPrimary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentAlertPrimary) UnmarshalBinary(b []byte) error { + var res UpdateIncidentAlertPrimary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_incident_change_event.go b/models/update_incident_change_event.go new file mode 100644 index 0000000..22596ea --- /dev/null +++ b/models/update_incident_change_event.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateIncidentChangeEvent Update a change attached to an incident +// +// swagger:model update_incident_change_event +type UpdateIncidentChangeEvent struct { + + // type + // Enum: [caused fixed suspect dismissed] + Type string `json:"type,omitempty"` + + // A short description about why this change event is related + Why string `json:"why,omitempty"` +} + +// Validate validates this update incident change event +func (m *UpdateIncidentChangeEvent) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var updateIncidentChangeEventTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["caused","fixed","suspect","dismissed"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateIncidentChangeEventTypeTypePropEnum = append(updateIncidentChangeEventTypeTypePropEnum, v) + } +} + +const ( + + // UpdateIncidentChangeEventTypeCaused captures enum value "caused" + UpdateIncidentChangeEventTypeCaused string = "caused" + + // UpdateIncidentChangeEventTypeFixed captures enum value "fixed" + UpdateIncidentChangeEventTypeFixed string = "fixed" + + // UpdateIncidentChangeEventTypeSuspect captures enum value "suspect" + UpdateIncidentChangeEventTypeSuspect string = "suspect" + + // UpdateIncidentChangeEventTypeDismissed captures enum value "dismissed" + UpdateIncidentChangeEventTypeDismissed string = "dismissed" +) + +// prop value enum +func (m *UpdateIncidentChangeEvent) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateIncidentChangeEventTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateIncidentChangeEvent) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update incident change event based on context it is used +func (m *UpdateIncidentChangeEvent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentChangeEvent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentChangeEvent) UnmarshalBinary(b []byte) error { + var res UpdateIncidentChangeEvent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_incident_chat_message.go b/models/update_incident_chat_message.go new file mode 100644 index 0000000..85a5b70 --- /dev/null +++ b/models/update_incident_chat_message.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateIncidentChatMessage Update an existing generic chat message on an incident. +// +// swagger:model update_incident_chat_message +type UpdateIncidentChatMessage struct { + + // body + // Required: true + Body *string `json:"body"` +} + +// Validate validates this update incident chat message +func (m *UpdateIncidentChatMessage) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBody(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentChatMessage) validateBody(formats strfmt.Registry) error { + + if err := validate.Required("body", "body", m.Body); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update incident chat message based on context it is used +func (m *UpdateIncidentChatMessage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentChatMessage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentChatMessage) UnmarshalBinary(b []byte) error { + var res UpdateIncidentChatMessage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_incident_impact_patch.go b/models/update_incident_impact_patch.go new file mode 100644 index 0000000..63d11d0 --- /dev/null +++ b/models/update_incident_impact_patch.go @@ -0,0 +1,332 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateIncidentImpactPatch Allows updating an incident's impacted infrastructure, with the option to +// move the incident into a different milestone and provide a note to update +// the incident timeline and any attached status pages. If this method is +// requested with the PUT verb, impacts will be completely replaced with the +// information in the request body, even if not provided (effectively clearing +// all impacts). If this method is requested with the PATCH verb, the provided +// impacts will be added or updated, but no impacts will be removed. +// +// swagger:model update_incident_impact_patch +type UpdateIncidentImpactPatch struct { + + // impact + Impact []*UpdateIncidentImpactPatchImpactItems0 `json:"impact"` + + // milestone + Milestone string `json:"milestone,omitempty"` + + // note + Note string `json:"note,omitempty"` + + // status pages + StatusPages []*UpdateIncidentImpactPatchStatusPagesItems0 `json:"status_pages"` +} + +// Validate validates this update incident impact patch +func (m *UpdateIncidentImpactPatch) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImpact(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatusPages(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentImpactPatch) validateImpact(formats strfmt.Registry) error { + if swag.IsZero(m.Impact) { // not required + return nil + } + + for i := 0; i < len(m.Impact); i++ { + if swag.IsZero(m.Impact[i]) { // not required + continue + } + + if m.Impact[i] != nil { + if err := m.Impact[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impact" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impact" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateIncidentImpactPatch) validateStatusPages(formats strfmt.Registry) error { + if swag.IsZero(m.StatusPages) { // not required + return nil + } + + for i := 0; i < len(m.StatusPages); i++ { + if swag.IsZero(m.StatusPages[i]) { // not required + continue + } + + if m.StatusPages[i] != nil { + if err := m.StatusPages[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update incident impact patch based on the context it is used +func (m *UpdateIncidentImpactPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateImpact(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatusPages(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentImpactPatch) contextValidateImpact(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Impact); i++ { + + if m.Impact[i] != nil { + if err := m.Impact[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impact" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impact" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateIncidentImpactPatch) contextValidateStatusPages(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.StatusPages); i++ { + + if m.StatusPages[i] != nil { + if err := m.StatusPages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentImpactPatch) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentImpactPatch) UnmarshalBinary(b []byte) error { + var res UpdateIncidentImpactPatch + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateIncidentImpactPatchImpactItems0 update incident impact patch impact items0 +// +// swagger:model UpdateIncidentImpactPatchImpactItems0 +type UpdateIncidentImpactPatchImpactItems0 struct { + + // condition id + // Required: true + ConditionID *string `json:"condition_id"` + + // id + // Required: true + ID *string `json:"id"` +} + +// Validate validates this update incident impact patch impact items0 +func (m *UpdateIncidentImpactPatchImpactItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConditionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentImpactPatchImpactItems0) validateConditionID(formats strfmt.Registry) error { + + if err := validate.Required("condition_id", "body", m.ConditionID); err != nil { + return err + } + + return nil +} + +func (m *UpdateIncidentImpactPatchImpactItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update incident impact patch impact items0 based on context it is used +func (m *UpdateIncidentImpactPatchImpactItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentImpactPatchImpactItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentImpactPatchImpactItems0) UnmarshalBinary(b []byte) error { + var res UpdateIncidentImpactPatchImpactItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateIncidentImpactPatchStatusPagesItems0 update incident impact patch status pages items0 +// +// swagger:model UpdateIncidentImpactPatchStatusPagesItems0 +type UpdateIncidentImpactPatchStatusPagesItems0 struct { + + // id + // Required: true + ID *string `json:"id"` + + // integration slug + // Required: true + IntegrationSlug *string `json:"integration_slug"` +} + +// Validate validates this update incident impact patch status pages items0 +func (m *UpdateIncidentImpactPatchStatusPagesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIntegrationSlug(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentImpactPatchStatusPagesItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *UpdateIncidentImpactPatchStatusPagesItems0) validateIntegrationSlug(formats strfmt.Registry) error { + + if err := validate.Required("integration_slug", "body", m.IntegrationSlug); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update incident impact patch status pages items0 based on context it is used +func (m *UpdateIncidentImpactPatchStatusPagesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentImpactPatchStatusPagesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentImpactPatchStatusPagesItems0) UnmarshalBinary(b []byte) error { + var res UpdateIncidentImpactPatchStatusPagesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_incident_impact_put.go b/models/update_incident_impact_put.go new file mode 100644 index 0000000..b670bd9 --- /dev/null +++ b/models/update_incident_impact_put.go @@ -0,0 +1,332 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateIncidentImpactPut Allows updating an incident's impacted infrastructure, with the option to +// move the incident into a different milestone and provide a note to update +// the incident timeline and any attached status pages. If this method is +// requested with the PUT verb, impacts will be completely replaced with the +// information in the request body, even if not provided (effectively clearing +// all impacts). If this method is requested with the PATCH verb, the provided +// impacts will be added or updated, but no impacts will be removed. +// +// swagger:model update_incident_impact_put +type UpdateIncidentImpactPut struct { + + // impact + Impact []*UpdateIncidentImpactPutImpactItems0 `json:"impact"` + + // milestone + Milestone string `json:"milestone,omitempty"` + + // note + Note string `json:"note,omitempty"` + + // status pages + StatusPages []*UpdateIncidentImpactPutStatusPagesItems0 `json:"status_pages"` +} + +// Validate validates this update incident impact put +func (m *UpdateIncidentImpactPut) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImpact(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatusPages(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentImpactPut) validateImpact(formats strfmt.Registry) error { + if swag.IsZero(m.Impact) { // not required + return nil + } + + for i := 0; i < len(m.Impact); i++ { + if swag.IsZero(m.Impact[i]) { // not required + continue + } + + if m.Impact[i] != nil { + if err := m.Impact[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impact" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impact" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateIncidentImpactPut) validateStatusPages(formats strfmt.Registry) error { + if swag.IsZero(m.StatusPages) { // not required + return nil + } + + for i := 0; i < len(m.StatusPages); i++ { + if swag.IsZero(m.StatusPages[i]) { // not required + continue + } + + if m.StatusPages[i] != nil { + if err := m.StatusPages[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update incident impact put based on the context it is used +func (m *UpdateIncidentImpactPut) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateImpact(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatusPages(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentImpactPut) contextValidateImpact(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Impact); i++ { + + if m.Impact[i] != nil { + if err := m.Impact[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impact" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impact" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateIncidentImpactPut) contextValidateStatusPages(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.StatusPages); i++ { + + if m.StatusPages[i] != nil { + if err := m.StatusPages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentImpactPut) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentImpactPut) UnmarshalBinary(b []byte) error { + var res UpdateIncidentImpactPut + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateIncidentImpactPutImpactItems0 update incident impact put impact items0 +// +// swagger:model UpdateIncidentImpactPutImpactItems0 +type UpdateIncidentImpactPutImpactItems0 struct { + + // condition id + // Required: true + ConditionID *string `json:"condition_id"` + + // id + // Required: true + ID *string `json:"id"` +} + +// Validate validates this update incident impact put impact items0 +func (m *UpdateIncidentImpactPutImpactItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConditionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentImpactPutImpactItems0) validateConditionID(formats strfmt.Registry) error { + + if err := validate.Required("condition_id", "body", m.ConditionID); err != nil { + return err + } + + return nil +} + +func (m *UpdateIncidentImpactPutImpactItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update incident impact put impact items0 based on context it is used +func (m *UpdateIncidentImpactPutImpactItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentImpactPutImpactItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentImpactPutImpactItems0) UnmarshalBinary(b []byte) error { + var res UpdateIncidentImpactPutImpactItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateIncidentImpactPutStatusPagesItems0 update incident impact put status pages items0 +// +// swagger:model UpdateIncidentImpactPutStatusPagesItems0 +type UpdateIncidentImpactPutStatusPagesItems0 struct { + + // id + // Required: true + ID *string `json:"id"` + + // integration slug + // Required: true + IntegrationSlug *string `json:"integration_slug"` +} + +// Validate validates this update incident impact put status pages items0 +func (m *UpdateIncidentImpactPutStatusPagesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIntegrationSlug(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentImpactPutStatusPagesItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *UpdateIncidentImpactPutStatusPagesItems0) validateIntegrationSlug(formats strfmt.Registry) error { + + if err := validate.Required("integration_slug", "body", m.IntegrationSlug); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update incident impact put status pages items0 based on context it is used +func (m *UpdateIncidentImpactPutStatusPagesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentImpactPutStatusPagesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentImpactPutStatusPagesItems0) UnmarshalBinary(b []byte) error { + var res UpdateIncidentImpactPutStatusPagesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_incident_link.go b/models/update_incident_link.go new file mode 100644 index 0000000..15ef64a --- /dev/null +++ b/models/update_incident_link.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateIncidentLink Update the external incident link attributes +// +// swagger:model update_incident_link +type UpdateIncidentLink struct { + + // display text + DisplayText string `json:"display_text,omitempty"` + + // href url + HrefURL string `json:"href_url,omitempty"` + + // icon url + IconURL string `json:"icon_url,omitempty"` +} + +// Validate validates this update incident link +func (m *UpdateIncidentLink) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update incident link based on context it is used +func (m *UpdateIncidentLink) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentLink) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentLink) UnmarshalBinary(b []byte) error { + var res UpdateIncidentLink + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_incident_note.go b/models/update_incident_note.go new file mode 100644 index 0000000..052795b --- /dev/null +++ b/models/update_incident_note.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateIncidentNote Updates the body of a note +// +// swagger:model update_incident_note +type UpdateIncidentNote struct { + + // body + // Required: true + Body *string `json:"body"` +} + +// Validate validates this update incident note +func (m *UpdateIncidentNote) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBody(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentNote) validateBody(formats strfmt.Registry) error { + + if err := validate.Required("body", "body", m.Body); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update incident note based on context it is used +func (m *UpdateIncidentNote) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentNote) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentNote) UnmarshalBinary(b []byte) error { + var res UpdateIncidentNote + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_incident_retrospective.go b/models/update_incident_retrospective.go new file mode 100644 index 0000000..70314e9 --- /dev/null +++ b/models/update_incident_retrospective.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateIncidentRetrospective Update a retrospective attached to an incident +// +// swagger:model update_incident_retrospective +type UpdateIncidentRetrospective struct { + + // To hide or unhide the retrospective. + IsHidden bool `json:"is_hidden,omitempty"` +} + +// Validate validates this update incident retrospective +func (m *UpdateIncidentRetrospective) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update incident retrospective based on context it is used +func (m *UpdateIncidentRetrospective) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentRetrospective) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentRetrospective) UnmarshalBinary(b []byte) error { + var res UpdateIncidentRetrospective + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_incident_retrospective_field.go b/models/update_incident_retrospective_field.go new file mode 100644 index 0000000..60f21d6 --- /dev/null +++ b/models/update_incident_retrospective_field.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateIncidentRetrospectiveField Update retrospective field value +// +// swagger:model update_incident_retrospective_field +type UpdateIncidentRetrospectiveField struct { + + // The ID of the dynamic input field to update. + DynamicInputFieldID string `json:"dynamic_input_field_id,omitempty"` + + // The value to set for the field. + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this update incident retrospective field +func (m *UpdateIncidentRetrospectiveField) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentRetrospectiveField) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update incident retrospective field based on context it is used +func (m *UpdateIncidentRetrospectiveField) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentRetrospectiveField) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentRetrospectiveField) UnmarshalBinary(b []byte) error { + var res UpdateIncidentRetrospectiveField + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_incident_role.go b/models/update_incident_role.go new file mode 100644 index 0000000..d7f834e --- /dev/null +++ b/models/update_incident_role.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateIncidentRole Update a single incident role from its ID +// +// swagger:model update_incident_role +type UpdateIncidentRole struct { + + // description + Description string `json:"description,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // summary + Summary string `json:"summary,omitempty"` +} + +// Validate validates this update incident role +func (m *UpdateIncidentRole) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update incident role based on context it is used +func (m *UpdateIncidentRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentRole) UnmarshalBinary(b []byte) error { + var res UpdateIncidentRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_incident_task.go b/models/update_incident_task.go new file mode 100644 index 0000000..e9ef985 --- /dev/null +++ b/models/update_incident_task.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateIncidentTask Update a task's attributes +// +// swagger:model update_incident_task +type UpdateIncidentTask struct { + + // The ID of the user assigned to the task. + AssigneeID string `json:"assignee_id,omitempty"` + + // A description of what the task is for. + Description string `json:"description,omitempty"` + + // The due date of the task. Relative values are supported such as '5m' + DueAt string `json:"due_at,omitempty"` + + // The state of the task. One of: open, in_progress, cancelled, done + State string `json:"state,omitempty"` + + // The title of the task. + Title string `json:"title,omitempty"` +} + +// Validate validates this update incident task +func (m *UpdateIncidentTask) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update incident task based on context it is used +func (m *UpdateIncidentTask) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentTask) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentTask) UnmarshalBinary(b []byte) error { + var res UpdateIncidentTask + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_incident_type.go b/models/update_incident_type.go new file mode 100644 index 0000000..3b7c855 --- /dev/null +++ b/models/update_incident_type.go @@ -0,0 +1,326 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateIncidentType Update a single incident type from its ID +// +// swagger:model update_incident_type +type UpdateIncidentType struct { + + // name + // Required: true + Name *string `json:"name"` + + // template + // Required: true + Template *UpdateIncidentTypeTemplate `json:"template"` +} + +// Validate validates this update incident type +func (m *UpdateIncidentType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTemplate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentType) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *UpdateIncidentType) validateTemplate(formats strfmt.Registry) error { + + if err := validate.Required("template", "body", m.Template); err != nil { + return err + } + + if m.Template != nil { + if err := m.Template.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("template") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update incident type based on the context it is used +func (m *UpdateIncidentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTemplate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentType) contextValidateTemplate(ctx context.Context, formats strfmt.Registry) error { + + if m.Template != nil { + if err := m.Template.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("template") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentType) UnmarshalBinary(b []byte) error { + var res UpdateIncidentType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateIncidentTypeTemplate update incident type template +// +// swagger:model UpdateIncidentTypeTemplate +type UpdateIncidentTypeTemplate struct { + + // customer impact summary + CustomerImpactSummary string `json:"customer_impact_summary,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // An array of impact/condition combinations + Impacts []*UpdateIncidentTypeTemplateImpactsItems0 `json:"impacts"` + + // A labels hash of keys and values + Labels map[string]string `json:"labels,omitempty"` + + // priority + Priority string `json:"priority,omitempty"` + + // private incident + PrivateIncident bool `json:"private_incident,omitempty"` + + // List of ids of Runbooks to attach to incidents created from this type + RunbookIds []string `json:"runbook_ids"` + + // severity + Severity string `json:"severity,omitempty"` + + // List of tags for the incident + TagList []string `json:"tag_list"` + + // List of ids of teams to be assigned to incidents + TeamIds []string `json:"team_ids"` +} + +// Validate validates this update incident type template +func (m *UpdateIncidentTypeTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImpacts(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentTypeTemplate) validateImpacts(formats strfmt.Registry) error { + if swag.IsZero(m.Impacts) { // not required + return nil + } + + for i := 0; i < len(m.Impacts); i++ { + if swag.IsZero(m.Impacts[i]) { // not required + continue + } + + if m.Impacts[i] != nil { + if err := m.Impacts[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template" + "." + "impacts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("template" + "." + "impacts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update incident type template based on the context it is used +func (m *UpdateIncidentTypeTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateImpacts(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentTypeTemplate) contextValidateImpacts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Impacts); i++ { + + if m.Impacts[i] != nil { + if err := m.Impacts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template" + "." + "impacts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("template" + "." + "impacts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentTypeTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentTypeTemplate) UnmarshalBinary(b []byte) error { + var res UpdateIncidentTypeTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateIncidentTypeTemplateImpactsItems0 update incident type template impacts items0 +// +// swagger:model UpdateIncidentTypeTemplateImpactsItems0 +type UpdateIncidentTypeTemplateImpactsItems0 struct { + + // The id of the condition + // Required: true + ConditionID *string `json:"condition_id"` + + // The id of impact + // Required: true + ID *string `json:"id"` +} + +// Validate validates this update incident type template impacts items0 +func (m *UpdateIncidentTypeTemplateImpactsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConditionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateIncidentTypeTemplateImpactsItems0) validateConditionID(formats strfmt.Registry) error { + + if err := validate.Required("condition_id", "body", m.ConditionID); err != nil { + return err + } + + return nil +} + +func (m *UpdateIncidentTypeTemplateImpactsItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update incident type template impacts items0 based on context it is used +func (m *UpdateIncidentTypeTemplateImpactsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateIncidentTypeTemplateImpactsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateIncidentTypeTemplateImpactsItems0) UnmarshalBinary(b []byte) error { + var res UpdateIncidentTypeTemplateImpactsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_nunc_link.go b/models/update_nunc_link.go new file mode 100644 index 0000000..c18c9ac --- /dev/null +++ b/models/update_nunc_link.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateNuncLink Update a link to be displayed on a FireHydrant status page +// +// swagger:model update_nunc_link +type UpdateNuncLink struct { + + // display text + DisplayText string `json:"display_text,omitempty"` + + // href url + HrefURL string `json:"href_url,omitempty"` + + // icon url + IconURL string `json:"icon_url,omitempty"` +} + +// Validate validates this update nunc link +func (m *UpdateNuncLink) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update nunc link based on context it is used +func (m *UpdateNuncLink) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateNuncLink) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateNuncLink) UnmarshalBinary(b []byte) error { + var res UpdateNuncLink + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_on_call_shift.go b/models/update_on_call_shift.go new file mode 100644 index 0000000..57985c0 --- /dev/null +++ b/models/update_on_call_shift.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateOnCallShift Update a Signals on-call shift by ID +// +// swagger:model update_on_call_shift +type UpdateOnCallShift struct { + + // A description of why coverage is needed for this shift. If the shift is re-assigned, this will automatically be cleared unless provided again. + CoverageRequest string `json:"coverage_request,omitempty"` + + // The end time of the shift in ISO8601 format. + EndTime string `json:"end_time,omitempty"` + + // The start time of the shift in ISO8601 format. + StartTime string `json:"start_time,omitempty"` + + // The ID of the user who is on-call for the shift. If not provided, the shift will be unassigned. + UserID string `json:"user_id,omitempty"` +} + +// Validate validates this update on call shift +func (m *UpdateOnCallShift) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update on call shift based on context it is used +func (m *UpdateOnCallShift) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateOnCallShift) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateOnCallShift) UnmarshalBinary(b []byte) error { + var res UpdateOnCallShift + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_post_mortem_field.go b/models/update_post_mortem_field.go new file mode 100644 index 0000000..a77bf63 --- /dev/null +++ b/models/update_post_mortem_field.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdatePostMortemField Update a field value on a post mortem report +// +// swagger:model update_post_mortem_field +type UpdatePostMortemField struct { + + // value + // Required: true + Value *string `json:"value"` +} + +// Validate validates this update post mortem field +func (m *UpdatePostMortemField) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePostMortemField) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update post mortem field based on context it is used +func (m *UpdatePostMortemField) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePostMortemField) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePostMortemField) UnmarshalBinary(b []byte) error { + var res UpdatePostMortemField + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_post_mortem_questions.go b/models/update_post_mortem_questions.go new file mode 100644 index 0000000..43399e1 --- /dev/null +++ b/models/update_post_mortem_questions.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdatePostMortemQuestions Update the questions configured to be provided and filled out on future retrospective reports. +// +// swagger:model update_post_mortem_questions +type UpdatePostMortemQuestions struct { + + // make swagger work + MakeSwaggerWork string `json:"_make_swagger_work_,omitempty"` + + // questions + Questions []*UpdatePostMortemQuestionsQuestionsItems0 `json:"questions"` +} + +// Validate validates this update post mortem questions +func (m *UpdatePostMortemQuestions) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateQuestions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePostMortemQuestions) validateQuestions(formats strfmt.Registry) error { + if swag.IsZero(m.Questions) { // not required + return nil + } + + for i := 0; i < len(m.Questions); i++ { + if swag.IsZero(m.Questions[i]) { // not required + continue + } + + if m.Questions[i] != nil { + if err := m.Questions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("questions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("questions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update post mortem questions based on the context it is used +func (m *UpdatePostMortemQuestions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateQuestions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePostMortemQuestions) contextValidateQuestions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Questions); i++ { + + if m.Questions[i] != nil { + if err := m.Questions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("questions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("questions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePostMortemQuestions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePostMortemQuestions) UnmarshalBinary(b []byte) error { + var res UpdatePostMortemQuestions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdatePostMortemQuestionsQuestionsItems0 update post mortem questions questions items0 +// +// swagger:model UpdatePostMortemQuestionsQuestionsItems0 +type UpdatePostMortemQuestionsQuestionsItems0 struct { + + // ID of a question + ID string `json:"id,omitempty"` + + // title of a question + Title string `json:"title,omitempty"` + + // tooltip of a question + Tooltip string `json:"tooltip,omitempty"` +} + +// Validate validates this update post mortem questions questions items0 +func (m *UpdatePostMortemQuestionsQuestionsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update post mortem questions questions items0 based on context it is used +func (m *UpdatePostMortemQuestionsQuestionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePostMortemQuestionsQuestionsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePostMortemQuestionsQuestionsItems0) UnmarshalBinary(b []byte) error { + var res UpdatePostMortemQuestionsQuestionsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_post_mortem_reason.go b/models/update_post_mortem_reason.go new file mode 100644 index 0000000..189b2e2 --- /dev/null +++ b/models/update_post_mortem_reason.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdatePostMortemReason Update a contributing factor +// +// swagger:model update_post_mortem_reason +type UpdatePostMortemReason struct { + + // summary + Summary string `json:"summary,omitempty"` +} + +// Validate validates this update post mortem reason +func (m *UpdatePostMortemReason) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update post mortem reason based on context it is used +func (m *UpdatePostMortemReason) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePostMortemReason) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePostMortemReason) UnmarshalBinary(b []byte) error { + var res UpdatePostMortemReason + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_post_mortem_report.go b/models/update_post_mortem_report.go new file mode 100644 index 0000000..4b76eeb --- /dev/null +++ b/models/update_post_mortem_report.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdatePostMortemReport Update a report +// +// swagger:model update_post_mortem_report +type UpdatePostMortemReport struct { + + // additional details + AdditionalDetails string `json:"additional_details,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // questions + Questions []*UpdatePostMortemReportQuestionsItems0 `json:"questions"` + + // summary + Summary string `json:"summary,omitempty"` +} + +// Validate validates this update post mortem report +func (m *UpdatePostMortemReport) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateQuestions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePostMortemReport) validateQuestions(formats strfmt.Registry) error { + if swag.IsZero(m.Questions) { // not required + return nil + } + + for i := 0; i < len(m.Questions); i++ { + if swag.IsZero(m.Questions[i]) { // not required + continue + } + + if m.Questions[i] != nil { + if err := m.Questions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("questions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("questions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update post mortem report based on the context it is used +func (m *UpdatePostMortemReport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateQuestions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePostMortemReport) contextValidateQuestions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Questions); i++ { + + if m.Questions[i] != nil { + if err := m.Questions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("questions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("questions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePostMortemReport) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePostMortemReport) UnmarshalBinary(b []byte) error { + var res UpdatePostMortemReport + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdatePostMortemReportQuestionsItems0 update post mortem report questions items0 +// +// swagger:model UpdatePostMortemReportQuestionsItems0 +type UpdatePostMortemReportQuestionsItems0 struct { + + // Answer to question + Body string `json:"body,omitempty"` + + // ID of a question + ID string `json:"id,omitempty"` +} + +// Validate validates this update post mortem report questions items0 +func (m *UpdatePostMortemReportQuestionsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update post mortem report questions items0 based on context it is used +func (m *UpdatePostMortemReportQuestionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePostMortemReportQuestionsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePostMortemReportQuestionsItems0) UnmarshalBinary(b []byte) error { + var res UpdatePostMortemReportQuestionsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_priority.go b/models/update_priority.go new file mode 100644 index 0000000..c5624fc --- /dev/null +++ b/models/update_priority.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdatePriority Update a specific priority +// +// swagger:model update_priority +type UpdatePriority struct { + + // default + Default bool `json:"default,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // slug + Slug string `json:"slug,omitempty"` +} + +// Validate validates this update priority +func (m *UpdatePriority) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update priority based on context it is used +func (m *UpdatePriority) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePriority) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePriority) UnmarshalBinary(b []byte) error { + var res UpdatePriority + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_runbook.go b/models/update_runbook.go new file mode 100644 index 0000000..6fe0c4b --- /dev/null +++ b/models/update_runbook.go @@ -0,0 +1,789 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateRunbook Update a runbook and any attachment rules associated with it. This endpoint is used to configure nearly everything +// about a runbook, including but not limited to the steps, environments, attachment rules, and severities. +// +// swagger:model update_runbook +type UpdateRunbook struct { + + // attachment rule + AttachmentRule *UpdateRunbookAttachmentRule `json:"attachment_rule,omitempty"` + + // Whether or not this runbook should be automatically attached to restricted incidents. Note that setting this to `true` will prevent it from being attached to public incidents, even manually. Defaults to `false`. + AutoAttachToRestrictedIncidents bool `json:"auto_attach_to_restricted_incidents,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // environments + Environments []*UpdateRunbookEnvironmentsItems0 `json:"environments"` + + // name + Name string `json:"name,omitempty"` + + // owner + Owner *UpdateRunbookOwner `json:"owner,omitempty"` + + // services + Services []*UpdateRunbookServicesItems0 `json:"services"` + + // severities + Severities []*UpdateRunbookSeveritiesItems0 `json:"severities"` + + // steps + Steps []*UpdateRunbookStepsItems0 `json:"steps"` + + // summary + Summary string `json:"summary,omitempty"` + + // Whether or not this runbook is a tutorial runbook + Tutorial bool `json:"tutorial,omitempty"` +} + +// Validate validates this update runbook +func (m *UpdateRunbook) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAttachmentRule(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnvironments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOwner(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServices(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverities(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSteps(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateRunbook) validateAttachmentRule(formats strfmt.Registry) error { + if swag.IsZero(m.AttachmentRule) { // not required + return nil + } + + if m.AttachmentRule != nil { + if err := m.AttachmentRule.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attachment_rule") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("attachment_rule") + } + return err + } + } + + return nil +} + +func (m *UpdateRunbook) validateEnvironments(formats strfmt.Registry) error { + if swag.IsZero(m.Environments) { // not required + return nil + } + + for i := 0; i < len(m.Environments); i++ { + if swag.IsZero(m.Environments[i]) { // not required + continue + } + + if m.Environments[i] != nil { + if err := m.Environments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateRunbook) validateOwner(formats strfmt.Registry) error { + if swag.IsZero(m.Owner) { // not required + return nil + } + + if m.Owner != nil { + if err := m.Owner.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + +func (m *UpdateRunbook) validateServices(formats strfmt.Registry) error { + if swag.IsZero(m.Services) { // not required + return nil + } + + for i := 0; i < len(m.Services); i++ { + if swag.IsZero(m.Services[i]) { // not required + continue + } + + if m.Services[i] != nil { + if err := m.Services[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateRunbook) validateSeverities(formats strfmt.Registry) error { + if swag.IsZero(m.Severities) { // not required + return nil + } + + for i := 0; i < len(m.Severities); i++ { + if swag.IsZero(m.Severities[i]) { // not required + continue + } + + if m.Severities[i] != nil { + if err := m.Severities[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("severities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("severities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateRunbook) validateSteps(formats strfmt.Registry) error { + if swag.IsZero(m.Steps) { // not required + return nil + } + + for i := 0; i < len(m.Steps); i++ { + if swag.IsZero(m.Steps[i]) { // not required + continue + } + + if m.Steps[i] != nil { + if err := m.Steps[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("steps" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("steps" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update runbook based on the context it is used +func (m *UpdateRunbook) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAttachmentRule(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEnvironments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOwner(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServices(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSeverities(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSteps(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateRunbook) contextValidateAttachmentRule(ctx context.Context, formats strfmt.Registry) error { + + if m.AttachmentRule != nil { + if err := m.AttachmentRule.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attachment_rule") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("attachment_rule") + } + return err + } + } + + return nil +} + +func (m *UpdateRunbook) contextValidateEnvironments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Environments); i++ { + + if m.Environments[i] != nil { + if err := m.Environments[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateRunbook) contextValidateOwner(ctx context.Context, formats strfmt.Registry) error { + + if m.Owner != nil { + if err := m.Owner.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + +func (m *UpdateRunbook) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Services); i++ { + + if m.Services[i] != nil { + if err := m.Services[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("services" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("services" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateRunbook) contextValidateSeverities(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Severities); i++ { + + if m.Severities[i] != nil { + if err := m.Severities[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("severities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("severities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateRunbook) contextValidateSteps(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Steps); i++ { + + if m.Steps[i] != nil { + if err := m.Steps[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("steps" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("steps" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateRunbook) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateRunbook) UnmarshalBinary(b []byte) error { + var res UpdateRunbook + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateRunbookAttachmentRule update runbook attachment rule +// +// swagger:model UpdateRunbookAttachmentRule +type UpdateRunbookAttachmentRule struct { + + // The JSON logic for the attaching the runbook + // Required: true + Logic *string `json:"logic"` + + // The user data for the rule + UserData string `json:"user_data,omitempty"` +} + +// Validate validates this update runbook attachment rule +func (m *UpdateRunbookAttachmentRule) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLogic(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateRunbookAttachmentRule) validateLogic(formats strfmt.Registry) error { + + if err := validate.Required("attachment_rule"+"."+"logic", "body", m.Logic); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update runbook attachment rule based on context it is used +func (m *UpdateRunbookAttachmentRule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateRunbookAttachmentRule) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateRunbookAttachmentRule) UnmarshalBinary(b []byte) error { + var res UpdateRunbookAttachmentRule + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateRunbookEnvironmentsItems0 update runbook environments items0 +// +// swagger:model UpdateRunbookEnvironmentsItems0 +type UpdateRunbookEnvironmentsItems0 struct { + + // id + ID string `json:"id,omitempty"` +} + +// Validate validates this update runbook environments items0 +func (m *UpdateRunbookEnvironmentsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update runbook environments items0 based on context it is used +func (m *UpdateRunbookEnvironmentsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateRunbookEnvironmentsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateRunbookEnvironmentsItems0) UnmarshalBinary(b []byte) error { + var res UpdateRunbookEnvironmentsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateRunbookOwner An object representing a Team that owns the runbook +// +// swagger:model UpdateRunbookOwner +type UpdateRunbookOwner struct { + + // id + ID string `json:"id,omitempty"` +} + +// Validate validates this update runbook owner +func (m *UpdateRunbookOwner) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update runbook owner based on context it is used +func (m *UpdateRunbookOwner) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateRunbookOwner) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateRunbookOwner) UnmarshalBinary(b []byte) error { + var res UpdateRunbookOwner + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateRunbookServicesItems0 update runbook services items0 +// +// swagger:model UpdateRunbookServicesItems0 +type UpdateRunbookServicesItems0 struct { + + // id + ID string `json:"id,omitempty"` +} + +// Validate validates this update runbook services items0 +func (m *UpdateRunbookServicesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update runbook services items0 based on context it is used +func (m *UpdateRunbookServicesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateRunbookServicesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateRunbookServicesItems0) UnmarshalBinary(b []byte) error { + var res UpdateRunbookServicesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateRunbookSeveritiesItems0 update runbook severities items0 +// +// swagger:model UpdateRunbookSeveritiesItems0 +type UpdateRunbookSeveritiesItems0 struct { + + // id + ID string `json:"id,omitempty"` +} + +// Validate validates this update runbook severities items0 +func (m *UpdateRunbookSeveritiesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update runbook severities items0 based on context it is used +func (m *UpdateRunbookSeveritiesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateRunbookSeveritiesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateRunbookSeveritiesItems0) UnmarshalBinary(b []byte) error { + var res UpdateRunbookSeveritiesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateRunbookStepsItems0 update runbook steps items0 +// +// swagger:model UpdateRunbookStepsItems0 +type UpdateRunbookStepsItems0 struct { + + // ID of action to use for this step. + // Required: true + ActionID *string `json:"action_id"` + + // Name for step + // Required: true + Name *string `json:"name"` + + // rule + Rule *UpdateRunbookStepsItems0Rule `json:"rule,omitempty"` + + // ID of step to be updated + StepID string `json:"step_id,omitempty"` +} + +// Validate validates this update runbook steps items0 +func (m *UpdateRunbookStepsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRule(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateRunbookStepsItems0) validateActionID(formats strfmt.Registry) error { + + if err := validate.Required("action_id", "body", m.ActionID); err != nil { + return err + } + + return nil +} + +func (m *UpdateRunbookStepsItems0) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *UpdateRunbookStepsItems0) validateRule(formats strfmt.Registry) error { + if swag.IsZero(m.Rule) { // not required + return nil + } + + if m.Rule != nil { + if err := m.Rule.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rule") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update runbook steps items0 based on the context it is used +func (m *UpdateRunbookStepsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRule(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateRunbookStepsItems0) contextValidateRule(ctx context.Context, formats strfmt.Registry) error { + + if m.Rule != nil { + if err := m.Rule.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rule") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rule") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateRunbookStepsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateRunbookStepsItems0) UnmarshalBinary(b []byte) error { + var res UpdateRunbookStepsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateRunbookStepsItems0Rule update runbook steps items0 rule +// +// swagger:model UpdateRunbookStepsItems0Rule +type UpdateRunbookStepsItems0Rule struct { + + // The JSON logic for the rule + // Required: true + Logic *string `json:"logic"` + + // The user data for the rule + UserData string `json:"user_data,omitempty"` +} + +// Validate validates this update runbook steps items0 rule +func (m *UpdateRunbookStepsItems0Rule) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLogic(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateRunbookStepsItems0Rule) validateLogic(formats strfmt.Registry) error { + + if err := validate.Required("rule"+"."+"logic", "body", m.Logic); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update runbook steps items0 rule based on context it is used +func (m *UpdateRunbookStepsItems0Rule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateRunbookStepsItems0Rule) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateRunbookStepsItems0Rule) UnmarshalBinary(b []byte) error { + var res UpdateRunbookStepsItems0Rule + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_runbook_execution_step.go b/models/update_runbook_execution_step.go new file mode 100644 index 0000000..a287df7 --- /dev/null +++ b/models/update_runbook_execution_step.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateRunbookExecutionStep Updates a runbook step execution, especially for changing the state of a step execution. +// +// swagger:model update_runbook_execution_step +type UpdateRunbookExecutionStep struct { + + // Data for execution of this step + Data interface{} `json:"data,omitempty"` + + // repeats at + // Format: date-time + RepeatsAt strfmt.DateTime `json:"repeats_at,omitempty"` + + // schedule for + // Format: date-time + ScheduleFor strfmt.DateTime `json:"schedule_for,omitempty"` + + // state + // Required: true + State *string `json:"state"` +} + +// Validate validates this update runbook execution step +func (m *UpdateRunbookExecutionStep) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRepeatsAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduleFor(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateRunbookExecutionStep) validateRepeatsAt(formats strfmt.Registry) error { + if swag.IsZero(m.RepeatsAt) { // not required + return nil + } + + if err := validate.FormatOf("repeats_at", "body", "date-time", m.RepeatsAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateRunbookExecutionStep) validateScheduleFor(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduleFor) { // not required + return nil + } + + if err := validate.FormatOf("schedule_for", "body", "date-time", m.ScheduleFor.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateRunbookExecutionStep) validateState(formats strfmt.Registry) error { + + if err := validate.Required("state", "body", m.State); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update runbook execution step based on context it is used +func (m *UpdateRunbookExecutionStep) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateRunbookExecutionStep) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateRunbookExecutionStep) UnmarshalBinary(b []byte) error { + var res UpdateRunbookExecutionStep + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_saved_search.go b/models/update_saved_search.go new file mode 100644 index 0000000..de0a5f0 --- /dev/null +++ b/models/update_saved_search.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateSavedSearch Update a specific saved search +// +// swagger:model update_saved_search +type UpdateSavedSearch struct { + + // filter values + FilterValues interface{} `json:"filter_values,omitempty"` + + // is private + IsPrivate bool `json:"is_private,omitempty"` + + // name + Name string `json:"name,omitempty"` +} + +// Validate validates this update saved search +func (m *UpdateSavedSearch) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update saved search based on context it is used +func (m *UpdateSavedSearch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSavedSearch) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSavedSearch) UnmarshalBinary(b []byte) error { + var res UpdateSavedSearch + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_scheduled_maintenance.go b/models/update_scheduled_maintenance.go new file mode 100644 index 0000000..d56c5b2 --- /dev/null +++ b/models/update_scheduled_maintenance.go @@ -0,0 +1,375 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateScheduledMaintenance Change the conditions of a scheduled maintenance event, including updating any status page announcements of changes. +// +// swagger:model update_scheduled_maintenance +type UpdateScheduledMaintenance struct { + + // description + Description string `json:"description,omitempty"` + + // ISO8601 timestamp for the end time of the scheduled maintenance + // Format: date-time + EndsAt strfmt.DateTime `json:"ends_at,omitempty"` + + // An array of impact/condition combinations + Impacts []*UpdateScheduledMaintenanceImpactsItems0 `json:"impacts"` + + // A json object of label keys and values + Labels map[string]string `json:"labels,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // ISO8601 timestamp for the start time of the scheduled maintenance + // Format: date-time + StartsAt strfmt.DateTime `json:"starts_at,omitempty"` + + // An array of status pages to display this maintenance on + StatusPages []*UpdateScheduledMaintenanceStatusPagesItems0 `json:"status_pages"` + + // summary + Summary string `json:"summary,omitempty"` +} + +// Validate validates this update scheduled maintenance +func (m *UpdateScheduledMaintenance) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEndsAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImpacts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartsAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatusPages(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateScheduledMaintenance) validateEndsAt(formats strfmt.Registry) error { + if swag.IsZero(m.EndsAt) { // not required + return nil + } + + if err := validate.FormatOf("ends_at", "body", "date-time", m.EndsAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateScheduledMaintenance) validateImpacts(formats strfmt.Registry) error { + if swag.IsZero(m.Impacts) { // not required + return nil + } + + for i := 0; i < len(m.Impacts); i++ { + if swag.IsZero(m.Impacts[i]) { // not required + continue + } + + if m.Impacts[i] != nil { + if err := m.Impacts[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impacts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impacts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateScheduledMaintenance) validateStartsAt(formats strfmt.Registry) error { + if swag.IsZero(m.StartsAt) { // not required + return nil + } + + if err := validate.FormatOf("starts_at", "body", "date-time", m.StartsAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateScheduledMaintenance) validateStatusPages(formats strfmt.Registry) error { + if swag.IsZero(m.StatusPages) { // not required + return nil + } + + for i := 0; i < len(m.StatusPages); i++ { + if swag.IsZero(m.StatusPages[i]) { // not required + continue + } + + if m.StatusPages[i] != nil { + if err := m.StatusPages[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update scheduled maintenance based on the context it is used +func (m *UpdateScheduledMaintenance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateImpacts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatusPages(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateScheduledMaintenance) contextValidateImpacts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Impacts); i++ { + + if m.Impacts[i] != nil { + if err := m.Impacts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impacts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impacts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateScheduledMaintenance) contextValidateStatusPages(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.StatusPages); i++ { + + if m.StatusPages[i] != nil { + if err := m.StatusPages[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status_pages" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateScheduledMaintenance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateScheduledMaintenance) UnmarshalBinary(b []byte) error { + var res UpdateScheduledMaintenance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateScheduledMaintenanceImpactsItems0 update scheduled maintenance impacts items0 +// +// swagger:model UpdateScheduledMaintenanceImpactsItems0 +type UpdateScheduledMaintenanceImpactsItems0 struct { + + // The id of the condition + // Required: true + ConditionID *string `json:"condition_id"` + + // The id of impact + // Required: true + ID *string `json:"id"` + + // The type of impact + // Required: true + Type *string `json:"type"` +} + +// Validate validates this update scheduled maintenance impacts items0 +func (m *UpdateScheduledMaintenanceImpactsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConditionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateScheduledMaintenanceImpactsItems0) validateConditionID(formats strfmt.Registry) error { + + if err := validate.Required("condition_id", "body", m.ConditionID); err != nil { + return err + } + + return nil +} + +func (m *UpdateScheduledMaintenanceImpactsItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *UpdateScheduledMaintenanceImpactsItems0) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update scheduled maintenance impacts items0 based on context it is used +func (m *UpdateScheduledMaintenanceImpactsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateScheduledMaintenanceImpactsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateScheduledMaintenanceImpactsItems0) UnmarshalBinary(b []byte) error { + var res UpdateScheduledMaintenanceImpactsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateScheduledMaintenanceStatusPagesItems0 update scheduled maintenance status pages items0 +// +// swagger:model UpdateScheduledMaintenanceStatusPagesItems0 +type UpdateScheduledMaintenanceStatusPagesItems0 struct { + + // The UUID of the status page to display this maintenance on + // Required: true + ConnectionID *string `json:"connection_id"` + + // The slug identifying the type of status page + IntegrationSlug string `json:"integration_slug,omitempty"` +} + +// Validate validates this update scheduled maintenance status pages items0 +func (m *UpdateScheduledMaintenanceStatusPagesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConnectionID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateScheduledMaintenanceStatusPagesItems0) validateConnectionID(formats strfmt.Registry) error { + + if err := validate.Required("connection_id", "body", m.ConnectionID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update scheduled maintenance status pages items0 based on context it is used +func (m *UpdateScheduledMaintenanceStatusPagesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateScheduledMaintenanceStatusPagesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateScheduledMaintenanceStatusPagesItems0) UnmarshalBinary(b []byte) error { + var res UpdateScheduledMaintenanceStatusPagesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_scim_group.go b/models/update_scim_group.go new file mode 100644 index 0000000..50830e7 --- /dev/null +++ b/models/update_scim_group.go @@ -0,0 +1,192 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateScimGroup SCIM endpoint to update a Team (Colloquial for Group in the SCIM protocol). Any members defined in the payload will be assigned to the team with no defined role, any missing members will be removed from the team. +// +// swagger:model update_scim_group +type UpdateScimGroup struct { + + // The name of the team being updated + // Required: true + DisplayName *string `json:"displayName"` + + // members + // Required: true + Members []*UpdateScimGroupMembersItems0 `json:"members"` +} + +// Validate validates this update scim group +func (m *UpdateScimGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDisplayName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMembers(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateScimGroup) validateDisplayName(formats strfmt.Registry) error { + + if err := validate.Required("displayName", "body", m.DisplayName); err != nil { + return err + } + + return nil +} + +func (m *UpdateScimGroup) validateMembers(formats strfmt.Registry) error { + + if err := validate.Required("members", "body", m.Members); err != nil { + return err + } + + for i := 0; i < len(m.Members); i++ { + if swag.IsZero(m.Members[i]) { // not required + continue + } + + if m.Members[i] != nil { + if err := m.Members[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("members" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("members" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update scim group based on the context it is used +func (m *UpdateScimGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMembers(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateScimGroup) contextValidateMembers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Members); i++ { + + if m.Members[i] != nil { + if err := m.Members[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("members" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("members" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateScimGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateScimGroup) UnmarshalBinary(b []byte) error { + var res UpdateScimGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateScimGroupMembersItems0 update scim group members items0 +// +// swagger:model UpdateScimGroupMembersItems0 +type UpdateScimGroupMembersItems0 struct { + + // String that represents the user's UUID to assign to the team + // Required: true + Value *string `json:"value"` +} + +// Validate validates this update scim group members items0 +func (m *UpdateScimGroupMembersItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateScimGroupMembersItems0) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update scim group members items0 based on context it is used +func (m *UpdateScimGroupMembersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateScimGroupMembersItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateScimGroupMembersItems0) UnmarshalBinary(b []byte) error { + var res UpdateScimGroupMembersItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_scim_user.go b/models/update_scim_user.go new file mode 100644 index 0000000..753c322 --- /dev/null +++ b/models/update_scim_user.go @@ -0,0 +1,304 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateScimUser PUT SCIM endpoint to update a User. This endpoint is used to replace a resource's attributes. +// +// swagger:model update_scim_user +type UpdateScimUser struct { + + // Boolean that represents whether user is active + Active bool `json:"active,omitempty"` + + // Email addresses for the User + Emails []*UpdateScimUserEmailsItems0 `json:"emails"` + + // name + Name *UpdateScimUserName `json:"name,omitempty"` + + // Roles for the User. Options are owner, member, collaborator, or viewer. Roles may be specified as strings or SCIM role objects. + Roles interface{} `json:"roles,omitempty"` + + // A service provider's unique identifier for the user + UserName string `json:"userName,omitempty"` +} + +// Validate validates this update scim user +func (m *UpdateScimUser) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEmails(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateScimUser) validateEmails(formats strfmt.Registry) error { + if swag.IsZero(m.Emails) { // not required + return nil + } + + for i := 0; i < len(m.Emails); i++ { + if swag.IsZero(m.Emails[i]) { // not required + continue + } + + if m.Emails[i] != nil { + if err := m.Emails[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emails" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emails" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateScimUser) validateName(formats strfmt.Registry) error { + if swag.IsZero(m.Name) { // not required + return nil + } + + if m.Name != nil { + if err := m.Name.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("name") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update scim user based on the context it is used +func (m *UpdateScimUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEmails(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateName(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateScimUser) contextValidateEmails(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Emails); i++ { + + if m.Emails[i] != nil { + if err := m.Emails[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emails" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emails" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateScimUser) contextValidateName(ctx context.Context, formats strfmt.Registry) error { + + if m.Name != nil { + if err := m.Name.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("name") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateScimUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateScimUser) UnmarshalBinary(b []byte) error { + var res UpdateScimUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateScimUserEmailsItems0 update scim user emails items0 +// +// swagger:model UpdateScimUserEmailsItems0 +type UpdateScimUserEmailsItems0 struct { + + // Boolean which signifies if an email is intended as the primary email for the User + Primary bool `json:"primary,omitempty"` + + // String that represents an email address for the User + // Required: true + Value *string `json:"value"` +} + +// Validate validates this update scim user emails items0 +func (m *UpdateScimUserEmailsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateScimUserEmailsItems0) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update scim user emails items0 based on context it is used +func (m *UpdateScimUserEmailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateScimUserEmailsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateScimUserEmailsItems0) UnmarshalBinary(b []byte) error { + var res UpdateScimUserEmailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateScimUserName The components of the user's name +// +// swagger:model UpdateScimUserName +type UpdateScimUserName struct { + + // The given name of the User, or first name in most Western languages + // Required: true + FamilyName *string `json:"familyName"` + + // The family name of the User, or last name in most Western languages + // Required: true + GivenName *string `json:"givenName"` +} + +// Validate validates this update scim user name +func (m *UpdateScimUserName) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFamilyName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGivenName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateScimUserName) validateFamilyName(formats strfmt.Registry) error { + + if err := validate.Required("name"+"."+"familyName", "body", m.FamilyName); err != nil { + return err + } + + return nil +} + +func (m *UpdateScimUserName) validateGivenName(formats strfmt.Registry) error { + + if err := validate.Required("name"+"."+"givenName", "body", m.GivenName); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update scim user name based on context it is used +func (m *UpdateScimUserName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateScimUserName) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateScimUserName) UnmarshalBinary(b []byte) error { + var res UpdateScimUserName + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_service.go b/models/update_service.go new file mode 100644 index 0000000..8a7ae51 --- /dev/null +++ b/models/update_service.go @@ -0,0 +1,825 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateService Update a services attributes, you may also add or remove functionalities from the service as well. +// Note: You may not remove or add individual label key/value pairs. You must include the entire object to override label values. +// +// swagger:model update_service +type UpdateService struct { + + // alert on add + AlertOnAdd bool `json:"alert_on_add,omitempty"` + + // auto add responding team + AutoAddRespondingTeam bool `json:"auto_add_responding_team,omitempty"` + + // Array of checklist IDs to attach to the service + Checklists []*UpdateServiceChecklistsItems0 `json:"checklists"` + + // description + Description string `json:"description,omitempty"` + + // An array of external resources to attach to this service. + ExternalResources []*UpdateServiceExternalResourcesItems0 `json:"external_resources"` + + // An array of functionalities + Functionalities []*UpdateServiceFunctionalitiesItems0 `json:"functionalities"` + + // A hash of label keys and values + Labels map[string]string `json:"labels,omitempty"` + + // An array of links to associate with this service. This will remove all links not present in the patch. Only acts if 'links' key is included in the payload. + Links []*UpdateServiceLinksItems0 `json:"links"` + + // name + Name string `json:"name,omitempty"` + + // owner + Owner *UpdateServiceOwner `json:"owner,omitempty"` + + // If you are trying to remove a team as an owner from a service, set this to 'true' + RemoveOwner bool `json:"remove_owner,omitempty"` + + // If set to true, any checklists tagged on the service that are not included in the given array will be removed. Set this to true if you want to do a replacement operation for the checklists + RemoveRemainingChecklists bool `json:"remove_remaining_checklists,omitempty"` + + // If set to true, any external_resources tagged on the service that are not included in the given array will be removed. Set this to true if you want to do a replacement operation for the external_resources + RemoveRemainingExternalResources bool `json:"remove_remaining_external_resources,omitempty"` + + // If set to true, any functionalities tagged on the service that are not included in the given array will be removed. Set this to true if you want to do a replacement operation for the functionalities + RemoveRemainingFunctionalities bool `json:"remove_remaining_functionalities,omitempty"` + + // If set to true, any teams tagged on the service that are not included in the given array will be removed. Set this to true if you want to do a replacement operation for the teams + RemoveRemainingTeams bool `json:"remove_remaining_teams,omitempty"` + + // Integer representing service tier + // Enum: [0 1 2 3 4 5] + ServiceTier int32 `json:"service_tier,omitempty"` + + // An array of teams to attach to this service. + Teams []*UpdateServiceTeamsItems0 `json:"teams"` +} + +// Validate validates this update service +func (m *UpdateService) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChecklists(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExternalResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFunctionalities(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLinks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOwner(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceTier(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTeams(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateService) validateChecklists(formats strfmt.Registry) error { + if swag.IsZero(m.Checklists) { // not required + return nil + } + + for i := 0; i < len(m.Checklists); i++ { + if swag.IsZero(m.Checklists[i]) { // not required + continue + } + + if m.Checklists[i] != nil { + if err := m.Checklists[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("checklists" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("checklists" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateService) validateExternalResources(formats strfmt.Registry) error { + if swag.IsZero(m.ExternalResources) { // not required + return nil + } + + for i := 0; i < len(m.ExternalResources); i++ { + if swag.IsZero(m.ExternalResources[i]) { // not required + continue + } + + if m.ExternalResources[i] != nil { + if err := m.ExternalResources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateService) validateFunctionalities(formats strfmt.Registry) error { + if swag.IsZero(m.Functionalities) { // not required + return nil + } + + for i := 0; i < len(m.Functionalities); i++ { + if swag.IsZero(m.Functionalities[i]) { // not required + continue + } + + if m.Functionalities[i] != nil { + if err := m.Functionalities[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("functionalities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("functionalities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateService) validateLinks(formats strfmt.Registry) error { + if swag.IsZero(m.Links) { // not required + return nil + } + + for i := 0; i < len(m.Links); i++ { + if swag.IsZero(m.Links[i]) { // not required + continue + } + + if m.Links[i] != nil { + if err := m.Links[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateService) validateOwner(formats strfmt.Registry) error { + if swag.IsZero(m.Owner) { // not required + return nil + } + + if m.Owner != nil { + if err := m.Owner.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + +var updateServiceTypeServiceTierPropEnum []interface{} + +func init() { + var res []int32 + if err := json.Unmarshal([]byte(`[0,1,2,3,4,5]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateServiceTypeServiceTierPropEnum = append(updateServiceTypeServiceTierPropEnum, v) + } +} + +// prop value enum +func (m *UpdateService) validateServiceTierEnum(path, location string, value int32) error { + if err := validate.EnumCase(path, location, value, updateServiceTypeServiceTierPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateService) validateServiceTier(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceTier) { // not required + return nil + } + + // value enum + if err := m.validateServiceTierEnum("service_tier", "body", m.ServiceTier); err != nil { + return err + } + + return nil +} + +func (m *UpdateService) validateTeams(formats strfmt.Registry) error { + if swag.IsZero(m.Teams) { // not required + return nil + } + + for i := 0; i < len(m.Teams); i++ { + if swag.IsZero(m.Teams[i]) { // not required + continue + } + + if m.Teams[i] != nil { + if err := m.Teams[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("teams" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("teams" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update service based on the context it is used +func (m *UpdateService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateChecklists(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExternalResources(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFunctionalities(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOwner(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTeams(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateService) contextValidateChecklists(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Checklists); i++ { + + if m.Checklists[i] != nil { + if err := m.Checklists[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("checklists" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("checklists" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateService) contextValidateExternalResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ExternalResources); i++ { + + if m.ExternalResources[i] != nil { + if err := m.ExternalResources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("external_resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateService) contextValidateFunctionalities(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Functionalities); i++ { + + if m.Functionalities[i] != nil { + if err := m.Functionalities[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("functionalities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("functionalities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateService) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Links); i++ { + + if m.Links[i] != nil { + if err := m.Links[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("links" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateService) contextValidateOwner(ctx context.Context, formats strfmt.Registry) error { + + if m.Owner != nil { + if err := m.Owner.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("owner") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("owner") + } + return err + } + } + + return nil +} + +func (m *UpdateService) contextValidateTeams(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Teams); i++ { + + if m.Teams[i] != nil { + if err := m.Teams[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("teams" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("teams" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateService) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateService) UnmarshalBinary(b []byte) error { + var res UpdateService + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateServiceChecklistsItems0 update service checklists items0 +// +// swagger:model UpdateServiceChecklistsItems0 +type UpdateServiceChecklistsItems0 struct { + + // id + // Required: true + ID *string `json:"id"` + + // Set to `true` to remove checklist from service + Remove bool `json:"remove,omitempty"` +} + +// Validate validates this update service checklists items0 +func (m *UpdateServiceChecklistsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateServiceChecklistsItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update service checklists items0 based on context it is used +func (m *UpdateServiceChecklistsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateServiceChecklistsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateServiceChecklistsItems0) UnmarshalBinary(b []byte) error { + var res UpdateServiceChecklistsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateServiceExternalResourcesItems0 update service external resources items0 +// +// swagger:model UpdateServiceExternalResourcesItems0 +type UpdateServiceExternalResourcesItems0 struct { + + // The integration slug for the external resource. Can be one of: github, opsgenie, pager_duty, victorops. Not required if the resource has already been imported. + ConnectionType string `json:"connection_type,omitempty"` + + // remote id + // Required: true + RemoteID *string `json:"remote_id"` + + // If you are trying to remove an external resource from a service, set this to 'true'. + Remove bool `json:"remove,omitempty"` +} + +// Validate validates this update service external resources items0 +func (m *UpdateServiceExternalResourcesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRemoteID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateServiceExternalResourcesItems0) validateRemoteID(formats strfmt.Registry) error { + + if err := validate.Required("remote_id", "body", m.RemoteID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update service external resources items0 based on context it is used +func (m *UpdateServiceExternalResourcesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateServiceExternalResourcesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateServiceExternalResourcesItems0) UnmarshalBinary(b []byte) error { + var res UpdateServiceExternalResourcesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateServiceFunctionalitiesItems0 update service functionalities items0 +// +// swagger:model UpdateServiceFunctionalitiesItems0 +type UpdateServiceFunctionalitiesItems0 struct { + + // If you are trying to reuse a functionality, you may set the ID to attach it to the service + ID string `json:"id,omitempty"` + + // If you are trying to remove a functionality from a service, set this to 'true' + Remove bool `json:"remove,omitempty"` + + // If you are trying to create a new functionality and attach it to this service, set the summary key + Summary string `json:"summary,omitempty"` +} + +// Validate validates this update service functionalities items0 +func (m *UpdateServiceFunctionalitiesItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update service functionalities items0 based on context it is used +func (m *UpdateServiceFunctionalitiesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateServiceFunctionalitiesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateServiceFunctionalitiesItems0) UnmarshalBinary(b []byte) error { + var res UpdateServiceFunctionalitiesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateServiceLinksItems0 update service links items0 +// +// swagger:model UpdateServiceLinksItems0 +type UpdateServiceLinksItems0 struct { + + // URL + // Required: true + HrefURL *string `json:"href_url"` + + // An optional URL to an icon representing this link + IconURL string `json:"icon_url,omitempty"` + + // If updating an existing link, specify it's id. + ID string `json:"id,omitempty"` + + // Short name used to display and identify this link + // Required: true + Name *string `json:"name"` + + // If you are trying to remove a link, set this to 'true' + Remove bool `json:"remove,omitempty"` +} + +// Validate validates this update service links items0 +func (m *UpdateServiceLinksItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHrefURL(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateServiceLinksItems0) validateHrefURL(formats strfmt.Registry) error { + + if err := validate.Required("href_url", "body", m.HrefURL); err != nil { + return err + } + + return nil +} + +func (m *UpdateServiceLinksItems0) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update service links items0 based on context it is used +func (m *UpdateServiceLinksItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateServiceLinksItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateServiceLinksItems0) UnmarshalBinary(b []byte) error { + var res UpdateServiceLinksItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateServiceOwner An object representing a Team that owns the service +// +// swagger:model UpdateServiceOwner +type UpdateServiceOwner struct { + + // id + // Required: true + ID *string `json:"id"` +} + +// Validate validates this update service owner +func (m *UpdateServiceOwner) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateServiceOwner) validateID(formats strfmt.Registry) error { + + if err := validate.Required("owner"+"."+"id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update service owner based on context it is used +func (m *UpdateServiceOwner) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateServiceOwner) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateServiceOwner) UnmarshalBinary(b []byte) error { + var res UpdateServiceOwner + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateServiceTeamsItems0 update service teams items0 +// +// swagger:model UpdateServiceTeamsItems0 +type UpdateServiceTeamsItems0 struct { + + // id + // Required: true + ID *string `json:"id"` + + // If you are trying to remove a team from a service, set this to 'true' + Remove bool `json:"remove,omitempty"` +} + +// Validate validates this update service teams items0 +func (m *UpdateServiceTeamsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateServiceTeamsItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update service teams items0 based on context it is used +func (m *UpdateServiceTeamsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateServiceTeamsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateServiceTeamsItems0) UnmarshalBinary(b []byte) error { + var res UpdateServiceTeamsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_service_dependency.go b/models/update_service_dependency.go new file mode 100644 index 0000000..4d6cea5 --- /dev/null +++ b/models/update_service_dependency.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateServiceDependency Update the notes of the service dependency +// +// swagger:model update_service_dependency +type UpdateServiceDependency struct { + + // A note to describe the service dependency relationship + Notes string `json:"notes,omitempty"` +} + +// Validate validates this update service dependency +func (m *UpdateServiceDependency) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update service dependency based on context it is used +func (m *UpdateServiceDependency) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateServiceDependency) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateServiceDependency) UnmarshalBinary(b []byte) error { + var res UpdateServiceDependency + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_severity.go b/models/update_severity.go new file mode 100644 index 0000000..500ac75 --- /dev/null +++ b/models/update_severity.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateSeverity Update a specific severity +// +// swagger:model update_severity +type UpdateSeverity struct { + + // color + // Enum: [red orange yellow blue teal grey] + Color string `json:"color,omitempty"` + + // description + Description string `json:"description,omitempty"` + + // position + Position int32 `json:"position,omitempty"` + + // slug + Slug string `json:"slug,omitempty"` +} + +// Validate validates this update severity +func (m *UpdateSeverity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateColor(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var updateSeverityTypeColorPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["red","orange","yellow","blue","teal","grey"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateSeverityTypeColorPropEnum = append(updateSeverityTypeColorPropEnum, v) + } +} + +const ( + + // UpdateSeverityColorRed captures enum value "red" + UpdateSeverityColorRed string = "red" + + // UpdateSeverityColorOrange captures enum value "orange" + UpdateSeverityColorOrange string = "orange" + + // UpdateSeverityColorYellow captures enum value "yellow" + UpdateSeverityColorYellow string = "yellow" + + // UpdateSeverityColorBlue captures enum value "blue" + UpdateSeverityColorBlue string = "blue" + + // UpdateSeverityColorTeal captures enum value "teal" + UpdateSeverityColorTeal string = "teal" + + // UpdateSeverityColorGrey captures enum value "grey" + UpdateSeverityColorGrey string = "grey" +) + +// prop value enum +func (m *UpdateSeverity) validateColorEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateSeverityTypeColorPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateSeverity) validateColor(formats strfmt.Registry) error { + if swag.IsZero(m.Color) { // not required + return nil + } + + // value enum + if err := m.validateColorEnum("color", "body", m.Color); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update severity based on context it is used +func (m *UpdateSeverity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSeverity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSeverity) UnmarshalBinary(b []byte) error { + var res UpdateSeverity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_severity_matrix.go b/models/update_severity_matrix.go new file mode 100644 index 0000000..b50e28a --- /dev/null +++ b/models/update_severity_matrix.go @@ -0,0 +1,212 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateSeverityMatrix Update available severities and impacts in your organization's severity matrix. +// +// swagger:model update_severity_matrix +type UpdateSeverityMatrix struct { + + // data + // Required: true + Data []*UpdateSeverityMatrixDataItems0 `json:"data"` + + // summary + Summary string `json:"summary,omitempty"` +} + +// Validate validates this update severity matrix +func (m *UpdateSeverityMatrix) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateSeverityMatrix) validateData(formats strfmt.Registry) error { + + if err := validate.Required("data", "body", m.Data); err != nil { + return err + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update severity matrix based on the context it is used +func (m *UpdateSeverityMatrix) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateSeverityMatrix) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Data); i++ { + + if m.Data[i] != nil { + if err := m.Data[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSeverityMatrix) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSeverityMatrix) UnmarshalBinary(b []byte) error { + var res UpdateSeverityMatrix + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateSeverityMatrixDataItems0 update severity matrix data items0 +// +// swagger:model UpdateSeverityMatrixDataItems0 +type UpdateSeverityMatrixDataItems0 struct { + + // Condition id + // Required: true + ConditionID *string `json:"condition_id"` + + // Impact id + // Required: true + ImpactID *string `json:"impact_id"` + + // Slug of a severity + // Required: true + Severity *string `json:"severity"` +} + +// Validate validates this update severity matrix data items0 +func (m *UpdateSeverityMatrixDataItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConditionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImpactID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateSeverityMatrixDataItems0) validateConditionID(formats strfmt.Registry) error { + + if err := validate.Required("condition_id", "body", m.ConditionID); err != nil { + return err + } + + return nil +} + +func (m *UpdateSeverityMatrixDataItems0) validateImpactID(formats strfmt.Registry) error { + + if err := validate.Required("impact_id", "body", m.ImpactID); err != nil { + return err + } + + return nil +} + +func (m *UpdateSeverityMatrixDataItems0) validateSeverity(formats strfmt.Registry) error { + + if err := validate.Required("severity", "body", m.Severity); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update severity matrix data items0 based on context it is used +func (m *UpdateSeverityMatrixDataItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSeverityMatrixDataItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSeverityMatrixDataItems0) UnmarshalBinary(b []byte) error { + var res UpdateSeverityMatrixDataItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_severity_matrix_condition.go b/models/update_severity_matrix_condition.go new file mode 100644 index 0000000..3133a28 --- /dev/null +++ b/models/update_severity_matrix_condition.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateSeverityMatrixCondition Update a severity matrix condition +// +// swagger:model update_severity_matrix_condition +type UpdateSeverityMatrixCondition struct { + + // name + Name string `json:"name,omitempty"` + + // Position is used to determine ordering of conditions in API responses and dropdowns. The condition with the lowest position (typically 0) will be considered the Default Condition + Position int32 `json:"position,omitempty"` +} + +// Validate validates this update severity matrix condition +func (m *UpdateSeverityMatrixCondition) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update severity matrix condition based on context it is used +func (m *UpdateSeverityMatrixCondition) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSeverityMatrixCondition) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSeverityMatrixCondition) UnmarshalBinary(b []byte) error { + var res UpdateSeverityMatrixCondition + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_severity_matrix_impact.go b/models/update_severity_matrix_impact.go new file mode 100644 index 0000000..84c86ed --- /dev/null +++ b/models/update_severity_matrix_impact.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateSeverityMatrixImpact Update a severity matrix impact +// +// swagger:model update_severity_matrix_impact +type UpdateSeverityMatrixImpact struct { + + // name + Name string `json:"name,omitempty"` + + // position + Position int32 `json:"position,omitempty"` +} + +// Validate validates this update severity matrix impact +func (m *UpdateSeverityMatrixImpact) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update severity matrix impact based on context it is used +func (m *UpdateSeverityMatrixImpact) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSeverityMatrixImpact) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSeverityMatrixImpact) UnmarshalBinary(b []byte) error { + var res UpdateSeverityMatrixImpact + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_signals_email_target.go b/models/update_signals_email_target.go new file mode 100644 index 0000000..76a51d2 --- /dev/null +++ b/models/update_signals_email_target.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateSignalsEmailTarget Update a Signals email target by ID +// +// swagger:model update_signals_email_target +type UpdateSignalsEmailTarget struct { + + // A list of email addresses that are allowed to send events to the target. Must be exact match. + AllowedSenders []string `json:"allowed_senders"` + + // A detailed description of the email target. + Description string `json:"description,omitempty"` + + // The CEL expression that defines the level of an incoming email that is sent to the target. + LevelCel string `json:"level_cel,omitempty"` + + // The email target's name. + Name string `json:"name,omitempty"` + + // Whether or not all rules must match, or if only one rule must match. + // Enum: [all any] + RuleMatchingStrategy string `json:"rule_matching_strategy,omitempty"` + + // A list of CEL expressions that should be evaluated and matched to determine if the target should be notified. + Rules []string `json:"rules"` + + // The email address that will be listening to events. + Slug string `json:"slug,omitempty"` + + // The CEL expression that defines the status of an incoming email that is sent to the target. + StatusCel string `json:"status_cel,omitempty"` + + // target + Target *UpdateSignalsEmailTargetTarget `json:"target,omitempty"` +} + +// Validate validates this update signals email target +func (m *UpdateSignalsEmailTarget) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRuleMatchingStrategy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTarget(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var updateSignalsEmailTargetTypeRuleMatchingStrategyPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["all","any"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateSignalsEmailTargetTypeRuleMatchingStrategyPropEnum = append(updateSignalsEmailTargetTypeRuleMatchingStrategyPropEnum, v) + } +} + +const ( + + // UpdateSignalsEmailTargetRuleMatchingStrategyAll captures enum value "all" + UpdateSignalsEmailTargetRuleMatchingStrategyAll string = "all" + + // UpdateSignalsEmailTargetRuleMatchingStrategyAny captures enum value "any" + UpdateSignalsEmailTargetRuleMatchingStrategyAny string = "any" +) + +// prop value enum +func (m *UpdateSignalsEmailTarget) validateRuleMatchingStrategyEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateSignalsEmailTargetTypeRuleMatchingStrategyPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateSignalsEmailTarget) validateRuleMatchingStrategy(formats strfmt.Registry) error { + if swag.IsZero(m.RuleMatchingStrategy) { // not required + return nil + } + + // value enum + if err := m.validateRuleMatchingStrategyEnum("rule_matching_strategy", "body", m.RuleMatchingStrategy); err != nil { + return err + } + + return nil +} + +func (m *UpdateSignalsEmailTarget) validateTarget(formats strfmt.Registry) error { + if swag.IsZero(m.Target) { // not required + return nil + } + + if m.Target != nil { + if err := m.Target.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("target") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("target") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update signals email target based on the context it is used +func (m *UpdateSignalsEmailTarget) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTarget(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateSignalsEmailTarget) contextValidateTarget(ctx context.Context, formats strfmt.Registry) error { + + if m.Target != nil { + if err := m.Target.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("target") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("target") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSignalsEmailTarget) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSignalsEmailTarget) UnmarshalBinary(b []byte) error { + var res UpdateSignalsEmailTarget + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateSignalsEmailTargetTarget The target that the email target will notify. This object must contain a `type` +// field that specifies the type of target and an `id` field that specifies the ID of +// the target. The `type` field must be one of "escalation_policy", "on_call_schedule", +// "team", "user", or "slack_channel". +// +// swagger:model UpdateSignalsEmailTargetTarget +type UpdateSignalsEmailTargetTarget struct { + + // The ID of the target that the inbound email will notify when matched. + // Required: true + ID *string `json:"id"` + + // The type of target that the inbound email will notify when matched. + // Required: true + // Enum: [Team EntireTeam EscalationPolicy OnCallSchedule User SlackChannel Webhook] + Type *string `json:"type"` +} + +// Validate validates this update signals email target target +func (m *UpdateSignalsEmailTargetTarget) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateSignalsEmailTargetTarget) validateID(formats strfmt.Registry) error { + + if err := validate.Required("target"+"."+"id", "body", m.ID); err != nil { + return err + } + + return nil +} + +var updateSignalsEmailTargetTargetTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Team","EntireTeam","EscalationPolicy","OnCallSchedule","User","SlackChannel","Webhook"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateSignalsEmailTargetTargetTypeTypePropEnum = append(updateSignalsEmailTargetTargetTypeTypePropEnum, v) + } +} + +const ( + + // UpdateSignalsEmailTargetTargetTypeTeam captures enum value "Team" + UpdateSignalsEmailTargetTargetTypeTeam string = "Team" + + // UpdateSignalsEmailTargetTargetTypeEntireTeam captures enum value "EntireTeam" + UpdateSignalsEmailTargetTargetTypeEntireTeam string = "EntireTeam" + + // UpdateSignalsEmailTargetTargetTypeEscalationPolicy captures enum value "EscalationPolicy" + UpdateSignalsEmailTargetTargetTypeEscalationPolicy string = "EscalationPolicy" + + // UpdateSignalsEmailTargetTargetTypeOnCallSchedule captures enum value "OnCallSchedule" + UpdateSignalsEmailTargetTargetTypeOnCallSchedule string = "OnCallSchedule" + + // UpdateSignalsEmailTargetTargetTypeUser captures enum value "User" + UpdateSignalsEmailTargetTargetTypeUser string = "User" + + // UpdateSignalsEmailTargetTargetTypeSlackChannel captures enum value "SlackChannel" + UpdateSignalsEmailTargetTargetTypeSlackChannel string = "SlackChannel" + + // UpdateSignalsEmailTargetTargetTypeWebhook captures enum value "Webhook" + UpdateSignalsEmailTargetTargetTypeWebhook string = "Webhook" +) + +// prop value enum +func (m *UpdateSignalsEmailTargetTarget) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateSignalsEmailTargetTargetTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateSignalsEmailTargetTarget) validateType(formats strfmt.Registry) error { + + if err := validate.Required("target"+"."+"type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("target"+"."+"type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update signals email target target based on context it is used +func (m *UpdateSignalsEmailTargetTarget) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSignalsEmailTargetTarget) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSignalsEmailTargetTarget) UnmarshalBinary(b []byte) error { + var res UpdateSignalsEmailTargetTarget + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_signals_webhook_target.go b/models/update_signals_webhook_target.go new file mode 100644 index 0000000..45eb3b1 --- /dev/null +++ b/models/update_signals_webhook_target.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateSignalsWebhookTarget Update a Signals webhook target by ID +// +// swagger:model update_signals_webhook_target +type UpdateSignalsWebhookTarget struct { + + // An optional detailed description of the webhook target. + Description string `json:"description,omitempty"` + + // The webhook target's name. + Name string `json:"name,omitempty"` + + // An optional secret we will provide in the `FH-Signature` header + // when sending a payload to the webhook target. This key will not be + // shown in any response once configured. + // + SigningKey string `json:"signing_key,omitempty"` + + // The URL that the webhook target will notify. + URL string `json:"url,omitempty"` +} + +// Validate validates this update signals webhook target +func (m *UpdateSignalsWebhookTarget) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update signals webhook target based on context it is used +func (m *UpdateSignalsWebhookTarget) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSignalsWebhookTarget) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSignalsWebhookTarget) UnmarshalBinary(b []byte) error { + var res UpdateSignalsWebhookTarget + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_status_update_template.go b/models/update_status_update_template.go new file mode 100644 index 0000000..ee3edfa --- /dev/null +++ b/models/update_status_update_template.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateStatusUpdateTemplate Update a single status update template +// +// swagger:model update_status_update_template +type UpdateStatusUpdateTemplate struct { + + // body + Body string `json:"body,omitempty"` + + // name + Name string `json:"name,omitempty"` +} + +// Validate validates this update status update template +func (m *UpdateStatusUpdateTemplate) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update status update template based on context it is used +func (m *UpdateStatusUpdateTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateStatusUpdateTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateStatusUpdateTemplate) UnmarshalBinary(b []byte) error { + var res UpdateStatusUpdateTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_statuspage_connection.go b/models/update_statuspage_connection.go new file mode 100644 index 0000000..7a839c1 --- /dev/null +++ b/models/update_statuspage_connection.go @@ -0,0 +1,495 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateStatuspageConnection Update the given Statuspage integration connection. +// +// swagger:model update_statuspage_connection +type UpdateStatuspageConnection struct { + + // conditions + Conditions []*UpdateStatuspageConnectionConditionsItems0 `json:"conditions"` + + // milestone mappings + MilestoneMappings []*UpdateStatuspageConnectionMilestoneMappingsItems0 `json:"milestone_mappings"` + + // page id + PageID string `json:"page_id,omitempty"` + + // severities + Severities []*UpdateStatuspageConnectionSeveritiesItems0 `json:"severities"` +} + +// Validate validates this update statuspage connection +func (m *UpdateStatuspageConnection) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConditions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMilestoneMappings(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverities(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateStatuspageConnection) validateConditions(formats strfmt.Registry) error { + if swag.IsZero(m.Conditions) { // not required + return nil + } + + for i := 0; i < len(m.Conditions); i++ { + if swag.IsZero(m.Conditions[i]) { // not required + continue + } + + if m.Conditions[i] != nil { + if err := m.Conditions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateStatuspageConnection) validateMilestoneMappings(formats strfmt.Registry) error { + if swag.IsZero(m.MilestoneMappings) { // not required + return nil + } + + for i := 0; i < len(m.MilestoneMappings); i++ { + if swag.IsZero(m.MilestoneMappings[i]) { // not required + continue + } + + if m.MilestoneMappings[i] != nil { + if err := m.MilestoneMappings[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("milestone_mappings" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("milestone_mappings" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateStatuspageConnection) validateSeverities(formats strfmt.Registry) error { + if swag.IsZero(m.Severities) { // not required + return nil + } + + for i := 0; i < len(m.Severities); i++ { + if swag.IsZero(m.Severities[i]) { // not required + continue + } + + if m.Severities[i] != nil { + if err := m.Severities[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("severities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("severities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update statuspage connection based on the context it is used +func (m *UpdateStatuspageConnection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateConditions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMilestoneMappings(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSeverities(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateStatuspageConnection) contextValidateConditions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Conditions); i++ { + + if m.Conditions[i] != nil { + if err := m.Conditions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("conditions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("conditions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateStatuspageConnection) contextValidateMilestoneMappings(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MilestoneMappings); i++ { + + if m.MilestoneMappings[i] != nil { + if err := m.MilestoneMappings[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("milestone_mappings" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("milestone_mappings" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateStatuspageConnection) contextValidateSeverities(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Severities); i++ { + + if m.Severities[i] != nil { + if err := m.Severities[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("severities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("severities" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateStatuspageConnection) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateStatuspageConnection) UnmarshalBinary(b []byte) error { + var res UpdateStatuspageConnection + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateStatuspageConnectionConditionsItems0 update statuspage connection conditions items0 +// +// swagger:model UpdateStatuspageConnectionConditionsItems0 +type UpdateStatuspageConnectionConditionsItems0 struct { + + // FireHydrant condition id + // Required: true + ConditionID *string `json:"condition_id"` + + // Statuspage.io condition name + // Required: true + StatuspageioCondition *string `json:"statuspageio_condition"` +} + +// Validate validates this update statuspage connection conditions items0 +func (m *UpdateStatuspageConnectionConditionsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConditionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatuspageioCondition(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateStatuspageConnectionConditionsItems0) validateConditionID(formats strfmt.Registry) error { + + if err := validate.Required("condition_id", "body", m.ConditionID); err != nil { + return err + } + + return nil +} + +func (m *UpdateStatuspageConnectionConditionsItems0) validateStatuspageioCondition(formats strfmt.Registry) error { + + if err := validate.Required("statuspageio_condition", "body", m.StatuspageioCondition); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update statuspage connection conditions items0 based on context it is used +func (m *UpdateStatuspageConnectionConditionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateStatuspageConnectionConditionsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateStatuspageConnectionConditionsItems0) UnmarshalBinary(b []byte) error { + var res UpdateStatuspageConnectionConditionsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateStatuspageConnectionMilestoneMappingsItems0 update statuspage connection milestone mappings items0 +// +// swagger:model UpdateStatuspageConnectionMilestoneMappingsItems0 +type UpdateStatuspageConnectionMilestoneMappingsItems0 struct { + + // FireHydrant milestone id + // Required: true + MilestoneID *string `json:"milestone_id"` + + // Statuspage.io status + // Required: true + // Enum: [investigating identified monitoring resolved] + Status *string `json:"status"` +} + +// Validate validates this update statuspage connection milestone mappings items0 +func (m *UpdateStatuspageConnectionMilestoneMappingsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMilestoneID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateStatuspageConnectionMilestoneMappingsItems0) validateMilestoneID(formats strfmt.Registry) error { + + if err := validate.Required("milestone_id", "body", m.MilestoneID); err != nil { + return err + } + + return nil +} + +var updateStatuspageConnectionMilestoneMappingsItems0TypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["investigating","identified","monitoring","resolved"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateStatuspageConnectionMilestoneMappingsItems0TypeStatusPropEnum = append(updateStatuspageConnectionMilestoneMappingsItems0TypeStatusPropEnum, v) + } +} + +const ( + + // UpdateStatuspageConnectionMilestoneMappingsItems0StatusInvestigating captures enum value "investigating" + UpdateStatuspageConnectionMilestoneMappingsItems0StatusInvestigating string = "investigating" + + // UpdateStatuspageConnectionMilestoneMappingsItems0StatusIdentified captures enum value "identified" + UpdateStatuspageConnectionMilestoneMappingsItems0StatusIdentified string = "identified" + + // UpdateStatuspageConnectionMilestoneMappingsItems0StatusMonitoring captures enum value "monitoring" + UpdateStatuspageConnectionMilestoneMappingsItems0StatusMonitoring string = "monitoring" + + // UpdateStatuspageConnectionMilestoneMappingsItems0StatusResolved captures enum value "resolved" + UpdateStatuspageConnectionMilestoneMappingsItems0StatusResolved string = "resolved" +) + +// prop value enum +func (m *UpdateStatuspageConnectionMilestoneMappingsItems0) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateStatuspageConnectionMilestoneMappingsItems0TypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateStatuspageConnectionMilestoneMappingsItems0) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + // value enum + if err := m.validateStatusEnum("status", "body", *m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update statuspage connection milestone mappings items0 based on context it is used +func (m *UpdateStatuspageConnectionMilestoneMappingsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateStatuspageConnectionMilestoneMappingsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateStatuspageConnectionMilestoneMappingsItems0) UnmarshalBinary(b []byte) error { + var res UpdateStatuspageConnectionMilestoneMappingsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateStatuspageConnectionSeveritiesItems0 update statuspage connection severities items0 +// +// swagger:model UpdateStatuspageConnectionSeveritiesItems0 +type UpdateStatuspageConnectionSeveritiesItems0 struct { + + // Statuspage.io severity name + // Required: true + RemoteStatus *string `json:"remote_status"` + + // FireHydrant severity slug + // Required: true + SeveritySlug *string `json:"severity_slug"` +} + +// Validate validates this update statuspage connection severities items0 +func (m *UpdateStatuspageConnectionSeveritiesItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRemoteStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeveritySlug(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateStatuspageConnectionSeveritiesItems0) validateRemoteStatus(formats strfmt.Registry) error { + + if err := validate.Required("remote_status", "body", m.RemoteStatus); err != nil { + return err + } + + return nil +} + +func (m *UpdateStatuspageConnectionSeveritiesItems0) validateSeveritySlug(formats strfmt.Registry) error { + + if err := validate.Required("severity_slug", "body", m.SeveritySlug); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update statuspage connection severities items0 based on context it is used +func (m *UpdateStatuspageConnectionSeveritiesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateStatuspageConnectionSeveritiesItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateStatuspageConnectionSeveritiesItems0) UnmarshalBinary(b []byte) error { + var res UpdateStatuspageConnectionSeveritiesItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_task_list.go b/models/update_task_list.go new file mode 100644 index 0000000..1a4c9d1 --- /dev/null +++ b/models/update_task_list.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateTaskList Updates a task list's attributes and task list items +// +// swagger:model update_task_list +type UpdateTaskList struct { + + // description + Description string `json:"description,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // task list items + TaskListItems []*UpdateTaskListTaskListItemsItems0 `json:"task_list_items"` +} + +// Validate validates this update task list +func (m *UpdateTaskList) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTaskListItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTaskList) validateTaskListItems(formats strfmt.Registry) error { + if swag.IsZero(m.TaskListItems) { // not required + return nil + } + + for i := 0; i < len(m.TaskListItems); i++ { + if swag.IsZero(m.TaskListItems[i]) { // not required + continue + } + + if m.TaskListItems[i] != nil { + if err := m.TaskListItems[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("task_list_items" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("task_list_items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update task list based on the context it is used +func (m *UpdateTaskList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTaskListItems(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTaskList) contextValidateTaskListItems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TaskListItems); i++ { + + if m.TaskListItems[i] != nil { + if err := m.TaskListItems[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("task_list_items" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("task_list_items" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTaskList) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTaskList) UnmarshalBinary(b []byte) error { + var res UpdateTaskList + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTaskListTaskListItemsItems0 update task list task list items items0 +// +// swagger:model UpdateTaskListTaskListItemsItems0 +type UpdateTaskListTaskListItemsItems0 struct { + + // A long-form description for the task if additional context is helpful + Description string `json:"description,omitempty"` + + // A summary of the task + // Required: true + Summary *string `json:"summary"` +} + +// Validate validates this update task list task list items items0 +func (m *UpdateTaskListTaskListItemsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSummary(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTaskListTaskListItemsItems0) validateSummary(formats strfmt.Registry) error { + + if err := validate.Required("summary", "body", m.Summary); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update task list task list items items0 based on context it is used +func (m *UpdateTaskListTaskListItemsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTaskListTaskListItemsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTaskListTaskListItemsItems0) UnmarshalBinary(b []byte) error { + var res UpdateTaskListTaskListItemsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_team.go b/models/update_team.go new file mode 100644 index 0000000..c6f5b0b --- /dev/null +++ b/models/update_team.go @@ -0,0 +1,292 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateTeam Update a single team from its ID +// +// swagger:model update_team +type UpdateTeam struct { + + // description + Description string `json:"description,omitempty"` + + // memberships + Memberships []*UpdateTeamMembershipsItems0 `json:"memberships"` + + // ms teams channel + MsTeamsChannel *UpdateTeamMsTeamsChannel `json:"ms_teams_channel,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // The Slack channel ID associated with this team. This may be the reference in FireHydrant's system (i.e. UUID) or the ID value from Slack (e.g. C1234567890). + // + SlackChannelID string `json:"slack_channel_id,omitempty"` + + // slug + Slug string `json:"slug,omitempty"` +} + +// Validate validates this update team +func (m *UpdateTeam) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMemberships(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMsTeamsChannel(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeam) validateMemberships(formats strfmt.Registry) error { + if swag.IsZero(m.Memberships) { // not required + return nil + } + + for i := 0; i < len(m.Memberships); i++ { + if swag.IsZero(m.Memberships[i]) { // not required + continue + } + + if m.Memberships[i] != nil { + if err := m.Memberships[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("memberships" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("memberships" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateTeam) validateMsTeamsChannel(formats strfmt.Registry) error { + if swag.IsZero(m.MsTeamsChannel) { // not required + return nil + } + + if m.MsTeamsChannel != nil { + if err := m.MsTeamsChannel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ms_teams_channel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ms_teams_channel") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update team based on the context it is used +func (m *UpdateTeam) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMemberships(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMsTeamsChannel(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeam) contextValidateMemberships(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Memberships); i++ { + + if m.Memberships[i] != nil { + if err := m.Memberships[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("memberships" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("memberships" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateTeam) contextValidateMsTeamsChannel(ctx context.Context, formats strfmt.Registry) error { + + if m.MsTeamsChannel != nil { + if err := m.MsTeamsChannel.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ms_teams_channel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ms_teams_channel") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeam) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeam) UnmarshalBinary(b []byte) error { + var res UpdateTeam + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamMembershipsItems0 update team memberships items0 +// +// swagger:model UpdateTeamMembershipsItems0 +type UpdateTeamMembershipsItems0 struct { + + // An incident role ID that this user will automatically assigned if this team is assigned to an incident + IncidentRoleID string `json:"incident_role_id,omitempty"` + + // schedule id + ScheduleID string `json:"schedule_id,omitempty"` + + // user id + UserID string `json:"user_id,omitempty"` +} + +// Validate validates this update team memberships items0 +func (m *UpdateTeamMembershipsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update team memberships items0 based on context it is used +func (m *UpdateTeamMembershipsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamMembershipsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamMembershipsItems0) UnmarshalBinary(b []byte) error { + var res UpdateTeamMembershipsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamMsTeamsChannel MS Teams channel identity for channel associated with this team +// +// swagger:model UpdateTeamMsTeamsChannel +type UpdateTeamMsTeamsChannel struct { + + // channel id + // Required: true + ChannelID *string `json:"channel_id"` + + // ms team id + // Required: true + MsTeamID *string `json:"ms_team_id"` +} + +// Validate validates this update team ms teams channel +func (m *UpdateTeamMsTeamsChannel) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChannelID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMsTeamID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamMsTeamsChannel) validateChannelID(formats strfmt.Registry) error { + + if err := validate.Required("ms_teams_channel"+"."+"channel_id", "body", m.ChannelID); err != nil { + return err + } + + return nil +} + +func (m *UpdateTeamMsTeamsChannel) validateMsTeamID(formats strfmt.Registry) error { + + if err := validate.Required("ms_teams_channel"+"."+"ms_team_id", "body", m.MsTeamID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update team ms teams channel based on context it is used +func (m *UpdateTeamMsTeamsChannel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamMsTeamsChannel) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamMsTeamsChannel) UnmarshalBinary(b []byte) error { + var res UpdateTeamMsTeamsChannel + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_team_escalation_policy.go b/models/update_team_escalation_policy.go new file mode 100644 index 0000000..ced3dbd --- /dev/null +++ b/models/update_team_escalation_policy.go @@ -0,0 +1,1409 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateTeamEscalationPolicy Update a Signals escalation policy by ID +// +// swagger:model update_team_escalation_policy +type UpdateTeamEscalationPolicy struct { + + // Whether this escalation policy should be the default for the team. + Default *bool `json:"default,omitempty"` + + // A detailed description of the escalation policy. + Description string `json:"description,omitempty"` + + // handoff step + HandoffStep *UpdateTeamEscalationPolicyHandoffStep `json:"handoff_step,omitempty"` + + // The escalation policy's name. + Name string `json:"name,omitempty"` + + // prioritized settings + PrioritizedSettings *UpdateTeamEscalationPolicyPrioritizedSettings `json:"prioritized_settings,omitempty"` + + // The number of times that the escalation policy should repeat before an alert is dropped. + Repetitions int32 `json:"repetitions,omitempty"` + + // The strategy for handling steps in the escalation policy. Can be "static" or "dynamic_by_priority". + StepStrategy string `json:"step_strategy,omitempty"` + + // A list of steps that define how an alert should escalate through the policy. + Steps []*UpdateTeamEscalationPolicyStepsItems0 `json:"steps"` +} + +// Validate validates this update team escalation policy +func (m *UpdateTeamEscalationPolicy) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHandoffStep(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrioritizedSettings(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSteps(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicy) validateHandoffStep(formats strfmt.Registry) error { + if swag.IsZero(m.HandoffStep) { // not required + return nil + } + + if m.HandoffStep != nil { + if err := m.HandoffStep.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("handoff_step") + } + return err + } + } + + return nil +} + +func (m *UpdateTeamEscalationPolicy) validatePrioritizedSettings(formats strfmt.Registry) error { + if swag.IsZero(m.PrioritizedSettings) { // not required + return nil + } + + if m.PrioritizedSettings != nil { + if err := m.PrioritizedSettings.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings") + } + return err + } + } + + return nil +} + +func (m *UpdateTeamEscalationPolicy) validateSteps(formats strfmt.Registry) error { + if swag.IsZero(m.Steps) { // not required + return nil + } + + for i := 0; i < len(m.Steps); i++ { + if swag.IsZero(m.Steps[i]) { // not required + continue + } + + if m.Steps[i] != nil { + if err := m.Steps[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("steps" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("steps" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this update team escalation policy based on the context it is used +func (m *UpdateTeamEscalationPolicy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHandoffStep(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrioritizedSettings(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSteps(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicy) contextValidateHandoffStep(ctx context.Context, formats strfmt.Registry) error { + + if m.HandoffStep != nil { + if err := m.HandoffStep.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("handoff_step") + } + return err + } + } + + return nil +} + +func (m *UpdateTeamEscalationPolicy) contextValidatePrioritizedSettings(ctx context.Context, formats strfmt.Registry) error { + + if m.PrioritizedSettings != nil { + if err := m.PrioritizedSettings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings") + } + return err + } + } + + return nil +} + +func (m *UpdateTeamEscalationPolicy) contextValidateSteps(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Steps); i++ { + + if m.Steps[i] != nil { + if err := m.Steps[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("steps" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("steps" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicy) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicy) UnmarshalBinary(b []byte) error { + var res UpdateTeamEscalationPolicy + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamEscalationPolicyHandoffStep A step that defines where an alert should be sent when the policy is exhausted and the alert is still unacknowledged. +// +// swagger:model UpdateTeamEscalationPolicyHandoffStep +type UpdateTeamEscalationPolicyHandoffStep struct { + + // The ID of the target to which the policy will hand off. + // Required: true + TargetID *string `json:"target_id"` + + // The type of target to which the policy will hand off. + // Required: true + // Enum: [EscalationPolicy Team] + TargetType *string `json:"target_type"` +} + +// Validate validates this update team escalation policy handoff step +func (m *UpdateTeamEscalationPolicyHandoffStep) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTargetID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicyHandoffStep) validateTargetID(formats strfmt.Registry) error { + + if err := validate.Required("handoff_step"+"."+"target_id", "body", m.TargetID); err != nil { + return err + } + + return nil +} + +var updateTeamEscalationPolicyHandoffStepTypeTargetTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["EscalationPolicy","Team"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateTeamEscalationPolicyHandoffStepTypeTargetTypePropEnum = append(updateTeamEscalationPolicyHandoffStepTypeTargetTypePropEnum, v) + } +} + +const ( + + // UpdateTeamEscalationPolicyHandoffStepTargetTypeEscalationPolicy captures enum value "EscalationPolicy" + UpdateTeamEscalationPolicyHandoffStepTargetTypeEscalationPolicy string = "EscalationPolicy" + + // UpdateTeamEscalationPolicyHandoffStepTargetTypeTeam captures enum value "Team" + UpdateTeamEscalationPolicyHandoffStepTargetTypeTeam string = "Team" +) + +// prop value enum +func (m *UpdateTeamEscalationPolicyHandoffStep) validateTargetTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateTeamEscalationPolicyHandoffStepTypeTargetTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateTeamEscalationPolicyHandoffStep) validateTargetType(formats strfmt.Registry) error { + + if err := validate.Required("handoff_step"+"."+"target_type", "body", m.TargetType); err != nil { + return err + } + + // value enum + if err := m.validateTargetTypeEnum("handoff_step"+"."+"target_type", "body", *m.TargetType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update team escalation policy handoff step based on context it is used +func (m *UpdateTeamEscalationPolicyHandoffStep) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyHandoffStep) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyHandoffStep) UnmarshalBinary(b []byte) error { + var res UpdateTeamEscalationPolicyHandoffStep + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamEscalationPolicyPrioritizedSettings Priority-specific settings for dynamic escalation policies +// +// swagger:model UpdateTeamEscalationPolicyPrioritizedSettings +type UpdateTeamEscalationPolicyPrioritizedSettings struct { + + // high + High *UpdateTeamEscalationPolicyPrioritizedSettingsHigh `json:"high,omitempty"` + + // low + Low *UpdateTeamEscalationPolicyPrioritizedSettingsLow `json:"low,omitempty"` + + // medium + Medium *UpdateTeamEscalationPolicyPrioritizedSettingsMedium `json:"medium,omitempty"` +} + +// Validate validates this update team escalation policy prioritized settings +func (m *UpdateTeamEscalationPolicyPrioritizedSettings) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHigh(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLow(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMedium(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettings) validateHigh(formats strfmt.Registry) error { + if swag.IsZero(m.High) { // not required + return nil + } + + if m.High != nil { + if err := m.High.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "high") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "high") + } + return err + } + } + + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettings) validateLow(formats strfmt.Registry) error { + if swag.IsZero(m.Low) { // not required + return nil + } + + if m.Low != nil { + if err := m.Low.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "low") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "low") + } + return err + } + } + + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettings) validateMedium(formats strfmt.Registry) error { + if swag.IsZero(m.Medium) { // not required + return nil + } + + if m.Medium != nil { + if err := m.Medium.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "medium") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "medium") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update team escalation policy prioritized settings based on the context it is used +func (m *UpdateTeamEscalationPolicyPrioritizedSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHigh(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLow(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMedium(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettings) contextValidateHigh(ctx context.Context, formats strfmt.Registry) error { + + if m.High != nil { + if err := m.High.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "high") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "high") + } + return err + } + } + + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettings) contextValidateLow(ctx context.Context, formats strfmt.Registry) error { + + if m.Low != nil { + if err := m.Low.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "low") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "low") + } + return err + } + } + + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettings) contextValidateMedium(ctx context.Context, formats strfmt.Registry) error { + + if m.Medium != nil { + if err := m.Medium.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "medium") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "medium") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyPrioritizedSettings) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyPrioritizedSettings) UnmarshalBinary(b []byte) error { + var res UpdateTeamEscalationPolicyPrioritizedSettings + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamEscalationPolicyPrioritizedSettingsHigh Settings for HIGH priority alerts +// +// swagger:model UpdateTeamEscalationPolicyPrioritizedSettingsHigh +type UpdateTeamEscalationPolicyPrioritizedSettingsHigh struct { + + // handoff step + HandoffStep *UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep `json:"handoff_step,omitempty"` + + // Number of repetitions for HIGH priority alerts + Repetitions int32 `json:"repetitions,omitempty"` +} + +// Validate validates this update team escalation policy prioritized settings high +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsHigh) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHandoffStep(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsHigh) validateHandoffStep(formats strfmt.Registry) error { + if swag.IsZero(m.HandoffStep) { // not required + return nil + } + + if m.HandoffStep != nil { + if err := m.HandoffStep.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "high" + "." + "handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "high" + "." + "handoff_step") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update team escalation policy prioritized settings high based on the context it is used +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsHigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHandoffStep(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsHigh) contextValidateHandoffStep(ctx context.Context, formats strfmt.Registry) error { + + if m.HandoffStep != nil { + if err := m.HandoffStep.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "high" + "." + "handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "high" + "." + "handoff_step") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsHigh) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsHigh) UnmarshalBinary(b []byte) error { + var res UpdateTeamEscalationPolicyPrioritizedSettingsHigh + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep Handoff step for HIGH priority alerts +// +// swagger:model UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep +type UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep struct { + + // target id + // Required: true + TargetID *string `json:"target_id"` + + // target type + // Required: true + // Enum: [EscalationPolicy Team] + TargetType *string `json:"target_type"` +} + +// Validate validates this update team escalation policy prioritized settings high handoff step +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTargetID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep) validateTargetID(formats strfmt.Registry) error { + + if err := validate.Required("prioritized_settings"+"."+"high"+"."+"handoff_step"+"."+"target_id", "body", m.TargetID); err != nil { + return err + } + + return nil +} + +var updateTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTypeTargetTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["EscalationPolicy","Team"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTypeTargetTypePropEnum = append(updateTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTypeTargetTypePropEnum, v) + } +} + +const ( + + // UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTargetTypeEscalationPolicy captures enum value "EscalationPolicy" + UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTargetTypeEscalationPolicy string = "EscalationPolicy" + + // UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTargetTypeTeam captures enum value "Team" + UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTargetTypeTeam string = "Team" +) + +// prop value enum +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep) validateTargetTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateTeamEscalationPolicyPrioritizedSettingsHighHandoffStepTypeTargetTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep) validateTargetType(formats strfmt.Registry) error { + + if err := validate.Required("prioritized_settings"+"."+"high"+"."+"handoff_step"+"."+"target_type", "body", m.TargetType); err != nil { + return err + } + + // value enum + if err := m.validateTargetTypeEnum("prioritized_settings"+"."+"high"+"."+"handoff_step"+"."+"target_type", "body", *m.TargetType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update team escalation policy prioritized settings high handoff step based on context it is used +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep) UnmarshalBinary(b []byte) error { + var res UpdateTeamEscalationPolicyPrioritizedSettingsHighHandoffStep + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamEscalationPolicyPrioritizedSettingsLow Settings for LOW priority alerts +// +// swagger:model UpdateTeamEscalationPolicyPrioritizedSettingsLow +type UpdateTeamEscalationPolicyPrioritizedSettingsLow struct { + + // handoff step + HandoffStep *UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep `json:"handoff_step,omitempty"` + + // Number of repetitions for LOW priority alerts + Repetitions int32 `json:"repetitions,omitempty"` +} + +// Validate validates this update team escalation policy prioritized settings low +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsLow) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHandoffStep(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsLow) validateHandoffStep(formats strfmt.Registry) error { + if swag.IsZero(m.HandoffStep) { // not required + return nil + } + + if m.HandoffStep != nil { + if err := m.HandoffStep.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "low" + "." + "handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "low" + "." + "handoff_step") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update team escalation policy prioritized settings low based on the context it is used +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsLow) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHandoffStep(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsLow) contextValidateHandoffStep(ctx context.Context, formats strfmt.Registry) error { + + if m.HandoffStep != nil { + if err := m.HandoffStep.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "low" + "." + "handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "low" + "." + "handoff_step") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsLow) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsLow) UnmarshalBinary(b []byte) error { + var res UpdateTeamEscalationPolicyPrioritizedSettingsLow + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep Handoff step for LOW priority alerts +// +// swagger:model UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep +type UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep struct { + + // target id + // Required: true + TargetID *string `json:"target_id"` + + // target type + // Required: true + // Enum: [EscalationPolicy Team] + TargetType *string `json:"target_type"` +} + +// Validate validates this update team escalation policy prioritized settings low handoff step +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTargetID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep) validateTargetID(formats strfmt.Registry) error { + + if err := validate.Required("prioritized_settings"+"."+"low"+"."+"handoff_step"+"."+"target_id", "body", m.TargetID); err != nil { + return err + } + + return nil +} + +var updateTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTypeTargetTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["EscalationPolicy","Team"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTypeTargetTypePropEnum = append(updateTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTypeTargetTypePropEnum, v) + } +} + +const ( + + // UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTargetTypeEscalationPolicy captures enum value "EscalationPolicy" + UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTargetTypeEscalationPolicy string = "EscalationPolicy" + + // UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTargetTypeTeam captures enum value "Team" + UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTargetTypeTeam string = "Team" +) + +// prop value enum +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep) validateTargetTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateTeamEscalationPolicyPrioritizedSettingsLowHandoffStepTypeTargetTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep) validateTargetType(formats strfmt.Registry) error { + + if err := validate.Required("prioritized_settings"+"."+"low"+"."+"handoff_step"+"."+"target_type", "body", m.TargetType); err != nil { + return err + } + + // value enum + if err := m.validateTargetTypeEnum("prioritized_settings"+"."+"low"+"."+"handoff_step"+"."+"target_type", "body", *m.TargetType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update team escalation policy prioritized settings low handoff step based on context it is used +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep) UnmarshalBinary(b []byte) error { + var res UpdateTeamEscalationPolicyPrioritizedSettingsLowHandoffStep + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamEscalationPolicyPrioritizedSettingsMedium Settings for MEDIUM priority alerts +// +// swagger:model UpdateTeamEscalationPolicyPrioritizedSettingsMedium +type UpdateTeamEscalationPolicyPrioritizedSettingsMedium struct { + + // handoff step + HandoffStep *UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep `json:"handoff_step,omitempty"` + + // Number of repetitions for MEDIUM priority alerts + Repetitions int32 `json:"repetitions,omitempty"` +} + +// Validate validates this update team escalation policy prioritized settings medium +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsMedium) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHandoffStep(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsMedium) validateHandoffStep(formats strfmt.Registry) error { + if swag.IsZero(m.HandoffStep) { // not required + return nil + } + + if m.HandoffStep != nil { + if err := m.HandoffStep.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "medium" + "." + "handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "medium" + "." + "handoff_step") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update team escalation policy prioritized settings medium based on the context it is used +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsMedium) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHandoffStep(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsMedium) contextValidateHandoffStep(ctx context.Context, formats strfmt.Registry) error { + + if m.HandoffStep != nil { + if err := m.HandoffStep.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("prioritized_settings" + "." + "medium" + "." + "handoff_step") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("prioritized_settings" + "." + "medium" + "." + "handoff_step") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsMedium) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsMedium) UnmarshalBinary(b []byte) error { + var res UpdateTeamEscalationPolicyPrioritizedSettingsMedium + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep Handoff step for MEDIUM priority alerts +// +// swagger:model UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep +type UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep struct { + + // target id + // Required: true + TargetID *string `json:"target_id"` + + // target type + // Required: true + // Enum: [EscalationPolicy Team] + TargetType *string `json:"target_type"` +} + +// Validate validates this update team escalation policy prioritized settings medium handoff step +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTargetID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep) validateTargetID(formats strfmt.Registry) error { + + if err := validate.Required("prioritized_settings"+"."+"medium"+"."+"handoff_step"+"."+"target_id", "body", m.TargetID); err != nil { + return err + } + + return nil +} + +var updateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTypeTargetTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["EscalationPolicy","Team"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTypeTargetTypePropEnum = append(updateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTypeTargetTypePropEnum, v) + } +} + +const ( + + // UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTargetTypeEscalationPolicy captures enum value "EscalationPolicy" + UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTargetTypeEscalationPolicy string = "EscalationPolicy" + + // UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTargetTypeTeam captures enum value "Team" + UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTargetTypeTeam string = "Team" +) + +// prop value enum +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep) validateTargetTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStepTypeTargetTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep) validateTargetType(formats strfmt.Registry) error { + + if err := validate.Required("prioritized_settings"+"."+"medium"+"."+"handoff_step"+"."+"target_type", "body", m.TargetType); err != nil { + return err + } + + // value enum + if err := m.validateTargetTypeEnum("prioritized_settings"+"."+"medium"+"."+"handoff_step"+"."+"target_type", "body", *m.TargetType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update team escalation policy prioritized settings medium handoff step based on context it is used +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep) UnmarshalBinary(b []byte) error { + var res UpdateTeamEscalationPolicyPrioritizedSettingsMediumHandoffStep + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamEscalationPolicyStepsItems0 update team escalation policy steps items0 +// +// swagger:model UpdateTeamEscalationPolicyStepsItems0 +type UpdateTeamEscalationPolicyStepsItems0 struct { + + // The round robin configuration for the step. One of 'unspecified', 'round_robin_by_alert', or 'round_robin_by_escalation_policy'. + // Enum: [unspecified round_robin_by_alert round_robin_by_escalation_policy] + DistributionType string `json:"distribution_type,omitempty"` + + // A list of priorities (HIGH, MEDIUM, LOW) to which the step applies when using a dynamic escalation policy. + Priorities []string `json:"priorities"` + + // A list of targets that the step will notify. You can specify up to 15 targets per step. + Targets []*UpdateTeamEscalationPolicyStepsItems0TargetsItems0 `json:"targets"` + + // An ISO8601 duration string specifying how long to wait before moving on to the next step. For the last step, this value specifies how long to wait before the escalation policy should repeat, if it repeats. + // Required: true + Timeout *string `json:"timeout"` +} + +// Validate validates this update team escalation policy steps items0 +func (m *UpdateTeamEscalationPolicyStepsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDistributionType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeout(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var updateTeamEscalationPolicyStepsItems0TypeDistributionTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["unspecified","round_robin_by_alert","round_robin_by_escalation_policy"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateTeamEscalationPolicyStepsItems0TypeDistributionTypePropEnum = append(updateTeamEscalationPolicyStepsItems0TypeDistributionTypePropEnum, v) + } +} + +const ( + + // UpdateTeamEscalationPolicyStepsItems0DistributionTypeUnspecified captures enum value "unspecified" + UpdateTeamEscalationPolicyStepsItems0DistributionTypeUnspecified string = "unspecified" + + // UpdateTeamEscalationPolicyStepsItems0DistributionTypeRoundRobinByAlert captures enum value "round_robin_by_alert" + UpdateTeamEscalationPolicyStepsItems0DistributionTypeRoundRobinByAlert string = "round_robin_by_alert" + + // UpdateTeamEscalationPolicyStepsItems0DistributionTypeRoundRobinByEscalationPolicy captures enum value "round_robin_by_escalation_policy" + UpdateTeamEscalationPolicyStepsItems0DistributionTypeRoundRobinByEscalationPolicy string = "round_robin_by_escalation_policy" +) + +// prop value enum +func (m *UpdateTeamEscalationPolicyStepsItems0) validateDistributionTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateTeamEscalationPolicyStepsItems0TypeDistributionTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateTeamEscalationPolicyStepsItems0) validateDistributionType(formats strfmt.Registry) error { + if swag.IsZero(m.DistributionType) { // not required + return nil + } + + // value enum + if err := m.validateDistributionTypeEnum("distribution_type", "body", m.DistributionType); err != nil { + return err + } + + return nil +} + +func (m *UpdateTeamEscalationPolicyStepsItems0) validateTargets(formats strfmt.Registry) error { + if swag.IsZero(m.Targets) { // not required + return nil + } + + for i := 0; i < len(m.Targets); i++ { + if swag.IsZero(m.Targets[i]) { // not required + continue + } + + if m.Targets[i] != nil { + if err := m.Targets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("targets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("targets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateTeamEscalationPolicyStepsItems0) validateTimeout(formats strfmt.Registry) error { + + if err := validate.Required("timeout", "body", m.Timeout); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update team escalation policy steps items0 based on the context it is used +func (m *UpdateTeamEscalationPolicyStepsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTargets(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicyStepsItems0) contextValidateTargets(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Targets); i++ { + + if m.Targets[i] != nil { + if err := m.Targets[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("targets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("targets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyStepsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyStepsItems0) UnmarshalBinary(b []byte) error { + var res UpdateTeamEscalationPolicyStepsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamEscalationPolicyStepsItems0TargetsItems0 update team escalation policy steps items0 targets items0 +// +// swagger:model UpdateTeamEscalationPolicyStepsItems0TargetsItems0 +type UpdateTeamEscalationPolicyStepsItems0TargetsItems0 struct { + + // The ID of the target that the step will notify. + // Required: true + ID *string `json:"id"` + + // The type of target that the step will notify. + // Required: true + // Enum: [OnCallSchedule User SlackChannel EntireTeam Webhook] + Type *string `json:"type"` +} + +// Validate validates this update team escalation policy steps items0 targets items0 +func (m *UpdateTeamEscalationPolicyStepsItems0TargetsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamEscalationPolicyStepsItems0TargetsItems0) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +var updateTeamEscalationPolicyStepsItems0TargetsItems0TypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["OnCallSchedule","User","SlackChannel","EntireTeam","Webhook"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateTeamEscalationPolicyStepsItems0TargetsItems0TypeTypePropEnum = append(updateTeamEscalationPolicyStepsItems0TargetsItems0TypeTypePropEnum, v) + } +} + +const ( + + // UpdateTeamEscalationPolicyStepsItems0TargetsItems0TypeOnCallSchedule captures enum value "OnCallSchedule" + UpdateTeamEscalationPolicyStepsItems0TargetsItems0TypeOnCallSchedule string = "OnCallSchedule" + + // UpdateTeamEscalationPolicyStepsItems0TargetsItems0TypeUser captures enum value "User" + UpdateTeamEscalationPolicyStepsItems0TargetsItems0TypeUser string = "User" + + // UpdateTeamEscalationPolicyStepsItems0TargetsItems0TypeSlackChannel captures enum value "SlackChannel" + UpdateTeamEscalationPolicyStepsItems0TargetsItems0TypeSlackChannel string = "SlackChannel" + + // UpdateTeamEscalationPolicyStepsItems0TargetsItems0TypeEntireTeam captures enum value "EntireTeam" + UpdateTeamEscalationPolicyStepsItems0TargetsItems0TypeEntireTeam string = "EntireTeam" + + // UpdateTeamEscalationPolicyStepsItems0TargetsItems0TypeWebhook captures enum value "Webhook" + UpdateTeamEscalationPolicyStepsItems0TargetsItems0TypeWebhook string = "Webhook" +) + +// prop value enum +func (m *UpdateTeamEscalationPolicyStepsItems0TargetsItems0) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateTeamEscalationPolicyStepsItems0TargetsItems0TypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateTeamEscalationPolicyStepsItems0TargetsItems0) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update team escalation policy steps items0 targets items0 based on context it is used +func (m *UpdateTeamEscalationPolicyStepsItems0TargetsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyStepsItems0TargetsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamEscalationPolicyStepsItems0TargetsItems0) UnmarshalBinary(b []byte) error { + var res UpdateTeamEscalationPolicyStepsItems0TargetsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_team_on_call_schedule.go b/models/update_team_on_call_schedule.go new file mode 100644 index 0000000..74f91f3 --- /dev/null +++ b/models/update_team_on_call_schedule.go @@ -0,0 +1,657 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateTeamOnCallSchedule Update a Signals on-call schedule by ID +// +// swagger:model update_team_on_call_schedule +type UpdateTeamOnCallSchedule struct { + + // A hex color code that will be used to represent the schedule in the UI and iCal subscriptions. + Color string `json:"color,omitempty"` + + // A detailed description of the on-call schedule. + Description string `json:"description,omitempty"` + + // An ISO8601 time string specifying when the updated schedule should take effect. This + // value must be provided if editing an attribute that would affect how the schedule's + // shifts are generated, such as the time zone, members, strategy, or restrictions. + // + EffectiveAt string `json:"effective_at,omitempty"` + + // This parameter is deprecated; use `members` instead. + MemberIds []string `json:"member_ids"` + + // An ordered list of objects that specify members of the on-call schedule's rotation. + Members []*UpdateTeamOnCallScheduleMembersItems0 `json:"members"` + + // The on-call schedule's name. + Name string `json:"name,omitempty"` + + // A list of objects that restrict the schedule to speccific on-call periods. + Restrictions []*UpdateTeamOnCallScheduleRestrictionsItems0 `json:"restrictions"` + + // The ID of a Slack user group for syncing purposes. If provided, we will automatically sync whoever is on call to the user group in Slack. + SlackUserGroupID string `json:"slack_user_group_id,omitempty"` + + // strategy + Strategy *UpdateTeamOnCallScheduleStrategy `json:"strategy,omitempty"` + + // The time zone in which the on-call schedule operates. This value must be a valid IANA time zone name. + TimeZone string `json:"time_zone,omitempty"` +} + +// Validate validates this update team on call schedule +func (m *UpdateTeamOnCallSchedule) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMembers(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRestrictions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStrategy(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamOnCallSchedule) validateMembers(formats strfmt.Registry) error { + if swag.IsZero(m.Members) { // not required + return nil + } + + for i := 0; i < len(m.Members); i++ { + if swag.IsZero(m.Members[i]) { // not required + continue + } + + if m.Members[i] != nil { + if err := m.Members[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("members" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("members" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateTeamOnCallSchedule) validateRestrictions(formats strfmt.Registry) error { + if swag.IsZero(m.Restrictions) { // not required + return nil + } + + for i := 0; i < len(m.Restrictions); i++ { + if swag.IsZero(m.Restrictions[i]) { // not required + continue + } + + if m.Restrictions[i] != nil { + if err := m.Restrictions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("restrictions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("restrictions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateTeamOnCallSchedule) validateStrategy(formats strfmt.Registry) error { + if swag.IsZero(m.Strategy) { // not required + return nil + } + + if m.Strategy != nil { + if err := m.Strategy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("strategy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("strategy") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update team on call schedule based on the context it is used +func (m *UpdateTeamOnCallSchedule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMembers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRestrictions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStrategy(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateTeamOnCallSchedule) contextValidateMembers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Members); i++ { + + if m.Members[i] != nil { + if err := m.Members[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("members" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("members" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateTeamOnCallSchedule) contextValidateRestrictions(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Restrictions); i++ { + + if m.Restrictions[i] != nil { + if err := m.Restrictions[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("restrictions" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("restrictions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateTeamOnCallSchedule) contextValidateStrategy(ctx context.Context, formats strfmt.Registry) error { + + if m.Strategy != nil { + if err := m.Strategy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("strategy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("strategy") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamOnCallSchedule) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamOnCallSchedule) UnmarshalBinary(b []byte) error { + var res UpdateTeamOnCallSchedule + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamOnCallScheduleMembersItems0 update team on call schedule members items0 +// +// swagger:model UpdateTeamOnCallScheduleMembersItems0 +type UpdateTeamOnCallScheduleMembersItems0 struct { + + // The ID of a user who should be added to the schedule's rotation. You can add a user to the schedule + // multiple times to construct more complex rotations, and you can specify a `null` user ID to create + // unassigned slots in the rotation. + // + UserID string `json:"user_id,omitempty"` +} + +// Validate validates this update team on call schedule members items0 +func (m *UpdateTeamOnCallScheduleMembersItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update team on call schedule members items0 based on context it is used +func (m *UpdateTeamOnCallScheduleMembersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamOnCallScheduleMembersItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamOnCallScheduleMembersItems0) UnmarshalBinary(b []byte) error { + var res UpdateTeamOnCallScheduleMembersItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamOnCallScheduleRestrictionsItems0 update team on call schedule restrictions items0 +// +// swagger:model UpdateTeamOnCallScheduleRestrictionsItems0 +type UpdateTeamOnCallScheduleRestrictionsItems0 struct { + + // The day of the week on which the restriction should end, as its long-form name (e.g. "monday", "tuesday", etc). + // Required: true + // Enum: [monday tuesday wednesday thursday friday saturday sunday] + EndDay *string `json:"end_day"` + + // An ISO8601 time string specifying when the restriction should end. + // Required: true + EndTime *string `json:"end_time"` + + // The day of the week on which the restriction should start, as its long-form name (e.g. "monday", "tuesday", etc). + // Required: true + // Enum: [monday tuesday wednesday thursday friday saturday sunday] + StartDay *string `json:"start_day"` + + // An ISO8601 time string specifying when the restriction should start. + // Required: true + StartTime *string `json:"start_time"` +} + +// Validate validates this update team on call schedule restrictions items0 +func (m *UpdateTeamOnCallScheduleRestrictionsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEndDay(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEndTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartDay(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartTime(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var updateTeamOnCallScheduleRestrictionsItems0TypeEndDayPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateTeamOnCallScheduleRestrictionsItems0TypeEndDayPropEnum = append(updateTeamOnCallScheduleRestrictionsItems0TypeEndDayPropEnum, v) + } +} + +const ( + + // UpdateTeamOnCallScheduleRestrictionsItems0EndDayMonday captures enum value "monday" + UpdateTeamOnCallScheduleRestrictionsItems0EndDayMonday string = "monday" + + // UpdateTeamOnCallScheduleRestrictionsItems0EndDayTuesday captures enum value "tuesday" + UpdateTeamOnCallScheduleRestrictionsItems0EndDayTuesday string = "tuesday" + + // UpdateTeamOnCallScheduleRestrictionsItems0EndDayWednesday captures enum value "wednesday" + UpdateTeamOnCallScheduleRestrictionsItems0EndDayWednesday string = "wednesday" + + // UpdateTeamOnCallScheduleRestrictionsItems0EndDayThursday captures enum value "thursday" + UpdateTeamOnCallScheduleRestrictionsItems0EndDayThursday string = "thursday" + + // UpdateTeamOnCallScheduleRestrictionsItems0EndDayFriday captures enum value "friday" + UpdateTeamOnCallScheduleRestrictionsItems0EndDayFriday string = "friday" + + // UpdateTeamOnCallScheduleRestrictionsItems0EndDaySaturday captures enum value "saturday" + UpdateTeamOnCallScheduleRestrictionsItems0EndDaySaturday string = "saturday" + + // UpdateTeamOnCallScheduleRestrictionsItems0EndDaySunday captures enum value "sunday" + UpdateTeamOnCallScheduleRestrictionsItems0EndDaySunday string = "sunday" +) + +// prop value enum +func (m *UpdateTeamOnCallScheduleRestrictionsItems0) validateEndDayEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateTeamOnCallScheduleRestrictionsItems0TypeEndDayPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateTeamOnCallScheduleRestrictionsItems0) validateEndDay(formats strfmt.Registry) error { + + if err := validate.Required("end_day", "body", m.EndDay); err != nil { + return err + } + + // value enum + if err := m.validateEndDayEnum("end_day", "body", *m.EndDay); err != nil { + return err + } + + return nil +} + +func (m *UpdateTeamOnCallScheduleRestrictionsItems0) validateEndTime(formats strfmt.Registry) error { + + if err := validate.Required("end_time", "body", m.EndTime); err != nil { + return err + } + + return nil +} + +var updateTeamOnCallScheduleRestrictionsItems0TypeStartDayPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateTeamOnCallScheduleRestrictionsItems0TypeStartDayPropEnum = append(updateTeamOnCallScheduleRestrictionsItems0TypeStartDayPropEnum, v) + } +} + +const ( + + // UpdateTeamOnCallScheduleRestrictionsItems0StartDayMonday captures enum value "monday" + UpdateTeamOnCallScheduleRestrictionsItems0StartDayMonday string = "monday" + + // UpdateTeamOnCallScheduleRestrictionsItems0StartDayTuesday captures enum value "tuesday" + UpdateTeamOnCallScheduleRestrictionsItems0StartDayTuesday string = "tuesday" + + // UpdateTeamOnCallScheduleRestrictionsItems0StartDayWednesday captures enum value "wednesday" + UpdateTeamOnCallScheduleRestrictionsItems0StartDayWednesday string = "wednesday" + + // UpdateTeamOnCallScheduleRestrictionsItems0StartDayThursday captures enum value "thursday" + UpdateTeamOnCallScheduleRestrictionsItems0StartDayThursday string = "thursday" + + // UpdateTeamOnCallScheduleRestrictionsItems0StartDayFriday captures enum value "friday" + UpdateTeamOnCallScheduleRestrictionsItems0StartDayFriday string = "friday" + + // UpdateTeamOnCallScheduleRestrictionsItems0StartDaySaturday captures enum value "saturday" + UpdateTeamOnCallScheduleRestrictionsItems0StartDaySaturday string = "saturday" + + // UpdateTeamOnCallScheduleRestrictionsItems0StartDaySunday captures enum value "sunday" + UpdateTeamOnCallScheduleRestrictionsItems0StartDaySunday string = "sunday" +) + +// prop value enum +func (m *UpdateTeamOnCallScheduleRestrictionsItems0) validateStartDayEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateTeamOnCallScheduleRestrictionsItems0TypeStartDayPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateTeamOnCallScheduleRestrictionsItems0) validateStartDay(formats strfmt.Registry) error { + + if err := validate.Required("start_day", "body", m.StartDay); err != nil { + return err + } + + // value enum + if err := m.validateStartDayEnum("start_day", "body", *m.StartDay); err != nil { + return err + } + + return nil +} + +func (m *UpdateTeamOnCallScheduleRestrictionsItems0) validateStartTime(formats strfmt.Registry) error { + + if err := validate.Required("start_time", "body", m.StartTime); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update team on call schedule restrictions items0 based on context it is used +func (m *UpdateTeamOnCallScheduleRestrictionsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamOnCallScheduleRestrictionsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamOnCallScheduleRestrictionsItems0) UnmarshalBinary(b []byte) error { + var res UpdateTeamOnCallScheduleRestrictionsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UpdateTeamOnCallScheduleStrategy An object that specifies how the schedule's on-call shifts should be generated. +// +// swagger:model UpdateTeamOnCallScheduleStrategy +type UpdateTeamOnCallScheduleStrategy struct { + + // The day of the week on which on-call shifts should hand off, as its long-form name (e.g. "monday", "tuesday", etc). This value is only used if the strategy type is "weekly". + // Enum: [monday tuesday wednesday thursday friday saturday sunday] + HandoffDay string `json:"handoff_day,omitempty"` + + // An ISO8601 time string specifying when on-call shifts should hand off. This value is only used if the strategy type is "daily" or "weekly". + HandoffTime string `json:"handoff_time,omitempty"` + + // An ISO8601 duration string specifying how long each shift should last. This value is only used if the strategy type is "custom". + ShiftDuration string `json:"shift_duration,omitempty"` + + // The type of strategy. Must be one of "daily", "weekly", or "custom". + // Required: true + // Enum: [daily weekly custom] + Type *string `json:"type"` +} + +// Validate validates this update team on call schedule strategy +func (m *UpdateTeamOnCallScheduleStrategy) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHandoffDay(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var updateTeamOnCallScheduleStrategyTypeHandoffDayPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateTeamOnCallScheduleStrategyTypeHandoffDayPropEnum = append(updateTeamOnCallScheduleStrategyTypeHandoffDayPropEnum, v) + } +} + +const ( + + // UpdateTeamOnCallScheduleStrategyHandoffDayMonday captures enum value "monday" + UpdateTeamOnCallScheduleStrategyHandoffDayMonday string = "monday" + + // UpdateTeamOnCallScheduleStrategyHandoffDayTuesday captures enum value "tuesday" + UpdateTeamOnCallScheduleStrategyHandoffDayTuesday string = "tuesday" + + // UpdateTeamOnCallScheduleStrategyHandoffDayWednesday captures enum value "wednesday" + UpdateTeamOnCallScheduleStrategyHandoffDayWednesday string = "wednesday" + + // UpdateTeamOnCallScheduleStrategyHandoffDayThursday captures enum value "thursday" + UpdateTeamOnCallScheduleStrategyHandoffDayThursday string = "thursday" + + // UpdateTeamOnCallScheduleStrategyHandoffDayFriday captures enum value "friday" + UpdateTeamOnCallScheduleStrategyHandoffDayFriday string = "friday" + + // UpdateTeamOnCallScheduleStrategyHandoffDaySaturday captures enum value "saturday" + UpdateTeamOnCallScheduleStrategyHandoffDaySaturday string = "saturday" + + // UpdateTeamOnCallScheduleStrategyHandoffDaySunday captures enum value "sunday" + UpdateTeamOnCallScheduleStrategyHandoffDaySunday string = "sunday" +) + +// prop value enum +func (m *UpdateTeamOnCallScheduleStrategy) validateHandoffDayEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateTeamOnCallScheduleStrategyTypeHandoffDayPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateTeamOnCallScheduleStrategy) validateHandoffDay(formats strfmt.Registry) error { + if swag.IsZero(m.HandoffDay) { // not required + return nil + } + + // value enum + if err := m.validateHandoffDayEnum("strategy"+"."+"handoff_day", "body", m.HandoffDay); err != nil { + return err + } + + return nil +} + +var updateTeamOnCallScheduleStrategyTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["daily","weekly","custom"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateTeamOnCallScheduleStrategyTypeTypePropEnum = append(updateTeamOnCallScheduleStrategyTypeTypePropEnum, v) + } +} + +const ( + + // UpdateTeamOnCallScheduleStrategyTypeDaily captures enum value "daily" + UpdateTeamOnCallScheduleStrategyTypeDaily string = "daily" + + // UpdateTeamOnCallScheduleStrategyTypeWeekly captures enum value "weekly" + UpdateTeamOnCallScheduleStrategyTypeWeekly string = "weekly" + + // UpdateTeamOnCallScheduleStrategyTypeCustom captures enum value "custom" + UpdateTeamOnCallScheduleStrategyTypeCustom string = "custom" +) + +// prop value enum +func (m *UpdateTeamOnCallScheduleStrategy) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateTeamOnCallScheduleStrategyTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateTeamOnCallScheduleStrategy) validateType(formats strfmt.Registry) error { + + if err := validate.Required("strategy"+"."+"type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("strategy"+"."+"type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update team on call schedule strategy based on context it is used +func (m *UpdateTeamOnCallScheduleStrategy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamOnCallScheduleStrategy) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamOnCallScheduleStrategy) UnmarshalBinary(b []byte) error { + var res UpdateTeamOnCallScheduleStrategy + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_team_signal_rule.go b/models/update_team_signal_rule.go new file mode 100644 index 0000000..c8b780a --- /dev/null +++ b/models/update_team_signal_rule.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateTeamSignalRule Update a Signals rule by ID +// +// swagger:model update_team_signal_rule +type UpdateTeamSignalRule struct { + + // Determines when an incident should be created when this rule is matched + // Enum: [WHEN_UNSPECIFIED WHEN_ALWAYS] + CreateIncidentConditionWhen string `json:"create_incident_condition_when,omitempty"` + + // The amount of time alerts created from this rule will be deduplicated + DeduplicationExpiry string `json:"deduplication_expiry,omitempty"` + + // The CEL expression that defines the rule. + Expression string `json:"expression,omitempty"` + + // The ID of an incident type that should be used when an alert is promoted to an incident + IncidentTypeID string `json:"incident_type_id,omitempty"` + + // The rule's name. + Name string `json:"name,omitempty"` + + // A notification priority that will be set on the resulting alert (default: HIGH) + // Enum: [HIGH MEDIUM LOW ] + NotificationPriorityOverride string `json:"notification_priority_override,omitempty"` + + // The ID of the target that the rule will notify when matched. + TargetID string `json:"target_id,omitempty"` + + // The type of target that the rule will notify when matched. + // Enum: [EscalationPolicy OnCallSchedule User Webhook SlackChannel] + TargetType string `json:"target_type,omitempty"` +} + +// Validate validates this update team signal rule +func (m *UpdateTeamSignalRule) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreateIncidentConditionWhen(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNotificationPriorityOverride(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var updateTeamSignalRuleTypeCreateIncidentConditionWhenPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["WHEN_UNSPECIFIED","WHEN_ALWAYS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateTeamSignalRuleTypeCreateIncidentConditionWhenPropEnum = append(updateTeamSignalRuleTypeCreateIncidentConditionWhenPropEnum, v) + } +} + +const ( + + // UpdateTeamSignalRuleCreateIncidentConditionWhenWHENUNSPECIFIED captures enum value "WHEN_UNSPECIFIED" + UpdateTeamSignalRuleCreateIncidentConditionWhenWHENUNSPECIFIED string = "WHEN_UNSPECIFIED" + + // UpdateTeamSignalRuleCreateIncidentConditionWhenWHENALWAYS captures enum value "WHEN_ALWAYS" + UpdateTeamSignalRuleCreateIncidentConditionWhenWHENALWAYS string = "WHEN_ALWAYS" +) + +// prop value enum +func (m *UpdateTeamSignalRule) validateCreateIncidentConditionWhenEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateTeamSignalRuleTypeCreateIncidentConditionWhenPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateTeamSignalRule) validateCreateIncidentConditionWhen(formats strfmt.Registry) error { + if swag.IsZero(m.CreateIncidentConditionWhen) { // not required + return nil + } + + // value enum + if err := m.validateCreateIncidentConditionWhenEnum("create_incident_condition_when", "body", m.CreateIncidentConditionWhen); err != nil { + return err + } + + return nil +} + +var updateTeamSignalRuleTypeNotificationPriorityOverridePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["HIGH","MEDIUM","LOW",""]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateTeamSignalRuleTypeNotificationPriorityOverridePropEnum = append(updateTeamSignalRuleTypeNotificationPriorityOverridePropEnum, v) + } +} + +const ( + + // UpdateTeamSignalRuleNotificationPriorityOverrideHIGH captures enum value "HIGH" + UpdateTeamSignalRuleNotificationPriorityOverrideHIGH string = "HIGH" + + // UpdateTeamSignalRuleNotificationPriorityOverrideMEDIUM captures enum value "MEDIUM" + UpdateTeamSignalRuleNotificationPriorityOverrideMEDIUM string = "MEDIUM" + + // UpdateTeamSignalRuleNotificationPriorityOverrideLOW captures enum value "LOW" + UpdateTeamSignalRuleNotificationPriorityOverrideLOW string = "LOW" + + // UpdateTeamSignalRuleNotificationPriorityOverrideEmpty captures enum value "" + UpdateTeamSignalRuleNotificationPriorityOverrideEmpty string = "" +) + +// prop value enum +func (m *UpdateTeamSignalRule) validateNotificationPriorityOverrideEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateTeamSignalRuleTypeNotificationPriorityOverridePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateTeamSignalRule) validateNotificationPriorityOverride(formats strfmt.Registry) error { + if swag.IsZero(m.NotificationPriorityOverride) { // not required + return nil + } + + // value enum + if err := m.validateNotificationPriorityOverrideEnum("notification_priority_override", "body", m.NotificationPriorityOverride); err != nil { + return err + } + + return nil +} + +var updateTeamSignalRuleTypeTargetTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["EscalationPolicy","OnCallSchedule","User","Webhook","SlackChannel"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateTeamSignalRuleTypeTargetTypePropEnum = append(updateTeamSignalRuleTypeTargetTypePropEnum, v) + } +} + +const ( + + // UpdateTeamSignalRuleTargetTypeEscalationPolicy captures enum value "EscalationPolicy" + UpdateTeamSignalRuleTargetTypeEscalationPolicy string = "EscalationPolicy" + + // UpdateTeamSignalRuleTargetTypeOnCallSchedule captures enum value "OnCallSchedule" + UpdateTeamSignalRuleTargetTypeOnCallSchedule string = "OnCallSchedule" + + // UpdateTeamSignalRuleTargetTypeUser captures enum value "User" + UpdateTeamSignalRuleTargetTypeUser string = "User" + + // UpdateTeamSignalRuleTargetTypeWebhook captures enum value "Webhook" + UpdateTeamSignalRuleTargetTypeWebhook string = "Webhook" + + // UpdateTeamSignalRuleTargetTypeSlackChannel captures enum value "SlackChannel" + UpdateTeamSignalRuleTargetTypeSlackChannel string = "SlackChannel" +) + +// prop value enum +func (m *UpdateTeamSignalRule) validateTargetTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateTeamSignalRuleTypeTargetTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateTeamSignalRule) validateTargetType(formats strfmt.Registry) error { + if swag.IsZero(m.TargetType) { // not required + return nil + } + + // value enum + if err := m.validateTargetTypeEnum("target_type", "body", m.TargetType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update team signal rule based on context it is used +func (m *UpdateTeamSignalRule) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTeamSignalRule) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTeamSignalRule) UnmarshalBinary(b []byte) error { + var res UpdateTeamSignalRule + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_ticket.go b/models/update_ticket.go new file mode 100644 index 0000000..e6874d3 --- /dev/null +++ b/models/update_ticket.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateTicket Update a ticket's attributes +// +// swagger:model update_ticket +type UpdateTicket struct { + + // description + Description string `json:"description,omitempty"` + + // priority id + PriorityID string `json:"priority_id,omitempty"` + + // state + State string `json:"state,omitempty"` + + // summary + Summary string `json:"summary,omitempty"` + + // List of tags for the ticket + TagList []string `json:"tag_list"` + + // type + Type string `json:"type,omitempty"` +} + +// Validate validates this update ticket +func (m *UpdateTicket) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update ticket based on context it is used +func (m *UpdateTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTicket) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTicket) UnmarshalBinary(b []byte) error { + var res UpdateTicket + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_ticketing_priority.go b/models/update_ticketing_priority.go new file mode 100644 index 0000000..3fee8dd --- /dev/null +++ b/models/update_ticketing_priority.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateTicketingPriority Update a single ticketing priority's attributes +// +// swagger:model update_ticketing_priority +type UpdateTicketingPriority struct { + + // name + Name string `json:"name,omitempty"` + + // The position that this priority should take in your list of priorities. Priorities should be ordered from highest to lowest, with the highest priority at 0. If a position isn't specified, the new priority will be added to the end of the list; if another priority already exists at the specified position, this priority will shift that priority and all priorities down the list. + Position int32 `json:"position,omitempty"` +} + +// Validate validates this update ticketing priority +func (m *UpdateTicketingPriority) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update ticketing priority based on context it is used +func (m *UpdateTicketingPriority) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateTicketingPriority) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateTicketingPriority) UnmarshalBinary(b []byte) error { + var res UpdateTicketingPriority + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_vote.go b/models/update_vote.go new file mode 100644 index 0000000..14c0df9 --- /dev/null +++ b/models/update_vote.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateVote Upvote or downvote an object +// +// swagger:model update_vote +type UpdateVote struct { + + // The direction you would like to vote, or if you dig it + // Required: true + // Enum: [up down dig] + Direction *string `json:"direction"` +} + +// Validate validates this update vote +func (m *UpdateVote) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDirection(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var updateVoteTypeDirectionPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["up","down","dig"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateVoteTypeDirectionPropEnum = append(updateVoteTypeDirectionPropEnum, v) + } +} + +const ( + + // UpdateVoteDirectionUp captures enum value "up" + UpdateVoteDirectionUp string = "up" + + // UpdateVoteDirectionDown captures enum value "down" + UpdateVoteDirectionDown string = "down" + + // UpdateVoteDirectionDig captures enum value "dig" + UpdateVoteDirectionDig string = "dig" +) + +// prop value enum +func (m *UpdateVote) validateDirectionEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateVoteTypeDirectionPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateVote) validateDirection(formats strfmt.Registry) error { + + if err := validate.Required("direction", "body", m.Direction); err != nil { + return err + } + + // value enum + if err := m.validateDirectionEnum("direction", "body", *m.Direction); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update vote based on context it is used +func (m *UpdateVote) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateVote) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateVote) UnmarshalBinary(b []byte) error { + var res UpdateVote + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/update_webhook.go b/models/update_webhook.go new file mode 100644 index 0000000..a90eae3 --- /dev/null +++ b/models/update_webhook.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateWebhook Update a specific webhook +// +// swagger:model update_webhook +type UpdateWebhook struct { + + // state + // Enum: [active inactive] + State string `json:"state,omitempty"` + + // url + URL string `json:"url,omitempty"` +} + +// Validate validates this update webhook +func (m *UpdateWebhook) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var updateWebhookTypeStatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["active","inactive"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateWebhookTypeStatePropEnum = append(updateWebhookTypeStatePropEnum, v) + } +} + +const ( + + // UpdateWebhookStateActive captures enum value "active" + UpdateWebhookStateActive string = "active" + + // UpdateWebhookStateInactive captures enum value "inactive" + UpdateWebhookStateInactive string = "inactive" +) + +// prop value enum +func (m *UpdateWebhook) validateStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateWebhookTypeStatePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateWebhook) validateState(formats strfmt.Registry) error { + if swag.IsZero(m.State) { // not required + return nil + } + + // value enum + if err := m.validateStateEnum("state", "body", m.State); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update webhook based on context it is used +func (m *UpdateWebhook) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateWebhook) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateWebhook) UnmarshalBinary(b []byte) error { + var res UpdateWebhook + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}