diff --git a/cmd/agent.go b/cmd/agent.go new file mode 100644 index 00000000..167a9aa8 --- /dev/null +++ b/cmd/agent.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/spf13/cobra" + "github.com/stackvista/stackstate-cli/cmd/agent" + "github.com/stackvista/stackstate-cli/internal/di" +) + +func AgentCommand(deps *di.Deps) *cobra.Command { + cmd := &cobra.Command{ + Use: "agent", + Short: "Manage the StackState agents", + Long: "Manage the StackState agents.", + } + + cmd.AddCommand(agent.ListCommand(deps)) + return cmd +} diff --git a/cmd/agent/agent_list.go b/cmd/agent/agent_list.go new file mode 100644 index 00000000..eff06298 --- /dev/null +++ b/cmd/agent/agent_list.go @@ -0,0 +1,79 @@ +package agent + +import ( + "cmp" + "fmt" + "github.com/spf13/cobra" + "github.com/stackvista/stackstate-cli/generated/stackstate_api" + "github.com/stackvista/stackstate-cli/internal/common" + "github.com/stackvista/stackstate-cli/internal/di" + "github.com/stackvista/stackstate-cli/internal/printer" + "slices" + "time" +) + +func ListCommand(deps *di.Deps) *cobra.Command { + cmd := &cobra.Command{ + Use: "list", + Short: "List all registered agents", + Long: "List all registered agents", + RunE: deps.CmdRunEWithApi(RunListCommand), + } + + return cmd +} + +func RunListCommand(cmd *cobra.Command, cli *di.Deps, api *stackstate_api.APIClient, serverInfo *stackstate_api.ServerInfo) common.CLIError { + agents, resp, err := api.AgentRegistrationsApi.AllAgentRegistrations(cli.Context).Execute() + + if err != nil { + return common.NewResponseError(err, resp) + } + + agentList := agents.Agents + + slices.SortFunc(agentList, func(a, b stackstate_api.AgentRegistration) int { + if n := cmp.Compare(a.Lease, b.Lease); n != 0 { + return n + } + // If leases are equal, order by registration moment + return cmp.Compare(a.RegisteredEpochMs, b.RegisteredEpochMs) + }) + + var active = 0 + var limited = 0 + var stale = 0 + + for _, agent := range agentList { + if agent.Lease == stackstate_api.AGENTLEASE_ACTIVE { + active++ + } else if agent.Lease == stackstate_api.AGENTLEASE_LIMITED { + limited++ + } else { + stale++ + } + } + + if cli.IsJson() { + cli.Printer.PrintJson(map[string]interface{}{ + "agents": agentList, + }) + } else { + data := make([][]interface{}, len(agentList)) + currentTime := time.Now() + + for i, agent := range agentList { + data[i] = []interface{}{agent.AgentId, agent.Lease, currentTime.Sub(time.UnixMilli(agent.RegisteredEpochMs)).String(), time.UnixMilli(agent.GetLeaseUntilEpochMs()).String()} + } + cli.Printer.Table(printer.TableData{ + Header: []string{"Host", "Lease", "Age", "Last Lease"}, + Data: data, + MissingTableDataMsg: printer.NotFoundMsg{Types: "topics"}, + }) + + cli.Printer.PrintLn("") + cli.Printer.PrintLn(fmt.Sprintf("Totals: %d active, %d limited, %d stale", active, limited, stale)) + } + + return nil +} diff --git a/cmd/sts.go b/cmd/sts.go index 5db35110..adfcc003 100644 --- a/cmd/sts.go +++ b/cmd/sts.go @@ -29,6 +29,7 @@ func STSCommand(cli *di.Deps) *cobra.Command { cmd.AddCommand(TopicCommand(cli)) cmd.AddCommand(TopologySyncCommand(cli)) cmd.AddCommand(IngestionApiKeyCommand(cli)) + cmd.AddCommand(AgentCommand(cli)) return cmd } diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..3d443bce --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1665733862, + "narHash": "sha256-uIcstZ0D5lEi6pDYupfsKLRLgC6ZmwdxsWzCE3li+IQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "4baef62b8eef25c97ac3e00804dce6920b2b850e", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..f1658f0a --- /dev/null +++ b/flake.nix @@ -0,0 +1,111 @@ +{ + description = "StackState CLI"; + + nixConfig.bash-prompt = "STS CLI 2 $ "; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; overlays = [ ]; }; + pkgs-linux = import nixpkgs { system = "x86_64-linux"; overlays = [ ]; }; + + # Dependencies used for both development and CI/CD + sharedDeps = pkgs: (with pkgs; [ + bash + go_1_19 + gotools + diffutils # Required for golangci-lint + golangci-lint + openapi-generator-cli + ]); + + # Dependencies used only by CI/CD + ciDeps = pkgs: (with pkgs; [ + git + cacert + gcc + coreutils-full + goreleaser + awscli + docker + ]); + + darwinDevShellExtraDeps = pkgs: pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk_11_0; [ + Libsystem + IOKit + ]); + in { + + devShells = { + dev = pkgs.mkShell { + buildInputs = sharedDeps(pkgs) ++ darwinDevShellExtraDeps(pkgs); + }; + + ci = pkgs.mkShell { + buildInputs = sharedDeps(pkgs) ++ ciDeps(pkgs); + }; + }; + + devShell = self.devShells."${system}".dev; + + packages = { + sts = pkgs.buildGo119Module { + pname = "sts"; + version = "2.0.0"; + + src = ./.; + + # This hash locks the dependencies of this package. + # Change it to the provided when the go dependencies change. + # See https://www.tweag.io/blog/2021-03-04-gomod2nix/ for details. + # + # NOTE In case if your build fails due to incosistency in vendor modules + # Comment out the real hash and uncomment the fake one then on next `nix build .` run + # you will get a new real hash which can be used here. + # + # vendorSha256 = pkgs.lib.fakeSha256; + vendorSha256 = "sha256-aXTDHT1N+4Qpkuxb8vvBvP2VPyS5ofCgX6XFhJ5smUQ="; + + postInstall = '' + mv $out/bin/stackstate-cli2 $out/bin/sts + ''; + }; + + ci-image = pkgs.dockerTools.buildImage { + name = "stackstate-cli2-ci"; + tag = "latest"; + created = "now"; + + contents = sharedDeps(pkgs-linux) ++ ciDeps(pkgs-linux); + + config = { + Env = [ + "GIT_SSL_CAINFO=/etc/ssl/certs/ca-bundle.crt" + "SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt" + ]; + + # Required to make golangci-lint work. + Volumes = { + "/tmp" = {}; + }; + }; + }; + + default = self.packages."${system}".sts; + }; + + apps = { + sts = { + type = "app"; + program = "${self.packages."${system}".sts}/bin/sts"; + }; + + default = self.apps."${system}".sts; + }; + }); +} diff --git a/generated/stackstate_api/.openapi-generator/FILES b/generated/stackstate_api/.openapi-generator/FILES index a99eeb52..f247f4d3 100644 --- a/generated/stackstate_api/.openapi-generator/FILES +++ b/generated/stackstate_api/.openapi-generator/FILES @@ -3,6 +3,8 @@ .travis.yml README.md api/openapi.yaml +api_agent_leases.go +api_agent_registrations.go api_api_token.go api_authorize_ingestion_api_key.go api_component.go @@ -28,6 +30,7 @@ api_service_token.go api_stackpack.go api_subject.go api_subscription.go +api_system_notifications.go api_topic.go api_topology_synchronization.go api_traces.go @@ -35,6 +38,12 @@ api_user_profile.go api_user_session.go client.go configuration.go +docs/AgentData.md +docs/AgentLease.md +docs/AgentLeasesApi.md +docs/AgentRegistration.md +docs/AgentRegistrations.md +docs/AgentRegistrationsApi.md docs/ApiToken.md docs/ApiTokenApi.md docs/Argument.md @@ -47,7 +56,6 @@ docs/ArgumentFailingHealthStateVal.md docs/ArgumentLongVal.md docs/ArgumentNodeIdVal.md docs/ArgumentPromQLMetricVal.md -docs/ArgumentPropagatedHealthStateVal.md docs/ArgumentQueryViewRef.md docs/ArgumentRelationTypeRef.md docs/ArgumentStateVal.md @@ -64,6 +72,7 @@ docs/BaseNotificationChannel.md docs/CausingEventsAreNotAvailableForTheTime.md docs/CausingEventsResult.md docs/ChannelReferenceId.md +docs/CheckLeaseRequest.md docs/ComparatorWithoutEquality.md docs/ComponentApi.md docs/ComponentHealthChange.md @@ -79,6 +88,11 @@ docs/DummyApi.md docs/DurationHistogram.md docs/DurationHistogramBucket.md docs/DurationQuantiles.md +docs/EmailChannelRefId.md +docs/EmailChannelWriteSchema.md +docs/EmailNotificationChannel.md +docs/EmailNotificationChannelAllOf.md +docs/EmailNotificationStatus.md docs/EventApi.md docs/EventBucket.md docs/EventCategory.md @@ -89,7 +103,6 @@ docs/EventElement.md docs/EventItemsWithTotal.md docs/EventListRequest.md docs/EventNotFoundError.md -docs/EventRef.md docs/EventRelation.md docs/EventTag.md docs/EventsHistogram.md @@ -283,7 +296,6 @@ docs/PromScalar.md docs/PromSeriesEnvelope.md docs/PromVector.md docs/PromVectorResult.md -docs/PropagatedHealthStateValue.md docs/ProvisionResponse.md docs/ReleaseStatus.md docs/RequestError.md @@ -342,6 +354,14 @@ docs/Subscription.md docs/SubscriptionApi.md docs/SubscriptionState.md docs/Suggestions.md +docs/SystemNotification.md +docs/SystemNotificationSeverity.md +docs/SystemNotifications.md +docs/SystemNotificationsApi.md +docs/TeamsChannelRefId.md +docs/TeamsChannelWriteSchema.md +docs/TeamsNotificationChannel.md +docs/TeamsNotificationChannelAllOf.md docs/TooManyActiveQueries.md docs/TooManyTopologyResults.md docs/Topic.md @@ -385,6 +405,10 @@ docs/WebhookNotificationChannelAllOf.md git_push.sh go.mod go.sum +model_agent_data.go +model_agent_lease.go +model_agent_registration.go +model_agent_registrations.go model_api_token.go model_argument.go model_argument_boolean_val.go @@ -396,7 +420,6 @@ model_argument_failing_health_state_val.go model_argument_long_val.go model_argument_node_id_val.go model_argument_prom_ql_metric_val.go -model_argument_propagated_health_state_val.go model_argument_query_view_ref.go model_argument_relation_type_ref.go model_argument_state_val.go @@ -412,6 +435,7 @@ model_base_notification_channel.go model_causing_events_are_not_available_for_the_time.go model_causing_events_result.go model_channel_reference_id.go +model_check_lease_request.go model_comparator_without_equality.go model_component_health_change.go model_component_health_history.go @@ -425,6 +449,11 @@ model_dependency_direction.go model_duration_histogram.go model_duration_histogram_bucket.go model_duration_quantiles.go +model_email_channel_ref_id.go +model_email_channel_write_schema.go +model_email_notification_channel.go +model_email_notification_channel_all_of.go +model_email_notification_status.go model_event_bucket.go model_event_category.go model_event_category_bucket.go @@ -434,7 +463,6 @@ model_event_element.go model_event_items_with_total.go model_event_list_request.go model_event_not_found_error.go -model_event_ref.go model_event_relation.go model_event_tag.go model_events_histogram.go @@ -614,7 +642,6 @@ model_prom_scalar.go model_prom_series_envelope.go model_prom_vector.go model_prom_vector_result.go -model_propagated_health_state_value.go model_provision_response.go model_release_status.go model_request_error.go @@ -667,6 +694,13 @@ model_subject_config.go model_subscription.go model_subscription_state.go model_suggestions.go +model_system_notification.go +model_system_notification_severity.go +model_system_notifications.go +model_teams_channel_ref_id.go +model_teams_channel_write_schema.go +model_teams_notification_channel.go +model_teams_notification_channel_all_of.go model_too_many_active_queries.go model_too_many_topology_results.go model_topic.go diff --git a/generated/stackstate_api/.openapi-generator/VERSION b/generated/stackstate_api/.openapi-generator/VERSION index 6d54bbd7..358e78e6 100644 --- a/generated/stackstate_api/.openapi-generator/VERSION +++ b/generated/stackstate_api/.openapi-generator/VERSION @@ -1 +1 @@ -6.0.1 \ No newline at end of file +6.1.0 \ No newline at end of file diff --git a/generated/stackstate_api/README.md b/generated/stackstate_api/README.md index d8c3e054..a391afbc 100644 --- a/generated/stackstate_api/README.md +++ b/generated/stackstate_api/README.md @@ -87,6 +87,8 @@ All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AgentLeasesApi* | [**AgentCheckLease**](docs/AgentLeasesApi.md#agentchecklease) | **Post** /agents/{agentId}/checkLease | Check the lease of an agent. +*AgentRegistrationsApi* | [**AllAgentRegistrations**](docs/AgentRegistrationsApi.md#allagentregistrations) | **Get** /agents | Overview of registered agents *ApiTokenApi* | [**GetCurrentUserApiTokens**](docs/ApiTokenApi.md#getcurrentuserapitokens) | **Get** /user/profile/tokens | Get current user's API tokens *AuthorizeIngestionApiKeyApi* | [**AuthorizeIngestionApiKey**](docs/AuthorizeIngestionApiKeyApi.md#authorizeingestionapikey) | **Post** /security/ingestion/authorize | Check authorization for an Ingestion Api Key *ComponentApi* | [**GetComponentHealthHistory**](docs/ComponentApi.md#getcomponenthealthhistory) | **Get** /components/{componentIdOrUrn}/healthHistory | Get a component health history @@ -151,23 +153,34 @@ Class | Method | HTTP request | Description *NodeApi* | [**NodeListTypes**](docs/NodeApi.md#nodelisttypes) | **Get** /node | Node API *NodeApi* | [**TypeList**](docs/NodeApi.md#typelist) | **Get** /node/{nodeType} | Node type API *NodeApi* | [**Unlock**](docs/NodeApi.md#unlock) | **Post** /node/{nodeType}/{nodeId}/unlock | Node unlock API +*NotificationChannelsApi* | [**CreateEmailNotificationChannel**](docs/NotificationChannelsApi.md#createemailnotificationchannel) | **Post** /notifications/channels/email | Create a Email Notification channel *NotificationChannelsApi* | [**CreateOpsgenieNotificationChannel**](docs/NotificationChannelsApi.md#createopsgenienotificationchannel) | **Post** /notifications/channels/opsgenie | Create a Opsgenie Notification channel +*NotificationChannelsApi* | [**CreateTeamsNotificationChannel**](docs/NotificationChannelsApi.md#createteamsnotificationchannel) | **Post** /notifications/channels/teams | Create a Teams Notification channel *NotificationChannelsApi* | [**CreateWebhookNotificationChannel**](docs/NotificationChannelsApi.md#createwebhooknotificationchannel) | **Post** /notifications/channels/webhook | Create a Webhook Notification channel +*NotificationChannelsApi* | [**DeleteEmailNotificationChannel**](docs/NotificationChannelsApi.md#deleteemailnotificationchannel) | **Delete** /notifications/channels/email/{channelId} | Delete the Email Notification channel by id *NotificationChannelsApi* | [**DeleteOpsgenieNotificationChannel**](docs/NotificationChannelsApi.md#deleteopsgenienotificationchannel) | **Delete** /notifications/channels/opsgenie/{channelId} | Delete the Opsgenie Notification channel by id *NotificationChannelsApi* | [**DeleteSlackNotificationChannel**](docs/NotificationChannelsApi.md#deleteslacknotificationchannel) | **Delete** /notifications/channels/slack/{channelId} | Delete the Slack Notification channel by id +*NotificationChannelsApi* | [**DeleteTeamsNotificationChannel**](docs/NotificationChannelsApi.md#deleteteamsnotificationchannel) | **Delete** /notifications/channels/teams/{channelId} | Delete the Teams Notification channel by id *NotificationChannelsApi* | [**DeleteWebhookNotificationChannel**](docs/NotificationChannelsApi.md#deletewebhooknotificationchannel) | **Delete** /notifications/channels/webhook/{channelId} | Delete the Webhook Notification channel by id +*NotificationChannelsApi* | [**GetEmailNotificationChannel**](docs/NotificationChannelsApi.md#getemailnotificationchannel) | **Get** /notifications/channels/email/{channelId} | Get the Email Notification channel by id +*NotificationChannelsApi* | [**GetEmailNotificationStatus**](docs/NotificationChannelsApi.md#getemailnotificationstatus) | **Get** /notifications/channels/email/status | Email Notification channel status *NotificationChannelsApi* | [**GetOpsgenieNotificationChannel**](docs/NotificationChannelsApi.md#getopsgenienotificationchannel) | **Get** /notifications/channels/opsgenie/{channelId} | Get the Opsgenie Notification channel by id *NotificationChannelsApi* | [**GetSlackNotificationChannel**](docs/NotificationChannelsApi.md#getslacknotificationchannel) | **Get** /notifications/channels/slack/{channelId} | Get the Slack Notification channel by id +*NotificationChannelsApi* | [**GetTeamsNotificationChannel**](docs/NotificationChannelsApi.md#getteamsnotificationchannel) | **Get** /notifications/channels/teams/{channelId} | Get the Teams Notification channel by id *NotificationChannelsApi* | [**GetWebhookNotificationChannel**](docs/NotificationChannelsApi.md#getwebhooknotificationchannel) | **Get** /notifications/channels/webhook/{channelId} | Get the Webhook Notification channel by id *NotificationChannelsApi* | [**JoinSlackChannel**](docs/NotificationChannelsApi.md#joinslackchannel) | **Post** /notifications/channels/slack/{channelId}/joinSlackChannel | Join the specified Slack channel to send notifications *NotificationChannelsApi* | [**ListOpsgenieResponders**](docs/NotificationChannelsApi.md#listopsgenieresponders) | **Get** /notifications/channels/opsgenie/responders | List Opsgenie responders *NotificationChannelsApi* | [**ListSlackChannels**](docs/NotificationChannelsApi.md#listslackchannels) | **Get** /notifications/channels/slack/{channelId}/listSlackChannels | List all public Slack channels *NotificationChannelsApi* | [**SlackOAuthCallback**](docs/NotificationChannelsApi.md#slackoauthcallback) | **Get** /notifications/channels/slack/oauth-callback | The OAuth callback for Slack *NotificationChannelsApi* | [**SlackOauthRedirect**](docs/NotificationChannelsApi.md#slackoauthredirect) | **Get** /notifications/channels/slack/oauth-redirect | Starts Slack OAuth2 flow +*NotificationChannelsApi* | [**TestEmailChannel**](docs/NotificationChannelsApi.md#testemailchannel) | **Post** /notifications/channels/email/{channelId}/test | Test the Email notification channel *NotificationChannelsApi* | [**TestOpsgenieChannel**](docs/NotificationChannelsApi.md#testopsgeniechannel) | **Post** /notifications/channels/opsgenie/{channelId}/test | Test the Opsgenie notification channel *NotificationChannelsApi* | [**TestSlackChannel**](docs/NotificationChannelsApi.md#testslackchannel) | **Post** /notifications/channels/slack/{channelId}/test | Test the Notification channel +*NotificationChannelsApi* | [**TestTeamsChannel**](docs/NotificationChannelsApi.md#testteamschannel) | **Post** /notifications/channels/teams/{channelId}/test | Test the Teams notification channel *NotificationChannelsApi* | [**TestWebhookChannel**](docs/NotificationChannelsApi.md#testwebhookchannel) | **Post** /notifications/channels/webhook/{channelId}/test | Test the Webhook notification channel +*NotificationChannelsApi* | [**UpdateEmailNotificationChannel**](docs/NotificationChannelsApi.md#updateemailnotificationchannel) | **Put** /notifications/channels/email/{channelId} | Update the Email Notification channel by id *NotificationChannelsApi* | [**UpdateOpsgenieNotificationChannel**](docs/NotificationChannelsApi.md#updateopsgenienotificationchannel) | **Put** /notifications/channels/opsgenie/{channelId} | Update the Opsgenie Notification channel by id +*NotificationChannelsApi* | [**UpdateTeamsNotificationChannel**](docs/NotificationChannelsApi.md#updateteamsnotificationchannel) | **Put** /notifications/channels/teams/{channelId} | Update the Teams Notification channel by id *NotificationChannelsApi* | [**UpdateWebhookNotificationChannel**](docs/NotificationChannelsApi.md#updatewebhooknotificationchannel) | **Put** /notifications/channels/webhook/{channelId} | Update the Webhook Notification channel by id *NotificationConfigurationsApi* | [**CreateNotificationConfiguration**](docs/NotificationConfigurationsApi.md#createnotificationconfiguration) | **Post** /notifications/configurations | Create a new notification configuration *NotificationConfigurationsApi* | [**DeleteNotificationConfiguration**](docs/NotificationConfigurationsApi.md#deletenotificationconfiguration) | **Delete** /notifications/configurations/{notificationConfigurationIdOrUrn} | Delete the notification configuration @@ -197,6 +210,7 @@ Class | Method | HTTP request | Description *SubjectApi* | [**ListSubjects**](docs/SubjectApi.md#listsubjects) | **Get** /security/subjects | List subjects *SubscriptionApi* | [**GetSubscription**](docs/SubscriptionApi.md#getsubscription) | **Get** /subscription | Get subscription info *SubscriptionApi* | [**PostSubscription**](docs/SubscriptionApi.md#postsubscription) | **Post** /subscription | Submit a new license to update the subscription +*SystemNotificationsApi* | [**AllSystemNotifications**](docs/SystemNotificationsApi.md#allsystemnotifications) | **Get** /system/notifications | Overview of system notifications *TopicApi* | [**Describe**](docs/TopicApi.md#describe) | **Get** /topic/{topic} | Describe a topic *TopicApi* | [**List**](docs/TopicApi.md#list) | **Get** /topic | List topics *TopologySynchronizationApi* | [**GetTopologySynchronizationStreamById**](docs/TopologySynchronizationApi.md#gettopologysynchronizationstreambyid) | **Get** /synchronization/topology/streams/sync | Overview of a specific Topology Stream, queried by node id or sync identifier @@ -220,6 +234,10 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [AgentData](docs/AgentData.md) + - [AgentLease](docs/AgentLease.md) + - [AgentRegistration](docs/AgentRegistration.md) + - [AgentRegistrations](docs/AgentRegistrations.md) - [ApiToken](docs/ApiToken.md) - [Argument](docs/Argument.md) - [ArgumentBooleanVal](docs/ArgumentBooleanVal.md) @@ -231,7 +249,6 @@ Class | Method | HTTP request | Description - [ArgumentLongVal](docs/ArgumentLongVal.md) - [ArgumentNodeIdVal](docs/ArgumentNodeIdVal.md) - [ArgumentPromQLMetricVal](docs/ArgumentPromQLMetricVal.md) - - [ArgumentPropagatedHealthStateVal](docs/ArgumentPropagatedHealthStateVal.md) - [ArgumentQueryViewRef](docs/ArgumentQueryViewRef.md) - [ArgumentRelationTypeRef](docs/ArgumentRelationTypeRef.md) - [ArgumentStateVal](docs/ArgumentStateVal.md) @@ -247,6 +264,7 @@ Class | Method | HTTP request | Description - [CausingEventsAreNotAvailableForTheTime](docs/CausingEventsAreNotAvailableForTheTime.md) - [CausingEventsResult](docs/CausingEventsResult.md) - [ChannelReferenceId](docs/ChannelReferenceId.md) + - [CheckLeaseRequest](docs/CheckLeaseRequest.md) - [ComparatorWithoutEquality](docs/ComparatorWithoutEquality.md) - [ComponentHealthChange](docs/ComponentHealthChange.md) - [ComponentHealthHistory](docs/ComponentHealthHistory.md) @@ -260,6 +278,11 @@ Class | Method | HTTP request | Description - [DurationHistogram](docs/DurationHistogram.md) - [DurationHistogramBucket](docs/DurationHistogramBucket.md) - [DurationQuantiles](docs/DurationQuantiles.md) + - [EmailChannelRefId](docs/EmailChannelRefId.md) + - [EmailChannelWriteSchema](docs/EmailChannelWriteSchema.md) + - [EmailNotificationChannel](docs/EmailNotificationChannel.md) + - [EmailNotificationChannelAllOf](docs/EmailNotificationChannelAllOf.md) + - [EmailNotificationStatus](docs/EmailNotificationStatus.md) - [EventBucket](docs/EventBucket.md) - [EventCategory](docs/EventCategory.md) - [EventCategoryBucket](docs/EventCategoryBucket.md) @@ -269,7 +292,6 @@ Class | Method | HTTP request | Description - [EventItemsWithTotal](docs/EventItemsWithTotal.md) - [EventListRequest](docs/EventListRequest.md) - [EventNotFoundError](docs/EventNotFoundError.md) - - [EventRef](docs/EventRef.md) - [EventRelation](docs/EventRelation.md) - [EventTag](docs/EventTag.md) - [EventsHistogram](docs/EventsHistogram.md) @@ -449,7 +471,6 @@ Class | Method | HTTP request | Description - [PromSeriesEnvelope](docs/PromSeriesEnvelope.md) - [PromVector](docs/PromVector.md) - [PromVectorResult](docs/PromVectorResult.md) - - [PropagatedHealthStateValue](docs/PropagatedHealthStateValue.md) - [ProvisionResponse](docs/ProvisionResponse.md) - [ReleaseStatus](docs/ReleaseStatus.md) - [RequestError](docs/RequestError.md) @@ -502,6 +523,13 @@ Class | Method | HTTP request | Description - [Subscription](docs/Subscription.md) - [SubscriptionState](docs/SubscriptionState.md) - [Suggestions](docs/Suggestions.md) + - [SystemNotification](docs/SystemNotification.md) + - [SystemNotificationSeverity](docs/SystemNotificationSeverity.md) + - [SystemNotifications](docs/SystemNotifications.md) + - [TeamsChannelRefId](docs/TeamsChannelRefId.md) + - [TeamsChannelWriteSchema](docs/TeamsChannelWriteSchema.md) + - [TeamsNotificationChannel](docs/TeamsNotificationChannel.md) + - [TeamsNotificationChannelAllOf](docs/TeamsNotificationChannelAllOf.md) - [TooManyActiveQueries](docs/TooManyActiveQueries.md) - [TooManyTopologyResults](docs/TooManyTopologyResults.md) - [Topic](docs/Topic.md) diff --git a/generated/stackstate_api/api/openapi.yaml b/generated/stackstate_api/api/openapi.yaml index 413c3f6b..6599908c 100644 --- a/generated/stackstate_api/api/openapi.yaml +++ b/generated/stackstate_api/api/openapi.yaml @@ -780,6 +780,11 @@ paths: required: true schema: $ref: '#/components/schemas/MonitorIdOrUrn' + - in: query + name: timestamp + schema: + format: int64 + type: integer responses: "200": content: @@ -828,6 +833,11 @@ paths: name: limit schema: type: integer + - in: query + name: timestamp + schema: + format: int64 + type: integer responses: "200": content: @@ -1837,6 +1847,386 @@ paths: summary: Test the Opsgenie notification channel tags: - notification_channels + /notifications/channels/teams: + post: + description: Create a Teams Notification channel + operationId: createTeamsNotificationChannel + requestBody: + $ref: '#/components/requestBodies/teamsChannelWrite' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TeamsNotificationChannel' + description: Teams notification channel + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + summary: Create a Teams Notification channel + tags: + - notification_channels + /notifications/channels/teams/{channelId}: + delete: + description: Delete the teams notification channel by id + operationId: deleteTeamsNotificationChannel + parameters: + - description: Channel identifier + in: path + name: channelId + required: true + schema: + $ref: '#/components/schemas/ChannelId' + responses: + "204": + description: Teams notification channel is deleted. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelNotFound' + description: Notification channel was not found in the database + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + summary: Delete the Teams Notification channel by id + tags: + - notification_channels + get: + description: Get the teams notification channel by id + operationId: getTeamsNotificationChannel + parameters: + - description: Channel identifier + in: path + name: channelId + required: true + schema: + $ref: '#/components/schemas/ChannelId' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TeamsNotificationChannel' + description: Teams notification channel + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelNotFound' + description: Notification channel was not found in the database + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + summary: Get the Teams Notification channel by id + tags: + - notification_channels + put: + description: Update the teams notification channel by id + operationId: updateTeamsNotificationChannel + parameters: + - description: Channel identifier + in: path + name: channelId + required: true + schema: + $ref: '#/components/schemas/ChannelId' + requestBody: + $ref: '#/components/requestBodies/teamsChannelWrite' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TeamsNotificationChannel' + description: Teams notification channel + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelNotFound' + description: Notification channel was not found in the database + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + summary: Update the Teams Notification channel by id + tags: + - notification_channels + /notifications/channels/teams/{channelId}/test: + post: + description: Test the teams notification channel by sending a test message to + the notification channel. + operationId: testTeamsChannel + parameters: + - description: Channel identifier + in: path + name: channelId + required: true + schema: + $ref: '#/components/schemas/ChannelId' + responses: + "204": + description: Successfully tested channel. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelNotFound' + description: Notification channel was not found in the database + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + summary: Test the Teams notification channel + tags: + - notification_channels + /notifications/channels/email: + post: + description: Create Email Notification channel + operationId: createEmailNotificationChannel + requestBody: + $ref: '#/components/requestBodies/emailChannelWrite' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EmailNotificationChannel' + description: Email notification channel + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + summary: Create a Email Notification channel + tags: + - notification_channels + /notifications/channels/email/status: + get: + description: "Email Notification channel status, test whether it can be used" + operationId: getEmailNotificationStatus + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EmailNotificationStatus' + description: Email notification status + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + summary: Email Notification channel status + tags: + - notification_channels + /notifications/channels/email/{channelId}: + delete: + description: Delete the email notification channel by id + operationId: deleteEmailNotificationChannel + parameters: + - description: Channel identifier + in: path + name: channelId + required: true + schema: + $ref: '#/components/schemas/ChannelId' + responses: + "204": + description: Email notification channel is deleted. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelNotFound' + description: Notification channel was not found in the database + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + summary: Delete the Email Notification channel by id + tags: + - notification_channels + get: + description: Get the email notification channel by id + operationId: getEmailNotificationChannel + parameters: + - description: Channel identifier + in: path + name: channelId + required: true + schema: + $ref: '#/components/schemas/ChannelId' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EmailNotificationChannel' + description: Email notification channel + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelNotFound' + description: Notification channel was not found in the database + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + summary: Get the Email Notification channel by id + tags: + - notification_channels + put: + description: Update the email notification channel by id + operationId: updateEmailNotificationChannel + parameters: + - description: Channel identifier + in: path + name: channelId + required: true + schema: + $ref: '#/components/schemas/ChannelId' + requestBody: + $ref: '#/components/requestBodies/emailChannelWrite' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EmailNotificationChannel' + description: Email notification channel + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelNotFound' + description: Notification channel was not found in the database + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + summary: Update the Email Notification channel by id + tags: + - notification_channels + /notifications/channels/email/{channelId}/test: + post: + description: Test the email notification channel by sending a test message to + the notification channel. + operationId: testEmailChannel + parameters: + - description: Channel identifier + in: path + name: channelId + required: true + schema: + $ref: '#/components/schemas/ChannelId' + responses: + "204": + description: Successfully tested channel. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelNotFound' + description: Notification channel was not found in the database + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationChannelError' + description: Error while executing the request. + summary: Test the Email notification channel + tags: + - notification_channels /notifications/configurations: get: description: Get all notification configurations @@ -3691,6 +4081,14 @@ paths: required: false schema: $ref: '#/components/schemas/PromTimeout' + - description: Query resolution step width in duration format or float number + of seconds. + example: 5m or 300 + in: query + name: step + required: false + schema: + $ref: '#/components/schemas/PromStep' - description: Enforce additional label filters for queries example: service=carts explode: true @@ -3818,6 +4216,12 @@ paths: required: false schema: $ref: '#/components/schemas/PromTimeout' + - description: Align start and end times with step size + in: query + name: aligned + required: false + schema: + type: boolean - description: Maximum number of data points to return. example: "2" in: query @@ -5120,23 +5524,109 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ComponentHealthHistory' - description: Component health history - "400": + $ref: '#/components/schemas/ComponentHealthHistory' + description: Component health history + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ComponentNotFoundError' + description: Component not found error + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericErrorsResponse' + description: Error when handling the request on the server side. + summary: Get a component health history + tags: + - component + /agents/{agentId}/checkLease: + post: + description: Checks the lease of an agent and might register it if it does not + exist yet. + operationId: agentCheckLease + parameters: + - description: The identifier of an agent + in: path + name: agentId + required: true + schema: + $ref: '#/components/schemas/AgentId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CheckLeaseRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AgentRegistration' + description: The lease was given + "403": + description: Forbidden + "429": content: application/json: schema: - $ref: '#/components/schemas/ComponentNotFoundError' - description: Component not found error + $ref: '#/components/schemas/AgentRegistration' + description: Too many agents registered "500": content: application/json: schema: $ref: '#/components/schemas/GenericErrorsResponse' description: Error when handling the request on the server side. - summary: Get a component health history + summary: Check the lease of an agent. tags: - - component + - agentLeases + /agents: + get: + description: Give an overview of all registered agents + operationId: allAgentRegistrations + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AgentRegistrations' + description: All registered agents + "403": + description: Forbidden + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericErrorsResponse' + description: Error when handling the request on the server side. + summary: Overview of registered agents + tags: + - agentRegistrations + /system/notifications: + get: + description: All active system notifications + operationId: allSystemNotifications + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SystemNotifications' + description: All system notifications + "403": + description: Forbidden + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericErrorsResponse' + description: Error when handling the request on the server side. + summary: Overview of system notifications + tags: + - systemNotifications /dummy/dummy: get: description: "" @@ -5217,6 +5707,20 @@ components: $ref: '#/components/schemas/OpsgenieChannelWriteSchema' description: Create or update a opsgenie channel required: true + teamsChannelWrite: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamsChannelWriteSchema' + description: Create or update a teams channel + required: true + emailChannelWrite: + content: + application/json: + schema: + $ref: '#/components/schemas/EmailChannelWriteSchema' + description: Create or update a email channel + required: true notificationConfigurationWrite: content: application/json: @@ -5416,6 +5920,24 @@ components: schema: $ref: '#/components/schemas/OpsgenieResponders' description: Opsgenie responders + teamsNotificationChannel: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamsNotificationChannel' + description: Teams notification channel + emailNotificationChannel: + content: + application/json: + schema: + $ref: '#/components/schemas/EmailNotificationChannel' + description: Email notification channel + emailNotificationStatus: + content: + application/json: + schema: + $ref: '#/components/schemas/EmailNotificationStatus' + description: Email notification status notificationConfigurations: content: application/json: @@ -7896,6 +8418,59 @@ components: items: $ref: '#/components/schemas/OpsgenieResponder' type: array + TeamsChannelWriteSchema: + example: + url: url + properties: + url: + type: string + required: + - url + type: object + TeamsNotificationChannel: + allOf: + - $ref: '#/components/schemas/BaseNotificationChannel' + - $ref: '#/components/schemas/TeamsChannelWriteSchema' + - $ref: '#/components/schemas/TeamsNotificationChannel_allOf' + EmailChannelWriteSchema: + example: + cc: + - cc + - cc + to: + - to + - to + subjectPrefix: subjectPrefix + properties: + to: + items: + type: string + minItems: 1 + type: array + cc: + items: + type: string + type: array + subjectPrefix: + type: string + required: + - cc + - to + type: object + EmailNotificationChannel: + allOf: + - $ref: '#/components/schemas/BaseNotificationChannel' + - $ref: '#/components/schemas/EmailChannelWriteSchema' + - $ref: '#/components/schemas/EmailNotificationChannel_allOf' + EmailNotificationStatus: + example: + validConfiguration: true + properties: + validConfiguration: + type: boolean + required: + - validConfiguration + type: object NotificationConfigurations: items: $ref: '#/components/schemas/NotificationConfigurationReadSchema' @@ -7987,6 +8562,8 @@ components: - $ref: '#/components/schemas/SlackChannelRefId' - $ref: '#/components/schemas/WebhookChannelRefId' - $ref: '#/components/schemas/OpsgenieChannelRefId' + - $ref: '#/components/schemas/TeamsChannelRefId' + - $ref: '#/components/schemas/EmailChannelRefId' type: object SlackChannelRefId: properties: @@ -8027,6 +8604,32 @@ components: - _type - id type: object + TeamsChannelRefId: + properties: + _type: + enum: + - TeamsChannelRefId + type: string + id: + format: int64 + type: integer + required: + - _type + - id + type: object + EmailChannelRefId: + properties: + _type: + enum: + - EmailChannelRefId + type: string + id: + format: int64 + type: integer + required: + - _type + - id + type: object NotificationConfigurationRuntimeStatusValue: enum: - ERROR @@ -8343,7 +8946,7 @@ components: type: object EventItemsWithTotal: example: - total: 5 + total: 1 items: - identifier: identifier sourceIdentifier: sourceIdentifier @@ -8371,15 +8974,6 @@ components: url: url - title: title url: url - causingEvents: - - eventId: eventId - eventType: eventType - title: title - eventTimestamp: 1 - - eventId: eventId - eventType: eventType - title: title - eventTimestamp: 1 - identifier: identifier sourceIdentifier: sourceIdentifier data: "{}" @@ -8406,15 +9000,6 @@ components: url: url - title: title url: url - causingEvents: - - eventId: eventId - eventType: eventType - title: title - eventTimestamp: 1 - - eventId: eventId - eventType: eventType - title: title - eventTimestamp: 1 properties: items: items: @@ -8455,15 +9040,6 @@ components: url: url - title: title url: url - causingEvents: - - eventId: eventId - eventType: eventType - title: title - eventTimestamp: 1 - - eventId: eventId - eventType: eventType - title: title - eventTimestamp: 1 properties: identifier: type: string @@ -8503,10 +9079,6 @@ components: items: $ref: '#/components/schemas/EventTag' type: array - causingEvents: - items: - $ref: '#/components/schemas/EventRef' - type: array required: - category - causingEvents @@ -8608,28 +9180,6 @@ components: - key - value type: object - EventRef: - example: - eventId: eventId - eventType: eventType - title: title - eventTimestamp: 1 - properties: - title: - type: string - eventId: - type: string - eventTimestamp: - format: int64 - type: integer - eventType: - type: string - required: - - eventId - - eventTimestamp - - eventType - - title - type: object EventId: type: string EventNotFoundError: @@ -10167,6 +10717,9 @@ components: PromTimeout: pattern: "^((([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?|0)$" type: string + PromStep: + pattern: "(^((([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?|0)$)|(^[0-9]+$)" + type: string PromPostFilter: items: type: string @@ -10352,14 +10905,13 @@ components: $ref: '#/components/schemas/PromTime' timeout: $ref: '#/components/schemas/PromTimeout' + step: + $ref: '#/components/schemas/PromStep' post_filter: $ref: '#/components/schemas/PromPostFilter' required: - query type: object - PromStep: - pattern: "(^((([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?|0)$)|(^[0-9]+$)" - type: string PromMaxNumberOfDataPoints: format: int64 type: integer @@ -10375,6 +10927,8 @@ components: $ref: '#/components/schemas/PromStep' timeout: $ref: '#/components/schemas/PromTimeout' + aligned: + $ref: '#/components/schemas/PromAligned' maxNumberOfDataPoints: $ref: '#/components/schemas/PromMaxNumberOfDataPoints' post_filter: @@ -10385,6 +10939,8 @@ components: - start - step type: object + PromAligned: + type: boolean PromExemplarEnvelope: example: data: @@ -12093,6 +12649,173 @@ components: ComponentId: format: int64 type: integer + CheckLeaseRequest: + example: + apiKey: apiKey + agentData: + memoryBytes: 5 + kernelVersion: kernelVersion + coreCount: 1 + platform: platform + properties: + apiKey: + type: string + agentData: + $ref: '#/components/schemas/AgentData' + required: + - apiKey + type: object + AgentId: + type: string + AgentRegistration: + example: + agentId: agentId + leaseUntilEpochMs: 0 + registeredEpochMs: 6 + lease: null + agentData: + memoryBytes: 5 + kernelVersion: kernelVersion + coreCount: 1 + platform: platform + properties: + agentId: + type: string + lease: + $ref: '#/components/schemas/AgentLease' + leaseUntilEpochMs: + format: int64 + type: integer + registeredEpochMs: + format: int64 + type: integer + agentData: + $ref: '#/components/schemas/AgentData' + required: + - agentId + - lease + - leaseUntilEpochMs + - registeredEpochMs + type: object + AgentLease: + enum: + - Active + - Limited + - Stale + type: string + AgentData: + example: + memoryBytes: 5 + kernelVersion: kernelVersion + coreCount: 1 + platform: platform + properties: + platform: + type: string + coreCount: + type: integer + memoryBytes: + format: int64 + type: integer + kernelVersion: + type: string + required: + - coreCount + - kernelVersion + - memoryBytes + - platform + type: object + AgentRegistrations: + example: + agents: + - agentId: agentId + leaseUntilEpochMs: 0 + registeredEpochMs: 6 + lease: null + agentData: + memoryBytes: 5 + kernelVersion: kernelVersion + coreCount: 1 + platform: platform + - agentId: agentId + leaseUntilEpochMs: 0 + registeredEpochMs: 6 + lease: null + agentData: + memoryBytes: 5 + kernelVersion: kernelVersion + coreCount: 1 + platform: platform + properties: + agents: + items: + $ref: '#/components/schemas/AgentRegistration' + type: array + required: + - agents + type: object + SystemNotifications: + example: + notifications: + - severity: null + toast: true + notificationTimeEpochMs: 0 + notificationId: notificationId + title: title + content: content + - severity: null + toast: true + notificationTimeEpochMs: 0 + notificationId: notificationId + title: title + content: content + properties: + notifications: + items: + $ref: '#/components/schemas/SystemNotification' + type: array + required: + - notifications + type: object + SystemNotification: + example: + severity: null + toast: true + notificationTimeEpochMs: 0 + notificationId: notificationId + title: title + content: content + properties: + notificationId: + type: string + title: + type: string + severity: + $ref: '#/components/schemas/SystemNotificationSeverity' + notificationTimeEpochMs: + format: int64 + type: integer + content: + type: string + toast: + type: boolean + required: + - content + - notificationId + - notificationTimeEpochMs + - severity + - title + - toast + type: object + SystemNotificationId: + type: string + SystemNotificationSeverity: + enum: + - info + - ok + - warning + - problem + type: string StackElementNotFound: discriminator: propertyName: _type @@ -12107,6 +12830,12 @@ components: type: string message: type: string + existedEarlierMs: + format: int64 + type: integer + existsLaterMs: + format: int64 + type: integer required: - _type - message @@ -12126,7 +12855,6 @@ components: - $ref: '#/components/schemas/ArgumentDoubleVal' - $ref: '#/components/schemas/ArgumentStateVal' - $ref: '#/components/schemas/ArgumentNodeIdVal' - - $ref: '#/components/schemas/ArgumentPropagatedHealthStateVal' - $ref: '#/components/schemas/ArgumentDurationVal' - $ref: '#/components/schemas/ArgumentStringVal' - $ref: '#/components/schemas/ArgumentTimeWindowVal' @@ -12342,36 +13070,6 @@ components: - parameter - value type: object - ArgumentPropagatedHealthStateVal: - properties: - _type: - enum: - - ArgumentPropagatedHealthStateVal - type: string - id: - format: int64 - type: integer - lastUpdateTimestamp: - format: int64 - type: integer - parameter: - format: int64 - type: integer - value: - $ref: '#/components/schemas/PropagatedHealthStateValue' - required: - - _type - - parameter - - value - type: object - PropagatedHealthStateValue: - enum: - - UNKNOWN - - PROPAGATION_ERROR - - DEVIATING - - FLAPPING - - CRITICAL - type: string ArgumentDurationVal: properties: _type: @@ -12637,8 +13335,6 @@ components: required: - checkStateId - componentIdentifier - - componentName - - componentType - healthState - lastUpdateTimestamp type: object @@ -12688,6 +13384,8 @@ components: - $ref: '#/components/schemas/SlackNotificationChannel' - $ref: '#/components/schemas/WebhookNotificationChannel' - $ref: '#/components/schemas/OpsgenieNotificationChannel' + - $ref: '#/components/schemas/TeamsNotificationChannel' + - $ref: '#/components/schemas/EmailNotificationChannel' InstantNanoPrecision: description: A custom representation for a date/time that needs better than milliseconds precision. Simply using nanoseconds since epoch results in integers @@ -12802,6 +13500,24 @@ components: required: - _type type: object + TeamsNotificationChannel_allOf: + properties: + _type: + enum: + - TeamsNotificationChannel + type: string + required: + - _type + type: object + EmailNotificationChannel_allOf: + properties: + _type: + enum: + - EmailNotificationChannel + type: string + required: + - _type + type: object NotificationConfigurationReadSchema_allOf: properties: id: diff --git a/generated/stackstate_api/api_agent_leases.go b/generated/stackstate_api/api_agent_leases.go new file mode 100644 index 00000000..41774faf --- /dev/null +++ b/generated/stackstate_api/api_agent_leases.go @@ -0,0 +1,261 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + +type AgentLeasesApi interface { + + /* + AgentCheckLease Check the lease of an agent. + + Checks the lease of an agent and might register it if it does not exist yet. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param agentId The identifier of an agent + @return ApiAgentCheckLeaseRequest + */ + AgentCheckLease(ctx context.Context, agentId string) ApiAgentCheckLeaseRequest + + // AgentCheckLeaseExecute executes the request + // @return AgentRegistration + AgentCheckLeaseExecute(r ApiAgentCheckLeaseRequest) (*AgentRegistration, *http.Response, error) +} + +// AgentLeasesApiService AgentLeasesApi service +type AgentLeasesApiService service + +type ApiAgentCheckLeaseRequest struct { + ctx context.Context + ApiService AgentLeasesApi + agentId string + checkLeaseRequest *CheckLeaseRequest +} + +func (r ApiAgentCheckLeaseRequest) CheckLeaseRequest(checkLeaseRequest CheckLeaseRequest) ApiAgentCheckLeaseRequest { + r.checkLeaseRequest = &checkLeaseRequest + return r +} + +func (r ApiAgentCheckLeaseRequest) Execute() (*AgentRegistration, *http.Response, error) { + return r.ApiService.AgentCheckLeaseExecute(r) +} + +/* +AgentCheckLease Check the lease of an agent. + +Checks the lease of an agent and might register it if it does not exist yet. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param agentId The identifier of an agent + @return ApiAgentCheckLeaseRequest +*/ +func (a *AgentLeasesApiService) AgentCheckLease(ctx context.Context, agentId string) ApiAgentCheckLeaseRequest { + return ApiAgentCheckLeaseRequest{ + ApiService: a, + ctx: ctx, + agentId: agentId, + } +} + +// Execute executes the request +// @return AgentRegistration +func (a *AgentLeasesApiService) AgentCheckLeaseExecute(r ApiAgentCheckLeaseRequest) (*AgentRegistration, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AgentRegistration + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AgentLeasesApiService.AgentCheckLease") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/agents/{agentId}/checkLease" + localVarPath = strings.Replace(localVarPath, "{"+"agentId"+"}", url.PathEscape(parameterToString(r.agentId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.checkLeaseRequest == nil { + return localVarReturnValue, nil, reportError("checkLeaseRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.checkLeaseRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Token"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceBearer"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-ServiceBearer"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 429 { + var v AgentRegistration + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorsResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// --------------------------------------------- +// ------------------ MOCKS -------------------- +// --------------------------------------------- + +type AgentLeasesApiMock struct { + AgentCheckLeaseCalls *[]AgentCheckLeaseCall + AgentCheckLeaseResponse AgentCheckLeaseMockResponse +} + +func NewAgentLeasesApiMock() AgentLeasesApiMock { + xAgentCheckLeaseCalls := make([]AgentCheckLeaseCall, 0) + return AgentLeasesApiMock{ + AgentCheckLeaseCalls: &xAgentCheckLeaseCalls, + } +} + +type AgentCheckLeaseMockResponse struct { + Result AgentRegistration + Response *http.Response + Error error +} + +type AgentCheckLeaseCall struct { + PagentId string + PcheckLeaseRequest *CheckLeaseRequest +} + +func (mock AgentLeasesApiMock) AgentCheckLease(ctx context.Context, agentId string) ApiAgentCheckLeaseRequest { + return ApiAgentCheckLeaseRequest{ + ApiService: mock, + ctx: ctx, + agentId: agentId, + } +} + +func (mock AgentLeasesApiMock) AgentCheckLeaseExecute(r ApiAgentCheckLeaseRequest) (*AgentRegistration, *http.Response, error) { + p := AgentCheckLeaseCall{ + PagentId: r.agentId, + PcheckLeaseRequest: r.checkLeaseRequest, + } + *mock.AgentCheckLeaseCalls = append(*mock.AgentCheckLeaseCalls, p) + return &mock.AgentCheckLeaseResponse.Result, mock.AgentCheckLeaseResponse.Response, mock.AgentCheckLeaseResponse.Error +} diff --git a/generated/stackstate_api/api_agent_registrations.go b/generated/stackstate_api/api_agent_registrations.go new file mode 100644 index 00000000..b810e295 --- /dev/null +++ b/generated/stackstate_api/api_agent_registrations.go @@ -0,0 +1,228 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" +) + +type AgentRegistrationsApi interface { + + /* + AllAgentRegistrations Overview of registered agents + + Give an overview of all registered agents + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAllAgentRegistrationsRequest + */ + AllAgentRegistrations(ctx context.Context) ApiAllAgentRegistrationsRequest + + // AllAgentRegistrationsExecute executes the request + // @return AgentRegistrations + AllAgentRegistrationsExecute(r ApiAllAgentRegistrationsRequest) (*AgentRegistrations, *http.Response, error) +} + +// AgentRegistrationsApiService AgentRegistrationsApi service +type AgentRegistrationsApiService service + +type ApiAllAgentRegistrationsRequest struct { + ctx context.Context + ApiService AgentRegistrationsApi +} + +func (r ApiAllAgentRegistrationsRequest) Execute() (*AgentRegistrations, *http.Response, error) { + return r.ApiService.AllAgentRegistrationsExecute(r) +} + +/* +AllAgentRegistrations Overview of registered agents + +Give an overview of all registered agents + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAllAgentRegistrationsRequest +*/ +func (a *AgentRegistrationsApiService) AllAgentRegistrations(ctx context.Context) ApiAllAgentRegistrationsRequest { + return ApiAllAgentRegistrationsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return AgentRegistrations +func (a *AgentRegistrationsApiService) AllAgentRegistrationsExecute(r ApiAllAgentRegistrationsRequest) (*AgentRegistrations, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AgentRegistrations + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AgentRegistrationsApiService.AllAgentRegistrations") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/agents" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Token"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceBearer"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-ServiceBearer"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorsResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// --------------------------------------------- +// ------------------ MOCKS -------------------- +// --------------------------------------------- + +type AgentRegistrationsApiMock struct { + AllAgentRegistrationsCalls *[]AllAgentRegistrationsCall + AllAgentRegistrationsResponse AllAgentRegistrationsMockResponse +} + +func NewAgentRegistrationsApiMock() AgentRegistrationsApiMock { + xAllAgentRegistrationsCalls := make([]AllAgentRegistrationsCall, 0) + return AgentRegistrationsApiMock{ + AllAgentRegistrationsCalls: &xAllAgentRegistrationsCalls, + } +} + +type AllAgentRegistrationsMockResponse struct { + Result AgentRegistrations + Response *http.Response + Error error +} + +type AllAgentRegistrationsCall struct { +} + +func (mock AgentRegistrationsApiMock) AllAgentRegistrations(ctx context.Context) ApiAllAgentRegistrationsRequest { + return ApiAllAgentRegistrationsRequest{ + ApiService: mock, + ctx: ctx, + } +} + +func (mock AgentRegistrationsApiMock) AllAgentRegistrationsExecute(r ApiAllAgentRegistrationsRequest) (*AgentRegistrations, *http.Response, error) { + p := AllAgentRegistrationsCall{} + *mock.AllAgentRegistrationsCalls = append(*mock.AllAgentRegistrationsCalls, p) + return &mock.AllAgentRegistrationsResponse.Result, mock.AllAgentRegistrationsResponse.Response, mock.AllAgentRegistrationsResponse.Error +} diff --git a/generated/stackstate_api/api_metric.go b/generated/stackstate_api/api_metric.go index 78b05ec6..5ecbec6e 100644 --- a/generated/stackstate_api/api_metric.go +++ b/generated/stackstate_api/api_metric.go @@ -441,6 +441,7 @@ type ApiGetInstantQueryRequest struct { query *string time *string timeout *string + step *string postFilter *[]string } @@ -462,6 +463,12 @@ func (r ApiGetInstantQueryRequest) Timeout(timeout string) ApiGetInstantQueryReq return r } +// Query resolution step width in duration format or float number of seconds. +func (r ApiGetInstantQueryRequest) Step(step string) ApiGetInstantQueryRequest { + r.step = &step + return r +} + // Enforce additional label filters for queries func (r ApiGetInstantQueryRequest) PostFilter(postFilter []string) ApiGetInstantQueryRequest { r.postFilter = &postFilter @@ -518,6 +525,9 @@ func (a *MetricApiService) GetInstantQueryExecute(r ApiGetInstantQueryRequest) ( if r.timeout != nil { localVarQueryParams.Add("timeout", parameterToString(*r.timeout, "")) } + if r.step != nil { + localVarQueryParams.Add("step", parameterToString(*r.step, "")) + } if r.postFilter != nil { localVarQueryParams.Add("post_filter", parameterToString(*r.postFilter, "csv")) } @@ -1288,6 +1298,7 @@ type ApiGetRangeQueryRequest struct { end *string step *string timeout *string + aligned *bool maxNumberOfDataPoints *int64 postFilter *[]string } @@ -1322,6 +1333,12 @@ func (r ApiGetRangeQueryRequest) Timeout(timeout string) ApiGetRangeQueryRequest return r } +// Align start and end times with step size +func (r ApiGetRangeQueryRequest) Aligned(aligned bool) ApiGetRangeQueryRequest { + r.aligned = &aligned + return r +} + // Maximum number of data points to return. func (r ApiGetRangeQueryRequest) MaxNumberOfDataPoints(maxNumberOfDataPoints int64) ApiGetRangeQueryRequest { r.maxNumberOfDataPoints = &maxNumberOfDataPoints @@ -1393,6 +1410,9 @@ func (a *MetricApiService) GetRangeQueryExecute(r ApiGetRangeQueryRequest) (*Pro if r.timeout != nil { localVarQueryParams.Add("timeout", parameterToString(*r.timeout, "")) } + if r.aligned != nil { + localVarQueryParams.Add("aligned", parameterToString(*r.aligned, "")) + } if r.maxNumberOfDataPoints != nil { localVarQueryParams.Add("maxNumberOfDataPoints", parameterToString(*r.maxNumberOfDataPoints, "")) } @@ -1962,6 +1982,7 @@ type ApiPostInstantQueryRequest struct { query *string time *string timeout *string + step *string postFilter *[]string } @@ -1980,6 +2001,11 @@ func (r ApiPostInstantQueryRequest) Timeout(timeout string) ApiPostInstantQueryR return r } +func (r ApiPostInstantQueryRequest) Step(step string) ApiPostInstantQueryRequest { + r.step = &step + return r +} + func (r ApiPostInstantQueryRequest) PostFilter(postFilter []string) ApiPostInstantQueryRequest { r.postFilter = &postFilter return r @@ -2052,6 +2078,9 @@ func (a *MetricApiService) PostInstantQueryExecute(r ApiPostInstantQueryRequest) if r.timeout != nil { localVarFormParams.Add("timeout", parameterToString(*r.timeout, "")) } + if r.step != nil { + localVarFormParams.Add("step", parameterToString(*r.step, "")) + } if r.postFilter != nil { localVarFormParams.Add("post_filter", parameterToString(*r.postFilter, "multi")) } @@ -2797,6 +2826,7 @@ type ApiPostRangeQueryRequest struct { end *string step *string timeout *string + aligned *bool maxNumberOfDataPoints *int64 postFilter *[]string } @@ -2826,6 +2856,11 @@ func (r ApiPostRangeQueryRequest) Timeout(timeout string) ApiPostRangeQueryReque return r } +func (r ApiPostRangeQueryRequest) Aligned(aligned bool) ApiPostRangeQueryRequest { + r.aligned = &aligned + return r +} + func (r ApiPostRangeQueryRequest) MaxNumberOfDataPoints(maxNumberOfDataPoints int64) ApiPostRangeQueryRequest { r.maxNumberOfDataPoints = &maxNumberOfDataPoints return r @@ -2912,6 +2947,9 @@ func (a *MetricApiService) PostRangeQueryExecute(r ApiPostRangeQueryRequest) (*P if r.timeout != nil { localVarFormParams.Add("timeout", parameterToString(*r.timeout, "")) } + if r.aligned != nil { + localVarFormParams.Add("aligned", parameterToString(*r.aligned, "")) + } if r.maxNumberOfDataPoints != nil { localVarFormParams.Add("maxNumberOfDataPoints", parameterToString(*r.maxNumberOfDataPoints, "")) } @@ -3354,6 +3392,7 @@ type GetInstantQueryCall struct { Pquery *string Ptime *string Ptimeout *string + Pstep *string PpostFilter *[]string } @@ -3369,6 +3408,7 @@ func (mock MetricApiMock) GetInstantQueryExecute(r ApiGetInstantQueryRequest) (* Pquery: r.query, Ptime: r.time, Ptimeout: r.timeout, + Pstep: r.step, PpostFilter: r.postFilter, } *mock.GetInstantQueryCalls = append(*mock.GetInstantQueryCalls, p) @@ -3475,6 +3515,7 @@ type GetRangeQueryCall struct { Pend *string Pstep *string Ptimeout *string + Paligned *bool PmaxNumberOfDataPoints *int64 PpostFilter *[]string } @@ -3493,6 +3534,7 @@ func (mock MetricApiMock) GetRangeQueryExecute(r ApiGetRangeQueryRequest) (*Prom Pend: r.end, Pstep: r.step, Ptimeout: r.timeout, + Paligned: r.aligned, PmaxNumberOfDataPoints: r.maxNumberOfDataPoints, PpostFilter: r.postFilter, } @@ -3568,6 +3610,7 @@ type PostInstantQueryCall struct { Pquery *string Ptime *string Ptimeout *string + Pstep *string PpostFilter *[]string } @@ -3583,6 +3626,7 @@ func (mock MetricApiMock) PostInstantQueryExecute(r ApiPostInstantQueryRequest) Pquery: r.query, Ptime: r.time, Ptimeout: r.timeout, + Pstep: r.step, PpostFilter: r.postFilter, } *mock.PostInstantQueryCalls = append(*mock.PostInstantQueryCalls, p) @@ -3689,6 +3733,7 @@ type PostRangeQueryCall struct { Pend *string Pstep *string Ptimeout *string + Paligned *bool PmaxNumberOfDataPoints *int64 PpostFilter *[]string } @@ -3707,6 +3752,7 @@ func (mock MetricApiMock) PostRangeQueryExecute(r ApiPostRangeQueryRequest) (*Pr Pend: r.end, Pstep: r.step, Ptimeout: r.timeout, + Paligned: r.aligned, PmaxNumberOfDataPoints: r.maxNumberOfDataPoints, PpostFilter: r.postFilter, } diff --git a/generated/stackstate_api/api_monitor.go b/generated/stackstate_api/api_monitor.go index 55728648..7bc474ad 100644 --- a/generated/stackstate_api/api_monitor.go +++ b/generated/stackstate_api/api_monitor.go @@ -724,6 +724,7 @@ type ApiGetMonitorCheckStatesRequest struct { monitorIdOrUrn string healthState *HealthStateValue limit *int32 + timestamp *int64 } // Health state of check states @@ -737,6 +738,11 @@ func (r ApiGetMonitorCheckStatesRequest) Limit(limit int32) ApiGetMonitorCheckSt return r } +func (r ApiGetMonitorCheckStatesRequest) Timestamp(timestamp int64) ApiGetMonitorCheckStatesRequest { + r.timestamp = ×tamp + return r +} + func (r ApiGetMonitorCheckStatesRequest) Execute() (*MonitorCheckStates, *http.Response, error) { return r.ApiService.GetMonitorCheckStatesExecute(r) } @@ -786,6 +792,9 @@ func (a *MonitorApiService) GetMonitorCheckStatesExecute(r ApiGetMonitorCheckSta if r.limit != nil { localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) } + if r.timestamp != nil { + localVarQueryParams.Add("timestamp", parameterToString(*r.timestamp, "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -915,6 +924,12 @@ type ApiGetMonitorWithStatusRequest struct { ctx context.Context ApiService MonitorApi monitorIdOrUrn string + timestamp *int64 +} + +func (r ApiGetMonitorWithStatusRequest) Timestamp(timestamp int64) ApiGetMonitorWithStatusRequest { + r.timestamp = ×tamp + return r } func (r ApiGetMonitorWithStatusRequest) Execute() (*MonitorStatus, *http.Response, error) { @@ -960,6 +975,9 @@ func (a *MonitorApiService) GetMonitorWithStatusExecute(r ApiGetMonitorWithStatu localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.timestamp != nil { + localVarQueryParams.Add("timestamp", parameterToString(*r.timestamp, "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2885,6 +2903,7 @@ type GetMonitorCheckStatesCall struct { PmonitorIdOrUrn string PhealthState *HealthStateValue Plimit *int32 + Ptimestamp *int64 } func (mock MonitorApiMock) GetMonitorCheckStates(ctx context.Context, monitorIdOrUrn string) ApiGetMonitorCheckStatesRequest { @@ -2900,6 +2919,7 @@ func (mock MonitorApiMock) GetMonitorCheckStatesExecute(r ApiGetMonitorCheckStat PmonitorIdOrUrn: r.monitorIdOrUrn, PhealthState: r.healthState, Plimit: r.limit, + Ptimestamp: r.timestamp, } *mock.GetMonitorCheckStatesCalls = append(*mock.GetMonitorCheckStatesCalls, p) return &mock.GetMonitorCheckStatesResponse.Result, mock.GetMonitorCheckStatesResponse.Response, mock.GetMonitorCheckStatesResponse.Error @@ -2913,6 +2933,7 @@ type GetMonitorWithStatusMockResponse struct { type GetMonitorWithStatusCall struct { PmonitorIdOrUrn string + Ptimestamp *int64 } func (mock MonitorApiMock) GetMonitorWithStatus(ctx context.Context, monitorIdOrUrn string) ApiGetMonitorWithStatusRequest { @@ -2926,6 +2947,7 @@ func (mock MonitorApiMock) GetMonitorWithStatus(ctx context.Context, monitorIdOr func (mock MonitorApiMock) GetMonitorWithStatusExecute(r ApiGetMonitorWithStatusRequest) (*MonitorStatus, *http.Response, error) { p := GetMonitorWithStatusCall{ PmonitorIdOrUrn: r.monitorIdOrUrn, + Ptimestamp: r.timestamp, } *mock.GetMonitorWithStatusCalls = append(*mock.GetMonitorWithStatusCalls, p) return &mock.GetMonitorWithStatusResponse.Result, mock.GetMonitorWithStatusResponse.Response, mock.GetMonitorWithStatusResponse.Error diff --git a/generated/stackstate_api/api_notification_channels.go b/generated/stackstate_api/api_notification_channels.go index d1238706..f0020a17 100644 --- a/generated/stackstate_api/api_notification_channels.go +++ b/generated/stackstate_api/api_notification_channels.go @@ -22,6 +22,20 @@ import ( type NotificationChannelsApi interface { + /* + CreateEmailNotificationChannel Create a Email Notification channel + + Create Email Notification channel + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateEmailNotificationChannelRequest + */ + CreateEmailNotificationChannel(ctx context.Context) ApiCreateEmailNotificationChannelRequest + + // CreateEmailNotificationChannelExecute executes the request + // @return EmailNotificationChannel + CreateEmailNotificationChannelExecute(r ApiCreateEmailNotificationChannelRequest) (*EmailNotificationChannel, *http.Response, error) + /* CreateOpsgenieNotificationChannel Create a Opsgenie Notification channel @@ -36,6 +50,20 @@ type NotificationChannelsApi interface { // @return OpsgenieNotificationChannel CreateOpsgenieNotificationChannelExecute(r ApiCreateOpsgenieNotificationChannelRequest) (*OpsgenieNotificationChannel, *http.Response, error) + /* + CreateTeamsNotificationChannel Create a Teams Notification channel + + Create a Teams Notification channel + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateTeamsNotificationChannelRequest + */ + CreateTeamsNotificationChannel(ctx context.Context) ApiCreateTeamsNotificationChannelRequest + + // CreateTeamsNotificationChannelExecute executes the request + // @return TeamsNotificationChannel + CreateTeamsNotificationChannelExecute(r ApiCreateTeamsNotificationChannelRequest) (*TeamsNotificationChannel, *http.Response, error) + /* CreateWebhookNotificationChannel Create a Webhook Notification channel @@ -50,6 +78,20 @@ type NotificationChannelsApi interface { // @return WebhookNotificationChannel CreateWebhookNotificationChannelExecute(r ApiCreateWebhookNotificationChannelRequest) (*WebhookNotificationChannel, *http.Response, error) + /* + DeleteEmailNotificationChannel Delete the Email Notification channel by id + + Delete the email notification channel by id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiDeleteEmailNotificationChannelRequest + */ + DeleteEmailNotificationChannel(ctx context.Context, channelId int64) ApiDeleteEmailNotificationChannelRequest + + // DeleteEmailNotificationChannelExecute executes the request + DeleteEmailNotificationChannelExecute(r ApiDeleteEmailNotificationChannelRequest) (*http.Response, error) + /* DeleteOpsgenieNotificationChannel Delete the Opsgenie Notification channel by id @@ -78,6 +120,20 @@ type NotificationChannelsApi interface { // DeleteSlackNotificationChannelExecute executes the request DeleteSlackNotificationChannelExecute(r ApiDeleteSlackNotificationChannelRequest) (*http.Response, error) + /* + DeleteTeamsNotificationChannel Delete the Teams Notification channel by id + + Delete the teams notification channel by id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiDeleteTeamsNotificationChannelRequest + */ + DeleteTeamsNotificationChannel(ctx context.Context, channelId int64) ApiDeleteTeamsNotificationChannelRequest + + // DeleteTeamsNotificationChannelExecute executes the request + DeleteTeamsNotificationChannelExecute(r ApiDeleteTeamsNotificationChannelRequest) (*http.Response, error) + /* DeleteWebhookNotificationChannel Delete the Webhook Notification channel by id @@ -92,6 +148,35 @@ type NotificationChannelsApi interface { // DeleteWebhookNotificationChannelExecute executes the request DeleteWebhookNotificationChannelExecute(r ApiDeleteWebhookNotificationChannelRequest) (*http.Response, error) + /* + GetEmailNotificationChannel Get the Email Notification channel by id + + Get the email notification channel by id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiGetEmailNotificationChannelRequest + */ + GetEmailNotificationChannel(ctx context.Context, channelId int64) ApiGetEmailNotificationChannelRequest + + // GetEmailNotificationChannelExecute executes the request + // @return EmailNotificationChannel + GetEmailNotificationChannelExecute(r ApiGetEmailNotificationChannelRequest) (*EmailNotificationChannel, *http.Response, error) + + /* + GetEmailNotificationStatus Email Notification channel status + + Email Notification channel status, test whether it can be used + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetEmailNotificationStatusRequest + */ + GetEmailNotificationStatus(ctx context.Context) ApiGetEmailNotificationStatusRequest + + // GetEmailNotificationStatusExecute executes the request + // @return EmailNotificationStatus + GetEmailNotificationStatusExecute(r ApiGetEmailNotificationStatusRequest) (*EmailNotificationStatus, *http.Response, error) + /* GetOpsgenieNotificationChannel Get the Opsgenie Notification channel by id @@ -122,6 +207,21 @@ type NotificationChannelsApi interface { // @return SlackNotificationChannel GetSlackNotificationChannelExecute(r ApiGetSlackNotificationChannelRequest) (*SlackNotificationChannel, *http.Response, error) + /* + GetTeamsNotificationChannel Get the Teams Notification channel by id + + Get the teams notification channel by id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiGetTeamsNotificationChannelRequest + */ + GetTeamsNotificationChannel(ctx context.Context, channelId int64) ApiGetTeamsNotificationChannelRequest + + // GetTeamsNotificationChannelExecute executes the request + // @return TeamsNotificationChannel + GetTeamsNotificationChannelExecute(r ApiGetTeamsNotificationChannelRequest) (*TeamsNotificationChannel, *http.Response, error) + /* GetWebhookNotificationChannel Get the Webhook Notification channel by id @@ -207,6 +307,20 @@ type NotificationChannelsApi interface { // SlackOauthRedirectExecute executes the request SlackOauthRedirectExecute(r ApiSlackOauthRedirectRequest) (*http.Response, error) + /* + TestEmailChannel Test the Email notification channel + + Test the email notification channel by sending a test message to the notification channel. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiTestEmailChannelRequest + */ + TestEmailChannel(ctx context.Context, channelId int64) ApiTestEmailChannelRequest + + // TestEmailChannelExecute executes the request + TestEmailChannelExecute(r ApiTestEmailChannelRequest) (*http.Response, error) + /* TestOpsgenieChannel Test the Opsgenie notification channel @@ -235,6 +349,20 @@ type NotificationChannelsApi interface { // TestSlackChannelExecute executes the request TestSlackChannelExecute(r ApiTestSlackChannelRequest) (*http.Response, error) + /* + TestTeamsChannel Test the Teams notification channel + + Test the teams notification channel by sending a test message to the notification channel. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiTestTeamsChannelRequest + */ + TestTeamsChannel(ctx context.Context, channelId int64) ApiTestTeamsChannelRequest + + // TestTeamsChannelExecute executes the request + TestTeamsChannelExecute(r ApiTestTeamsChannelRequest) (*http.Response, error) + /* TestWebhookChannel Test the Webhook notification channel @@ -249,6 +377,21 @@ type NotificationChannelsApi interface { // TestWebhookChannelExecute executes the request TestWebhookChannelExecute(r ApiTestWebhookChannelRequest) (*http.Response, error) + /* + UpdateEmailNotificationChannel Update the Email Notification channel by id + + Update the email notification channel by id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiUpdateEmailNotificationChannelRequest + */ + UpdateEmailNotificationChannel(ctx context.Context, channelId int64) ApiUpdateEmailNotificationChannelRequest + + // UpdateEmailNotificationChannelExecute executes the request + // @return EmailNotificationChannel + UpdateEmailNotificationChannelExecute(r ApiUpdateEmailNotificationChannelRequest) (*EmailNotificationChannel, *http.Response, error) + /* UpdateOpsgenieNotificationChannel Update the Opsgenie Notification channel by id @@ -264,6 +407,21 @@ type NotificationChannelsApi interface { // @return OpsgenieNotificationChannel UpdateOpsgenieNotificationChannelExecute(r ApiUpdateOpsgenieNotificationChannelRequest) (*OpsgenieNotificationChannel, *http.Response, error) + /* + UpdateTeamsNotificationChannel Update the Teams Notification channel by id + + Update the teams notification channel by id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiUpdateTeamsNotificationChannelRequest + */ + UpdateTeamsNotificationChannel(ctx context.Context, channelId int64) ApiUpdateTeamsNotificationChannelRequest + + // UpdateTeamsNotificationChannelExecute executes the request + // @return TeamsNotificationChannel + UpdateTeamsNotificationChannelExecute(r ApiUpdateTeamsNotificationChannelRequest) (*TeamsNotificationChannel, *http.Response, error) + /* UpdateWebhookNotificationChannel Update the Webhook Notification channel by id @@ -283,59 +441,59 @@ type NotificationChannelsApi interface { // NotificationChannelsApiService NotificationChannelsApi service type NotificationChannelsApiService service -type ApiCreateOpsgenieNotificationChannelRequest struct { - ctx context.Context - ApiService NotificationChannelsApi - opsgenieChannelWriteSchema *OpsgenieChannelWriteSchema +type ApiCreateEmailNotificationChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + emailChannelWriteSchema *EmailChannelWriteSchema } -// Create or update a opsgenie channel -func (r ApiCreateOpsgenieNotificationChannelRequest) OpsgenieChannelWriteSchema(opsgenieChannelWriteSchema OpsgenieChannelWriteSchema) ApiCreateOpsgenieNotificationChannelRequest { - r.opsgenieChannelWriteSchema = &opsgenieChannelWriteSchema +// Create or update a email channel +func (r ApiCreateEmailNotificationChannelRequest) EmailChannelWriteSchema(emailChannelWriteSchema EmailChannelWriteSchema) ApiCreateEmailNotificationChannelRequest { + r.emailChannelWriteSchema = &emailChannelWriteSchema return r } -func (r ApiCreateOpsgenieNotificationChannelRequest) Execute() (*OpsgenieNotificationChannel, *http.Response, error) { - return r.ApiService.CreateOpsgenieNotificationChannelExecute(r) +func (r ApiCreateEmailNotificationChannelRequest) Execute() (*EmailNotificationChannel, *http.Response, error) { + return r.ApiService.CreateEmailNotificationChannelExecute(r) } /* -CreateOpsgenieNotificationChannel Create a Opsgenie Notification channel +CreateEmailNotificationChannel Create a Email Notification channel -Create a Opsgenie Notification channel +Create Email Notification channel @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateOpsgenieNotificationChannelRequest + @return ApiCreateEmailNotificationChannelRequest */ -func (a *NotificationChannelsApiService) CreateOpsgenieNotificationChannel(ctx context.Context) ApiCreateOpsgenieNotificationChannelRequest { - return ApiCreateOpsgenieNotificationChannelRequest{ +func (a *NotificationChannelsApiService) CreateEmailNotificationChannel(ctx context.Context) ApiCreateEmailNotificationChannelRequest { + return ApiCreateEmailNotificationChannelRequest{ ApiService: a, ctx: ctx, } } // Execute executes the request -// @return OpsgenieNotificationChannel -func (a *NotificationChannelsApiService) CreateOpsgenieNotificationChannelExecute(r ApiCreateOpsgenieNotificationChannelRequest) (*OpsgenieNotificationChannel, *http.Response, error) { +// @return EmailNotificationChannel +func (a *NotificationChannelsApiService) CreateEmailNotificationChannelExecute(r ApiCreateEmailNotificationChannelRequest) (*EmailNotificationChannel, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *OpsgenieNotificationChannel + localVarReturnValue *EmailNotificationChannel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.CreateOpsgenieNotificationChannel") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.CreateEmailNotificationChannel") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/opsgenie" + localVarPath := localBasePath + "/notifications/channels/email" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.opsgenieChannelWriteSchema == nil { - return localVarReturnValue, nil, reportError("opsgenieChannelWriteSchema is required and must be specified") + if r.emailChannelWriteSchema == nil { + return localVarReturnValue, nil, reportError("emailChannelWriteSchema is required and must be specified") } // to determine the Content-Type header @@ -356,7 +514,7 @@ func (a *NotificationChannelsApiService) CreateOpsgenieNotificationChannelExecut localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.opsgenieChannelWriteSchema + localVarPostBody = r.emailChannelWriteSchema if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -455,59 +613,59 @@ func (a *NotificationChannelsApiService) CreateOpsgenieNotificationChannelExecut return localVarReturnValue, localVarHTTPResponse, nil } -type ApiCreateWebhookNotificationChannelRequest struct { - ctx context.Context - ApiService NotificationChannelsApi - webhookChannelWriteSchema *WebhookChannelWriteSchema +type ApiCreateOpsgenieNotificationChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + opsgenieChannelWriteSchema *OpsgenieChannelWriteSchema } -// Create or update a webhook channel -func (r ApiCreateWebhookNotificationChannelRequest) WebhookChannelWriteSchema(webhookChannelWriteSchema WebhookChannelWriteSchema) ApiCreateWebhookNotificationChannelRequest { - r.webhookChannelWriteSchema = &webhookChannelWriteSchema +// Create or update a opsgenie channel +func (r ApiCreateOpsgenieNotificationChannelRequest) OpsgenieChannelWriteSchema(opsgenieChannelWriteSchema OpsgenieChannelWriteSchema) ApiCreateOpsgenieNotificationChannelRequest { + r.opsgenieChannelWriteSchema = &opsgenieChannelWriteSchema return r } -func (r ApiCreateWebhookNotificationChannelRequest) Execute() (*WebhookNotificationChannel, *http.Response, error) { - return r.ApiService.CreateWebhookNotificationChannelExecute(r) +func (r ApiCreateOpsgenieNotificationChannelRequest) Execute() (*OpsgenieNotificationChannel, *http.Response, error) { + return r.ApiService.CreateOpsgenieNotificationChannelExecute(r) } /* -CreateWebhookNotificationChannel Create a Webhook Notification channel +CreateOpsgenieNotificationChannel Create a Opsgenie Notification channel -Create a Webhook Notification channel +Create a Opsgenie Notification channel @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateWebhookNotificationChannelRequest + @return ApiCreateOpsgenieNotificationChannelRequest */ -func (a *NotificationChannelsApiService) CreateWebhookNotificationChannel(ctx context.Context) ApiCreateWebhookNotificationChannelRequest { - return ApiCreateWebhookNotificationChannelRequest{ +func (a *NotificationChannelsApiService) CreateOpsgenieNotificationChannel(ctx context.Context) ApiCreateOpsgenieNotificationChannelRequest { + return ApiCreateOpsgenieNotificationChannelRequest{ ApiService: a, ctx: ctx, } } // Execute executes the request -// @return WebhookNotificationChannel -func (a *NotificationChannelsApiService) CreateWebhookNotificationChannelExecute(r ApiCreateWebhookNotificationChannelRequest) (*WebhookNotificationChannel, *http.Response, error) { +// @return OpsgenieNotificationChannel +func (a *NotificationChannelsApiService) CreateOpsgenieNotificationChannelExecute(r ApiCreateOpsgenieNotificationChannelRequest) (*OpsgenieNotificationChannel, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *WebhookNotificationChannel + localVarReturnValue *OpsgenieNotificationChannel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.CreateWebhookNotificationChannel") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.CreateOpsgenieNotificationChannel") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/webhook" + localVarPath := localBasePath + "/notifications/channels/opsgenie" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.webhookChannelWriteSchema == nil { - return localVarReturnValue, nil, reportError("webhookChannelWriteSchema is required and must be specified") + if r.opsgenieChannelWriteSchema == nil { + return localVarReturnValue, nil, reportError("opsgenieChannelWriteSchema is required and must be specified") } // to determine the Content-Type header @@ -528,7 +686,7 @@ func (a *NotificationChannelsApiService) CreateWebhookNotificationChannelExecute localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.webhookChannelWriteSchema + localVarPostBody = r.opsgenieChannelWriteSchema if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -627,55 +785,63 @@ func (a *NotificationChannelsApiService) CreateWebhookNotificationChannelExecute return localVarReturnValue, localVarHTTPResponse, nil } -type ApiDeleteOpsgenieNotificationChannelRequest struct { - ctx context.Context - ApiService NotificationChannelsApi - channelId int64 +type ApiCreateTeamsNotificationChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + teamsChannelWriteSchema *TeamsChannelWriteSchema } -func (r ApiDeleteOpsgenieNotificationChannelRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteOpsgenieNotificationChannelExecute(r) +// Create or update a teams channel +func (r ApiCreateTeamsNotificationChannelRequest) TeamsChannelWriteSchema(teamsChannelWriteSchema TeamsChannelWriteSchema) ApiCreateTeamsNotificationChannelRequest { + r.teamsChannelWriteSchema = &teamsChannelWriteSchema + return r +} + +func (r ApiCreateTeamsNotificationChannelRequest) Execute() (*TeamsNotificationChannel, *http.Response, error) { + return r.ApiService.CreateTeamsNotificationChannelExecute(r) } /* -DeleteOpsgenieNotificationChannel Delete the Opsgenie Notification channel by id +CreateTeamsNotificationChannel Create a Teams Notification channel -Delete the opsgenie notification channel by id +Create a Teams Notification channel @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param channelId Channel identifier - @return ApiDeleteOpsgenieNotificationChannelRequest + @return ApiCreateTeamsNotificationChannelRequest */ -func (a *NotificationChannelsApiService) DeleteOpsgenieNotificationChannel(ctx context.Context, channelId int64) ApiDeleteOpsgenieNotificationChannelRequest { - return ApiDeleteOpsgenieNotificationChannelRequest{ +func (a *NotificationChannelsApiService) CreateTeamsNotificationChannel(ctx context.Context) ApiCreateTeamsNotificationChannelRequest { + return ApiCreateTeamsNotificationChannelRequest{ ApiService: a, ctx: ctx, - channelId: channelId, } } // Execute executes the request -func (a *NotificationChannelsApiService) DeleteOpsgenieNotificationChannelExecute(r ApiDeleteOpsgenieNotificationChannelRequest) (*http.Response, error) { +// @return TeamsNotificationChannel +func (a *NotificationChannelsApiService) CreateTeamsNotificationChannelExecute(r ApiCreateTeamsNotificationChannelRequest) (*TeamsNotificationChannel, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TeamsNotificationChannel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.DeleteOpsgenieNotificationChannel") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.CreateTeamsNotificationChannel") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/opsgenie/{channelId}" - localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) + localVarPath := localBasePath + "/notifications/channels/teams" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.teamsChannelWriteSchema == nil { + return localVarReturnValue, nil, reportError("teamsChannelWriteSchema is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -691,6 +857,8 @@ func (a *NotificationChannelsApiService) DeleteOpsgenieNotificationChannelExecut if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.teamsChannelWriteSchema if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -735,19 +903,19 @@ func (a *NotificationChannelsApiService) DeleteOpsgenieNotificationChannelExecut } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -760,85 +928,92 @@ func (a *NotificationChannelsApiService) DeleteOpsgenieNotificationChannelExecut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v NotificationChannelNotFound - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v NotificationChannelError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } -type ApiDeleteSlackNotificationChannelRequest struct { - ctx context.Context - ApiService NotificationChannelsApi - channelId int64 +type ApiCreateWebhookNotificationChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + webhookChannelWriteSchema *WebhookChannelWriteSchema } -func (r ApiDeleteSlackNotificationChannelRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteSlackNotificationChannelExecute(r) +// Create or update a webhook channel +func (r ApiCreateWebhookNotificationChannelRequest) WebhookChannelWriteSchema(webhookChannelWriteSchema WebhookChannelWriteSchema) ApiCreateWebhookNotificationChannelRequest { + r.webhookChannelWriteSchema = &webhookChannelWriteSchema + return r +} + +func (r ApiCreateWebhookNotificationChannelRequest) Execute() (*WebhookNotificationChannel, *http.Response, error) { + return r.ApiService.CreateWebhookNotificationChannelExecute(r) } /* -DeleteSlackNotificationChannel Delete the Slack Notification channel by id +CreateWebhookNotificationChannel Create a Webhook Notification channel -Delete the slack notification channel by id +Create a Webhook Notification channel @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param channelId Channel identifier - @return ApiDeleteSlackNotificationChannelRequest + @return ApiCreateWebhookNotificationChannelRequest */ -func (a *NotificationChannelsApiService) DeleteSlackNotificationChannel(ctx context.Context, channelId int64) ApiDeleteSlackNotificationChannelRequest { - return ApiDeleteSlackNotificationChannelRequest{ +func (a *NotificationChannelsApiService) CreateWebhookNotificationChannel(ctx context.Context) ApiCreateWebhookNotificationChannelRequest { + return ApiCreateWebhookNotificationChannelRequest{ ApiService: a, ctx: ctx, - channelId: channelId, } } // Execute executes the request -func (a *NotificationChannelsApiService) DeleteSlackNotificationChannelExecute(r ApiDeleteSlackNotificationChannelRequest) (*http.Response, error) { +// @return WebhookNotificationChannel +func (a *NotificationChannelsApiService) CreateWebhookNotificationChannelExecute(r ApiCreateWebhookNotificationChannelRequest) (*WebhookNotificationChannel, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.DeleteSlackNotificationChannel") + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WebhookNotificationChannel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.CreateWebhookNotificationChannel") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/slack/{channelId}" - localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) + localVarPath := localBasePath + "/notifications/channels/webhook" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.webhookChannelWriteSchema == nil { + return localVarReturnValue, nil, reportError("webhookChannelWriteSchema is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -854,6 +1029,8 @@ func (a *NotificationChannelsApiService) DeleteSlackNotificationChannelExecute(r if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.webhookChannelWriteSchema if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -898,19 +1075,19 @@ func (a *NotificationChannelsApiService) DeleteSlackNotificationChannelExecute(r } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -923,57 +1100,56 @@ func (a *NotificationChannelsApiService) DeleteSlackNotificationChannelExecute(r err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v NotificationChannelNotFound - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v NotificationChannelError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } -type ApiDeleteWebhookNotificationChannelRequest struct { +type ApiDeleteEmailNotificationChannelRequest struct { ctx context.Context ApiService NotificationChannelsApi channelId int64 } -func (r ApiDeleteWebhookNotificationChannelRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteWebhookNotificationChannelExecute(r) +func (r ApiDeleteEmailNotificationChannelRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteEmailNotificationChannelExecute(r) } /* -DeleteWebhookNotificationChannel Delete the Webhook Notification channel by id +DeleteEmailNotificationChannel Delete the Email Notification channel by id -Delete the webhook notification channel by id +Delete the email notification channel by id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param channelId Channel identifier - @return ApiDeleteWebhookNotificationChannelRequest + @return ApiDeleteEmailNotificationChannelRequest */ -func (a *NotificationChannelsApiService) DeleteWebhookNotificationChannel(ctx context.Context, channelId int64) ApiDeleteWebhookNotificationChannelRequest { - return ApiDeleteWebhookNotificationChannelRequest{ +func (a *NotificationChannelsApiService) DeleteEmailNotificationChannel(ctx context.Context, channelId int64) ApiDeleteEmailNotificationChannelRequest { + return ApiDeleteEmailNotificationChannelRequest{ ApiService: a, ctx: ctx, channelId: channelId, @@ -981,19 +1157,19 @@ func (a *NotificationChannelsApiService) DeleteWebhookNotificationChannel(ctx co } // Execute executes the request -func (a *NotificationChannelsApiService) DeleteWebhookNotificationChannelExecute(r ApiDeleteWebhookNotificationChannelRequest) (*http.Response, error) { +func (a *NotificationChannelsApiService) DeleteEmailNotificationChannelExecute(r ApiDeleteEmailNotificationChannelRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.DeleteWebhookNotificationChannel") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.DeleteEmailNotificationChannel") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/webhook/{channelId}" + localVarPath := localBasePath + "/notifications/channels/email/{channelId}" localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) localVarHeaderParams := make(map[string]string) @@ -1116,27 +1292,27 @@ func (a *NotificationChannelsApiService) DeleteWebhookNotificationChannelExecute return localVarHTTPResponse, nil } -type ApiGetOpsgenieNotificationChannelRequest struct { +type ApiDeleteOpsgenieNotificationChannelRequest struct { ctx context.Context ApiService NotificationChannelsApi channelId int64 } -func (r ApiGetOpsgenieNotificationChannelRequest) Execute() (*OpsgenieNotificationChannel, *http.Response, error) { - return r.ApiService.GetOpsgenieNotificationChannelExecute(r) +func (r ApiDeleteOpsgenieNotificationChannelRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteOpsgenieNotificationChannelExecute(r) } /* -GetOpsgenieNotificationChannel Get the Opsgenie Notification channel by id +DeleteOpsgenieNotificationChannel Delete the Opsgenie Notification channel by id -Get the opsgenie notification channel by id +Delete the opsgenie notification channel by id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param channelId Channel identifier - @return ApiGetOpsgenieNotificationChannelRequest + @return ApiDeleteOpsgenieNotificationChannelRequest */ -func (a *NotificationChannelsApiService) GetOpsgenieNotificationChannel(ctx context.Context, channelId int64) ApiGetOpsgenieNotificationChannelRequest { - return ApiGetOpsgenieNotificationChannelRequest{ +func (a *NotificationChannelsApiService) DeleteOpsgenieNotificationChannel(ctx context.Context, channelId int64) ApiDeleteOpsgenieNotificationChannelRequest { + return ApiDeleteOpsgenieNotificationChannelRequest{ ApiService: a, ctx: ctx, channelId: channelId, @@ -1144,18 +1320,16 @@ func (a *NotificationChannelsApiService) GetOpsgenieNotificationChannel(ctx cont } // Execute executes the request -// @return OpsgenieNotificationChannel -func (a *NotificationChannelsApiService) GetOpsgenieNotificationChannelExecute(r ApiGetOpsgenieNotificationChannelRequest) (*OpsgenieNotificationChannel, *http.Response, error) { +func (a *NotificationChannelsApiService) DeleteOpsgenieNotificationChannelExecute(r ApiDeleteOpsgenieNotificationChannelRequest) (*http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *OpsgenieNotificationChannel + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.GetOpsgenieNotificationChannel") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.DeleteOpsgenieNotificationChannel") if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/notifications/channels/opsgenie/{channelId}" @@ -1226,19 +1400,19 @@ func (a *NotificationChannelsApiService) GetOpsgenieNotificationChannelExecute(r } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -1251,66 +1425,57 @@ func (a *NotificationChannelsApiService) GetOpsgenieNotificationChannelExecute(r err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v NotificationChannelNotFound err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v NotificationChannelError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } -type ApiGetSlackNotificationChannelRequest struct { +type ApiDeleteSlackNotificationChannelRequest struct { ctx context.Context ApiService NotificationChannelsApi channelId int64 } -func (r ApiGetSlackNotificationChannelRequest) Execute() (*SlackNotificationChannel, *http.Response, error) { - return r.ApiService.GetSlackNotificationChannelExecute(r) +func (r ApiDeleteSlackNotificationChannelRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteSlackNotificationChannelExecute(r) } /* -GetSlackNotificationChannel Get the Slack Notification channel by id +DeleteSlackNotificationChannel Delete the Slack Notification channel by id -Get the slack notification channel by id +Delete the slack notification channel by id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param channelId Channel identifier - @return ApiGetSlackNotificationChannelRequest + @return ApiDeleteSlackNotificationChannelRequest */ -func (a *NotificationChannelsApiService) GetSlackNotificationChannel(ctx context.Context, channelId int64) ApiGetSlackNotificationChannelRequest { - return ApiGetSlackNotificationChannelRequest{ +func (a *NotificationChannelsApiService) DeleteSlackNotificationChannel(ctx context.Context, channelId int64) ApiDeleteSlackNotificationChannelRequest { + return ApiDeleteSlackNotificationChannelRequest{ ApiService: a, ctx: ctx, channelId: channelId, @@ -1318,18 +1483,16 @@ func (a *NotificationChannelsApiService) GetSlackNotificationChannel(ctx context } // Execute executes the request -// @return SlackNotificationChannel -func (a *NotificationChannelsApiService) GetSlackNotificationChannelExecute(r ApiGetSlackNotificationChannelRequest) (*SlackNotificationChannel, *http.Response, error) { +func (a *NotificationChannelsApiService) DeleteSlackNotificationChannelExecute(r ApiDeleteSlackNotificationChannelRequest) (*http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *SlackNotificationChannel + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.GetSlackNotificationChannel") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.DeleteSlackNotificationChannel") if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/notifications/channels/slack/{channelId}" @@ -1400,19 +1563,19 @@ func (a *NotificationChannelsApiService) GetSlackNotificationChannelExecute(r Ap } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -1425,66 +1588,57 @@ func (a *NotificationChannelsApiService) GetSlackNotificationChannelExecute(r Ap err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v NotificationChannelNotFound err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v NotificationChannelError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } -type ApiGetWebhookNotificationChannelRequest struct { +type ApiDeleteTeamsNotificationChannelRequest struct { ctx context.Context ApiService NotificationChannelsApi channelId int64 } -func (r ApiGetWebhookNotificationChannelRequest) Execute() (*WebhookNotificationChannel, *http.Response, error) { - return r.ApiService.GetWebhookNotificationChannelExecute(r) +func (r ApiDeleteTeamsNotificationChannelRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteTeamsNotificationChannelExecute(r) } /* -GetWebhookNotificationChannel Get the Webhook Notification channel by id +DeleteTeamsNotificationChannel Delete the Teams Notification channel by id -Get the webhook notification channel by id +Delete the teams notification channel by id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param channelId Channel identifier - @return ApiGetWebhookNotificationChannelRequest + @return ApiDeleteTeamsNotificationChannelRequest */ -func (a *NotificationChannelsApiService) GetWebhookNotificationChannel(ctx context.Context, channelId int64) ApiGetWebhookNotificationChannelRequest { - return ApiGetWebhookNotificationChannelRequest{ +func (a *NotificationChannelsApiService) DeleteTeamsNotificationChannel(ctx context.Context, channelId int64) ApiDeleteTeamsNotificationChannelRequest { + return ApiDeleteTeamsNotificationChannelRequest{ ApiService: a, ctx: ctx, channelId: channelId, @@ -1492,21 +1646,19 @@ func (a *NotificationChannelsApiService) GetWebhookNotificationChannel(ctx conte } // Execute executes the request -// @return WebhookNotificationChannel -func (a *NotificationChannelsApiService) GetWebhookNotificationChannelExecute(r ApiGetWebhookNotificationChannelRequest) (*WebhookNotificationChannel, *http.Response, error) { +func (a *NotificationChannelsApiService) DeleteTeamsNotificationChannelExecute(r ApiDeleteTeamsNotificationChannelRequest) (*http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *WebhookNotificationChannel + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.GetWebhookNotificationChannel") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.DeleteTeamsNotificationChannel") if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/webhook/{channelId}" + localVarPath := localBasePath + "/notifications/channels/teams/{channelId}" localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) localVarHeaderParams := make(map[string]string) @@ -1574,19 +1726,19 @@ func (a *NotificationChannelsApiService) GetWebhookNotificationChannelExecute(r } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -1599,73 +1751,57 @@ func (a *NotificationChannelsApiService) GetWebhookNotificationChannelExecute(r err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v NotificationChannelNotFound err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v NotificationChannelError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiJoinSlackChannelRequest struct { - ctx context.Context - ApiService NotificationChannelsApi - channelId int64 - slackChannelId *SlackChannelId + return localVarHTTPResponse, nil } -// Provide a Slack channel id to join the specified Slack channel -func (r ApiJoinSlackChannelRequest) SlackChannelId(slackChannelId SlackChannelId) ApiJoinSlackChannelRequest { - r.slackChannelId = &slackChannelId - return r +type ApiDeleteWebhookNotificationChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + channelId int64 } -func (r ApiJoinSlackChannelRequest) Execute() (*SlackNotificationChannel, *http.Response, error) { - return r.ApiService.JoinSlackChannelExecute(r) +func (r ApiDeleteWebhookNotificationChannelRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteWebhookNotificationChannelExecute(r) } /* -JoinSlackChannel Join the specified Slack channel to send notifications +DeleteWebhookNotificationChannel Delete the Webhook Notification channel by id -Join the specified Slack channel and configure this notifiation channel to post notifications to the specified slack channel. +Delete the webhook notification channel by id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param channelId Channel identifier - @return ApiJoinSlackChannelRequest + @return ApiDeleteWebhookNotificationChannelRequest */ -func (a *NotificationChannelsApiService) JoinSlackChannel(ctx context.Context, channelId int64) ApiJoinSlackChannelRequest { - return ApiJoinSlackChannelRequest{ +func (a *NotificationChannelsApiService) DeleteWebhookNotificationChannel(ctx context.Context, channelId int64) ApiDeleteWebhookNotificationChannelRequest { + return ApiDeleteWebhookNotificationChannelRequest{ ApiService: a, ctx: ctx, channelId: channelId, @@ -1673,32 +1809,27 @@ func (a *NotificationChannelsApiService) JoinSlackChannel(ctx context.Context, c } // Execute executes the request -// @return SlackNotificationChannel -func (a *NotificationChannelsApiService) JoinSlackChannelExecute(r ApiJoinSlackChannelRequest) (*SlackNotificationChannel, *http.Response, error) { +func (a *NotificationChannelsApiService) DeleteWebhookNotificationChannelExecute(r ApiDeleteWebhookNotificationChannelRequest) (*http.Response, error) { var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *SlackNotificationChannel + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.JoinSlackChannel") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.DeleteWebhookNotificationChannel") if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/slack/{channelId}/joinSlackChannel" + localVarPath := localBasePath + "/notifications/channels/webhook/{channelId}" localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.slackChannelId == nil { - return localVarReturnValue, nil, reportError("slackChannelId is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1714,8 +1845,6 @@ func (a *NotificationChannelsApiService) JoinSlackChannelExecute(r ApiJoinSlackC if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.slackChannelId if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -1760,19 +1889,19 @@ func (a *NotificationChannelsApiService) JoinSlackChannelExecute(r ApiJoinSlackC } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -1785,112 +1914,85 @@ func (a *NotificationChannelsApiService) JoinSlackChannelExecute(r ApiJoinSlackC err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v NotificationChannelNotFound err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v NotificationChannelError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } -type ApiListOpsgenieRespondersRequest struct { +type ApiGetEmailNotificationChannelRequest struct { ctx context.Context ApiService NotificationChannelsApi - genieKey *string - region *string -} - -// OpsGenie API key -func (r ApiListOpsgenieRespondersRequest) GenieKey(genieKey string) ApiListOpsgenieRespondersRequest { - r.genieKey = &genieKey - return r -} - -// OpsGenie region -func (r ApiListOpsgenieRespondersRequest) Region(region string) ApiListOpsgenieRespondersRequest { - r.region = ®ion - return r + channelId int64 } -func (r ApiListOpsgenieRespondersRequest) Execute() ([]OpsgenieResponder, *http.Response, error) { - return r.ApiService.ListOpsgenieRespondersExecute(r) +func (r ApiGetEmailNotificationChannelRequest) Execute() (*EmailNotificationChannel, *http.Response, error) { + return r.ApiService.GetEmailNotificationChannelExecute(r) } /* -ListOpsgenieResponders List Opsgenie responders +GetEmailNotificationChannel Get the Email Notification channel by id -List Opsgenie responders +Get the email notification channel by id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListOpsgenieRespondersRequest + @param channelId Channel identifier + @return ApiGetEmailNotificationChannelRequest */ -func (a *NotificationChannelsApiService) ListOpsgenieResponders(ctx context.Context) ApiListOpsgenieRespondersRequest { - return ApiListOpsgenieRespondersRequest{ +func (a *NotificationChannelsApiService) GetEmailNotificationChannel(ctx context.Context, channelId int64) ApiGetEmailNotificationChannelRequest { + return ApiGetEmailNotificationChannelRequest{ ApiService: a, ctx: ctx, + channelId: channelId, } } // Execute executes the request -// @return []OpsgenieResponder -func (a *NotificationChannelsApiService) ListOpsgenieRespondersExecute(r ApiListOpsgenieRespondersRequest) ([]OpsgenieResponder, *http.Response, error) { +// @return EmailNotificationChannel +func (a *NotificationChannelsApiService) GetEmailNotificationChannelExecute(r ApiGetEmailNotificationChannelRequest) (*EmailNotificationChannel, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue []OpsgenieResponder + localVarReturnValue *EmailNotificationChannel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.ListOpsgenieResponders") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.GetEmailNotificationChannel") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/opsgenie/responders" + localVarPath := localBasePath + "/notifications/channels/email/{channelId}" + localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.genieKey == nil { - return localVarReturnValue, nil, reportError("genieKey is required and must be specified") - } - if r.region == nil { - return localVarReturnValue, nil, reportError("region is required and must be specified") - } - localVarQueryParams.Add("genieKey", parameterToString(*r.genieKey, "")) - localVarQueryParams.Add("region", parameterToString(*r.region, "")) // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1982,6 +2084,16 @@ func (a *NotificationChannelsApiService) ListOpsgenieRespondersExecute(r ApiList newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } + if localVarHTTPResponse.StatusCode == 404 { + var v NotificationChannelNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v NotificationChannelError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2006,50 +2118,46 @@ func (a *NotificationChannelsApiService) ListOpsgenieRespondersExecute(r ApiList return localVarReturnValue, localVarHTTPResponse, nil } -type ApiListSlackChannelsRequest struct { +type ApiGetEmailNotificationStatusRequest struct { ctx context.Context ApiService NotificationChannelsApi - channelId int64 } -func (r ApiListSlackChannelsRequest) Execute() ([]SlackChannel, *http.Response, error) { - return r.ApiService.ListSlackChannelsExecute(r) +func (r ApiGetEmailNotificationStatusRequest) Execute() (*EmailNotificationStatus, *http.Response, error) { + return r.ApiService.GetEmailNotificationStatusExecute(r) } /* -ListSlackChannels List all public Slack channels +GetEmailNotificationStatus Email Notification channel status -List all public Slack channels, used for selecting a channel for the notifications +Email Notification channel status, test whether it can be used @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param channelId Channel identifier - @return ApiListSlackChannelsRequest + @return ApiGetEmailNotificationStatusRequest */ -func (a *NotificationChannelsApiService) ListSlackChannels(ctx context.Context, channelId int64) ApiListSlackChannelsRequest { - return ApiListSlackChannelsRequest{ +func (a *NotificationChannelsApiService) GetEmailNotificationStatus(ctx context.Context) ApiGetEmailNotificationStatusRequest { + return ApiGetEmailNotificationStatusRequest{ ApiService: a, ctx: ctx, - channelId: channelId, } } // Execute executes the request -// @return []SlackChannel -func (a *NotificationChannelsApiService) ListSlackChannelsExecute(r ApiListSlackChannelsRequest) ([]SlackChannel, *http.Response, error) { +// @return EmailNotificationStatus +func (a *NotificationChannelsApiService) GetEmailNotificationStatusExecute(r ApiGetEmailNotificationStatusRequest) (*EmailNotificationStatus, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue []SlackChannel + localVarReturnValue *EmailNotificationStatus ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.ListSlackChannels") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.GetEmailNotificationStatus") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/slack/{channelId}/listSlackChannels" - localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) + localVarPath := localBasePath + "/notifications/channels/email/status" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2146,16 +2254,6 @@ func (a *NotificationChannelsApiService) ListSlackChannelsExecute(r ApiListSlack newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 404 { - var v NotificationChannelNotFound - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } if localVarHTTPResponse.StatusCode == 500 { var v NotificationChannelError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2180,80 +2278,55 @@ func (a *NotificationChannelsApiService) ListSlackChannelsExecute(r ApiListSlack return localVarReturnValue, localVarHTTPResponse, nil } -type ApiSlackOAuthCallbackRequest struct { +type ApiGetOpsgenieNotificationChannelRequest struct { ctx context.Context ApiService NotificationChannelsApi - state *string - code *string - error_ *string -} - -// State parameter that was passed to Slack, should have the same value as the one passed to Slack. -func (r ApiSlackOAuthCallbackRequest) State(state string) ApiSlackOAuthCallbackRequest { - r.state = &state - return r -} - -// OAuth code from Slack. Either the code is present for the success case or the error parameter is present for the error case. -func (r ApiSlackOAuthCallbackRequest) Code(code string) ApiSlackOAuthCallbackRequest { - r.code = &code - return r -} - -// Error parameter. Either the code is present for the success case or the error parameter is present for the error case. -func (r ApiSlackOAuthCallbackRequest) Error_(error_ string) ApiSlackOAuthCallbackRequest { - r.error_ = &error_ - return r + channelId int64 } -func (r ApiSlackOAuthCallbackRequest) Execute() (*http.Response, error) { - return r.ApiService.SlackOAuthCallbackExecute(r) +func (r ApiGetOpsgenieNotificationChannelRequest) Execute() (*OpsgenieNotificationChannel, *http.Response, error) { + return r.ApiService.GetOpsgenieNotificationChannelExecute(r) } /* -SlackOAuthCallback The OAuth callback for Slack +GetOpsgenieNotificationChannel Get the Opsgenie Notification channel by id -The OAuth callback for Slack, which is used to obtain the access token for the Slack channel. +Get the opsgenie notification channel by id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiSlackOAuthCallbackRequest + @param channelId Channel identifier + @return ApiGetOpsgenieNotificationChannelRequest */ -func (a *NotificationChannelsApiService) SlackOAuthCallback(ctx context.Context) ApiSlackOAuthCallbackRequest { - return ApiSlackOAuthCallbackRequest{ +func (a *NotificationChannelsApiService) GetOpsgenieNotificationChannel(ctx context.Context, channelId int64) ApiGetOpsgenieNotificationChannelRequest { + return ApiGetOpsgenieNotificationChannelRequest{ ApiService: a, ctx: ctx, + channelId: channelId, } } // Execute executes the request -func (a *NotificationChannelsApiService) SlackOAuthCallbackExecute(r ApiSlackOAuthCallbackRequest) (*http.Response, error) { +// @return OpsgenieNotificationChannel +func (a *NotificationChannelsApiService) GetOpsgenieNotificationChannelExecute(r ApiGetOpsgenieNotificationChannelRequest) (*OpsgenieNotificationChannel, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OpsgenieNotificationChannel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.SlackOAuthCallback") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.GetOpsgenieNotificationChannel") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/slack/oauth-callback" + localVarPath := localBasePath + "/notifications/channels/opsgenie/{channelId}" + localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.state == nil { - return nil, reportError("state is required and must be specified") - } - if r.code != nil { - localVarQueryParams.Add("code", parameterToString(*r.code, "")) - } - localVarQueryParams.Add("state", parameterToString(*r.state, "")) - if r.error_ != nil { - localVarQueryParams.Add("error", parameterToString(*r.error_, "")) - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2264,7 +2337,7 @@ func (a *NotificationChannelsApiService) SlackOAuthCallbackExecute(r ApiSlackOAu } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -2315,19 +2388,19 @@ func (a *NotificationChannelsApiService) SlackOAuthCallbackExecute(r ApiSlackOAu } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -2335,16 +2408,1279 @@ func (a *NotificationChannelsApiService) SlackOAuthCallbackExecute(r ApiSlackOAu body: localVarBody, error: localVarHTTPResponse.Status, } - return localVarHTTPResponse, newErr + if localVarHTTPResponse.StatusCode == 400 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v NotificationChannelNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil -} + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } -type ApiSlackOauthRedirectRequest struct { - ctx context.Context - ApiService NotificationChannelsApi - redirectPath *string + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetSlackNotificationChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + channelId int64 +} + +func (r ApiGetSlackNotificationChannelRequest) Execute() (*SlackNotificationChannel, *http.Response, error) { + return r.ApiService.GetSlackNotificationChannelExecute(r) +} + +/* +GetSlackNotificationChannel Get the Slack Notification channel by id + +Get the slack notification channel by id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiGetSlackNotificationChannelRequest +*/ +func (a *NotificationChannelsApiService) GetSlackNotificationChannel(ctx context.Context, channelId int64) ApiGetSlackNotificationChannelRequest { + return ApiGetSlackNotificationChannelRequest{ + ApiService: a, + ctx: ctx, + channelId: channelId, + } +} + +// Execute executes the request +// @return SlackNotificationChannel +func (a *NotificationChannelsApiService) GetSlackNotificationChannelExecute(r ApiGetSlackNotificationChannelRequest) (*SlackNotificationChannel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SlackNotificationChannel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.GetSlackNotificationChannel") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/notifications/channels/slack/{channelId}" + localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Token"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceBearer"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-ServiceBearer"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v NotificationChannelNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetTeamsNotificationChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + channelId int64 +} + +func (r ApiGetTeamsNotificationChannelRequest) Execute() (*TeamsNotificationChannel, *http.Response, error) { + return r.ApiService.GetTeamsNotificationChannelExecute(r) +} + +/* +GetTeamsNotificationChannel Get the Teams Notification channel by id + +Get the teams notification channel by id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiGetTeamsNotificationChannelRequest +*/ +func (a *NotificationChannelsApiService) GetTeamsNotificationChannel(ctx context.Context, channelId int64) ApiGetTeamsNotificationChannelRequest { + return ApiGetTeamsNotificationChannelRequest{ + ApiService: a, + ctx: ctx, + channelId: channelId, + } +} + +// Execute executes the request +// @return TeamsNotificationChannel +func (a *NotificationChannelsApiService) GetTeamsNotificationChannelExecute(r ApiGetTeamsNotificationChannelRequest) (*TeamsNotificationChannel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TeamsNotificationChannel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.GetTeamsNotificationChannel") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/notifications/channels/teams/{channelId}" + localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Token"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceBearer"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-ServiceBearer"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v NotificationChannelNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetWebhookNotificationChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + channelId int64 +} + +func (r ApiGetWebhookNotificationChannelRequest) Execute() (*WebhookNotificationChannel, *http.Response, error) { + return r.ApiService.GetWebhookNotificationChannelExecute(r) +} + +/* +GetWebhookNotificationChannel Get the Webhook Notification channel by id + +Get the webhook notification channel by id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiGetWebhookNotificationChannelRequest +*/ +func (a *NotificationChannelsApiService) GetWebhookNotificationChannel(ctx context.Context, channelId int64) ApiGetWebhookNotificationChannelRequest { + return ApiGetWebhookNotificationChannelRequest{ + ApiService: a, + ctx: ctx, + channelId: channelId, + } +} + +// Execute executes the request +// @return WebhookNotificationChannel +func (a *NotificationChannelsApiService) GetWebhookNotificationChannelExecute(r ApiGetWebhookNotificationChannelRequest) (*WebhookNotificationChannel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WebhookNotificationChannel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.GetWebhookNotificationChannel") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/notifications/channels/webhook/{channelId}" + localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Token"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceBearer"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-ServiceBearer"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v NotificationChannelNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiJoinSlackChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + channelId int64 + slackChannelId *SlackChannelId +} + +// Provide a Slack channel id to join the specified Slack channel +func (r ApiJoinSlackChannelRequest) SlackChannelId(slackChannelId SlackChannelId) ApiJoinSlackChannelRequest { + r.slackChannelId = &slackChannelId + return r +} + +func (r ApiJoinSlackChannelRequest) Execute() (*SlackNotificationChannel, *http.Response, error) { + return r.ApiService.JoinSlackChannelExecute(r) +} + +/* +JoinSlackChannel Join the specified Slack channel to send notifications + +Join the specified Slack channel and configure this notifiation channel to post notifications to the specified slack channel. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiJoinSlackChannelRequest +*/ +func (a *NotificationChannelsApiService) JoinSlackChannel(ctx context.Context, channelId int64) ApiJoinSlackChannelRequest { + return ApiJoinSlackChannelRequest{ + ApiService: a, + ctx: ctx, + channelId: channelId, + } +} + +// Execute executes the request +// @return SlackNotificationChannel +func (a *NotificationChannelsApiService) JoinSlackChannelExecute(r ApiJoinSlackChannelRequest) (*SlackNotificationChannel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SlackNotificationChannel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.JoinSlackChannel") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/notifications/channels/slack/{channelId}/joinSlackChannel" + localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.slackChannelId == nil { + return localVarReturnValue, nil, reportError("slackChannelId is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.slackChannelId + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Token"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceBearer"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-ServiceBearer"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v NotificationChannelNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListOpsgenieRespondersRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + genieKey *string + region *string +} + +// OpsGenie API key +func (r ApiListOpsgenieRespondersRequest) GenieKey(genieKey string) ApiListOpsgenieRespondersRequest { + r.genieKey = &genieKey + return r +} + +// OpsGenie region +func (r ApiListOpsgenieRespondersRequest) Region(region string) ApiListOpsgenieRespondersRequest { + r.region = ®ion + return r +} + +func (r ApiListOpsgenieRespondersRequest) Execute() ([]OpsgenieResponder, *http.Response, error) { + return r.ApiService.ListOpsgenieRespondersExecute(r) +} + +/* +ListOpsgenieResponders List Opsgenie responders + +List Opsgenie responders + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListOpsgenieRespondersRequest +*/ +func (a *NotificationChannelsApiService) ListOpsgenieResponders(ctx context.Context) ApiListOpsgenieRespondersRequest { + return ApiListOpsgenieRespondersRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []OpsgenieResponder +func (a *NotificationChannelsApiService) ListOpsgenieRespondersExecute(r ApiListOpsgenieRespondersRequest) ([]OpsgenieResponder, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []OpsgenieResponder + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.ListOpsgenieResponders") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/notifications/channels/opsgenie/responders" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.genieKey == nil { + return localVarReturnValue, nil, reportError("genieKey is required and must be specified") + } + if r.region == nil { + return localVarReturnValue, nil, reportError("region is required and must be specified") + } + + localVarQueryParams.Add("genieKey", parameterToString(*r.genieKey, "")) + localVarQueryParams.Add("region", parameterToString(*r.region, "")) + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Token"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceBearer"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-ServiceBearer"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListSlackChannelsRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + channelId int64 +} + +func (r ApiListSlackChannelsRequest) Execute() ([]SlackChannel, *http.Response, error) { + return r.ApiService.ListSlackChannelsExecute(r) +} + +/* +ListSlackChannels List all public Slack channels + +List all public Slack channels, used for selecting a channel for the notifications + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiListSlackChannelsRequest +*/ +func (a *NotificationChannelsApiService) ListSlackChannels(ctx context.Context, channelId int64) ApiListSlackChannelsRequest { + return ApiListSlackChannelsRequest{ + ApiService: a, + ctx: ctx, + channelId: channelId, + } +} + +// Execute executes the request +// @return []SlackChannel +func (a *NotificationChannelsApiService) ListSlackChannelsExecute(r ApiListSlackChannelsRequest) ([]SlackChannel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []SlackChannel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.ListSlackChannels") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/notifications/channels/slack/{channelId}/listSlackChannels" + localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Token"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceBearer"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-ServiceBearer"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v NotificationChannelNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSlackOAuthCallbackRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + state *string + code *string + error_ *string +} + +// State parameter that was passed to Slack, should have the same value as the one passed to Slack. +func (r ApiSlackOAuthCallbackRequest) State(state string) ApiSlackOAuthCallbackRequest { + r.state = &state + return r +} + +// OAuth code from Slack. Either the code is present for the success case or the error parameter is present for the error case. +func (r ApiSlackOAuthCallbackRequest) Code(code string) ApiSlackOAuthCallbackRequest { + r.code = &code + return r +} + +// Error parameter. Either the code is present for the success case or the error parameter is present for the error case. +func (r ApiSlackOAuthCallbackRequest) Error_(error_ string) ApiSlackOAuthCallbackRequest { + r.error_ = &error_ + return r +} + +func (r ApiSlackOAuthCallbackRequest) Execute() (*http.Response, error) { + return r.ApiService.SlackOAuthCallbackExecute(r) +} + +/* +SlackOAuthCallback The OAuth callback for Slack + +The OAuth callback for Slack, which is used to obtain the access token for the Slack channel. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSlackOAuthCallbackRequest +*/ +func (a *NotificationChannelsApiService) SlackOAuthCallback(ctx context.Context) ApiSlackOAuthCallbackRequest { + return ApiSlackOAuthCallbackRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *NotificationChannelsApiService) SlackOAuthCallbackExecute(r ApiSlackOAuthCallbackRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.SlackOAuthCallback") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/notifications/channels/slack/oauth-callback" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.state == nil { + return nil, reportError("state is required and must be specified") + } + + if r.code != nil { + localVarQueryParams.Add("code", parameterToString(*r.code, "")) + } + localVarQueryParams.Add("state", parameterToString(*r.state, "")) + if r.error_ != nil { + localVarQueryParams.Add("error", parameterToString(*r.error_, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Token"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceBearer"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-ServiceBearer"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSlackOauthRedirectRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + redirectPath *string } // After completing the oauth flow the user will be redirected back to this path, in the UI, on StackState, to continue further setup of the Slack notification channel. @@ -2353,48 +3689,671 @@ func (r ApiSlackOauthRedirectRequest) RedirectPath(redirectPath string) ApiSlack return r } -func (r ApiSlackOauthRedirectRequest) Execute() (*http.Response, error) { - return r.ApiService.SlackOauthRedirectExecute(r) +func (r ApiSlackOauthRedirectRequest) Execute() (*http.Response, error) { + return r.ApiService.SlackOauthRedirectExecute(r) +} + +/* +SlackOauthRedirect Starts Slack OAuth2 flow + +Redirects to Slack to start an OAuth2 flow. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSlackOauthRedirectRequest +*/ +func (a *NotificationChannelsApiService) SlackOauthRedirect(ctx context.Context) ApiSlackOauthRedirectRequest { + return ApiSlackOauthRedirectRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *NotificationChannelsApiService) SlackOauthRedirectExecute(r ApiSlackOauthRedirectRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.SlackOauthRedirect") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/notifications/channels/slack/oauth-redirect" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.redirectPath == nil { + return nil, reportError("redirectPath is required and must be specified") + } + + localVarQueryParams.Add("redirectPath", parameterToString(*r.redirectPath, "")) + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Token"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceBearer"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-ServiceBearer"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTestEmailChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + channelId int64 +} + +func (r ApiTestEmailChannelRequest) Execute() (*http.Response, error) { + return r.ApiService.TestEmailChannelExecute(r) +} + +/* +TestEmailChannel Test the Email notification channel + +Test the email notification channel by sending a test message to the notification channel. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiTestEmailChannelRequest +*/ +func (a *NotificationChannelsApiService) TestEmailChannel(ctx context.Context, channelId int64) ApiTestEmailChannelRequest { + return ApiTestEmailChannelRequest{ + ApiService: a, + ctx: ctx, + channelId: channelId, + } +} + +// Execute executes the request +func (a *NotificationChannelsApiService) TestEmailChannelExecute(r ApiTestEmailChannelRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.TestEmailChannel") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/notifications/channels/email/{channelId}/test" + localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Token"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceBearer"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-ServiceBearer"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v NotificationChannelNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTestOpsgenieChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + channelId int64 +} + +func (r ApiTestOpsgenieChannelRequest) Execute() (*http.Response, error) { + return r.ApiService.TestOpsgenieChannelExecute(r) +} + +/* +TestOpsgenieChannel Test the Opsgenie notification channel + +Test the opsgenie notification channel by sending a test message to the notification channel. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiTestOpsgenieChannelRequest +*/ +func (a *NotificationChannelsApiService) TestOpsgenieChannel(ctx context.Context, channelId int64) ApiTestOpsgenieChannelRequest { + return ApiTestOpsgenieChannelRequest{ + ApiService: a, + ctx: ctx, + channelId: channelId, + } +} + +// Execute executes the request +func (a *NotificationChannelsApiService) TestOpsgenieChannelExecute(r ApiTestOpsgenieChannelRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.TestOpsgenieChannel") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/notifications/channels/opsgenie/{channelId}/test" + localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Token"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceBearer"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-ServiceBearer"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v NotificationChannelNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTestSlackChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + channelId int64 +} + +func (r ApiTestSlackChannelRequest) Execute() (*http.Response, error) { + return r.ApiService.TestSlackChannelExecute(r) +} + +/* +TestSlackChannel Test the Notification channel + +Test the Notification channel by sending a test message to the notification channel. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param channelId Channel identifier + @return ApiTestSlackChannelRequest +*/ +func (a *NotificationChannelsApiService) TestSlackChannel(ctx context.Context, channelId int64) ApiTestSlackChannelRequest { + return ApiTestSlackChannelRequest{ + ApiService: a, + ctx: ctx, + channelId: channelId, + } +} + +// Execute executes the request +func (a *NotificationChannelsApiService) TestSlackChannelExecute(r ApiTestSlackChannelRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.TestSlackChannel") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/notifications/channels/slack/{channelId}/test" + localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Token"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceBearer"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-ServiceBearer"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v NotificationChannelNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTestTeamsChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + channelId int64 +} + +func (r ApiTestTeamsChannelRequest) Execute() (*http.Response, error) { + return r.ApiService.TestTeamsChannelExecute(r) } /* -SlackOauthRedirect Starts Slack OAuth2 flow +TestTeamsChannel Test the Teams notification channel -Redirects to Slack to start an OAuth2 flow. +Test the teams notification channel by sending a test message to the notification channel. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiSlackOauthRedirectRequest + @param channelId Channel identifier + @return ApiTestTeamsChannelRequest */ -func (a *NotificationChannelsApiService) SlackOauthRedirect(ctx context.Context) ApiSlackOauthRedirectRequest { - return ApiSlackOauthRedirectRequest{ +func (a *NotificationChannelsApiService) TestTeamsChannel(ctx context.Context, channelId int64) ApiTestTeamsChannelRequest { + return ApiTestTeamsChannelRequest{ ApiService: a, ctx: ctx, + channelId: channelId, } } // Execute executes the request -func (a *NotificationChannelsApiService) SlackOauthRedirectExecute(r ApiSlackOauthRedirectRequest) (*http.Response, error) { +func (a *NotificationChannelsApiService) TestTeamsChannelExecute(r ApiTestTeamsChannelRequest) (*http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.SlackOauthRedirect") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.TestTeamsChannel") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/slack/oauth-redirect" + localVarPath := localBasePath + "/notifications/channels/teams/{channelId}/test" + localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.redirectPath == nil { - return nil, reportError("redirectPath is required and must be specified") - } - localVarQueryParams.Add("redirectPath", parameterToString(*r.redirectPath, "")) // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2405,7 +4364,7 @@ func (a *NotificationChannelsApiService) SlackOauthRedirectExecute(r ApiSlackOau } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -2476,33 +4435,62 @@ func (a *NotificationChannelsApiService) SlackOauthRedirectExecute(r ApiSlackOau body: localVarBody, error: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v NotificationChannelNotFound + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v NotificationChannelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } return localVarHTTPResponse, newErr } return localVarHTTPResponse, nil } -type ApiTestOpsgenieChannelRequest struct { +type ApiTestWebhookChannelRequest struct { ctx context.Context ApiService NotificationChannelsApi channelId int64 } -func (r ApiTestOpsgenieChannelRequest) Execute() (*http.Response, error) { - return r.ApiService.TestOpsgenieChannelExecute(r) +func (r ApiTestWebhookChannelRequest) Execute() (*http.Response, error) { + return r.ApiService.TestWebhookChannelExecute(r) } /* -TestOpsgenieChannel Test the Opsgenie notification channel +TestWebhookChannel Test the Webhook notification channel -Test the opsgenie notification channel by sending a test message to the notification channel. +Test the webhook notification channel by sending a test message to the notification channel. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param channelId Channel identifier - @return ApiTestOpsgenieChannelRequest + @return ApiTestWebhookChannelRequest */ -func (a *NotificationChannelsApiService) TestOpsgenieChannel(ctx context.Context, channelId int64) ApiTestOpsgenieChannelRequest { - return ApiTestOpsgenieChannelRequest{ +func (a *NotificationChannelsApiService) TestWebhookChannel(ctx context.Context, channelId int64) ApiTestWebhookChannelRequest { + return ApiTestWebhookChannelRequest{ ApiService: a, ctx: ctx, channelId: channelId, @@ -2510,19 +4498,19 @@ func (a *NotificationChannelsApiService) TestOpsgenieChannel(ctx context.Context } // Execute executes the request -func (a *NotificationChannelsApiService) TestOpsgenieChannelExecute(r ApiTestOpsgenieChannelRequest) (*http.Response, error) { +func (a *NotificationChannelsApiService) TestWebhookChannelExecute(r ApiTestWebhookChannelRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.TestOpsgenieChannel") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.TestWebhookChannel") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/opsgenie/{channelId}/test" + localVarPath := localBasePath + "/notifications/channels/webhook/{channelId}/test" localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) localVarHeaderParams := make(map[string]string) @@ -2645,27 +4633,34 @@ func (a *NotificationChannelsApiService) TestOpsgenieChannelExecute(r ApiTestOps return localVarHTTPResponse, nil } -type ApiTestSlackChannelRequest struct { - ctx context.Context - ApiService NotificationChannelsApi - channelId int64 +type ApiUpdateEmailNotificationChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + channelId int64 + emailChannelWriteSchema *EmailChannelWriteSchema } -func (r ApiTestSlackChannelRequest) Execute() (*http.Response, error) { - return r.ApiService.TestSlackChannelExecute(r) +// Create or update a email channel +func (r ApiUpdateEmailNotificationChannelRequest) EmailChannelWriteSchema(emailChannelWriteSchema EmailChannelWriteSchema) ApiUpdateEmailNotificationChannelRequest { + r.emailChannelWriteSchema = &emailChannelWriteSchema + return r +} + +func (r ApiUpdateEmailNotificationChannelRequest) Execute() (*EmailNotificationChannel, *http.Response, error) { + return r.ApiService.UpdateEmailNotificationChannelExecute(r) } /* -TestSlackChannel Test the Notification channel +UpdateEmailNotificationChannel Update the Email Notification channel by id -Test the Notification channel by sending a test message to the notification channel. +Update the email notification channel by id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param channelId Channel identifier - @return ApiTestSlackChannelRequest + @return ApiUpdateEmailNotificationChannelRequest */ -func (a *NotificationChannelsApiService) TestSlackChannel(ctx context.Context, channelId int64) ApiTestSlackChannelRequest { - return ApiTestSlackChannelRequest{ +func (a *NotificationChannelsApiService) UpdateEmailNotificationChannel(ctx context.Context, channelId int64) ApiUpdateEmailNotificationChannelRequest { + return ApiUpdateEmailNotificationChannelRequest{ ApiService: a, ctx: ctx, channelId: channelId, @@ -2673,27 +4668,32 @@ func (a *NotificationChannelsApiService) TestSlackChannel(ctx context.Context, c } // Execute executes the request -func (a *NotificationChannelsApiService) TestSlackChannelExecute(r ApiTestSlackChannelRequest) (*http.Response, error) { +// @return EmailNotificationChannel +func (a *NotificationChannelsApiService) UpdateEmailNotificationChannelExecute(r ApiUpdateEmailNotificationChannelRequest) (*EmailNotificationChannel, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EmailNotificationChannel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.TestSlackChannel") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.UpdateEmailNotificationChannel") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/slack/{channelId}/test" + localVarPath := localBasePath + "/notifications/channels/email/{channelId}" localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.emailChannelWriteSchema == nil { + return localVarReturnValue, nil, reportError("emailChannelWriteSchema is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2709,6 +4709,8 @@ func (a *NotificationChannelsApiService) TestSlackChannelExecute(r ApiTestSlackC if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.emailChannelWriteSchema if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -2753,19 +4755,19 @@ func (a *NotificationChannelsApiService) TestSlackChannelExecute(r ApiTestSlackC } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -2778,57 +4780,73 @@ func (a *NotificationChannelsApiService) TestSlackChannelExecute(r ApiTestSlackC err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v NotificationChannelNotFound err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v NotificationChannelError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } -type ApiTestWebhookChannelRequest struct { - ctx context.Context - ApiService NotificationChannelsApi - channelId int64 +type ApiUpdateOpsgenieNotificationChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + channelId int64 + opsgenieChannelWriteSchema *OpsgenieChannelWriteSchema } -func (r ApiTestWebhookChannelRequest) Execute() (*http.Response, error) { - return r.ApiService.TestWebhookChannelExecute(r) +// Create or update a opsgenie channel +func (r ApiUpdateOpsgenieNotificationChannelRequest) OpsgenieChannelWriteSchema(opsgenieChannelWriteSchema OpsgenieChannelWriteSchema) ApiUpdateOpsgenieNotificationChannelRequest { + r.opsgenieChannelWriteSchema = &opsgenieChannelWriteSchema + return r +} + +func (r ApiUpdateOpsgenieNotificationChannelRequest) Execute() (*OpsgenieNotificationChannel, *http.Response, error) { + return r.ApiService.UpdateOpsgenieNotificationChannelExecute(r) } /* -TestWebhookChannel Test the Webhook notification channel +UpdateOpsgenieNotificationChannel Update the Opsgenie Notification channel by id -Test the webhook notification channel by sending a test message to the notification channel. +Update the opsgenie notification channel by id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param channelId Channel identifier - @return ApiTestWebhookChannelRequest + @return ApiUpdateOpsgenieNotificationChannelRequest */ -func (a *NotificationChannelsApiService) TestWebhookChannel(ctx context.Context, channelId int64) ApiTestWebhookChannelRequest { - return ApiTestWebhookChannelRequest{ +func (a *NotificationChannelsApiService) UpdateOpsgenieNotificationChannel(ctx context.Context, channelId int64) ApiUpdateOpsgenieNotificationChannelRequest { + return ApiUpdateOpsgenieNotificationChannelRequest{ ApiService: a, ctx: ctx, channelId: channelId, @@ -2836,27 +4854,32 @@ func (a *NotificationChannelsApiService) TestWebhookChannel(ctx context.Context, } // Execute executes the request -func (a *NotificationChannelsApiService) TestWebhookChannelExecute(r ApiTestWebhookChannelRequest) (*http.Response, error) { +// @return OpsgenieNotificationChannel +func (a *NotificationChannelsApiService) UpdateOpsgenieNotificationChannelExecute(r ApiUpdateOpsgenieNotificationChannelRequest) (*OpsgenieNotificationChannel, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OpsgenieNotificationChannel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.TestWebhookChannel") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.UpdateOpsgenieNotificationChannel") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/webhook/{channelId}/test" + localVarPath := localBasePath + "/notifications/channels/opsgenie/{channelId}" localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.opsgenieChannelWriteSchema == nil { + return localVarReturnValue, nil, reportError("opsgenieChannelWriteSchema is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2872,6 +4895,8 @@ func (a *NotificationChannelsApiService) TestWebhookChannelExecute(r ApiTestWebh if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.opsgenieChannelWriteSchema if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -2916,19 +4941,19 @@ func (a *NotificationChannelsApiService) TestWebhookChannelExecute(r ApiTestWebh } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -2941,64 +4966,73 @@ func (a *NotificationChannelsApiService) TestWebhookChannelExecute(r ApiTestWebh err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v NotificationChannelNotFound err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v NotificationChannelError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } -type ApiUpdateOpsgenieNotificationChannelRequest struct { - ctx context.Context - ApiService NotificationChannelsApi - channelId int64 - opsgenieChannelWriteSchema *OpsgenieChannelWriteSchema +type ApiUpdateTeamsNotificationChannelRequest struct { + ctx context.Context + ApiService NotificationChannelsApi + channelId int64 + teamsChannelWriteSchema *TeamsChannelWriteSchema } -// Create or update a opsgenie channel -func (r ApiUpdateOpsgenieNotificationChannelRequest) OpsgenieChannelWriteSchema(opsgenieChannelWriteSchema OpsgenieChannelWriteSchema) ApiUpdateOpsgenieNotificationChannelRequest { - r.opsgenieChannelWriteSchema = &opsgenieChannelWriteSchema +// Create or update a teams channel +func (r ApiUpdateTeamsNotificationChannelRequest) TeamsChannelWriteSchema(teamsChannelWriteSchema TeamsChannelWriteSchema) ApiUpdateTeamsNotificationChannelRequest { + r.teamsChannelWriteSchema = &teamsChannelWriteSchema return r } -func (r ApiUpdateOpsgenieNotificationChannelRequest) Execute() (*OpsgenieNotificationChannel, *http.Response, error) { - return r.ApiService.UpdateOpsgenieNotificationChannelExecute(r) +func (r ApiUpdateTeamsNotificationChannelRequest) Execute() (*TeamsNotificationChannel, *http.Response, error) { + return r.ApiService.UpdateTeamsNotificationChannelExecute(r) } /* -UpdateOpsgenieNotificationChannel Update the Opsgenie Notification channel by id +UpdateTeamsNotificationChannel Update the Teams Notification channel by id -Update the opsgenie notification channel by id +Update the teams notification channel by id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param channelId Channel identifier - @return ApiUpdateOpsgenieNotificationChannelRequest + @return ApiUpdateTeamsNotificationChannelRequest */ -func (a *NotificationChannelsApiService) UpdateOpsgenieNotificationChannel(ctx context.Context, channelId int64) ApiUpdateOpsgenieNotificationChannelRequest { - return ApiUpdateOpsgenieNotificationChannelRequest{ +func (a *NotificationChannelsApiService) UpdateTeamsNotificationChannel(ctx context.Context, channelId int64) ApiUpdateTeamsNotificationChannelRequest { + return ApiUpdateTeamsNotificationChannelRequest{ ApiService: a, ctx: ctx, channelId: channelId, @@ -3006,28 +5040,28 @@ func (a *NotificationChannelsApiService) UpdateOpsgenieNotificationChannel(ctx c } // Execute executes the request -// @return OpsgenieNotificationChannel -func (a *NotificationChannelsApiService) UpdateOpsgenieNotificationChannelExecute(r ApiUpdateOpsgenieNotificationChannelRequest) (*OpsgenieNotificationChannel, *http.Response, error) { +// @return TeamsNotificationChannel +func (a *NotificationChannelsApiService) UpdateTeamsNotificationChannelExecute(r ApiUpdateTeamsNotificationChannelRequest) (*TeamsNotificationChannel, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *OpsgenieNotificationChannel + localVarReturnValue *TeamsNotificationChannel ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.UpdateOpsgenieNotificationChannel") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotificationChannelsApiService.UpdateTeamsNotificationChannel") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/notifications/channels/opsgenie/{channelId}" + localVarPath := localBasePath + "/notifications/channels/teams/{channelId}" localVarPath = strings.Replace(localVarPath, "{"+"channelId"+"}", url.PathEscape(parameterToString(r.channelId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.opsgenieChannelWriteSchema == nil { - return localVarReturnValue, nil, reportError("opsgenieChannelWriteSchema is required and must be specified") + if r.teamsChannelWriteSchema == nil { + return localVarReturnValue, nil, reportError("teamsChannelWriteSchema is required and must be specified") } // to determine the Content-Type header @@ -3048,7 +5082,7 @@ func (a *NotificationChannelsApiService) UpdateOpsgenieNotificationChannelExecut localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.opsgenieChannelWriteSchema + localVarPostBody = r.teamsChannelWriteSchema if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -3348,20 +5382,34 @@ func (a *NotificationChannelsApiService) UpdateWebhookNotificationChannelExecute // --------------------------------------------- type NotificationChannelsApiMock struct { + CreateEmailNotificationChannelCalls *[]CreateEmailNotificationChannelCall + CreateEmailNotificationChannelResponse CreateEmailNotificationChannelMockResponse CreateOpsgenieNotificationChannelCalls *[]CreateOpsgenieNotificationChannelCall CreateOpsgenieNotificationChannelResponse CreateOpsgenieNotificationChannelMockResponse + CreateTeamsNotificationChannelCalls *[]CreateTeamsNotificationChannelCall + CreateTeamsNotificationChannelResponse CreateTeamsNotificationChannelMockResponse CreateWebhookNotificationChannelCalls *[]CreateWebhookNotificationChannelCall CreateWebhookNotificationChannelResponse CreateWebhookNotificationChannelMockResponse + DeleteEmailNotificationChannelCalls *[]DeleteEmailNotificationChannelCall + DeleteEmailNotificationChannelResponse DeleteEmailNotificationChannelMockResponse DeleteOpsgenieNotificationChannelCalls *[]DeleteOpsgenieNotificationChannelCall DeleteOpsgenieNotificationChannelResponse DeleteOpsgenieNotificationChannelMockResponse DeleteSlackNotificationChannelCalls *[]DeleteSlackNotificationChannelCall DeleteSlackNotificationChannelResponse DeleteSlackNotificationChannelMockResponse + DeleteTeamsNotificationChannelCalls *[]DeleteTeamsNotificationChannelCall + DeleteTeamsNotificationChannelResponse DeleteTeamsNotificationChannelMockResponse DeleteWebhookNotificationChannelCalls *[]DeleteWebhookNotificationChannelCall DeleteWebhookNotificationChannelResponse DeleteWebhookNotificationChannelMockResponse + GetEmailNotificationChannelCalls *[]GetEmailNotificationChannelCall + GetEmailNotificationChannelResponse GetEmailNotificationChannelMockResponse + GetEmailNotificationStatusCalls *[]GetEmailNotificationStatusCall + GetEmailNotificationStatusResponse GetEmailNotificationStatusMockResponse GetOpsgenieNotificationChannelCalls *[]GetOpsgenieNotificationChannelCall GetOpsgenieNotificationChannelResponse GetOpsgenieNotificationChannelMockResponse GetSlackNotificationChannelCalls *[]GetSlackNotificationChannelCall GetSlackNotificationChannelResponse GetSlackNotificationChannelMockResponse + GetTeamsNotificationChannelCalls *[]GetTeamsNotificationChannelCall + GetTeamsNotificationChannelResponse GetTeamsNotificationChannelMockResponse GetWebhookNotificationChannelCalls *[]GetWebhookNotificationChannelCall GetWebhookNotificationChannelResponse GetWebhookNotificationChannelMockResponse JoinSlackChannelCalls *[]JoinSlackChannelCall @@ -3374,59 +5422,114 @@ type NotificationChannelsApiMock struct { SlackOAuthCallbackResponse SlackOAuthCallbackMockResponse SlackOauthRedirectCalls *[]SlackOauthRedirectCall SlackOauthRedirectResponse SlackOauthRedirectMockResponse + TestEmailChannelCalls *[]TestEmailChannelCall + TestEmailChannelResponse TestEmailChannelMockResponse TestOpsgenieChannelCalls *[]TestOpsgenieChannelCall TestOpsgenieChannelResponse TestOpsgenieChannelMockResponse TestSlackChannelCalls *[]TestSlackChannelCall TestSlackChannelResponse TestSlackChannelMockResponse + TestTeamsChannelCalls *[]TestTeamsChannelCall + TestTeamsChannelResponse TestTeamsChannelMockResponse TestWebhookChannelCalls *[]TestWebhookChannelCall TestWebhookChannelResponse TestWebhookChannelMockResponse + UpdateEmailNotificationChannelCalls *[]UpdateEmailNotificationChannelCall + UpdateEmailNotificationChannelResponse UpdateEmailNotificationChannelMockResponse UpdateOpsgenieNotificationChannelCalls *[]UpdateOpsgenieNotificationChannelCall UpdateOpsgenieNotificationChannelResponse UpdateOpsgenieNotificationChannelMockResponse + UpdateTeamsNotificationChannelCalls *[]UpdateTeamsNotificationChannelCall + UpdateTeamsNotificationChannelResponse UpdateTeamsNotificationChannelMockResponse UpdateWebhookNotificationChannelCalls *[]UpdateWebhookNotificationChannelCall UpdateWebhookNotificationChannelResponse UpdateWebhookNotificationChannelMockResponse } func NewNotificationChannelsApiMock() NotificationChannelsApiMock { + xCreateEmailNotificationChannelCalls := make([]CreateEmailNotificationChannelCall, 0) xCreateOpsgenieNotificationChannelCalls := make([]CreateOpsgenieNotificationChannelCall, 0) + xCreateTeamsNotificationChannelCalls := make([]CreateTeamsNotificationChannelCall, 0) xCreateWebhookNotificationChannelCalls := make([]CreateWebhookNotificationChannelCall, 0) + xDeleteEmailNotificationChannelCalls := make([]DeleteEmailNotificationChannelCall, 0) xDeleteOpsgenieNotificationChannelCalls := make([]DeleteOpsgenieNotificationChannelCall, 0) xDeleteSlackNotificationChannelCalls := make([]DeleteSlackNotificationChannelCall, 0) + xDeleteTeamsNotificationChannelCalls := make([]DeleteTeamsNotificationChannelCall, 0) xDeleteWebhookNotificationChannelCalls := make([]DeleteWebhookNotificationChannelCall, 0) + xGetEmailNotificationChannelCalls := make([]GetEmailNotificationChannelCall, 0) + xGetEmailNotificationStatusCalls := make([]GetEmailNotificationStatusCall, 0) xGetOpsgenieNotificationChannelCalls := make([]GetOpsgenieNotificationChannelCall, 0) xGetSlackNotificationChannelCalls := make([]GetSlackNotificationChannelCall, 0) + xGetTeamsNotificationChannelCalls := make([]GetTeamsNotificationChannelCall, 0) xGetWebhookNotificationChannelCalls := make([]GetWebhookNotificationChannelCall, 0) xJoinSlackChannelCalls := make([]JoinSlackChannelCall, 0) xListOpsgenieRespondersCalls := make([]ListOpsgenieRespondersCall, 0) xListSlackChannelsCalls := make([]ListSlackChannelsCall, 0) xSlackOAuthCallbackCalls := make([]SlackOAuthCallbackCall, 0) xSlackOauthRedirectCalls := make([]SlackOauthRedirectCall, 0) + xTestEmailChannelCalls := make([]TestEmailChannelCall, 0) xTestOpsgenieChannelCalls := make([]TestOpsgenieChannelCall, 0) xTestSlackChannelCalls := make([]TestSlackChannelCall, 0) + xTestTeamsChannelCalls := make([]TestTeamsChannelCall, 0) xTestWebhookChannelCalls := make([]TestWebhookChannelCall, 0) + xUpdateEmailNotificationChannelCalls := make([]UpdateEmailNotificationChannelCall, 0) xUpdateOpsgenieNotificationChannelCalls := make([]UpdateOpsgenieNotificationChannelCall, 0) + xUpdateTeamsNotificationChannelCalls := make([]UpdateTeamsNotificationChannelCall, 0) xUpdateWebhookNotificationChannelCalls := make([]UpdateWebhookNotificationChannelCall, 0) return NotificationChannelsApiMock{ + CreateEmailNotificationChannelCalls: &xCreateEmailNotificationChannelCalls, CreateOpsgenieNotificationChannelCalls: &xCreateOpsgenieNotificationChannelCalls, + CreateTeamsNotificationChannelCalls: &xCreateTeamsNotificationChannelCalls, CreateWebhookNotificationChannelCalls: &xCreateWebhookNotificationChannelCalls, + DeleteEmailNotificationChannelCalls: &xDeleteEmailNotificationChannelCalls, DeleteOpsgenieNotificationChannelCalls: &xDeleteOpsgenieNotificationChannelCalls, DeleteSlackNotificationChannelCalls: &xDeleteSlackNotificationChannelCalls, + DeleteTeamsNotificationChannelCalls: &xDeleteTeamsNotificationChannelCalls, DeleteWebhookNotificationChannelCalls: &xDeleteWebhookNotificationChannelCalls, + GetEmailNotificationChannelCalls: &xGetEmailNotificationChannelCalls, + GetEmailNotificationStatusCalls: &xGetEmailNotificationStatusCalls, GetOpsgenieNotificationChannelCalls: &xGetOpsgenieNotificationChannelCalls, GetSlackNotificationChannelCalls: &xGetSlackNotificationChannelCalls, + GetTeamsNotificationChannelCalls: &xGetTeamsNotificationChannelCalls, GetWebhookNotificationChannelCalls: &xGetWebhookNotificationChannelCalls, JoinSlackChannelCalls: &xJoinSlackChannelCalls, ListOpsgenieRespondersCalls: &xListOpsgenieRespondersCalls, ListSlackChannelsCalls: &xListSlackChannelsCalls, SlackOAuthCallbackCalls: &xSlackOAuthCallbackCalls, SlackOauthRedirectCalls: &xSlackOauthRedirectCalls, + TestEmailChannelCalls: &xTestEmailChannelCalls, TestOpsgenieChannelCalls: &xTestOpsgenieChannelCalls, TestSlackChannelCalls: &xTestSlackChannelCalls, + TestTeamsChannelCalls: &xTestTeamsChannelCalls, TestWebhookChannelCalls: &xTestWebhookChannelCalls, + UpdateEmailNotificationChannelCalls: &xUpdateEmailNotificationChannelCalls, UpdateOpsgenieNotificationChannelCalls: &xUpdateOpsgenieNotificationChannelCalls, + UpdateTeamsNotificationChannelCalls: &xUpdateTeamsNotificationChannelCalls, UpdateWebhookNotificationChannelCalls: &xUpdateWebhookNotificationChannelCalls, } } +type CreateEmailNotificationChannelMockResponse struct { + Result EmailNotificationChannel + Response *http.Response + Error error +} + +type CreateEmailNotificationChannelCall struct { + PemailChannelWriteSchema *EmailChannelWriteSchema +} + +func (mock NotificationChannelsApiMock) CreateEmailNotificationChannel(ctx context.Context) ApiCreateEmailNotificationChannelRequest { + return ApiCreateEmailNotificationChannelRequest{ + ApiService: mock, + ctx: ctx, + } +} + +func (mock NotificationChannelsApiMock) CreateEmailNotificationChannelExecute(r ApiCreateEmailNotificationChannelRequest) (*EmailNotificationChannel, *http.Response, error) { + p := CreateEmailNotificationChannelCall{ + PemailChannelWriteSchema: r.emailChannelWriteSchema, + } + *mock.CreateEmailNotificationChannelCalls = append(*mock.CreateEmailNotificationChannelCalls, p) + return &mock.CreateEmailNotificationChannelResponse.Result, mock.CreateEmailNotificationChannelResponse.Response, mock.CreateEmailNotificationChannelResponse.Error +} + type CreateOpsgenieNotificationChannelMockResponse struct { Result OpsgenieNotificationChannel Response *http.Response @@ -3452,6 +5555,31 @@ func (mock NotificationChannelsApiMock) CreateOpsgenieNotificationChannelExecute return &mock.CreateOpsgenieNotificationChannelResponse.Result, mock.CreateOpsgenieNotificationChannelResponse.Response, mock.CreateOpsgenieNotificationChannelResponse.Error } +type CreateTeamsNotificationChannelMockResponse struct { + Result TeamsNotificationChannel + Response *http.Response + Error error +} + +type CreateTeamsNotificationChannelCall struct { + PteamsChannelWriteSchema *TeamsChannelWriteSchema +} + +func (mock NotificationChannelsApiMock) CreateTeamsNotificationChannel(ctx context.Context) ApiCreateTeamsNotificationChannelRequest { + return ApiCreateTeamsNotificationChannelRequest{ + ApiService: mock, + ctx: ctx, + } +} + +func (mock NotificationChannelsApiMock) CreateTeamsNotificationChannelExecute(r ApiCreateTeamsNotificationChannelRequest) (*TeamsNotificationChannel, *http.Response, error) { + p := CreateTeamsNotificationChannelCall{ + PteamsChannelWriteSchema: r.teamsChannelWriteSchema, + } + *mock.CreateTeamsNotificationChannelCalls = append(*mock.CreateTeamsNotificationChannelCalls, p) + return &mock.CreateTeamsNotificationChannelResponse.Result, mock.CreateTeamsNotificationChannelResponse.Response, mock.CreateTeamsNotificationChannelResponse.Error +} + type CreateWebhookNotificationChannelMockResponse struct { Result WebhookNotificationChannel Response *http.Response @@ -3477,6 +5605,31 @@ func (mock NotificationChannelsApiMock) CreateWebhookNotificationChannelExecute( return &mock.CreateWebhookNotificationChannelResponse.Result, mock.CreateWebhookNotificationChannelResponse.Response, mock.CreateWebhookNotificationChannelResponse.Error } +type DeleteEmailNotificationChannelMockResponse struct { + Response *http.Response + Error error +} + +type DeleteEmailNotificationChannelCall struct { + PchannelId int64 +} + +func (mock NotificationChannelsApiMock) DeleteEmailNotificationChannel(ctx context.Context, channelId int64) ApiDeleteEmailNotificationChannelRequest { + return ApiDeleteEmailNotificationChannelRequest{ + ApiService: mock, + ctx: ctx, + channelId: channelId, + } +} + +func (mock NotificationChannelsApiMock) DeleteEmailNotificationChannelExecute(r ApiDeleteEmailNotificationChannelRequest) (*http.Response, error) { + p := DeleteEmailNotificationChannelCall{ + PchannelId: r.channelId, + } + *mock.DeleteEmailNotificationChannelCalls = append(*mock.DeleteEmailNotificationChannelCalls, p) + return mock.DeleteEmailNotificationChannelResponse.Response, mock.DeleteEmailNotificationChannelResponse.Error +} + type DeleteOpsgenieNotificationChannelMockResponse struct { Response *http.Response Error error @@ -3527,6 +5680,31 @@ func (mock NotificationChannelsApiMock) DeleteSlackNotificationChannelExecute(r return mock.DeleteSlackNotificationChannelResponse.Response, mock.DeleteSlackNotificationChannelResponse.Error } +type DeleteTeamsNotificationChannelMockResponse struct { + Response *http.Response + Error error +} + +type DeleteTeamsNotificationChannelCall struct { + PchannelId int64 +} + +func (mock NotificationChannelsApiMock) DeleteTeamsNotificationChannel(ctx context.Context, channelId int64) ApiDeleteTeamsNotificationChannelRequest { + return ApiDeleteTeamsNotificationChannelRequest{ + ApiService: mock, + ctx: ctx, + channelId: channelId, + } +} + +func (mock NotificationChannelsApiMock) DeleteTeamsNotificationChannelExecute(r ApiDeleteTeamsNotificationChannelRequest) (*http.Response, error) { + p := DeleteTeamsNotificationChannelCall{ + PchannelId: r.channelId, + } + *mock.DeleteTeamsNotificationChannelCalls = append(*mock.DeleteTeamsNotificationChannelCalls, p) + return mock.DeleteTeamsNotificationChannelResponse.Response, mock.DeleteTeamsNotificationChannelResponse.Error +} + type DeleteWebhookNotificationChannelMockResponse struct { Response *http.Response Error error @@ -3552,6 +5730,54 @@ func (mock NotificationChannelsApiMock) DeleteWebhookNotificationChannelExecute( return mock.DeleteWebhookNotificationChannelResponse.Response, mock.DeleteWebhookNotificationChannelResponse.Error } +type GetEmailNotificationChannelMockResponse struct { + Result EmailNotificationChannel + Response *http.Response + Error error +} + +type GetEmailNotificationChannelCall struct { + PchannelId int64 +} + +func (mock NotificationChannelsApiMock) GetEmailNotificationChannel(ctx context.Context, channelId int64) ApiGetEmailNotificationChannelRequest { + return ApiGetEmailNotificationChannelRequest{ + ApiService: mock, + ctx: ctx, + channelId: channelId, + } +} + +func (mock NotificationChannelsApiMock) GetEmailNotificationChannelExecute(r ApiGetEmailNotificationChannelRequest) (*EmailNotificationChannel, *http.Response, error) { + p := GetEmailNotificationChannelCall{ + PchannelId: r.channelId, + } + *mock.GetEmailNotificationChannelCalls = append(*mock.GetEmailNotificationChannelCalls, p) + return &mock.GetEmailNotificationChannelResponse.Result, mock.GetEmailNotificationChannelResponse.Response, mock.GetEmailNotificationChannelResponse.Error +} + +type GetEmailNotificationStatusMockResponse struct { + Result EmailNotificationStatus + Response *http.Response + Error error +} + +type GetEmailNotificationStatusCall struct { +} + +func (mock NotificationChannelsApiMock) GetEmailNotificationStatus(ctx context.Context) ApiGetEmailNotificationStatusRequest { + return ApiGetEmailNotificationStatusRequest{ + ApiService: mock, + ctx: ctx, + } +} + +func (mock NotificationChannelsApiMock) GetEmailNotificationStatusExecute(r ApiGetEmailNotificationStatusRequest) (*EmailNotificationStatus, *http.Response, error) { + p := GetEmailNotificationStatusCall{} + *mock.GetEmailNotificationStatusCalls = append(*mock.GetEmailNotificationStatusCalls, p) + return &mock.GetEmailNotificationStatusResponse.Result, mock.GetEmailNotificationStatusResponse.Response, mock.GetEmailNotificationStatusResponse.Error +} + type GetOpsgenieNotificationChannelMockResponse struct { Result OpsgenieNotificationChannel Response *http.Response @@ -3604,6 +5830,32 @@ func (mock NotificationChannelsApiMock) GetSlackNotificationChannelExecute(r Api return &mock.GetSlackNotificationChannelResponse.Result, mock.GetSlackNotificationChannelResponse.Response, mock.GetSlackNotificationChannelResponse.Error } +type GetTeamsNotificationChannelMockResponse struct { + Result TeamsNotificationChannel + Response *http.Response + Error error +} + +type GetTeamsNotificationChannelCall struct { + PchannelId int64 +} + +func (mock NotificationChannelsApiMock) GetTeamsNotificationChannel(ctx context.Context, channelId int64) ApiGetTeamsNotificationChannelRequest { + return ApiGetTeamsNotificationChannelRequest{ + ApiService: mock, + ctx: ctx, + channelId: channelId, + } +} + +func (mock NotificationChannelsApiMock) GetTeamsNotificationChannelExecute(r ApiGetTeamsNotificationChannelRequest) (*TeamsNotificationChannel, *http.Response, error) { + p := GetTeamsNotificationChannelCall{ + PchannelId: r.channelId, + } + *mock.GetTeamsNotificationChannelCalls = append(*mock.GetTeamsNotificationChannelCalls, p) + return &mock.GetTeamsNotificationChannelResponse.Result, mock.GetTeamsNotificationChannelResponse.Response, mock.GetTeamsNotificationChannelResponse.Error +} + type GetWebhookNotificationChannelMockResponse struct { Result WebhookNotificationChannel Response *http.Response @@ -3763,6 +6015,31 @@ func (mock NotificationChannelsApiMock) SlackOauthRedirectExecute(r ApiSlackOaut return mock.SlackOauthRedirectResponse.Response, mock.SlackOauthRedirectResponse.Error } +type TestEmailChannelMockResponse struct { + Response *http.Response + Error error +} + +type TestEmailChannelCall struct { + PchannelId int64 +} + +func (mock NotificationChannelsApiMock) TestEmailChannel(ctx context.Context, channelId int64) ApiTestEmailChannelRequest { + return ApiTestEmailChannelRequest{ + ApiService: mock, + ctx: ctx, + channelId: channelId, + } +} + +func (mock NotificationChannelsApiMock) TestEmailChannelExecute(r ApiTestEmailChannelRequest) (*http.Response, error) { + p := TestEmailChannelCall{ + PchannelId: r.channelId, + } + *mock.TestEmailChannelCalls = append(*mock.TestEmailChannelCalls, p) + return mock.TestEmailChannelResponse.Response, mock.TestEmailChannelResponse.Error +} + type TestOpsgenieChannelMockResponse struct { Response *http.Response Error error @@ -3813,6 +6090,31 @@ func (mock NotificationChannelsApiMock) TestSlackChannelExecute(r ApiTestSlackCh return mock.TestSlackChannelResponse.Response, mock.TestSlackChannelResponse.Error } +type TestTeamsChannelMockResponse struct { + Response *http.Response + Error error +} + +type TestTeamsChannelCall struct { + PchannelId int64 +} + +func (mock NotificationChannelsApiMock) TestTeamsChannel(ctx context.Context, channelId int64) ApiTestTeamsChannelRequest { + return ApiTestTeamsChannelRequest{ + ApiService: mock, + ctx: ctx, + channelId: channelId, + } +} + +func (mock NotificationChannelsApiMock) TestTeamsChannelExecute(r ApiTestTeamsChannelRequest) (*http.Response, error) { + p := TestTeamsChannelCall{ + PchannelId: r.channelId, + } + *mock.TestTeamsChannelCalls = append(*mock.TestTeamsChannelCalls, p) + return mock.TestTeamsChannelResponse.Response, mock.TestTeamsChannelResponse.Error +} + type TestWebhookChannelMockResponse struct { Response *http.Response Error error @@ -3838,6 +6140,34 @@ func (mock NotificationChannelsApiMock) TestWebhookChannelExecute(r ApiTestWebho return mock.TestWebhookChannelResponse.Response, mock.TestWebhookChannelResponse.Error } +type UpdateEmailNotificationChannelMockResponse struct { + Result EmailNotificationChannel + Response *http.Response + Error error +} + +type UpdateEmailNotificationChannelCall struct { + PchannelId int64 + PemailChannelWriteSchema *EmailChannelWriteSchema +} + +func (mock NotificationChannelsApiMock) UpdateEmailNotificationChannel(ctx context.Context, channelId int64) ApiUpdateEmailNotificationChannelRequest { + return ApiUpdateEmailNotificationChannelRequest{ + ApiService: mock, + ctx: ctx, + channelId: channelId, + } +} + +func (mock NotificationChannelsApiMock) UpdateEmailNotificationChannelExecute(r ApiUpdateEmailNotificationChannelRequest) (*EmailNotificationChannel, *http.Response, error) { + p := UpdateEmailNotificationChannelCall{ + PchannelId: r.channelId, + PemailChannelWriteSchema: r.emailChannelWriteSchema, + } + *mock.UpdateEmailNotificationChannelCalls = append(*mock.UpdateEmailNotificationChannelCalls, p) + return &mock.UpdateEmailNotificationChannelResponse.Result, mock.UpdateEmailNotificationChannelResponse.Response, mock.UpdateEmailNotificationChannelResponse.Error +} + type UpdateOpsgenieNotificationChannelMockResponse struct { Result OpsgenieNotificationChannel Response *http.Response @@ -3866,6 +6196,34 @@ func (mock NotificationChannelsApiMock) UpdateOpsgenieNotificationChannelExecute return &mock.UpdateOpsgenieNotificationChannelResponse.Result, mock.UpdateOpsgenieNotificationChannelResponse.Response, mock.UpdateOpsgenieNotificationChannelResponse.Error } +type UpdateTeamsNotificationChannelMockResponse struct { + Result TeamsNotificationChannel + Response *http.Response + Error error +} + +type UpdateTeamsNotificationChannelCall struct { + PchannelId int64 + PteamsChannelWriteSchema *TeamsChannelWriteSchema +} + +func (mock NotificationChannelsApiMock) UpdateTeamsNotificationChannel(ctx context.Context, channelId int64) ApiUpdateTeamsNotificationChannelRequest { + return ApiUpdateTeamsNotificationChannelRequest{ + ApiService: mock, + ctx: ctx, + channelId: channelId, + } +} + +func (mock NotificationChannelsApiMock) UpdateTeamsNotificationChannelExecute(r ApiUpdateTeamsNotificationChannelRequest) (*TeamsNotificationChannel, *http.Response, error) { + p := UpdateTeamsNotificationChannelCall{ + PchannelId: r.channelId, + PteamsChannelWriteSchema: r.teamsChannelWriteSchema, + } + *mock.UpdateTeamsNotificationChannelCalls = append(*mock.UpdateTeamsNotificationChannelCalls, p) + return &mock.UpdateTeamsNotificationChannelResponse.Result, mock.UpdateTeamsNotificationChannelResponse.Response, mock.UpdateTeamsNotificationChannelResponse.Error +} + type UpdateWebhookNotificationChannelMockResponse struct { Result WebhookNotificationChannel Response *http.Response diff --git a/generated/stackstate_api/api_system_notifications.go b/generated/stackstate_api/api_system_notifications.go new file mode 100644 index 00000000..ff0f7f69 --- /dev/null +++ b/generated/stackstate_api/api_system_notifications.go @@ -0,0 +1,228 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" +) + +type SystemNotificationsApi interface { + + /* + AllSystemNotifications Overview of system notifications + + All active system notifications + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAllSystemNotificationsRequest + */ + AllSystemNotifications(ctx context.Context) ApiAllSystemNotificationsRequest + + // AllSystemNotificationsExecute executes the request + // @return SystemNotifications + AllSystemNotificationsExecute(r ApiAllSystemNotificationsRequest) (*SystemNotifications, *http.Response, error) +} + +// SystemNotificationsApiService SystemNotificationsApi service +type SystemNotificationsApiService service + +type ApiAllSystemNotificationsRequest struct { + ctx context.Context + ApiService SystemNotificationsApi +} + +func (r ApiAllSystemNotificationsRequest) Execute() (*SystemNotifications, *http.Response, error) { + return r.ApiService.AllSystemNotificationsExecute(r) +} + +/* +AllSystemNotifications Overview of system notifications + +All active system notifications + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAllSystemNotificationsRequest +*/ +func (a *SystemNotificationsApiService) AllSystemNotifications(ctx context.Context) ApiAllSystemNotificationsRequest { + return ApiAllSystemNotificationsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SystemNotifications +func (a *SystemNotificationsApiService) AllSystemNotificationsExecute(r ApiAllSystemNotificationsRequest) (*SystemNotifications, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SystemNotifications + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SystemNotificationsApiService.AllSystemNotifications") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/system/notifications" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ApiToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Token"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceBearer"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-ServiceBearer"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["ServiceToken"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-API-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorsResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// --------------------------------------------- +// ------------------ MOCKS -------------------- +// --------------------------------------------- + +type SystemNotificationsApiMock struct { + AllSystemNotificationsCalls *[]AllSystemNotificationsCall + AllSystemNotificationsResponse AllSystemNotificationsMockResponse +} + +func NewSystemNotificationsApiMock() SystemNotificationsApiMock { + xAllSystemNotificationsCalls := make([]AllSystemNotificationsCall, 0) + return SystemNotificationsApiMock{ + AllSystemNotificationsCalls: &xAllSystemNotificationsCalls, + } +} + +type AllSystemNotificationsMockResponse struct { + Result SystemNotifications + Response *http.Response + Error error +} + +type AllSystemNotificationsCall struct { +} + +func (mock SystemNotificationsApiMock) AllSystemNotifications(ctx context.Context) ApiAllSystemNotificationsRequest { + return ApiAllSystemNotificationsRequest{ + ApiService: mock, + ctx: ctx, + } +} + +func (mock SystemNotificationsApiMock) AllSystemNotificationsExecute(r ApiAllSystemNotificationsRequest) (*SystemNotifications, *http.Response, error) { + p := AllSystemNotificationsCall{} + *mock.AllSystemNotificationsCalls = append(*mock.AllSystemNotificationsCalls, p) + return &mock.AllSystemNotificationsResponse.Result, mock.AllSystemNotificationsResponse.Response, mock.AllSystemNotificationsResponse.Error +} diff --git a/generated/stackstate_api/client.go b/generated/stackstate_api/client.go index d3288c02..71b3ace0 100644 --- a/generated/stackstate_api/client.go +++ b/generated/stackstate_api/client.go @@ -50,6 +50,10 @@ type APIClient struct { // API Services + AgentLeasesApi AgentLeasesApi + + AgentRegistrationsApi AgentRegistrationsApi + ApiTokenApi ApiTokenApi AuthorizeIngestionApiKeyApi AuthorizeIngestionApiKeyApi @@ -100,6 +104,8 @@ type APIClient struct { SubscriptionApi SubscriptionApi + SystemNotificationsApi SystemNotificationsApi + TopicApi TopicApi TopologySynchronizationApi TopologySynchronizationApi @@ -127,6 +133,8 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.common.client = c // API Services + c.AgentLeasesApi = (*AgentLeasesApiService)(&c.common) + c.AgentRegistrationsApi = (*AgentRegistrationsApiService)(&c.common) c.ApiTokenApi = (*ApiTokenApiService)(&c.common) c.AuthorizeIngestionApiKeyApi = (*AuthorizeIngestionApiKeyApiService)(&c.common) c.ComponentApi = (*ComponentApiService)(&c.common) @@ -152,6 +160,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.StackpackApi = (*StackpackApiService)(&c.common) c.SubjectApi = (*SubjectApiService)(&c.common) c.SubscriptionApi = (*SubscriptionApiService)(&c.common) + c.SystemNotificationsApi = (*SystemNotificationsApiService)(&c.common) c.TopicApi = (*TopicApiService)(&c.common) c.TopologySynchronizationApi = (*TopologySynchronizationApiService)(&c.common) c.TracesApi = (*TracesApiService)(&c.common) diff --git a/generated/stackstate_api/docs/AgentData.md b/generated/stackstate_api/docs/AgentData.md new file mode 100644 index 00000000..b0e3cc5b --- /dev/null +++ b/generated/stackstate_api/docs/AgentData.md @@ -0,0 +1,114 @@ +# AgentData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Platform** | **string** | | +**CoreCount** | **int32** | | +**MemoryBytes** | **int64** | | +**KernelVersion** | **string** | | + +## Methods + +### NewAgentData + +`func NewAgentData(platform string, coreCount int32, memoryBytes int64, kernelVersion string, ) *AgentData` + +NewAgentData instantiates a new AgentData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAgentDataWithDefaults + +`func NewAgentDataWithDefaults() *AgentData` + +NewAgentDataWithDefaults instantiates a new AgentData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPlatform + +`func (o *AgentData) GetPlatform() string` + +GetPlatform returns the Platform field if non-nil, zero value otherwise. + +### GetPlatformOk + +`func (o *AgentData) GetPlatformOk() (*string, bool)` + +GetPlatformOk returns a tuple with the Platform field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlatform + +`func (o *AgentData) SetPlatform(v string)` + +SetPlatform sets Platform field to given value. + + +### GetCoreCount + +`func (o *AgentData) GetCoreCount() int32` + +GetCoreCount returns the CoreCount field if non-nil, zero value otherwise. + +### GetCoreCountOk + +`func (o *AgentData) GetCoreCountOk() (*int32, bool)` + +GetCoreCountOk returns a tuple with the CoreCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCoreCount + +`func (o *AgentData) SetCoreCount(v int32)` + +SetCoreCount sets CoreCount field to given value. + + +### GetMemoryBytes + +`func (o *AgentData) GetMemoryBytes() int64` + +GetMemoryBytes returns the MemoryBytes field if non-nil, zero value otherwise. + +### GetMemoryBytesOk + +`func (o *AgentData) GetMemoryBytesOk() (*int64, bool)` + +GetMemoryBytesOk returns a tuple with the MemoryBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemoryBytes + +`func (o *AgentData) SetMemoryBytes(v int64)` + +SetMemoryBytes sets MemoryBytes field to given value. + + +### GetKernelVersion + +`func (o *AgentData) GetKernelVersion() string` + +GetKernelVersion returns the KernelVersion field if non-nil, zero value otherwise. + +### GetKernelVersionOk + +`func (o *AgentData) GetKernelVersionOk() (*string, bool)` + +GetKernelVersionOk returns a tuple with the KernelVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKernelVersion + +`func (o *AgentData) SetKernelVersion(v string)` + +SetKernelVersion sets KernelVersion field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/AgentLease.md b/generated/stackstate_api/docs/AgentLease.md new file mode 100644 index 00000000..91af3980 --- /dev/null +++ b/generated/stackstate_api/docs/AgentLease.md @@ -0,0 +1,15 @@ +# AgentLease + +## Enum + + +* `ACTIVE` (value: `"Active"`) + +* `LIMITED` (value: `"Limited"`) + +* `STALE` (value: `"Stale"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/AgentLeasesApi.md b/generated/stackstate_api/docs/AgentLeasesApi.md new file mode 100644 index 00000000..0b4ca5b6 --- /dev/null +++ b/generated/stackstate_api/docs/AgentLeasesApi.md @@ -0,0 +1,81 @@ +# \AgentLeasesApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AgentCheckLease**](AgentLeasesApi.md#AgentCheckLease) | **Post** /agents/{agentId}/checkLease | Check the lease of an agent. + + + +## AgentCheckLease + +> AgentRegistration AgentCheckLease(ctx, agentId).CheckLeaseRequest(checkLeaseRequest).Execute() + +Check the lease of an agent. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + agentId := "agentId_example" // string | The identifier of an agent + checkLeaseRequest := *openapiclient.NewCheckLeaseRequest("ApiKey_example") // CheckLeaseRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AgentLeasesApi.AgentCheckLease(context.Background(), agentId).CheckLeaseRequest(checkLeaseRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AgentLeasesApi.AgentCheckLease``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AgentCheckLease`: AgentRegistration + fmt.Fprintf(os.Stdout, "Response from `AgentLeasesApi.AgentCheckLease`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**agentId** | **string** | The identifier of an agent | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAgentCheckLeaseRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **checkLeaseRequest** | [**CheckLeaseRequest**](CheckLeaseRequest.md) | | + +### Return type + +[**AgentRegistration**](AgentRegistration.md) + +### Authorization + +[ApiToken](../README.md#ApiToken), [ServiceBearer](../README.md#ServiceBearer), [ServiceToken](../README.md#ServiceToken) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/generated/stackstate_api/docs/AgentRegistration.md b/generated/stackstate_api/docs/AgentRegistration.md new file mode 100644 index 00000000..894fa296 --- /dev/null +++ b/generated/stackstate_api/docs/AgentRegistration.md @@ -0,0 +1,140 @@ +# AgentRegistration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AgentId** | **string** | | +**Lease** | [**AgentLease**](AgentLease.md) | | +**LeaseUntilEpochMs** | **int64** | | +**RegisteredEpochMs** | **int64** | | +**AgentData** | Pointer to [**AgentData**](AgentData.md) | | [optional] + +## Methods + +### NewAgentRegistration + +`func NewAgentRegistration(agentId string, lease AgentLease, leaseUntilEpochMs int64, registeredEpochMs int64, ) *AgentRegistration` + +NewAgentRegistration instantiates a new AgentRegistration object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAgentRegistrationWithDefaults + +`func NewAgentRegistrationWithDefaults() *AgentRegistration` + +NewAgentRegistrationWithDefaults instantiates a new AgentRegistration object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAgentId + +`func (o *AgentRegistration) GetAgentId() string` + +GetAgentId returns the AgentId field if non-nil, zero value otherwise. + +### GetAgentIdOk + +`func (o *AgentRegistration) GetAgentIdOk() (*string, bool)` + +GetAgentIdOk returns a tuple with the AgentId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAgentId + +`func (o *AgentRegistration) SetAgentId(v string)` + +SetAgentId sets AgentId field to given value. + + +### GetLease + +`func (o *AgentRegistration) GetLease() AgentLease` + +GetLease returns the Lease field if non-nil, zero value otherwise. + +### GetLeaseOk + +`func (o *AgentRegistration) GetLeaseOk() (*AgentLease, bool)` + +GetLeaseOk returns a tuple with the Lease field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLease + +`func (o *AgentRegistration) SetLease(v AgentLease)` + +SetLease sets Lease field to given value. + + +### GetLeaseUntilEpochMs + +`func (o *AgentRegistration) GetLeaseUntilEpochMs() int64` + +GetLeaseUntilEpochMs returns the LeaseUntilEpochMs field if non-nil, zero value otherwise. + +### GetLeaseUntilEpochMsOk + +`func (o *AgentRegistration) GetLeaseUntilEpochMsOk() (*int64, bool)` + +GetLeaseUntilEpochMsOk returns a tuple with the LeaseUntilEpochMs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLeaseUntilEpochMs + +`func (o *AgentRegistration) SetLeaseUntilEpochMs(v int64)` + +SetLeaseUntilEpochMs sets LeaseUntilEpochMs field to given value. + + +### GetRegisteredEpochMs + +`func (o *AgentRegistration) GetRegisteredEpochMs() int64` + +GetRegisteredEpochMs returns the RegisteredEpochMs field if non-nil, zero value otherwise. + +### GetRegisteredEpochMsOk + +`func (o *AgentRegistration) GetRegisteredEpochMsOk() (*int64, bool)` + +GetRegisteredEpochMsOk returns a tuple with the RegisteredEpochMs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegisteredEpochMs + +`func (o *AgentRegistration) SetRegisteredEpochMs(v int64)` + +SetRegisteredEpochMs sets RegisteredEpochMs field to given value. + + +### GetAgentData + +`func (o *AgentRegistration) GetAgentData() AgentData` + +GetAgentData returns the AgentData field if non-nil, zero value otherwise. + +### GetAgentDataOk + +`func (o *AgentRegistration) GetAgentDataOk() (*AgentData, bool)` + +GetAgentDataOk returns a tuple with the AgentData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAgentData + +`func (o *AgentRegistration) SetAgentData(v AgentData)` + +SetAgentData sets AgentData field to given value. + +### HasAgentData + +`func (o *AgentRegistration) HasAgentData() bool` + +HasAgentData returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/AgentRegistrations.md b/generated/stackstate_api/docs/AgentRegistrations.md new file mode 100644 index 00000000..54b5d989 --- /dev/null +++ b/generated/stackstate_api/docs/AgentRegistrations.md @@ -0,0 +1,51 @@ +# AgentRegistrations + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Agents** | [**[]AgentRegistration**](AgentRegistration.md) | | + +## Methods + +### NewAgentRegistrations + +`func NewAgentRegistrations(agents []AgentRegistration, ) *AgentRegistrations` + +NewAgentRegistrations instantiates a new AgentRegistrations object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAgentRegistrationsWithDefaults + +`func NewAgentRegistrationsWithDefaults() *AgentRegistrations` + +NewAgentRegistrationsWithDefaults instantiates a new AgentRegistrations object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAgents + +`func (o *AgentRegistrations) GetAgents() []AgentRegistration` + +GetAgents returns the Agents field if non-nil, zero value otherwise. + +### GetAgentsOk + +`func (o *AgentRegistrations) GetAgentsOk() (*[]AgentRegistration, bool)` + +GetAgentsOk returns a tuple with the Agents field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAgents + +`func (o *AgentRegistrations) SetAgents(v []AgentRegistration)` + +SetAgents sets Agents field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/AgentRegistrationsApi.md b/generated/stackstate_api/docs/AgentRegistrationsApi.md new file mode 100644 index 00000000..c289873d --- /dev/null +++ b/generated/stackstate_api/docs/AgentRegistrationsApi.md @@ -0,0 +1,70 @@ +# \AgentRegistrationsApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AllAgentRegistrations**](AgentRegistrationsApi.md#AllAgentRegistrations) | **Get** /agents | Overview of registered agents + + + +## AllAgentRegistrations + +> AgentRegistrations AllAgentRegistrations(ctx).Execute() + +Overview of registered agents + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AgentRegistrationsApi.AllAgentRegistrations(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AgentRegistrationsApi.AllAgentRegistrations``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AllAgentRegistrations`: AgentRegistrations + fmt.Fprintf(os.Stdout, "Response from `AgentRegistrationsApi.AllAgentRegistrations`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiAllAgentRegistrationsRequest struct via the builder pattern + + +### Return type + +[**AgentRegistrations**](AgentRegistrations.md) + +### Authorization + +[ApiToken](../README.md#ApiToken), [ServiceBearer](../README.md#ServiceBearer), [ServiceToken](../README.md#ServiceToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/generated/stackstate_api/docs/ArgumentPropagatedHealthStateVal.md b/generated/stackstate_api/docs/ArgumentPropagatedHealthStateVal.md deleted file mode 100644 index eb0c1f00..00000000 --- a/generated/stackstate_api/docs/ArgumentPropagatedHealthStateVal.md +++ /dev/null @@ -1,145 +0,0 @@ -# ArgumentPropagatedHealthStateVal - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Type** | **string** | | -**Id** | Pointer to **int64** | | [optional] -**LastUpdateTimestamp** | Pointer to **int64** | | [optional] -**Parameter** | **int64** | | -**Value** | [**PropagatedHealthStateValue**](PropagatedHealthStateValue.md) | | - -## Methods - -### NewArgumentPropagatedHealthStateVal - -`func NewArgumentPropagatedHealthStateVal(type_ string, parameter int64, value PropagatedHealthStateValue, ) *ArgumentPropagatedHealthStateVal` - -NewArgumentPropagatedHealthStateVal instantiates a new ArgumentPropagatedHealthStateVal object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewArgumentPropagatedHealthStateValWithDefaults - -`func NewArgumentPropagatedHealthStateValWithDefaults() *ArgumentPropagatedHealthStateVal` - -NewArgumentPropagatedHealthStateValWithDefaults instantiates a new ArgumentPropagatedHealthStateVal object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetType - -`func (o *ArgumentPropagatedHealthStateVal) GetType() string` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ArgumentPropagatedHealthStateVal) GetTypeOk() (*string, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ArgumentPropagatedHealthStateVal) SetType(v string)` - -SetType sets Type field to given value. - - -### GetId - -`func (o *ArgumentPropagatedHealthStateVal) GetId() int64` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *ArgumentPropagatedHealthStateVal) GetIdOk() (*int64, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *ArgumentPropagatedHealthStateVal) SetId(v int64)` - -SetId sets Id field to given value. - -### HasId - -`func (o *ArgumentPropagatedHealthStateVal) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetLastUpdateTimestamp - -`func (o *ArgumentPropagatedHealthStateVal) GetLastUpdateTimestamp() int64` - -GetLastUpdateTimestamp returns the LastUpdateTimestamp field if non-nil, zero value otherwise. - -### GetLastUpdateTimestampOk - -`func (o *ArgumentPropagatedHealthStateVal) GetLastUpdateTimestampOk() (*int64, bool)` - -GetLastUpdateTimestampOk returns a tuple with the LastUpdateTimestamp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLastUpdateTimestamp - -`func (o *ArgumentPropagatedHealthStateVal) SetLastUpdateTimestamp(v int64)` - -SetLastUpdateTimestamp sets LastUpdateTimestamp field to given value. - -### HasLastUpdateTimestamp - -`func (o *ArgumentPropagatedHealthStateVal) HasLastUpdateTimestamp() bool` - -HasLastUpdateTimestamp returns a boolean if a field has been set. - -### GetParameter - -`func (o *ArgumentPropagatedHealthStateVal) GetParameter() int64` - -GetParameter returns the Parameter field if non-nil, zero value otherwise. - -### GetParameterOk - -`func (o *ArgumentPropagatedHealthStateVal) GetParameterOk() (*int64, bool)` - -GetParameterOk returns a tuple with the Parameter field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetParameter - -`func (o *ArgumentPropagatedHealthStateVal) SetParameter(v int64)` - -SetParameter sets Parameter field to given value. - - -### GetValue - -`func (o *ArgumentPropagatedHealthStateVal) GetValue() PropagatedHealthStateValue` - -GetValue returns the Value field if non-nil, zero value otherwise. - -### GetValueOk - -`func (o *ArgumentPropagatedHealthStateVal) GetValueOk() (*PropagatedHealthStateValue, bool)` - -GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetValue - -`func (o *ArgumentPropagatedHealthStateVal) SetValue(v PropagatedHealthStateValue)` - -SetValue sets Value field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/generated/stackstate_api/docs/CheckLeaseRequest.md b/generated/stackstate_api/docs/CheckLeaseRequest.md new file mode 100644 index 00000000..32125f47 --- /dev/null +++ b/generated/stackstate_api/docs/CheckLeaseRequest.md @@ -0,0 +1,77 @@ +# CheckLeaseRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApiKey** | **string** | | +**AgentData** | Pointer to [**AgentData**](AgentData.md) | | [optional] + +## Methods + +### NewCheckLeaseRequest + +`func NewCheckLeaseRequest(apiKey string, ) *CheckLeaseRequest` + +NewCheckLeaseRequest instantiates a new CheckLeaseRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCheckLeaseRequestWithDefaults + +`func NewCheckLeaseRequestWithDefaults() *CheckLeaseRequest` + +NewCheckLeaseRequestWithDefaults instantiates a new CheckLeaseRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetApiKey + +`func (o *CheckLeaseRequest) GetApiKey() string` + +GetApiKey returns the ApiKey field if non-nil, zero value otherwise. + +### GetApiKeyOk + +`func (o *CheckLeaseRequest) GetApiKeyOk() (*string, bool)` + +GetApiKeyOk returns a tuple with the ApiKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApiKey + +`func (o *CheckLeaseRequest) SetApiKey(v string)` + +SetApiKey sets ApiKey field to given value. + + +### GetAgentData + +`func (o *CheckLeaseRequest) GetAgentData() AgentData` + +GetAgentData returns the AgentData field if non-nil, zero value otherwise. + +### GetAgentDataOk + +`func (o *CheckLeaseRequest) GetAgentDataOk() (*AgentData, bool)` + +GetAgentDataOk returns a tuple with the AgentData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAgentData + +`func (o *CheckLeaseRequest) SetAgentData(v AgentData)` + +SetAgentData sets AgentData field to given value. + +### HasAgentData + +`func (o *CheckLeaseRequest) HasAgentData() bool` + +HasAgentData returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/EmailChannelRefId.md b/generated/stackstate_api/docs/EmailChannelRefId.md new file mode 100644 index 00000000..3e83abd7 --- /dev/null +++ b/generated/stackstate_api/docs/EmailChannelRefId.md @@ -0,0 +1,72 @@ +# EmailChannelRefId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | | +**Id** | **int64** | | + +## Methods + +### NewEmailChannelRefId + +`func NewEmailChannelRefId(type_ string, id int64, ) *EmailChannelRefId` + +NewEmailChannelRefId instantiates a new EmailChannelRefId object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEmailChannelRefIdWithDefaults + +`func NewEmailChannelRefIdWithDefaults() *EmailChannelRefId` + +NewEmailChannelRefIdWithDefaults instantiates a new EmailChannelRefId object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *EmailChannelRefId) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *EmailChannelRefId) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *EmailChannelRefId) SetType(v string)` + +SetType sets Type field to given value. + + +### GetId + +`func (o *EmailChannelRefId) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *EmailChannelRefId) GetIdOk() (*int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *EmailChannelRefId) SetId(v int64)` + +SetId sets Id field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/EmailChannelWriteSchema.md b/generated/stackstate_api/docs/EmailChannelWriteSchema.md new file mode 100644 index 00000000..378d4719 --- /dev/null +++ b/generated/stackstate_api/docs/EmailChannelWriteSchema.md @@ -0,0 +1,98 @@ +# EmailChannelWriteSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**To** | **[]string** | | +**Cc** | **[]string** | | +**SubjectPrefix** | Pointer to **string** | | [optional] + +## Methods + +### NewEmailChannelWriteSchema + +`func NewEmailChannelWriteSchema(to []string, cc []string, ) *EmailChannelWriteSchema` + +NewEmailChannelWriteSchema instantiates a new EmailChannelWriteSchema object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEmailChannelWriteSchemaWithDefaults + +`func NewEmailChannelWriteSchemaWithDefaults() *EmailChannelWriteSchema` + +NewEmailChannelWriteSchemaWithDefaults instantiates a new EmailChannelWriteSchema object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTo + +`func (o *EmailChannelWriteSchema) GetTo() []string` + +GetTo returns the To field if non-nil, zero value otherwise. + +### GetToOk + +`func (o *EmailChannelWriteSchema) GetToOk() (*[]string, bool)` + +GetToOk returns a tuple with the To field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTo + +`func (o *EmailChannelWriteSchema) SetTo(v []string)` + +SetTo sets To field to given value. + + +### GetCc + +`func (o *EmailChannelWriteSchema) GetCc() []string` + +GetCc returns the Cc field if non-nil, zero value otherwise. + +### GetCcOk + +`func (o *EmailChannelWriteSchema) GetCcOk() (*[]string, bool)` + +GetCcOk returns a tuple with the Cc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCc + +`func (o *EmailChannelWriteSchema) SetCc(v []string)` + +SetCc sets Cc field to given value. + + +### GetSubjectPrefix + +`func (o *EmailChannelWriteSchema) GetSubjectPrefix() string` + +GetSubjectPrefix returns the SubjectPrefix field if non-nil, zero value otherwise. + +### GetSubjectPrefixOk + +`func (o *EmailChannelWriteSchema) GetSubjectPrefixOk() (*string, bool)` + +GetSubjectPrefixOk returns a tuple with the SubjectPrefix field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubjectPrefix + +`func (o *EmailChannelWriteSchema) SetSubjectPrefix(v string)` + +SetSubjectPrefix sets SubjectPrefix field to given value. + +### HasSubjectPrefix + +`func (o *EmailChannelWriteSchema) HasSubjectPrefix() bool` + +HasSubjectPrefix returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/EmailNotificationChannel.md b/generated/stackstate_api/docs/EmailNotificationChannel.md new file mode 100644 index 00000000..398378cf --- /dev/null +++ b/generated/stackstate_api/docs/EmailNotificationChannel.md @@ -0,0 +1,187 @@ +# EmailNotificationChannel + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int64** | | +**NotificationConfigurationId** | Pointer to **int64** | | [optional] +**Status** | [**NotificationChannelStatus**](NotificationChannelStatus.md) | | +**To** | **[]string** | | +**Cc** | **[]string** | | +**SubjectPrefix** | Pointer to **string** | | [optional] +**Type** | **string** | | + +## Methods + +### NewEmailNotificationChannel + +`func NewEmailNotificationChannel(id int64, status NotificationChannelStatus, to []string, cc []string, type_ string, ) *EmailNotificationChannel` + +NewEmailNotificationChannel instantiates a new EmailNotificationChannel object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEmailNotificationChannelWithDefaults + +`func NewEmailNotificationChannelWithDefaults() *EmailNotificationChannel` + +NewEmailNotificationChannelWithDefaults instantiates a new EmailNotificationChannel object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *EmailNotificationChannel) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *EmailNotificationChannel) GetIdOk() (*int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *EmailNotificationChannel) SetId(v int64)` + +SetId sets Id field to given value. + + +### GetNotificationConfigurationId + +`func (o *EmailNotificationChannel) GetNotificationConfigurationId() int64` + +GetNotificationConfigurationId returns the NotificationConfigurationId field if non-nil, zero value otherwise. + +### GetNotificationConfigurationIdOk + +`func (o *EmailNotificationChannel) GetNotificationConfigurationIdOk() (*int64, bool)` + +GetNotificationConfigurationIdOk returns a tuple with the NotificationConfigurationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotificationConfigurationId + +`func (o *EmailNotificationChannel) SetNotificationConfigurationId(v int64)` + +SetNotificationConfigurationId sets NotificationConfigurationId field to given value. + +### HasNotificationConfigurationId + +`func (o *EmailNotificationChannel) HasNotificationConfigurationId() bool` + +HasNotificationConfigurationId returns a boolean if a field has been set. + +### GetStatus + +`func (o *EmailNotificationChannel) GetStatus() NotificationChannelStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *EmailNotificationChannel) GetStatusOk() (*NotificationChannelStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *EmailNotificationChannel) SetStatus(v NotificationChannelStatus)` + +SetStatus sets Status field to given value. + + +### GetTo + +`func (o *EmailNotificationChannel) GetTo() []string` + +GetTo returns the To field if non-nil, zero value otherwise. + +### GetToOk + +`func (o *EmailNotificationChannel) GetToOk() (*[]string, bool)` + +GetToOk returns a tuple with the To field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTo + +`func (o *EmailNotificationChannel) SetTo(v []string)` + +SetTo sets To field to given value. + + +### GetCc + +`func (o *EmailNotificationChannel) GetCc() []string` + +GetCc returns the Cc field if non-nil, zero value otherwise. + +### GetCcOk + +`func (o *EmailNotificationChannel) GetCcOk() (*[]string, bool)` + +GetCcOk returns a tuple with the Cc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCc + +`func (o *EmailNotificationChannel) SetCc(v []string)` + +SetCc sets Cc field to given value. + + +### GetSubjectPrefix + +`func (o *EmailNotificationChannel) GetSubjectPrefix() string` + +GetSubjectPrefix returns the SubjectPrefix field if non-nil, zero value otherwise. + +### GetSubjectPrefixOk + +`func (o *EmailNotificationChannel) GetSubjectPrefixOk() (*string, bool)` + +GetSubjectPrefixOk returns a tuple with the SubjectPrefix field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubjectPrefix + +`func (o *EmailNotificationChannel) SetSubjectPrefix(v string)` + +SetSubjectPrefix sets SubjectPrefix field to given value. + +### HasSubjectPrefix + +`func (o *EmailNotificationChannel) HasSubjectPrefix() bool` + +HasSubjectPrefix returns a boolean if a field has been set. + +### GetType + +`func (o *EmailNotificationChannel) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *EmailNotificationChannel) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *EmailNotificationChannel) SetType(v string)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/EmailNotificationChannelAllOf.md b/generated/stackstate_api/docs/EmailNotificationChannelAllOf.md new file mode 100644 index 00000000..699f9cdb --- /dev/null +++ b/generated/stackstate_api/docs/EmailNotificationChannelAllOf.md @@ -0,0 +1,51 @@ +# EmailNotificationChannelAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | | + +## Methods + +### NewEmailNotificationChannelAllOf + +`func NewEmailNotificationChannelAllOf(type_ string, ) *EmailNotificationChannelAllOf` + +NewEmailNotificationChannelAllOf instantiates a new EmailNotificationChannelAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEmailNotificationChannelAllOfWithDefaults + +`func NewEmailNotificationChannelAllOfWithDefaults() *EmailNotificationChannelAllOf` + +NewEmailNotificationChannelAllOfWithDefaults instantiates a new EmailNotificationChannelAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *EmailNotificationChannelAllOf) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *EmailNotificationChannelAllOf) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *EmailNotificationChannelAllOf) SetType(v string)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/EmailNotificationStatus.md b/generated/stackstate_api/docs/EmailNotificationStatus.md new file mode 100644 index 00000000..c416cf0f --- /dev/null +++ b/generated/stackstate_api/docs/EmailNotificationStatus.md @@ -0,0 +1,51 @@ +# EmailNotificationStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ValidConfiguration** | **bool** | | + +## Methods + +### NewEmailNotificationStatus + +`func NewEmailNotificationStatus(validConfiguration bool, ) *EmailNotificationStatus` + +NewEmailNotificationStatus instantiates a new EmailNotificationStatus object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEmailNotificationStatusWithDefaults + +`func NewEmailNotificationStatusWithDefaults() *EmailNotificationStatus` + +NewEmailNotificationStatusWithDefaults instantiates a new EmailNotificationStatus object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetValidConfiguration + +`func (o *EmailNotificationStatus) GetValidConfiguration() bool` + +GetValidConfiguration returns the ValidConfiguration field if non-nil, zero value otherwise. + +### GetValidConfigurationOk + +`func (o *EmailNotificationStatus) GetValidConfigurationOk() (*bool, bool)` + +GetValidConfigurationOk returns a tuple with the ValidConfiguration field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValidConfiguration + +`func (o *EmailNotificationStatus) SetValidConfiguration(v bool)` + +SetValidConfiguration sets ValidConfiguration field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/EventRef.md b/generated/stackstate_api/docs/EventRef.md deleted file mode 100644 index 06dd47d0..00000000 --- a/generated/stackstate_api/docs/EventRef.md +++ /dev/null @@ -1,114 +0,0 @@ -# EventRef - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Title** | **string** | | -**EventId** | **string** | | -**EventTimestamp** | **int64** | | -**EventType** | **string** | | - -## Methods - -### NewEventRef - -`func NewEventRef(title string, eventId string, eventTimestamp int64, eventType string, ) *EventRef` - -NewEventRef instantiates a new EventRef object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewEventRefWithDefaults - -`func NewEventRefWithDefaults() *EventRef` - -NewEventRefWithDefaults instantiates a new EventRef object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTitle - -`func (o *EventRef) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *EventRef) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *EventRef) SetTitle(v string)` - -SetTitle sets Title field to given value. - - -### GetEventId - -`func (o *EventRef) GetEventId() string` - -GetEventId returns the EventId field if non-nil, zero value otherwise. - -### GetEventIdOk - -`func (o *EventRef) GetEventIdOk() (*string, bool)` - -GetEventIdOk returns a tuple with the EventId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventId - -`func (o *EventRef) SetEventId(v string)` - -SetEventId sets EventId field to given value. - - -### GetEventTimestamp - -`func (o *EventRef) GetEventTimestamp() int64` - -GetEventTimestamp returns the EventTimestamp field if non-nil, zero value otherwise. - -### GetEventTimestampOk - -`func (o *EventRef) GetEventTimestampOk() (*int64, bool)` - -GetEventTimestampOk returns a tuple with the EventTimestamp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventTimestamp - -`func (o *EventRef) SetEventTimestamp(v int64)` - -SetEventTimestamp sets EventTimestamp field to given value. - - -### GetEventType - -`func (o *EventRef) GetEventType() string` - -GetEventType returns the EventType field if non-nil, zero value otherwise. - -### GetEventTypeOk - -`func (o *EventRef) GetEventTypeOk() (*string, bool)` - -GetEventTypeOk returns a tuple with the EventType field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventType - -`func (o *EventRef) SetEventType(v string)` - -SetEventType sets EventType field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/generated/stackstate_api/docs/MetricApi.md b/generated/stackstate_api/docs/MetricApi.md index 870b6d2d..3d7c2ebe 100644 --- a/generated/stackstate_api/docs/MetricApi.md +++ b/generated/stackstate_api/docs/MetricApi.md @@ -93,7 +93,7 @@ Name | Type | Description | Notes ## GetInstantQuery -> PromEnvelope GetInstantQuery(ctx).Query(query).Time(time).Timeout(timeout).PostFilter(postFilter).Execute() +> PromEnvelope GetInstantQuery(ctx).Query(query).Time(time).Timeout(timeout).Step(step).PostFilter(postFilter).Execute() Instant query at a single point in time @@ -115,11 +115,12 @@ func main() { query := "query_example" // string | Prometheus expression query string time := "2015-07-01T20:10:51.781Z or 1660817432" // string | Evaluation timestamp in rfc3339 format or unix format (optional) timeout := "timeout_example" // string | Evaluation timeout (optional) + step := "5m or 300" // string | Query resolution step width in duration format or float number of seconds. (optional) postFilter := []string{"Inner_example"} // []string | Enforce additional label filters for queries (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.MetricApi.GetInstantQuery(context.Background()).Query(query).Time(time).Timeout(timeout).PostFilter(postFilter).Execute() + resp, r, err := apiClient.MetricApi.GetInstantQuery(context.Background()).Query(query).Time(time).Timeout(timeout).Step(step).PostFilter(postFilter).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.GetInstantQuery``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -143,6 +144,7 @@ Name | Type | Description | Notes **query** | **string** | Prometheus expression query string | **time** | **string** | Evaluation timestamp in rfc3339 format or unix format | **timeout** | **string** | Evaluation timeout | + **step** | **string** | Query resolution step width in duration format or float number of seconds. | **postFilter** | **[]string** | Enforce additional label filters for queries | ### Return type @@ -379,7 +381,7 @@ Name | Type | Description | Notes ## GetRangeQuery -> PromEnvelope GetRangeQuery(ctx).Query(query).Start(start).End(end).Step(step).Timeout(timeout).MaxNumberOfDataPoints(maxNumberOfDataPoints).PostFilter(postFilter).Execute() +> PromEnvelope GetRangeQuery(ctx).Query(query).Start(start).End(end).Step(step).Timeout(timeout).Aligned(aligned).MaxNumberOfDataPoints(maxNumberOfDataPoints).PostFilter(postFilter).Execute() Query over a range of time @@ -403,12 +405,13 @@ func main() { end := "2015-07-01T20:10:51.781Z or 1660817432" // string | End timestamp in rfc3339 format or unix format step := "5m or 300" // string | Query resolution step width in duration format or float number of seconds. timeout := "timeout_example" // string | Evaluation timeout (optional) + aligned := true // bool | Align start and end times with step size (optional) maxNumberOfDataPoints := int64(2) // int64 | Maximum number of data points to return. (optional) postFilter := []string{"Inner_example"} // []string | Enforce additional label filters for queries (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.MetricApi.GetRangeQuery(context.Background()).Query(query).Start(start).End(end).Step(step).Timeout(timeout).MaxNumberOfDataPoints(maxNumberOfDataPoints).PostFilter(postFilter).Execute() + resp, r, err := apiClient.MetricApi.GetRangeQuery(context.Background()).Query(query).Start(start).End(end).Step(step).Timeout(timeout).Aligned(aligned).MaxNumberOfDataPoints(maxNumberOfDataPoints).PostFilter(postFilter).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.GetRangeQuery``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -434,6 +437,7 @@ Name | Type | Description | Notes **end** | **string** | End timestamp in rfc3339 format or unix format | **step** | **string** | Query resolution step width in duration format or float number of seconds. | **timeout** | **string** | Evaluation timeout | + **aligned** | **bool** | Align start and end times with step size | **maxNumberOfDataPoints** | **int64** | Maximum number of data points to return. | **postFilter** | **[]string** | Enforce additional label filters for queries | @@ -597,7 +601,7 @@ Name | Type | Description | Notes ## PostInstantQuery -> PromEnvelope PostInstantQuery(ctx).Query(query).Time(time).Timeout(timeout).PostFilter(postFilter).Execute() +> PromEnvelope PostInstantQuery(ctx).Query(query).Time(time).Timeout(timeout).Step(step).PostFilter(postFilter).Execute() Instant query at a single point in time @@ -619,11 +623,12 @@ func main() { query := "query_example" // string | time := "time_example" // string | (optional) timeout := "timeout_example" // string | (optional) + step := "step_example" // string | (optional) postFilter := []string{"Inner_example"} // []string | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.MetricApi.PostInstantQuery(context.Background()).Query(query).Time(time).Timeout(timeout).PostFilter(postFilter).Execute() + resp, r, err := apiClient.MetricApi.PostInstantQuery(context.Background()).Query(query).Time(time).Timeout(timeout).Step(step).PostFilter(postFilter).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.PostInstantQuery``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -647,6 +652,7 @@ Name | Type | Description | Notes **query** | **string** | | **time** | **string** | | **timeout** | **string** | | + **step** | **string** | | **postFilter** | **[]string** | | ### Return type @@ -883,7 +889,7 @@ Name | Type | Description | Notes ## PostRangeQuery -> PromEnvelope PostRangeQuery(ctx).Query(query).Start(start).End(end).Step(step).Timeout(timeout).MaxNumberOfDataPoints(maxNumberOfDataPoints).PostFilter(postFilter).Execute() +> PromEnvelope PostRangeQuery(ctx).Query(query).Start(start).End(end).Step(step).Timeout(timeout).Aligned(aligned).MaxNumberOfDataPoints(maxNumberOfDataPoints).PostFilter(postFilter).Execute() Query over a range of time @@ -907,12 +913,13 @@ func main() { end := "end_example" // string | step := "step_example" // string | timeout := "timeout_example" // string | (optional) + aligned := true // bool | (optional) maxNumberOfDataPoints := int64(789) // int64 | (optional) postFilter := []string{"Inner_example"} // []string | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.MetricApi.PostRangeQuery(context.Background()).Query(query).Start(start).End(end).Step(step).Timeout(timeout).MaxNumberOfDataPoints(maxNumberOfDataPoints).PostFilter(postFilter).Execute() + resp, r, err := apiClient.MetricApi.PostRangeQuery(context.Background()).Query(query).Start(start).End(end).Step(step).Timeout(timeout).Aligned(aligned).MaxNumberOfDataPoints(maxNumberOfDataPoints).PostFilter(postFilter).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `MetricApi.PostRangeQuery``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -938,6 +945,7 @@ Name | Type | Description | Notes **end** | **string** | | **step** | **string** | | **timeout** | **string** | | + **aligned** | **bool** | | **maxNumberOfDataPoints** | **int64** | | **postFilter** | **[]string** | | diff --git a/generated/stackstate_api/docs/MonitorApi.md b/generated/stackstate_api/docs/MonitorApi.md index f0fabebd..9b17c671 100644 --- a/generated/stackstate_api/docs/MonitorApi.md +++ b/generated/stackstate_api/docs/MonitorApi.md @@ -222,7 +222,7 @@ Name | Type | Description | Notes ## GetMonitorCheckStates -> MonitorCheckStates GetMonitorCheckStates(ctx, monitorIdOrUrn).HealthState(healthState).Limit(limit).Execute() +> MonitorCheckStates GetMonitorCheckStates(ctx, monitorIdOrUrn).HealthState(healthState).Limit(limit).Timestamp(timestamp).Execute() Get the check states for a monitor @@ -244,10 +244,11 @@ func main() { monitorIdOrUrn := "monitorIdOrUrn_example" // string | The id or identifier (urn) of a monitor healthState := openapiclient.HealthStateValue("UNINITIALIZED") // HealthStateValue | Health state of check states (optional) limit := int32(56) // int32 | (optional) + timestamp := int64(789) // int64 | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.MonitorApi.GetMonitorCheckStates(context.Background(), monitorIdOrUrn).HealthState(healthState).Limit(limit).Execute() + resp, r, err := apiClient.MonitorApi.GetMonitorCheckStates(context.Background(), monitorIdOrUrn).HealthState(healthState).Limit(limit).Timestamp(timestamp).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `MonitorApi.GetMonitorCheckStates``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -275,6 +276,7 @@ Name | Type | Description | Notes **healthState** | [**HealthStateValue**](HealthStateValue.md) | Health state of check states | **limit** | **int32** | | + **timestamp** | **int64** | | ### Return type @@ -296,7 +298,7 @@ Name | Type | Description | Notes ## GetMonitorWithStatus -> MonitorStatus GetMonitorWithStatus(ctx, monitorIdOrUrn).Execute() +> MonitorStatus GetMonitorWithStatus(ctx, monitorIdOrUrn).Timestamp(timestamp).Execute() Get a monitor with stream information @@ -316,10 +318,11 @@ import ( func main() { monitorIdOrUrn := "monitorIdOrUrn_example" // string | The id or identifier (urn) of a monitor + timestamp := int64(789) // int64 | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.MonitorApi.GetMonitorWithStatus(context.Background(), monitorIdOrUrn).Execute() + resp, r, err := apiClient.MonitorApi.GetMonitorWithStatus(context.Background(), monitorIdOrUrn).Timestamp(timestamp).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `MonitorApi.GetMonitorWithStatus``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -345,6 +348,7 @@ Other parameters are passed through a pointer to a apiGetMonitorWithStatusReques Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **timestamp** | **int64** | | ### Return type diff --git a/generated/stackstate_api/docs/NotificationChannel.md b/generated/stackstate_api/docs/NotificationChannel.md index 74ef2e0c..77170328 100644 --- a/generated/stackstate_api/docs/NotificationChannel.md +++ b/generated/stackstate_api/docs/NotificationChannel.md @@ -19,12 +19,15 @@ Name | Type | Description | Notes **GenieKey** | **string** | | **Responders** | [**[]OpsgenieResponder**](OpsgenieResponder.md) | | **Priority** | **string** | | +**To** | **[]string** | | +**Cc** | **[]string** | | +**SubjectPrefix** | Pointer to **string** | | [optional] ## Methods ### NewNotificationChannel -`func NewNotificationChannel(id int64, status NotificationChannelStatus, type_ string, slackWorkspace string, url string, token string, verifySsl bool, metadata map[string]string, region string, genieKey string, responders []OpsgenieResponder, priority string, ) *NotificationChannel` +`func NewNotificationChannel(id int64, status NotificationChannelStatus, type_ string, slackWorkspace string, url string, token string, verifySsl bool, metadata map[string]string, region string, genieKey string, responders []OpsgenieResponder, priority string, to []string, cc []string, ) *NotificationChannel` NewNotificationChannel instantiates a new NotificationChannel object This constructor will assign default values to properties that have it defined, @@ -354,6 +357,71 @@ and a boolean to check if the value has been set. SetPriority sets Priority field to given value. +### GetTo + +`func (o *NotificationChannel) GetTo() []string` + +GetTo returns the To field if non-nil, zero value otherwise. + +### GetToOk + +`func (o *NotificationChannel) GetToOk() (*[]string, bool)` + +GetToOk returns a tuple with the To field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTo + +`func (o *NotificationChannel) SetTo(v []string)` + +SetTo sets To field to given value. + + +### GetCc + +`func (o *NotificationChannel) GetCc() []string` + +GetCc returns the Cc field if non-nil, zero value otherwise. + +### GetCcOk + +`func (o *NotificationChannel) GetCcOk() (*[]string, bool)` + +GetCcOk returns a tuple with the Cc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCc + +`func (o *NotificationChannel) SetCc(v []string)` + +SetCc sets Cc field to given value. + + +### GetSubjectPrefix + +`func (o *NotificationChannel) GetSubjectPrefix() string` + +GetSubjectPrefix returns the SubjectPrefix field if non-nil, zero value otherwise. + +### GetSubjectPrefixOk + +`func (o *NotificationChannel) GetSubjectPrefixOk() (*string, bool)` + +GetSubjectPrefixOk returns a tuple with the SubjectPrefix field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubjectPrefix + +`func (o *NotificationChannel) SetSubjectPrefix(v string)` + +SetSubjectPrefix sets SubjectPrefix field to given value. + +### HasSubjectPrefix + +`func (o *NotificationChannel) HasSubjectPrefix() bool` + +HasSubjectPrefix returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generated/stackstate_api/docs/NotificationChannelsApi.md b/generated/stackstate_api/docs/NotificationChannelsApi.md index 760a3b05..c77b13c7 100644 --- a/generated/stackstate_api/docs/NotificationChannelsApi.md +++ b/generated/stackstate_api/docs/NotificationChannelsApi.md @@ -4,32 +4,43 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[**CreateEmailNotificationChannel**](NotificationChannelsApi.md#CreateEmailNotificationChannel) | **Post** /notifications/channels/email | Create a Email Notification channel [**CreateOpsgenieNotificationChannel**](NotificationChannelsApi.md#CreateOpsgenieNotificationChannel) | **Post** /notifications/channels/opsgenie | Create a Opsgenie Notification channel +[**CreateTeamsNotificationChannel**](NotificationChannelsApi.md#CreateTeamsNotificationChannel) | **Post** /notifications/channels/teams | Create a Teams Notification channel [**CreateWebhookNotificationChannel**](NotificationChannelsApi.md#CreateWebhookNotificationChannel) | **Post** /notifications/channels/webhook | Create a Webhook Notification channel +[**DeleteEmailNotificationChannel**](NotificationChannelsApi.md#DeleteEmailNotificationChannel) | **Delete** /notifications/channels/email/{channelId} | Delete the Email Notification channel by id [**DeleteOpsgenieNotificationChannel**](NotificationChannelsApi.md#DeleteOpsgenieNotificationChannel) | **Delete** /notifications/channels/opsgenie/{channelId} | Delete the Opsgenie Notification channel by id [**DeleteSlackNotificationChannel**](NotificationChannelsApi.md#DeleteSlackNotificationChannel) | **Delete** /notifications/channels/slack/{channelId} | Delete the Slack Notification channel by id +[**DeleteTeamsNotificationChannel**](NotificationChannelsApi.md#DeleteTeamsNotificationChannel) | **Delete** /notifications/channels/teams/{channelId} | Delete the Teams Notification channel by id [**DeleteWebhookNotificationChannel**](NotificationChannelsApi.md#DeleteWebhookNotificationChannel) | **Delete** /notifications/channels/webhook/{channelId} | Delete the Webhook Notification channel by id +[**GetEmailNotificationChannel**](NotificationChannelsApi.md#GetEmailNotificationChannel) | **Get** /notifications/channels/email/{channelId} | Get the Email Notification channel by id +[**GetEmailNotificationStatus**](NotificationChannelsApi.md#GetEmailNotificationStatus) | **Get** /notifications/channels/email/status | Email Notification channel status [**GetOpsgenieNotificationChannel**](NotificationChannelsApi.md#GetOpsgenieNotificationChannel) | **Get** /notifications/channels/opsgenie/{channelId} | Get the Opsgenie Notification channel by id [**GetSlackNotificationChannel**](NotificationChannelsApi.md#GetSlackNotificationChannel) | **Get** /notifications/channels/slack/{channelId} | Get the Slack Notification channel by id +[**GetTeamsNotificationChannel**](NotificationChannelsApi.md#GetTeamsNotificationChannel) | **Get** /notifications/channels/teams/{channelId} | Get the Teams Notification channel by id [**GetWebhookNotificationChannel**](NotificationChannelsApi.md#GetWebhookNotificationChannel) | **Get** /notifications/channels/webhook/{channelId} | Get the Webhook Notification channel by id [**JoinSlackChannel**](NotificationChannelsApi.md#JoinSlackChannel) | **Post** /notifications/channels/slack/{channelId}/joinSlackChannel | Join the specified Slack channel to send notifications [**ListOpsgenieResponders**](NotificationChannelsApi.md#ListOpsgenieResponders) | **Get** /notifications/channels/opsgenie/responders | List Opsgenie responders [**ListSlackChannels**](NotificationChannelsApi.md#ListSlackChannels) | **Get** /notifications/channels/slack/{channelId}/listSlackChannels | List all public Slack channels [**SlackOAuthCallback**](NotificationChannelsApi.md#SlackOAuthCallback) | **Get** /notifications/channels/slack/oauth-callback | The OAuth callback for Slack [**SlackOauthRedirect**](NotificationChannelsApi.md#SlackOauthRedirect) | **Get** /notifications/channels/slack/oauth-redirect | Starts Slack OAuth2 flow +[**TestEmailChannel**](NotificationChannelsApi.md#TestEmailChannel) | **Post** /notifications/channels/email/{channelId}/test | Test the Email notification channel [**TestOpsgenieChannel**](NotificationChannelsApi.md#TestOpsgenieChannel) | **Post** /notifications/channels/opsgenie/{channelId}/test | Test the Opsgenie notification channel [**TestSlackChannel**](NotificationChannelsApi.md#TestSlackChannel) | **Post** /notifications/channels/slack/{channelId}/test | Test the Notification channel +[**TestTeamsChannel**](NotificationChannelsApi.md#TestTeamsChannel) | **Post** /notifications/channels/teams/{channelId}/test | Test the Teams notification channel [**TestWebhookChannel**](NotificationChannelsApi.md#TestWebhookChannel) | **Post** /notifications/channels/webhook/{channelId}/test | Test the Webhook notification channel +[**UpdateEmailNotificationChannel**](NotificationChannelsApi.md#UpdateEmailNotificationChannel) | **Put** /notifications/channels/email/{channelId} | Update the Email Notification channel by id [**UpdateOpsgenieNotificationChannel**](NotificationChannelsApi.md#UpdateOpsgenieNotificationChannel) | **Put** /notifications/channels/opsgenie/{channelId} | Update the Opsgenie Notification channel by id +[**UpdateTeamsNotificationChannel**](NotificationChannelsApi.md#UpdateTeamsNotificationChannel) | **Put** /notifications/channels/teams/{channelId} | Update the Teams Notification channel by id [**UpdateWebhookNotificationChannel**](NotificationChannelsApi.md#UpdateWebhookNotificationChannel) | **Put** /notifications/channels/webhook/{channelId} | Update the Webhook Notification channel by id -## CreateOpsgenieNotificationChannel +## CreateEmailNotificationChannel -> OpsgenieNotificationChannel CreateOpsgenieNotificationChannel(ctx).OpsgenieChannelWriteSchema(opsgenieChannelWriteSchema).Execute() +> EmailNotificationChannel CreateEmailNotificationChannel(ctx).EmailChannelWriteSchema(emailChannelWriteSchema).Execute() -Create a Opsgenie Notification channel +Create a Email Notification channel @@ -46,17 +57,17 @@ import ( ) func main() { - opsgenieChannelWriteSchema := *openapiclient.NewOpsgenieChannelWriteSchema("Region_example", "GenieKey_example", []openapiclient.OpsgenieResponder{*openapiclient.NewOpsgenieResponder("ResponderType_example", "Responder_example")}, "Priority_example") // OpsgenieChannelWriteSchema | Create or update a opsgenie channel + emailChannelWriteSchema := *openapiclient.NewEmailChannelWriteSchema([]string{"To_example"}, []string{"Cc_example"}) // EmailChannelWriteSchema | Create or update a email channel configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.CreateOpsgenieNotificationChannel(context.Background()).OpsgenieChannelWriteSchema(opsgenieChannelWriteSchema).Execute() + resp, r, err := apiClient.NotificationChannelsApi.CreateEmailNotificationChannel(context.Background()).EmailChannelWriteSchema(emailChannelWriteSchema).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.CreateOpsgenieNotificationChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.CreateEmailNotificationChannel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `CreateOpsgenieNotificationChannel`: OpsgenieNotificationChannel - fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.CreateOpsgenieNotificationChannel`: %v\n", resp) + // response from `CreateEmailNotificationChannel`: EmailNotificationChannel + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.CreateEmailNotificationChannel`: %v\n", resp) } ``` @@ -66,16 +77,16 @@ func main() { ### Other Parameters -Other parameters are passed through a pointer to a apiCreateOpsgenieNotificationChannelRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiCreateEmailNotificationChannelRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **opsgenieChannelWriteSchema** | [**OpsgenieChannelWriteSchema**](OpsgenieChannelWriteSchema.md) | Create or update a opsgenie channel | + **emailChannelWriteSchema** | [**EmailChannelWriteSchema**](EmailChannelWriteSchema.md) | Create or update a email channel | ### Return type -[**OpsgenieNotificationChannel**](OpsgenieNotificationChannel.md) +[**EmailNotificationChannel**](EmailNotificationChannel.md) ### Authorization @@ -91,11 +102,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## CreateWebhookNotificationChannel +## CreateOpsgenieNotificationChannel -> WebhookNotificationChannel CreateWebhookNotificationChannel(ctx).WebhookChannelWriteSchema(webhookChannelWriteSchema).Execute() +> OpsgenieNotificationChannel CreateOpsgenieNotificationChannel(ctx).OpsgenieChannelWriteSchema(opsgenieChannelWriteSchema).Execute() -Create a Webhook Notification channel +Create a Opsgenie Notification channel @@ -112,17 +123,17 @@ import ( ) func main() { - webhookChannelWriteSchema := *openapiclient.NewWebhookChannelWriteSchema("Url_example", "Token_example", false, map[string]string{"key": "Inner_example"}) // WebhookChannelWriteSchema | Create or update a webhook channel + opsgenieChannelWriteSchema := *openapiclient.NewOpsgenieChannelWriteSchema("Region_example", "GenieKey_example", []openapiclient.OpsgenieResponder{*openapiclient.NewOpsgenieResponder("ResponderType_example", "Responder_example")}, "Priority_example") // OpsgenieChannelWriteSchema | Create or update a opsgenie channel configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.CreateWebhookNotificationChannel(context.Background()).WebhookChannelWriteSchema(webhookChannelWriteSchema).Execute() + resp, r, err := apiClient.NotificationChannelsApi.CreateOpsgenieNotificationChannel(context.Background()).OpsgenieChannelWriteSchema(opsgenieChannelWriteSchema).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.CreateWebhookNotificationChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.CreateOpsgenieNotificationChannel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `CreateWebhookNotificationChannel`: WebhookNotificationChannel - fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.CreateWebhookNotificationChannel`: %v\n", resp) + // response from `CreateOpsgenieNotificationChannel`: OpsgenieNotificationChannel + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.CreateOpsgenieNotificationChannel`: %v\n", resp) } ``` @@ -132,16 +143,16 @@ func main() { ### Other Parameters -Other parameters are passed through a pointer to a apiCreateWebhookNotificationChannelRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiCreateOpsgenieNotificationChannelRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **webhookChannelWriteSchema** | [**WebhookChannelWriteSchema**](WebhookChannelWriteSchema.md) | Create or update a webhook channel | + **opsgenieChannelWriteSchema** | [**OpsgenieChannelWriteSchema**](OpsgenieChannelWriteSchema.md) | Create or update a opsgenie channel | ### Return type -[**WebhookNotificationChannel**](WebhookNotificationChannel.md) +[**OpsgenieNotificationChannel**](OpsgenieNotificationChannel.md) ### Authorization @@ -157,11 +168,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## DeleteOpsgenieNotificationChannel +## CreateTeamsNotificationChannel -> DeleteOpsgenieNotificationChannel(ctx, channelId).Execute() +> TeamsNotificationChannel CreateTeamsNotificationChannel(ctx).TeamsChannelWriteSchema(teamsChannelWriteSchema).Execute() -Delete the Opsgenie Notification channel by id +Create a Teams Notification channel @@ -178,38 +189,36 @@ import ( ) func main() { - channelId := int64(789) // int64 | Channel identifier + teamsChannelWriteSchema := *openapiclient.NewTeamsChannelWriteSchema("Url_example") // TeamsChannelWriteSchema | Create or update a teams channel configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.DeleteOpsgenieNotificationChannel(context.Background(), channelId).Execute() + resp, r, err := apiClient.NotificationChannelsApi.CreateTeamsNotificationChannel(context.Background()).TeamsChannelWriteSchema(teamsChannelWriteSchema).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.DeleteOpsgenieNotificationChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.CreateTeamsNotificationChannel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `CreateTeamsNotificationChannel`: TeamsNotificationChannel + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.CreateTeamsNotificationChannel`: %v\n", resp) } ``` ### Path Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**channelId** | **int64** | Channel identifier | ### Other Parameters -Other parameters are passed through a pointer to a apiDeleteOpsgenieNotificationChannelRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiCreateTeamsNotificationChannelRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - + **teamsChannelWriteSchema** | [**TeamsChannelWriteSchema**](TeamsChannelWriteSchema.md) | Create or update a teams channel | ### Return type - (empty response body) +[**TeamsNotificationChannel**](TeamsNotificationChannel.md) ### Authorization @@ -217,7 +226,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -225,11 +234,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## DeleteSlackNotificationChannel +## CreateWebhookNotificationChannel -> DeleteSlackNotificationChannel(ctx, channelId).Execute() +> WebhookNotificationChannel CreateWebhookNotificationChannel(ctx).WebhookChannelWriteSchema(webhookChannelWriteSchema).Execute() -Delete the Slack Notification channel by id +Create a Webhook Notification channel @@ -246,38 +255,36 @@ import ( ) func main() { - channelId := int64(789) // int64 | Channel identifier + webhookChannelWriteSchema := *openapiclient.NewWebhookChannelWriteSchema("Url_example", "Token_example", false, map[string]string{"key": "Inner_example"}) // WebhookChannelWriteSchema | Create or update a webhook channel configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.DeleteSlackNotificationChannel(context.Background(), channelId).Execute() + resp, r, err := apiClient.NotificationChannelsApi.CreateWebhookNotificationChannel(context.Background()).WebhookChannelWriteSchema(webhookChannelWriteSchema).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.DeleteSlackNotificationChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.CreateWebhookNotificationChannel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `CreateWebhookNotificationChannel`: WebhookNotificationChannel + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.CreateWebhookNotificationChannel`: %v\n", resp) } ``` ### Path Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**channelId** | **int64** | Channel identifier | ### Other Parameters -Other parameters are passed through a pointer to a apiDeleteSlackNotificationChannelRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiCreateWebhookNotificationChannelRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - + **webhookChannelWriteSchema** | [**WebhookChannelWriteSchema**](WebhookChannelWriteSchema.md) | Create or update a webhook channel | ### Return type - (empty response body) +[**WebhookNotificationChannel**](WebhookNotificationChannel.md) ### Authorization @@ -285,7 +292,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -293,11 +300,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## DeleteWebhookNotificationChannel +## DeleteEmailNotificationChannel -> DeleteWebhookNotificationChannel(ctx, channelId).Execute() +> DeleteEmailNotificationChannel(ctx, channelId).Execute() -Delete the Webhook Notification channel by id +Delete the Email Notification channel by id @@ -318,9 +325,9 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.DeleteWebhookNotificationChannel(context.Background(), channelId).Execute() + resp, r, err := apiClient.NotificationChannelsApi.DeleteEmailNotificationChannel(context.Background(), channelId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.DeleteWebhookNotificationChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.DeleteEmailNotificationChannel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } } @@ -336,7 +343,7 @@ Name | Type | Description | Notes ### Other Parameters -Other parameters are passed through a pointer to a apiDeleteWebhookNotificationChannelRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteEmailNotificationChannelRequest struct via the builder pattern Name | Type | Description | Notes @@ -361,11 +368,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetOpsgenieNotificationChannel +## DeleteOpsgenieNotificationChannel -> OpsgenieNotificationChannel GetOpsgenieNotificationChannel(ctx, channelId).Execute() +> DeleteOpsgenieNotificationChannel(ctx, channelId).Execute() -Get the Opsgenie Notification channel by id +Delete the Opsgenie Notification channel by id @@ -386,13 +393,11 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.GetOpsgenieNotificationChannel(context.Background(), channelId).Execute() + resp, r, err := apiClient.NotificationChannelsApi.DeleteOpsgenieNotificationChannel(context.Background(), channelId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.GetOpsgenieNotificationChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.DeleteOpsgenieNotificationChannel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetOpsgenieNotificationChannel`: OpsgenieNotificationChannel - fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.GetOpsgenieNotificationChannel`: %v\n", resp) } ``` @@ -406,7 +411,7 @@ Name | Type | Description | Notes ### Other Parameters -Other parameters are passed through a pointer to a apiGetOpsgenieNotificationChannelRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteOpsgenieNotificationChannelRequest struct via the builder pattern Name | Type | Description | Notes @@ -415,7 +420,7 @@ Name | Type | Description | Notes ### Return type -[**OpsgenieNotificationChannel**](OpsgenieNotificationChannel.md) + (empty response body) ### Authorization @@ -431,11 +436,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetSlackNotificationChannel +## DeleteSlackNotificationChannel -> SlackNotificationChannel GetSlackNotificationChannel(ctx, channelId).Execute() +> DeleteSlackNotificationChannel(ctx, channelId).Execute() -Get the Slack Notification channel by id +Delete the Slack Notification channel by id @@ -456,13 +461,11 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.GetSlackNotificationChannel(context.Background(), channelId).Execute() + resp, r, err := apiClient.NotificationChannelsApi.DeleteSlackNotificationChannel(context.Background(), channelId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.GetSlackNotificationChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.DeleteSlackNotificationChannel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetSlackNotificationChannel`: SlackNotificationChannel - fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.GetSlackNotificationChannel`: %v\n", resp) } ``` @@ -476,7 +479,7 @@ Name | Type | Description | Notes ### Other Parameters -Other parameters are passed through a pointer to a apiGetSlackNotificationChannelRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteSlackNotificationChannelRequest struct via the builder pattern Name | Type | Description | Notes @@ -485,7 +488,7 @@ Name | Type | Description | Notes ### Return type -[**SlackNotificationChannel**](SlackNotificationChannel.md) + (empty response body) ### Authorization @@ -501,11 +504,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetWebhookNotificationChannel +## DeleteTeamsNotificationChannel -> WebhookNotificationChannel GetWebhookNotificationChannel(ctx, channelId).Execute() +> DeleteTeamsNotificationChannel(ctx, channelId).Execute() -Get the Webhook Notification channel by id +Delete the Teams Notification channel by id @@ -526,13 +529,11 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.GetWebhookNotificationChannel(context.Background(), channelId).Execute() + resp, r, err := apiClient.NotificationChannelsApi.DeleteTeamsNotificationChannel(context.Background(), channelId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.GetWebhookNotificationChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.DeleteTeamsNotificationChannel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetWebhookNotificationChannel`: WebhookNotificationChannel - fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.GetWebhookNotificationChannel`: %v\n", resp) } ``` @@ -546,7 +547,7 @@ Name | Type | Description | Notes ### Other Parameters -Other parameters are passed through a pointer to a apiGetWebhookNotificationChannelRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteTeamsNotificationChannelRequest struct via the builder pattern Name | Type | Description | Notes @@ -555,7 +556,7 @@ Name | Type | Description | Notes ### Return type -[**WebhookNotificationChannel**](WebhookNotificationChannel.md) + (empty response body) ### Authorization @@ -571,11 +572,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## JoinSlackChannel +## DeleteWebhookNotificationChannel -> SlackNotificationChannel JoinSlackChannel(ctx, channelId).SlackChannelId(slackChannelId).Execute() +> DeleteWebhookNotificationChannel(ctx, channelId).Execute() -Join the specified Slack channel to send notifications +Delete the Webhook Notification channel by id @@ -593,17 +594,14 @@ import ( func main() { channelId := int64(789) // int64 | Channel identifier - slackChannelId := *openapiclient.NewSlackChannelId("Id_example") // SlackChannelId | Provide a Slack channel id to join the specified Slack channel configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.JoinSlackChannel(context.Background(), channelId).SlackChannelId(slackChannelId).Execute() + resp, r, err := apiClient.NotificationChannelsApi.DeleteWebhookNotificationChannel(context.Background(), channelId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.JoinSlackChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.DeleteWebhookNotificationChannel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `JoinSlackChannel`: SlackNotificationChannel - fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.JoinSlackChannel`: %v\n", resp) } ``` @@ -617,17 +615,16 @@ Name | Type | Description | Notes ### Other Parameters -Other parameters are passed through a pointer to a apiJoinSlackChannelRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteWebhookNotificationChannelRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **slackChannelId** | [**SlackChannelId**](SlackChannelId.md) | Provide a Slack channel id to join the specified Slack channel | ### Return type -[**SlackNotificationChannel**](SlackNotificationChannel.md) + (empty response body) ### Authorization @@ -635,7 +632,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -643,11 +640,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## ListOpsgenieResponders +## GetEmailNotificationChannel -> []OpsgenieResponder ListOpsgenieResponders(ctx).GenieKey(genieKey).Region(region).Execute() +> EmailNotificationChannel GetEmailNotificationChannel(ctx, channelId).Execute() -List Opsgenie responders +Get the Email Notification channel by id @@ -664,38 +661,40 @@ import ( ) func main() { - genieKey := "genieKey_example" // string | OpsGenie API key - region := "region_example" // string | OpsGenie region + channelId := int64(789) // int64 | Channel identifier configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.ListOpsgenieResponders(context.Background()).GenieKey(genieKey).Region(region).Execute() + resp, r, err := apiClient.NotificationChannelsApi.GetEmailNotificationChannel(context.Background(), channelId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.ListOpsgenieResponders``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.GetEmailNotificationChannel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `ListOpsgenieResponders`: []OpsgenieResponder - fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.ListOpsgenieResponders`: %v\n", resp) + // response from `GetEmailNotificationChannel`: EmailNotificationChannel + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.GetEmailNotificationChannel`: %v\n", resp) } ``` ### Path Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**channelId** | **int64** | Channel identifier | ### Other Parameters -Other parameters are passed through a pointer to a apiListOpsgenieRespondersRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetEmailNotificationChannelRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **genieKey** | **string** | OpsGenie API key | - **region** | **string** | OpsGenie region | + ### Return type -[**[]OpsgenieResponder**](OpsgenieResponder.md) +[**EmailNotificationChannel**](EmailNotificationChannel.md) ### Authorization @@ -711,11 +710,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## ListSlackChannels +## GetEmailNotificationStatus -> []SlackChannel ListSlackChannels(ctx, channelId).Execute() +> EmailNotificationStatus GetEmailNotificationStatus(ctx).Execute() -List all public Slack channels +Email Notification channel status @@ -732,40 +731,31 @@ import ( ) func main() { - channelId := int64(789) // int64 | Channel identifier configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.ListSlackChannels(context.Background(), channelId).Execute() + resp, r, err := apiClient.NotificationChannelsApi.GetEmailNotificationStatus(context.Background()).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.ListSlackChannels``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.GetEmailNotificationStatus``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `ListSlackChannels`: []SlackChannel - fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.ListSlackChannels`: %v\n", resp) + // response from `GetEmailNotificationStatus`: EmailNotificationStatus + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.GetEmailNotificationStatus`: %v\n", resp) } ``` ### Path Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**channelId** | **int64** | Channel identifier | +This endpoint does not need any parameter. ### Other Parameters -Other parameters are passed through a pointer to a apiListSlackChannelsRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +Other parameters are passed through a pointer to a apiGetEmailNotificationStatusRequest struct via the builder pattern ### Return type -[**[]SlackChannel**](SlackChannel.md) +[**EmailNotificationStatus**](EmailNotificationStatus.md) ### Authorization @@ -781,11 +771,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## SlackOAuthCallback +## GetOpsgenieNotificationChannel -> SlackOAuthCallback(ctx).State(state).Code(code).Error_(error_).Execute() +> OpsgenieNotificationChannel GetOpsgenieNotificationChannel(ctx, channelId).Execute() -The OAuth callback for Slack +Get the Opsgenie Notification channel by id @@ -802,38 +792,40 @@ import ( ) func main() { - state := "state_example" // string | State parameter that was passed to Slack, should have the same value as the one passed to Slack. - code := "code_example" // string | OAuth code from Slack. Either the code is present for the success case or the error parameter is present for the error case. (optional) - error_ := "error__example" // string | Error parameter. Either the code is present for the success case or the error parameter is present for the error case. (optional) + channelId := int64(789) // int64 | Channel identifier configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.SlackOAuthCallback(context.Background()).State(state).Code(code).Error_(error_).Execute() + resp, r, err := apiClient.NotificationChannelsApi.GetOpsgenieNotificationChannel(context.Background(), channelId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.SlackOAuthCallback``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.GetOpsgenieNotificationChannel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `GetOpsgenieNotificationChannel`: OpsgenieNotificationChannel + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.GetOpsgenieNotificationChannel`: %v\n", resp) } ``` ### Path Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**channelId** | **int64** | Channel identifier | ### Other Parameters -Other parameters are passed through a pointer to a apiSlackOAuthCallbackRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetOpsgenieNotificationChannelRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **state** | **string** | State parameter that was passed to Slack, should have the same value as the one passed to Slack. | - **code** | **string** | OAuth code from Slack. Either the code is present for the success case or the error parameter is present for the error case. | - **error_** | **string** | Error parameter. Either the code is present for the success case or the error parameter is present for the error case. | + ### Return type - (empty response body) +[**OpsgenieNotificationChannel**](OpsgenieNotificationChannel.md) ### Authorization @@ -842,18 +834,18 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: Not defined +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## SlackOauthRedirect +## GetSlackNotificationChannel -> SlackOauthRedirect(ctx).RedirectPath(redirectPath).Execute() +> SlackNotificationChannel GetSlackNotificationChannel(ctx, channelId).Execute() -Starts Slack OAuth2 flow +Get the Slack Notification channel by id @@ -870,34 +862,40 @@ import ( ) func main() { - redirectPath := "redirectPath_example" // string | After completing the oauth flow the user will be redirected back to this path, in the UI, on StackState, to continue further setup of the Slack notification channel. + channelId := int64(789) // int64 | Channel identifier configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.SlackOauthRedirect(context.Background()).RedirectPath(redirectPath).Execute() + resp, r, err := apiClient.NotificationChannelsApi.GetSlackNotificationChannel(context.Background(), channelId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.SlackOauthRedirect``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.GetSlackNotificationChannel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `GetSlackNotificationChannel`: SlackNotificationChannel + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.GetSlackNotificationChannel`: %v\n", resp) } ``` ### Path Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**channelId** | **int64** | Channel identifier | ### Other Parameters -Other parameters are passed through a pointer to a apiSlackOauthRedirectRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetSlackNotificationChannelRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **redirectPath** | **string** | After completing the oauth flow the user will be redirected back to this path, in the UI, on StackState, to continue further setup of the Slack notification channel. | + ### Return type - (empty response body) +[**SlackNotificationChannel**](SlackNotificationChannel.md) ### Authorization @@ -906,18 +904,18 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: Not defined +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## TestOpsgenieChannel +## GetTeamsNotificationChannel -> TestOpsgenieChannel(ctx, channelId).Execute() +> TeamsNotificationChannel GetTeamsNotificationChannel(ctx, channelId).Execute() -Test the Opsgenie notification channel +Get the Teams Notification channel by id @@ -938,11 +936,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.TestOpsgenieChannel(context.Background(), channelId).Execute() + resp, r, err := apiClient.NotificationChannelsApi.GetTeamsNotificationChannel(context.Background(), channelId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.TestOpsgenieChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.GetTeamsNotificationChannel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `GetTeamsNotificationChannel`: TeamsNotificationChannel + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.GetTeamsNotificationChannel`: %v\n", resp) } ``` @@ -956,7 +956,7 @@ Name | Type | Description | Notes ### Other Parameters -Other parameters are passed through a pointer to a apiTestOpsgenieChannelRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetTeamsNotificationChannelRequest struct via the builder pattern Name | Type | Description | Notes @@ -965,7 +965,7 @@ Name | Type | Description | Notes ### Return type - (empty response body) +[**TeamsNotificationChannel**](TeamsNotificationChannel.md) ### Authorization @@ -981,11 +981,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## TestSlackChannel +## GetWebhookNotificationChannel -> TestSlackChannel(ctx, channelId).Execute() +> WebhookNotificationChannel GetWebhookNotificationChannel(ctx, channelId).Execute() -Test the Notification channel +Get the Webhook Notification channel by id @@ -1006,11 +1006,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.NotificationChannelsApi.TestSlackChannel(context.Background(), channelId).Execute() + resp, r, err := apiClient.NotificationChannelsApi.GetWebhookNotificationChannel(context.Background(), channelId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.TestSlackChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.GetWebhookNotificationChannel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `GetWebhookNotificationChannel`: WebhookNotificationChannel + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.GetWebhookNotificationChannel`: %v\n", resp) } ``` @@ -1024,7 +1026,621 @@ Name | Type | Description | Notes ### Other Parameters -Other parameters are passed through a pointer to a apiTestSlackChannelRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetWebhookNotificationChannelRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**WebhookNotificationChannel**](WebhookNotificationChannel.md) + +### Authorization + +[ApiToken](../README.md#ApiToken), [ServiceBearer](../README.md#ServiceBearer), [ServiceToken](../README.md#ServiceToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## JoinSlackChannel + +> SlackNotificationChannel JoinSlackChannel(ctx, channelId).SlackChannelId(slackChannelId).Execute() + +Join the specified Slack channel to send notifications + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + channelId := int64(789) // int64 | Channel identifier + slackChannelId := *openapiclient.NewSlackChannelId("Id_example") // SlackChannelId | Provide a Slack channel id to join the specified Slack channel + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NotificationChannelsApi.JoinSlackChannel(context.Background(), channelId).SlackChannelId(slackChannelId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.JoinSlackChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `JoinSlackChannel`: SlackNotificationChannel + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.JoinSlackChannel`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**channelId** | **int64** | Channel identifier | + +### Other Parameters + +Other parameters are passed through a pointer to a apiJoinSlackChannelRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **slackChannelId** | [**SlackChannelId**](SlackChannelId.md) | Provide a Slack channel id to join the specified Slack channel | + +### Return type + +[**SlackNotificationChannel**](SlackNotificationChannel.md) + +### Authorization + +[ApiToken](../README.md#ApiToken), [ServiceBearer](../README.md#ServiceBearer), [ServiceToken](../README.md#ServiceToken) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListOpsgenieResponders + +> []OpsgenieResponder ListOpsgenieResponders(ctx).GenieKey(genieKey).Region(region).Execute() + +List Opsgenie responders + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + genieKey := "genieKey_example" // string | OpsGenie API key + region := "region_example" // string | OpsGenie region + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NotificationChannelsApi.ListOpsgenieResponders(context.Background()).GenieKey(genieKey).Region(region).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.ListOpsgenieResponders``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListOpsgenieResponders`: []OpsgenieResponder + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.ListOpsgenieResponders`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiListOpsgenieRespondersRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **genieKey** | **string** | OpsGenie API key | + **region** | **string** | OpsGenie region | + +### Return type + +[**[]OpsgenieResponder**](OpsgenieResponder.md) + +### Authorization + +[ApiToken](../README.md#ApiToken), [ServiceBearer](../README.md#ServiceBearer), [ServiceToken](../README.md#ServiceToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListSlackChannels + +> []SlackChannel ListSlackChannels(ctx, channelId).Execute() + +List all public Slack channels + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + channelId := int64(789) // int64 | Channel identifier + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NotificationChannelsApi.ListSlackChannels(context.Background(), channelId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.ListSlackChannels``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListSlackChannels`: []SlackChannel + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.ListSlackChannels`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**channelId** | **int64** | Channel identifier | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListSlackChannelsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**[]SlackChannel**](SlackChannel.md) + +### Authorization + +[ApiToken](../README.md#ApiToken), [ServiceBearer](../README.md#ServiceBearer), [ServiceToken](../README.md#ServiceToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## SlackOAuthCallback + +> SlackOAuthCallback(ctx).State(state).Code(code).Error_(error_).Execute() + +The OAuth callback for Slack + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + state := "state_example" // string | State parameter that was passed to Slack, should have the same value as the one passed to Slack. + code := "code_example" // string | OAuth code from Slack. Either the code is present for the success case or the error parameter is present for the error case. (optional) + error_ := "error__example" // string | Error parameter. Either the code is present for the success case or the error parameter is present for the error case. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NotificationChannelsApi.SlackOAuthCallback(context.Background()).State(state).Code(code).Error_(error_).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.SlackOAuthCallback``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiSlackOAuthCallbackRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **state** | **string** | State parameter that was passed to Slack, should have the same value as the one passed to Slack. | + **code** | **string** | OAuth code from Slack. Either the code is present for the success case or the error parameter is present for the error case. | + **error_** | **string** | Error parameter. Either the code is present for the success case or the error parameter is present for the error case. | + +### Return type + + (empty response body) + +### Authorization + +[ApiToken](../README.md#ApiToken), [ServiceBearer](../README.md#ServiceBearer), [ServiceToken](../README.md#ServiceToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## SlackOauthRedirect + +> SlackOauthRedirect(ctx).RedirectPath(redirectPath).Execute() + +Starts Slack OAuth2 flow + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + redirectPath := "redirectPath_example" // string | After completing the oauth flow the user will be redirected back to this path, in the UI, on StackState, to continue further setup of the Slack notification channel. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NotificationChannelsApi.SlackOauthRedirect(context.Background()).RedirectPath(redirectPath).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.SlackOauthRedirect``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiSlackOauthRedirectRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **redirectPath** | **string** | After completing the oauth flow the user will be redirected back to this path, in the UI, on StackState, to continue further setup of the Slack notification channel. | + +### Return type + + (empty response body) + +### Authorization + +[ApiToken](../README.md#ApiToken), [ServiceBearer](../README.md#ServiceBearer), [ServiceToken](../README.md#ServiceToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestEmailChannel + +> TestEmailChannel(ctx, channelId).Execute() + +Test the Email notification channel + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + channelId := int64(789) // int64 | Channel identifier + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NotificationChannelsApi.TestEmailChannel(context.Background(), channelId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.TestEmailChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**channelId** | **int64** | Channel identifier | + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestEmailChannelRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[ApiToken](../README.md#ApiToken), [ServiceBearer](../README.md#ServiceBearer), [ServiceToken](../README.md#ServiceToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestOpsgenieChannel + +> TestOpsgenieChannel(ctx, channelId).Execute() + +Test the Opsgenie notification channel + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + channelId := int64(789) // int64 | Channel identifier + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NotificationChannelsApi.TestOpsgenieChannel(context.Background(), channelId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.TestOpsgenieChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**channelId** | **int64** | Channel identifier | + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestOpsgenieChannelRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[ApiToken](../README.md#ApiToken), [ServiceBearer](../README.md#ServiceBearer), [ServiceToken](../README.md#ServiceToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestSlackChannel + +> TestSlackChannel(ctx, channelId).Execute() + +Test the Notification channel + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + channelId := int64(789) // int64 | Channel identifier + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NotificationChannelsApi.TestSlackChannel(context.Background(), channelId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.TestSlackChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**channelId** | **int64** | Channel identifier | + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestSlackChannelRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[ApiToken](../README.md#ApiToken), [ServiceBearer](../README.md#ServiceBearer), [ServiceToken](../README.md#ServiceToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestTeamsChannel + +> TestTeamsChannel(ctx, channelId).Execute() + +Test the Teams notification channel + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + channelId := int64(789) // int64 | Channel identifier + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NotificationChannelsApi.TestTeamsChannel(context.Background(), channelId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.TestTeamsChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**channelId** | **int64** | Channel identifier | + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestTeamsChannelRequest struct via the builder pattern Name | Type | Description | Notes @@ -1117,6 +1733,78 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## UpdateEmailNotificationChannel + +> EmailNotificationChannel UpdateEmailNotificationChannel(ctx, channelId).EmailChannelWriteSchema(emailChannelWriteSchema).Execute() + +Update the Email Notification channel by id + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + channelId := int64(789) // int64 | Channel identifier + emailChannelWriteSchema := *openapiclient.NewEmailChannelWriteSchema([]string{"To_example"}, []string{"Cc_example"}) // EmailChannelWriteSchema | Create or update a email channel + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NotificationChannelsApi.UpdateEmailNotificationChannel(context.Background(), channelId).EmailChannelWriteSchema(emailChannelWriteSchema).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.UpdateEmailNotificationChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateEmailNotificationChannel`: EmailNotificationChannel + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.UpdateEmailNotificationChannel`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**channelId** | **int64** | Channel identifier | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateEmailNotificationChannelRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **emailChannelWriteSchema** | [**EmailChannelWriteSchema**](EmailChannelWriteSchema.md) | Create or update a email channel | + +### Return type + +[**EmailNotificationChannel**](EmailNotificationChannel.md) + +### Authorization + +[ApiToken](../README.md#ApiToken), [ServiceBearer](../README.md#ServiceBearer), [ServiceToken](../README.md#ServiceToken) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## UpdateOpsgenieNotificationChannel > OpsgenieNotificationChannel UpdateOpsgenieNotificationChannel(ctx, channelId).OpsgenieChannelWriteSchema(opsgenieChannelWriteSchema).Execute() @@ -1189,6 +1877,78 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## UpdateTeamsNotificationChannel + +> TeamsNotificationChannel UpdateTeamsNotificationChannel(ctx, channelId).TeamsChannelWriteSchema(teamsChannelWriteSchema).Execute() + +Update the Teams Notification channel by id + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + channelId := int64(789) // int64 | Channel identifier + teamsChannelWriteSchema := *openapiclient.NewTeamsChannelWriteSchema("Url_example") // TeamsChannelWriteSchema | Create or update a teams channel + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NotificationChannelsApi.UpdateTeamsNotificationChannel(context.Background(), channelId).TeamsChannelWriteSchema(teamsChannelWriteSchema).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NotificationChannelsApi.UpdateTeamsNotificationChannel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateTeamsNotificationChannel`: TeamsNotificationChannel + fmt.Fprintf(os.Stdout, "Response from `NotificationChannelsApi.UpdateTeamsNotificationChannel`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**channelId** | **int64** | Channel identifier | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateTeamsNotificationChannelRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **teamsChannelWriteSchema** | [**TeamsChannelWriteSchema**](TeamsChannelWriteSchema.md) | Create or update a teams channel | + +### Return type + +[**TeamsNotificationChannel**](TeamsNotificationChannel.md) + +### Authorization + +[ApiToken](../README.md#ApiToken), [ServiceBearer](../README.md#ServiceBearer), [ServiceToken](../README.md#ServiceToken) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## UpdateWebhookNotificationChannel > WebhookNotificationChannel UpdateWebhookNotificationChannel(ctx, channelId).WebhookChannelWriteSchema(webhookChannelWriteSchema).Execute() diff --git a/generated/stackstate_api/docs/NotificationConfigurationsApi.md b/generated/stackstate_api/docs/NotificationConfigurationsApi.md index 85d4e3f9..ea78af79 100644 --- a/generated/stackstate_api/docs/NotificationConfigurationsApi.md +++ b/generated/stackstate_api/docs/NotificationConfigurationsApi.md @@ -34,7 +34,7 @@ import ( ) func main() { - notificationConfigurationWriteSchema := *openapiclient.NewNotificationConfigurationWriteSchema("Name_example", openapiclient.NotifyOnOptions("CRITICAL"), []openapiclient.MonitorReferenceId{openapiclient.MonitorReferenceId{ExternalMonitorDefId: openapiclient.NewExternalMonitorDefId("Type_example", int64(123))}}, []string{"MonitorTags_example"}, []int64{int64(123)}, []string{"ComponentTags_example"}, openapiclient.NotificationConfigurationStatusValue("ENABLED"), []openapiclient.ChannelReferenceId{openapiclient.ChannelReferenceId{OpsgenieChannelRefId: openapiclient.NewOpsgenieChannelRefId("Type_example", int64(123))}}) // NotificationConfigurationWriteSchema | Create or update a notification configuration + notificationConfigurationWriteSchema := *openapiclient.NewNotificationConfigurationWriteSchema("Name_example", openapiclient.NotifyOnOptions("CRITICAL"), []openapiclient.MonitorReferenceId{openapiclient.MonitorReferenceId{ExternalMonitorDefId: openapiclient.NewExternalMonitorDefId("Type_example", int64(123))}}, []string{"MonitorTags_example"}, []int64{int64(123)}, []string{"ComponentTags_example"}, openapiclient.NotificationConfigurationStatusValue("ENABLED"), []openapiclient.ChannelReferenceId{openapiclient.ChannelReferenceId{EmailChannelRefId: openapiclient.NewEmailChannelRefId("Type_example", int64(123))}}) // NotificationConfigurationWriteSchema | Create or update a notification configuration configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -370,7 +370,7 @@ import ( func main() { notificationConfigurationIdOrUrn := "notificationConfigurationIdOrUrn_example" // string | Notification identifier - notificationConfigurationWriteSchema := *openapiclient.NewNotificationConfigurationWriteSchema("Name_example", openapiclient.NotifyOnOptions("CRITICAL"), []openapiclient.MonitorReferenceId{openapiclient.MonitorReferenceId{ExternalMonitorDefId: openapiclient.NewExternalMonitorDefId("Type_example", int64(123))}}, []string{"MonitorTags_example"}, []int64{int64(123)}, []string{"ComponentTags_example"}, openapiclient.NotificationConfigurationStatusValue("ENABLED"), []openapiclient.ChannelReferenceId{openapiclient.ChannelReferenceId{OpsgenieChannelRefId: openapiclient.NewOpsgenieChannelRefId("Type_example", int64(123))}}) // NotificationConfigurationWriteSchema | Create or update a notification configuration + notificationConfigurationWriteSchema := *openapiclient.NewNotificationConfigurationWriteSchema("Name_example", openapiclient.NotifyOnOptions("CRITICAL"), []openapiclient.MonitorReferenceId{openapiclient.MonitorReferenceId{ExternalMonitorDefId: openapiclient.NewExternalMonitorDefId("Type_example", int64(123))}}, []string{"MonitorTags_example"}, []int64{int64(123)}, []string{"ComponentTags_example"}, openapiclient.NotificationConfigurationStatusValue("ENABLED"), []openapiclient.ChannelReferenceId{openapiclient.ChannelReferenceId{EmailChannelRefId: openapiclient.NewEmailChannelRefId("Type_example", int64(123))}}) // NotificationConfigurationWriteSchema | Create or update a notification configuration configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) diff --git a/generated/stackstate_api/docs/PropagatedHealthStateValue.md b/generated/stackstate_api/docs/PropagatedHealthStateValue.md deleted file mode 100644 index 1fbb24d3..00000000 --- a/generated/stackstate_api/docs/PropagatedHealthStateValue.md +++ /dev/null @@ -1,19 +0,0 @@ -# PropagatedHealthStateValue - -## Enum - - -* `UNKNOWN` (value: `"UNKNOWN"`) - -* `PROPAGATION_ERROR` (value: `"PROPAGATION_ERROR"`) - -* `DEVIATING` (value: `"DEVIATING"`) - -* `FLAPPING` (value: `"FLAPPING"`) - -* `CRITICAL` (value: `"CRITICAL"`) - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/generated/stackstate_api/docs/StackElementNotFound.md b/generated/stackstate_api/docs/StackElementNotFound.md index 0c48a4f2..e73c931a 100644 --- a/generated/stackstate_api/docs/StackElementNotFound.md +++ b/generated/stackstate_api/docs/StackElementNotFound.md @@ -8,6 +8,8 @@ Name | Type | Description | Notes **ObjectType** | **string** | | **ObjectId** | **string** | | **Message** | **string** | | +**ExistedEarlierMs** | Pointer to **int64** | | [optional] +**ExistsLaterMs** | Pointer to **int64** | | [optional] ## Methods @@ -108,6 +110,56 @@ and a boolean to check if the value has been set. SetMessage sets Message field to given value. +### GetExistedEarlierMs + +`func (o *StackElementNotFound) GetExistedEarlierMs() int64` + +GetExistedEarlierMs returns the ExistedEarlierMs field if non-nil, zero value otherwise. + +### GetExistedEarlierMsOk + +`func (o *StackElementNotFound) GetExistedEarlierMsOk() (*int64, bool)` + +GetExistedEarlierMsOk returns a tuple with the ExistedEarlierMs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExistedEarlierMs + +`func (o *StackElementNotFound) SetExistedEarlierMs(v int64)` + +SetExistedEarlierMs sets ExistedEarlierMs field to given value. + +### HasExistedEarlierMs + +`func (o *StackElementNotFound) HasExistedEarlierMs() bool` + +HasExistedEarlierMs returns a boolean if a field has been set. + +### GetExistsLaterMs + +`func (o *StackElementNotFound) GetExistsLaterMs() int64` + +GetExistsLaterMs returns the ExistsLaterMs field if non-nil, zero value otherwise. + +### GetExistsLaterMsOk + +`func (o *StackElementNotFound) GetExistsLaterMsOk() (*int64, bool)` + +GetExistsLaterMsOk returns a tuple with the ExistsLaterMs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExistsLaterMs + +`func (o *StackElementNotFound) SetExistsLaterMs(v int64)` + +SetExistsLaterMs sets ExistsLaterMs field to given value. + +### HasExistsLaterMs + +`func (o *StackElementNotFound) HasExistsLaterMs() bool` + +HasExistsLaterMs returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generated/stackstate_api/docs/SystemNotification.md b/generated/stackstate_api/docs/SystemNotification.md new file mode 100644 index 00000000..dc89ff5c --- /dev/null +++ b/generated/stackstate_api/docs/SystemNotification.md @@ -0,0 +1,156 @@ +# SystemNotification + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NotificationId** | **string** | | +**Title** | **string** | | +**Severity** | [**SystemNotificationSeverity**](SystemNotificationSeverity.md) | | +**NotificationTimeEpochMs** | **int64** | | +**Content** | **string** | | +**Toast** | **bool** | | + +## Methods + +### NewSystemNotification + +`func NewSystemNotification(notificationId string, title string, severity SystemNotificationSeverity, notificationTimeEpochMs int64, content string, toast bool, ) *SystemNotification` + +NewSystemNotification instantiates a new SystemNotification object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSystemNotificationWithDefaults + +`func NewSystemNotificationWithDefaults() *SystemNotification` + +NewSystemNotificationWithDefaults instantiates a new SystemNotification object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNotificationId + +`func (o *SystemNotification) GetNotificationId() string` + +GetNotificationId returns the NotificationId field if non-nil, zero value otherwise. + +### GetNotificationIdOk + +`func (o *SystemNotification) GetNotificationIdOk() (*string, bool)` + +GetNotificationIdOk returns a tuple with the NotificationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotificationId + +`func (o *SystemNotification) SetNotificationId(v string)` + +SetNotificationId sets NotificationId field to given value. + + +### GetTitle + +`func (o *SystemNotification) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *SystemNotification) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *SystemNotification) SetTitle(v string)` + +SetTitle sets Title field to given value. + + +### GetSeverity + +`func (o *SystemNotification) GetSeverity() SystemNotificationSeverity` + +GetSeverity returns the Severity field if non-nil, zero value otherwise. + +### GetSeverityOk + +`func (o *SystemNotification) GetSeverityOk() (*SystemNotificationSeverity, bool)` + +GetSeverityOk returns a tuple with the Severity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSeverity + +`func (o *SystemNotification) SetSeverity(v SystemNotificationSeverity)` + +SetSeverity sets Severity field to given value. + + +### GetNotificationTimeEpochMs + +`func (o *SystemNotification) GetNotificationTimeEpochMs() int64` + +GetNotificationTimeEpochMs returns the NotificationTimeEpochMs field if non-nil, zero value otherwise. + +### GetNotificationTimeEpochMsOk + +`func (o *SystemNotification) GetNotificationTimeEpochMsOk() (*int64, bool)` + +GetNotificationTimeEpochMsOk returns a tuple with the NotificationTimeEpochMs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotificationTimeEpochMs + +`func (o *SystemNotification) SetNotificationTimeEpochMs(v int64)` + +SetNotificationTimeEpochMs sets NotificationTimeEpochMs field to given value. + + +### GetContent + +`func (o *SystemNotification) GetContent() string` + +GetContent returns the Content field if non-nil, zero value otherwise. + +### GetContentOk + +`func (o *SystemNotification) GetContentOk() (*string, bool)` + +GetContentOk returns a tuple with the Content field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContent + +`func (o *SystemNotification) SetContent(v string)` + +SetContent sets Content field to given value. + + +### GetToast + +`func (o *SystemNotification) GetToast() bool` + +GetToast returns the Toast field if non-nil, zero value otherwise. + +### GetToastOk + +`func (o *SystemNotification) GetToastOk() (*bool, bool)` + +GetToastOk returns a tuple with the Toast field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetToast + +`func (o *SystemNotification) SetToast(v bool)` + +SetToast sets Toast field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/SystemNotificationSeverity.md b/generated/stackstate_api/docs/SystemNotificationSeverity.md new file mode 100644 index 00000000..d940d130 --- /dev/null +++ b/generated/stackstate_api/docs/SystemNotificationSeverity.md @@ -0,0 +1,17 @@ +# SystemNotificationSeverity + +## Enum + + +* `INFO` (value: `"info"`) + +* `OK` (value: `"ok"`) + +* `WARNING` (value: `"warning"`) + +* `PROBLEM` (value: `"problem"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/SystemNotifications.md b/generated/stackstate_api/docs/SystemNotifications.md new file mode 100644 index 00000000..a3a6ae17 --- /dev/null +++ b/generated/stackstate_api/docs/SystemNotifications.md @@ -0,0 +1,51 @@ +# SystemNotifications + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Notifications** | [**[]SystemNotification**](SystemNotification.md) | | + +## Methods + +### NewSystemNotifications + +`func NewSystemNotifications(notifications []SystemNotification, ) *SystemNotifications` + +NewSystemNotifications instantiates a new SystemNotifications object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSystemNotificationsWithDefaults + +`func NewSystemNotificationsWithDefaults() *SystemNotifications` + +NewSystemNotificationsWithDefaults instantiates a new SystemNotifications object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNotifications + +`func (o *SystemNotifications) GetNotifications() []SystemNotification` + +GetNotifications returns the Notifications field if non-nil, zero value otherwise. + +### GetNotificationsOk + +`func (o *SystemNotifications) GetNotificationsOk() (*[]SystemNotification, bool)` + +GetNotificationsOk returns a tuple with the Notifications field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotifications + +`func (o *SystemNotifications) SetNotifications(v []SystemNotification)` + +SetNotifications sets Notifications field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/SystemNotificationsApi.md b/generated/stackstate_api/docs/SystemNotificationsApi.md new file mode 100644 index 00000000..5c9a1833 --- /dev/null +++ b/generated/stackstate_api/docs/SystemNotificationsApi.md @@ -0,0 +1,70 @@ +# \SystemNotificationsApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AllSystemNotifications**](SystemNotificationsApi.md#AllSystemNotifications) | **Get** /system/notifications | Overview of system notifications + + + +## AllSystemNotifications + +> SystemNotifications AllSystemNotifications(ctx).Execute() + +Overview of system notifications + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SystemNotificationsApi.AllSystemNotifications(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SystemNotificationsApi.AllSystemNotifications``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AllSystemNotifications`: SystemNotifications + fmt.Fprintf(os.Stdout, "Response from `SystemNotificationsApi.AllSystemNotifications`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiAllSystemNotificationsRequest struct via the builder pattern + + +### Return type + +[**SystemNotifications**](SystemNotifications.md) + +### Authorization + +[ApiToken](../README.md#ApiToken), [ServiceBearer](../README.md#ServiceBearer), [ServiceToken](../README.md#ServiceToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/generated/stackstate_api/docs/TeamsChannelRefId.md b/generated/stackstate_api/docs/TeamsChannelRefId.md new file mode 100644 index 00000000..73792561 --- /dev/null +++ b/generated/stackstate_api/docs/TeamsChannelRefId.md @@ -0,0 +1,72 @@ +# TeamsChannelRefId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | | +**Id** | **int64** | | + +## Methods + +### NewTeamsChannelRefId + +`func NewTeamsChannelRefId(type_ string, id int64, ) *TeamsChannelRefId` + +NewTeamsChannelRefId instantiates a new TeamsChannelRefId object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTeamsChannelRefIdWithDefaults + +`func NewTeamsChannelRefIdWithDefaults() *TeamsChannelRefId` + +NewTeamsChannelRefIdWithDefaults instantiates a new TeamsChannelRefId object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *TeamsChannelRefId) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *TeamsChannelRefId) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *TeamsChannelRefId) SetType(v string)` + +SetType sets Type field to given value. + + +### GetId + +`func (o *TeamsChannelRefId) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *TeamsChannelRefId) GetIdOk() (*int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *TeamsChannelRefId) SetId(v int64)` + +SetId sets Id field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/TeamsChannelWriteSchema.md b/generated/stackstate_api/docs/TeamsChannelWriteSchema.md new file mode 100644 index 00000000..e486e398 --- /dev/null +++ b/generated/stackstate_api/docs/TeamsChannelWriteSchema.md @@ -0,0 +1,51 @@ +# TeamsChannelWriteSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | | + +## Methods + +### NewTeamsChannelWriteSchema + +`func NewTeamsChannelWriteSchema(url string, ) *TeamsChannelWriteSchema` + +NewTeamsChannelWriteSchema instantiates a new TeamsChannelWriteSchema object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTeamsChannelWriteSchemaWithDefaults + +`func NewTeamsChannelWriteSchemaWithDefaults() *TeamsChannelWriteSchema` + +NewTeamsChannelWriteSchemaWithDefaults instantiates a new TeamsChannelWriteSchema object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUrl + +`func (o *TeamsChannelWriteSchema) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *TeamsChannelWriteSchema) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *TeamsChannelWriteSchema) SetUrl(v string)` + +SetUrl sets Url field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/TeamsNotificationChannel.md b/generated/stackstate_api/docs/TeamsNotificationChannel.md new file mode 100644 index 00000000..d3522113 --- /dev/null +++ b/generated/stackstate_api/docs/TeamsNotificationChannel.md @@ -0,0 +1,140 @@ +# TeamsNotificationChannel + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int64** | | +**NotificationConfigurationId** | Pointer to **int64** | | [optional] +**Status** | [**NotificationChannelStatus**](NotificationChannelStatus.md) | | +**Url** | **string** | | +**Type** | **string** | | + +## Methods + +### NewTeamsNotificationChannel + +`func NewTeamsNotificationChannel(id int64, status NotificationChannelStatus, url string, type_ string, ) *TeamsNotificationChannel` + +NewTeamsNotificationChannel instantiates a new TeamsNotificationChannel object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTeamsNotificationChannelWithDefaults + +`func NewTeamsNotificationChannelWithDefaults() *TeamsNotificationChannel` + +NewTeamsNotificationChannelWithDefaults instantiates a new TeamsNotificationChannel object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *TeamsNotificationChannel) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *TeamsNotificationChannel) GetIdOk() (*int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *TeamsNotificationChannel) SetId(v int64)` + +SetId sets Id field to given value. + + +### GetNotificationConfigurationId + +`func (o *TeamsNotificationChannel) GetNotificationConfigurationId() int64` + +GetNotificationConfigurationId returns the NotificationConfigurationId field if non-nil, zero value otherwise. + +### GetNotificationConfigurationIdOk + +`func (o *TeamsNotificationChannel) GetNotificationConfigurationIdOk() (*int64, bool)` + +GetNotificationConfigurationIdOk returns a tuple with the NotificationConfigurationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotificationConfigurationId + +`func (o *TeamsNotificationChannel) SetNotificationConfigurationId(v int64)` + +SetNotificationConfigurationId sets NotificationConfigurationId field to given value. + +### HasNotificationConfigurationId + +`func (o *TeamsNotificationChannel) HasNotificationConfigurationId() bool` + +HasNotificationConfigurationId returns a boolean if a field has been set. + +### GetStatus + +`func (o *TeamsNotificationChannel) GetStatus() NotificationChannelStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *TeamsNotificationChannel) GetStatusOk() (*NotificationChannelStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *TeamsNotificationChannel) SetStatus(v NotificationChannelStatus)` + +SetStatus sets Status field to given value. + + +### GetUrl + +`func (o *TeamsNotificationChannel) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *TeamsNotificationChannel) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *TeamsNotificationChannel) SetUrl(v string)` + +SetUrl sets Url field to given value. + + +### GetType + +`func (o *TeamsNotificationChannel) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *TeamsNotificationChannel) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *TeamsNotificationChannel) SetType(v string)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/TeamsNotificationChannelAllOf.md b/generated/stackstate_api/docs/TeamsNotificationChannelAllOf.md new file mode 100644 index 00000000..602cc726 --- /dev/null +++ b/generated/stackstate_api/docs/TeamsNotificationChannelAllOf.md @@ -0,0 +1,51 @@ +# TeamsNotificationChannelAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | | + +## Methods + +### NewTeamsNotificationChannelAllOf + +`func NewTeamsNotificationChannelAllOf(type_ string, ) *TeamsNotificationChannelAllOf` + +NewTeamsNotificationChannelAllOf instantiates a new TeamsNotificationChannelAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTeamsNotificationChannelAllOfWithDefaults + +`func NewTeamsNotificationChannelAllOfWithDefaults() *TeamsNotificationChannelAllOf` + +NewTeamsNotificationChannelAllOfWithDefaults instantiates a new TeamsNotificationChannelAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *TeamsNotificationChannelAllOf) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *TeamsNotificationChannelAllOf) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *TeamsNotificationChannelAllOf) SetType(v string)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/stackstate_api/docs/TopologyEvent.md b/generated/stackstate_api/docs/TopologyEvent.md index 069323e5..a0da7a38 100644 --- a/generated/stackstate_api/docs/TopologyEvent.md +++ b/generated/stackstate_api/docs/TopologyEvent.md @@ -18,13 +18,12 @@ Name | Type | Description | Notes **EventTime** | **int64** | | **ProcessedTime** | **int64** | | **Tags** | [**[]EventTag**](EventTag.md) | | -**CausingEvents** | [**[]EventRef**](EventRef.md) | | ## Methods ### NewTopologyEvent -`func NewTopologyEvent(identifier string, elementIdentifiers []string, elements []EventElement, source string, category EventCategory, name string, sourceLinks []SourceLink, data map[string]interface{}, eventType string, eventTime int64, processedTime int64, tags []EventTag, causingEvents []EventRef, ) *TopologyEvent` +`func NewTopologyEvent(identifier string, elementIdentifiers []string, elements []EventElement, source string, category EventCategory, name string, sourceLinks []SourceLink, data map[string]interface{}, eventType string, eventTime int64, processedTime int64, tags []EventTag, ) *TopologyEvent` NewTopologyEvent instantiates a new TopologyEvent object This constructor will assign default values to properties that have it defined, @@ -329,26 +328,6 @@ and a boolean to check if the value has been set. SetTags sets Tags field to given value. -### GetCausingEvents - -`func (o *TopologyEvent) GetCausingEvents() []EventRef` - -GetCausingEvents returns the CausingEvents field if non-nil, zero value otherwise. - -### GetCausingEventsOk - -`func (o *TopologyEvent) GetCausingEventsOk() (*[]EventRef, bool)` - -GetCausingEventsOk returns a tuple with the CausingEvents field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCausingEvents - -`func (o *TopologyEvent) SetCausingEvents(v []EventRef)` - -SetCausingEvents sets CausingEvents field to given value. - - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generated/stackstate_api/docs/ViewCheckState.md b/generated/stackstate_api/docs/ViewCheckState.md index 5e5a56f8..352eff20 100644 --- a/generated/stackstate_api/docs/ViewCheckState.md +++ b/generated/stackstate_api/docs/ViewCheckState.md @@ -6,16 +6,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **CheckStateId** | **string** | | **HealthState** | [**HealthStateValue**](HealthStateValue.md) | | -**ComponentName** | **string** | | +**ComponentName** | Pointer to **string** | | [optional] **ComponentIdentifier** | **string** | | -**ComponentType** | **string** | | +**ComponentType** | Pointer to **string** | | [optional] **LastUpdateTimestamp** | **int64** | | ## Methods ### NewViewCheckState -`func NewViewCheckState(checkStateId string, healthState HealthStateValue, componentName string, componentIdentifier string, componentType string, lastUpdateTimestamp int64, ) *ViewCheckState` +`func NewViewCheckState(checkStateId string, healthState HealthStateValue, componentIdentifier string, lastUpdateTimestamp int64, ) *ViewCheckState` NewViewCheckState instantiates a new ViewCheckState object This constructor will assign default values to properties that have it defined, @@ -89,6 +89,11 @@ and a boolean to check if the value has been set. SetComponentName sets ComponentName field to given value. +### HasComponentName + +`func (o *ViewCheckState) HasComponentName() bool` + +HasComponentName returns a boolean if a field has been set. ### GetComponentIdentifier @@ -129,6 +134,11 @@ and a boolean to check if the value has been set. SetComponentType sets ComponentType field to given value. +### HasComponentType + +`func (o *ViewCheckState) HasComponentType() bool` + +HasComponentType returns a boolean if a field has been set. ### GetLastUpdateTimestamp diff --git a/generated/stackstate_api/model_agent_data.go b/generated/stackstate_api/model_agent_data.go new file mode 100644 index 00000000..def35ac7 --- /dev/null +++ b/generated/stackstate_api/model_agent_data.go @@ -0,0 +1,194 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// AgentData struct for AgentData +type AgentData struct { + Platform string `json:"platform"` + CoreCount int32 `json:"coreCount"` + MemoryBytes int64 `json:"memoryBytes"` + KernelVersion string `json:"kernelVersion"` +} + +// NewAgentData instantiates a new AgentData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentData(platform string, coreCount int32, memoryBytes int64, kernelVersion string) *AgentData { + this := AgentData{} + this.Platform = platform + this.CoreCount = coreCount + this.MemoryBytes = memoryBytes + this.KernelVersion = kernelVersion + return &this +} + +// NewAgentDataWithDefaults instantiates a new AgentData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentDataWithDefaults() *AgentData { + this := AgentData{} + return &this +} + +// GetPlatform returns the Platform field value +func (o *AgentData) GetPlatform() string { + if o == nil { + var ret string + return ret + } + + return o.Platform +} + +// GetPlatformOk returns a tuple with the Platform field value +// and a boolean to check if the value has been set. +func (o *AgentData) GetPlatformOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Platform, true +} + +// SetPlatform sets field value +func (o *AgentData) SetPlatform(v string) { + o.Platform = v +} + +// GetCoreCount returns the CoreCount field value +func (o *AgentData) GetCoreCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CoreCount +} + +// GetCoreCountOk returns a tuple with the CoreCount field value +// and a boolean to check if the value has been set. +func (o *AgentData) GetCoreCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CoreCount, true +} + +// SetCoreCount sets field value +func (o *AgentData) SetCoreCount(v int32) { + o.CoreCount = v +} + +// GetMemoryBytes returns the MemoryBytes field value +func (o *AgentData) GetMemoryBytes() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MemoryBytes +} + +// GetMemoryBytesOk returns a tuple with the MemoryBytes field value +// and a boolean to check if the value has been set. +func (o *AgentData) GetMemoryBytesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MemoryBytes, true +} + +// SetMemoryBytes sets field value +func (o *AgentData) SetMemoryBytes(v int64) { + o.MemoryBytes = v +} + +// GetKernelVersion returns the KernelVersion field value +func (o *AgentData) GetKernelVersion() string { + if o == nil { + var ret string + return ret + } + + return o.KernelVersion +} + +// GetKernelVersionOk returns a tuple with the KernelVersion field value +// and a boolean to check if the value has been set. +func (o *AgentData) GetKernelVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KernelVersion, true +} + +// SetKernelVersion sets field value +func (o *AgentData) SetKernelVersion(v string) { + o.KernelVersion = v +} + +func (o AgentData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["platform"] = o.Platform + } + if true { + toSerialize["coreCount"] = o.CoreCount + } + if true { + toSerialize["memoryBytes"] = o.MemoryBytes + } + if true { + toSerialize["kernelVersion"] = o.KernelVersion + } + return json.Marshal(toSerialize) +} + +type NullableAgentData struct { + value *AgentData + isSet bool +} + +func (v NullableAgentData) Get() *AgentData { + return v.value +} + +func (v *NullableAgentData) Set(val *AgentData) { + v.value = val + v.isSet = true +} + +func (v NullableAgentData) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentData(val *AgentData) *NullableAgentData { + return &NullableAgentData{value: val, isSet: true} +} + +func (v NullableAgentData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_agent_lease.go b/generated/stackstate_api/model_agent_lease.go new file mode 100644 index 00000000..aff9c61a --- /dev/null +++ b/generated/stackstate_api/model_agent_lease.go @@ -0,0 +1,113 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" + "fmt" +) + +// AgentLease the model 'AgentLease' +type AgentLease string + +// List of AgentLease +const ( + AGENTLEASE_ACTIVE AgentLease = "Active" + AGENTLEASE_LIMITED AgentLease = "Limited" + AGENTLEASE_STALE AgentLease = "Stale" +) + +// All allowed values of AgentLease enum +var AllowedAgentLeaseEnumValues = []AgentLease{ + "Active", + "Limited", + "Stale", +} + +func (v *AgentLease) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AgentLease(value) + for _, existing := range AllowedAgentLeaseEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid AgentLease", value) +} + +// NewAgentLeaseFromValue returns a pointer to a valid AgentLease +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAgentLeaseFromValue(v string) (*AgentLease, error) { + ev := AgentLease(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AgentLease: valid values are %v", v, AllowedAgentLeaseEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AgentLease) IsValid() bool { + for _, existing := range AllowedAgentLeaseEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AgentLease value +func (v AgentLease) Ptr() *AgentLease { + return &v +} + +type NullableAgentLease struct { + value *AgentLease + isSet bool +} + +func (v NullableAgentLease) Get() *AgentLease { + return v.value +} + +func (v *NullableAgentLease) Set(val *AgentLease) { + v.value = val + v.isSet = true +} + +func (v NullableAgentLease) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentLease) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentLease(val *AgentLease) *NullableAgentLease { + return &NullableAgentLease{value: val, isSet: true} +} + +func (v NullableAgentLease) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentLease) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_agent_registration.go b/generated/stackstate_api/model_agent_registration.go new file mode 100644 index 00000000..6b5992a1 --- /dev/null +++ b/generated/stackstate_api/model_agent_registration.go @@ -0,0 +1,230 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// AgentRegistration struct for AgentRegistration +type AgentRegistration struct { + AgentId string `json:"agentId"` + Lease AgentLease `json:"lease"` + LeaseUntilEpochMs int64 `json:"leaseUntilEpochMs"` + RegisteredEpochMs int64 `json:"registeredEpochMs"` + AgentData *AgentData `json:"agentData,omitempty"` +} + +// NewAgentRegistration instantiates a new AgentRegistration object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentRegistration(agentId string, lease AgentLease, leaseUntilEpochMs int64, registeredEpochMs int64) *AgentRegistration { + this := AgentRegistration{} + this.AgentId = agentId + this.Lease = lease + this.LeaseUntilEpochMs = leaseUntilEpochMs + this.RegisteredEpochMs = registeredEpochMs + return &this +} + +// NewAgentRegistrationWithDefaults instantiates a new AgentRegistration object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentRegistrationWithDefaults() *AgentRegistration { + this := AgentRegistration{} + return &this +} + +// GetAgentId returns the AgentId field value +func (o *AgentRegistration) GetAgentId() string { + if o == nil { + var ret string + return ret + } + + return o.AgentId +} + +// GetAgentIdOk returns a tuple with the AgentId field value +// and a boolean to check if the value has been set. +func (o *AgentRegistration) GetAgentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AgentId, true +} + +// SetAgentId sets field value +func (o *AgentRegistration) SetAgentId(v string) { + o.AgentId = v +} + +// GetLease returns the Lease field value +func (o *AgentRegistration) GetLease() AgentLease { + if o == nil { + var ret AgentLease + return ret + } + + return o.Lease +} + +// GetLeaseOk returns a tuple with the Lease field value +// and a boolean to check if the value has been set. +func (o *AgentRegistration) GetLeaseOk() (*AgentLease, bool) { + if o == nil { + return nil, false + } + return &o.Lease, true +} + +// SetLease sets field value +func (o *AgentRegistration) SetLease(v AgentLease) { + o.Lease = v +} + +// GetLeaseUntilEpochMs returns the LeaseUntilEpochMs field value +func (o *AgentRegistration) GetLeaseUntilEpochMs() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.LeaseUntilEpochMs +} + +// GetLeaseUntilEpochMsOk returns a tuple with the LeaseUntilEpochMs field value +// and a boolean to check if the value has been set. +func (o *AgentRegistration) GetLeaseUntilEpochMsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.LeaseUntilEpochMs, true +} + +// SetLeaseUntilEpochMs sets field value +func (o *AgentRegistration) SetLeaseUntilEpochMs(v int64) { + o.LeaseUntilEpochMs = v +} + +// GetRegisteredEpochMs returns the RegisteredEpochMs field value +func (o *AgentRegistration) GetRegisteredEpochMs() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.RegisteredEpochMs +} + +// GetRegisteredEpochMsOk returns a tuple with the RegisteredEpochMs field value +// and a boolean to check if the value has been set. +func (o *AgentRegistration) GetRegisteredEpochMsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.RegisteredEpochMs, true +} + +// SetRegisteredEpochMs sets field value +func (o *AgentRegistration) SetRegisteredEpochMs(v int64) { + o.RegisteredEpochMs = v +} + +// GetAgentData returns the AgentData field value if set, zero value otherwise. +func (o *AgentRegistration) GetAgentData() AgentData { + if o == nil || o.AgentData == nil { + var ret AgentData + return ret + } + return *o.AgentData +} + +// GetAgentDataOk returns a tuple with the AgentData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentRegistration) GetAgentDataOk() (*AgentData, bool) { + if o == nil || o.AgentData == nil { + return nil, false + } + return o.AgentData, true +} + +// HasAgentData returns a boolean if a field has been set. +func (o *AgentRegistration) HasAgentData() bool { + if o != nil && o.AgentData != nil { + return true + } + + return false +} + +// SetAgentData gets a reference to the given AgentData and assigns it to the AgentData field. +func (o *AgentRegistration) SetAgentData(v AgentData) { + o.AgentData = &v +} + +func (o AgentRegistration) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["agentId"] = o.AgentId + } + if true { + toSerialize["lease"] = o.Lease + } + if true { + toSerialize["leaseUntilEpochMs"] = o.LeaseUntilEpochMs + } + if true { + toSerialize["registeredEpochMs"] = o.RegisteredEpochMs + } + if o.AgentData != nil { + toSerialize["agentData"] = o.AgentData + } + return json.Marshal(toSerialize) +} + +type NullableAgentRegistration struct { + value *AgentRegistration + isSet bool +} + +func (v NullableAgentRegistration) Get() *AgentRegistration { + return v.value +} + +func (v *NullableAgentRegistration) Set(val *AgentRegistration) { + v.value = val + v.isSet = true +} + +func (v NullableAgentRegistration) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentRegistration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentRegistration(val *AgentRegistration) *NullableAgentRegistration { + return &NullableAgentRegistration{value: val, isSet: true} +} + +func (v NullableAgentRegistration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentRegistration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_agent_registrations.go b/generated/stackstate_api/model_agent_registrations.go new file mode 100644 index 00000000..5d79e849 --- /dev/null +++ b/generated/stackstate_api/model_agent_registrations.go @@ -0,0 +1,107 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// AgentRegistrations struct for AgentRegistrations +type AgentRegistrations struct { + Agents []AgentRegistration `json:"agents"` +} + +// NewAgentRegistrations instantiates a new AgentRegistrations object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentRegistrations(agents []AgentRegistration) *AgentRegistrations { + this := AgentRegistrations{} + this.Agents = agents + return &this +} + +// NewAgentRegistrationsWithDefaults instantiates a new AgentRegistrations object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentRegistrationsWithDefaults() *AgentRegistrations { + this := AgentRegistrations{} + return &this +} + +// GetAgents returns the Agents field value +func (o *AgentRegistrations) GetAgents() []AgentRegistration { + if o == nil { + var ret []AgentRegistration + return ret + } + + return o.Agents +} + +// GetAgentsOk returns a tuple with the Agents field value +// and a boolean to check if the value has been set. +func (o *AgentRegistrations) GetAgentsOk() ([]AgentRegistration, bool) { + if o == nil { + return nil, false + } + return o.Agents, true +} + +// SetAgents sets field value +func (o *AgentRegistrations) SetAgents(v []AgentRegistration) { + o.Agents = v +} + +func (o AgentRegistrations) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["agents"] = o.Agents + } + return json.Marshal(toSerialize) +} + +type NullableAgentRegistrations struct { + value *AgentRegistrations + isSet bool +} + +func (v NullableAgentRegistrations) Get() *AgentRegistrations { + return v.value +} + +func (v *NullableAgentRegistrations) Set(val *AgentRegistrations) { + v.value = val + v.isSet = true +} + +func (v NullableAgentRegistrations) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentRegistrations) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentRegistrations(val *AgentRegistrations) *NullableAgentRegistrations { + return &NullableAgentRegistrations{value: val, isSet: true} +} + +func (v NullableAgentRegistrations) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentRegistrations) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_argument.go b/generated/stackstate_api/model_argument.go index 2cde61f0..6249f908 100644 --- a/generated/stackstate_api/model_argument.go +++ b/generated/stackstate_api/model_argument.go @@ -27,7 +27,6 @@ type Argument struct { ArgumentLongVal *ArgumentLongVal ArgumentNodeIdVal *ArgumentNodeIdVal ArgumentPromQLMetricVal *ArgumentPromQLMetricVal - ArgumentPropagatedHealthStateVal *ArgumentPropagatedHealthStateVal ArgumentQueryViewRef *ArgumentQueryViewRef ArgumentRelationTypeRef *ArgumentRelationTypeRef ArgumentStateVal *ArgumentStateVal @@ -101,13 +100,6 @@ func ArgumentPromQLMetricValAsArgument(v *ArgumentPromQLMetricVal) Argument { } } -// ArgumentPropagatedHealthStateValAsArgument is a convenience function that returns ArgumentPropagatedHealthStateVal wrapped in Argument -func ArgumentPropagatedHealthStateValAsArgument(v *ArgumentPropagatedHealthStateVal) Argument { - return Argument{ - ArgumentPropagatedHealthStateVal: v, - } -} - // ArgumentQueryViewRefAsArgument is a convenience function that returns ArgumentQueryViewRef wrapped in Argument func ArgumentQueryViewRefAsArgument(v *ArgumentQueryViewRef) Argument { return Argument{ @@ -282,18 +274,6 @@ func (dst *Argument) UnmarshalJSON(data []byte) error { } } - // check if the discriminator value is 'ArgumentPropagatedHealthStateVal' - if jsonDict["_type"] == "ArgumentPropagatedHealthStateVal" { - // try to unmarshal JSON data into ArgumentPropagatedHealthStateVal - err = json.Unmarshal(data, &dst.ArgumentPropagatedHealthStateVal) - if err == nil { - return nil // data stored in dst.ArgumentPropagatedHealthStateVal, return on the first match - } else { - dst.ArgumentPropagatedHealthStateVal = nil - return fmt.Errorf("Failed to unmarshal Argument as ArgumentPropagatedHealthStateVal: %s", err.Error()) - } - } - // check if the discriminator value is 'ArgumentQueryViewRef' if jsonDict["_type"] == "ArgumentQueryViewRef" { // try to unmarshal JSON data into ArgumentQueryViewRef @@ -431,10 +411,6 @@ func (src Argument) MarshalJSON() ([]byte, error) { return json.Marshal(&src.ArgumentPromQLMetricVal) } - if src.ArgumentPropagatedHealthStateVal != nil { - return json.Marshal(&src.ArgumentPropagatedHealthStateVal) - } - if src.ArgumentQueryViewRef != nil { return json.Marshal(&src.ArgumentQueryViewRef) } @@ -511,10 +487,6 @@ func (obj *Argument) GetActualInstance() interface{} { return obj.ArgumentPromQLMetricVal } - if obj.ArgumentPropagatedHealthStateVal != nil { - return obj.ArgumentPropagatedHealthStateVal - } - if obj.ArgumentQueryViewRef != nil { return obj.ArgumentQueryViewRef } diff --git a/generated/stackstate_api/model_argument_propagated_health_state_val.go b/generated/stackstate_api/model_argument_propagated_health_state_val.go deleted file mode 100644 index 6de4cbc3..00000000 --- a/generated/stackstate_api/model_argument_propagated_health_state_val.go +++ /dev/null @@ -1,237 +0,0 @@ -/* -StackState API - -This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). - -API version: 5.2.0 -Contact: info@stackstate.com -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package stackstate_api - -import ( - "encoding/json" -) - -// ArgumentPropagatedHealthStateVal struct for ArgumentPropagatedHealthStateVal -type ArgumentPropagatedHealthStateVal struct { - Type string `json:"_type"` - Id *int64 `json:"id,omitempty"` - LastUpdateTimestamp *int64 `json:"lastUpdateTimestamp,omitempty"` - Parameter int64 `json:"parameter"` - Value PropagatedHealthStateValue `json:"value"` -} - -// NewArgumentPropagatedHealthStateVal instantiates a new ArgumentPropagatedHealthStateVal object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewArgumentPropagatedHealthStateVal(type_ string, parameter int64, value PropagatedHealthStateValue) *ArgumentPropagatedHealthStateVal { - this := ArgumentPropagatedHealthStateVal{} - this.Type = type_ - this.Parameter = parameter - this.Value = value - return &this -} - -// NewArgumentPropagatedHealthStateValWithDefaults instantiates a new ArgumentPropagatedHealthStateVal object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewArgumentPropagatedHealthStateValWithDefaults() *ArgumentPropagatedHealthStateVal { - this := ArgumentPropagatedHealthStateVal{} - return &this -} - -// GetType returns the Type field value -func (o *ArgumentPropagatedHealthStateVal) GetType() string { - if o == nil { - var ret string - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *ArgumentPropagatedHealthStateVal) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *ArgumentPropagatedHealthStateVal) SetType(v string) { - o.Type = v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *ArgumentPropagatedHealthStateVal) GetId() int64 { - if o == nil || o.Id == nil { - var ret int64 - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ArgumentPropagatedHealthStateVal) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *ArgumentPropagatedHealthStateVal) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *ArgumentPropagatedHealthStateVal) SetId(v int64) { - o.Id = &v -} - -// GetLastUpdateTimestamp returns the LastUpdateTimestamp field value if set, zero value otherwise. -func (o *ArgumentPropagatedHealthStateVal) GetLastUpdateTimestamp() int64 { - if o == nil || o.LastUpdateTimestamp == nil { - var ret int64 - return ret - } - return *o.LastUpdateTimestamp -} - -// GetLastUpdateTimestampOk returns a tuple with the LastUpdateTimestamp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ArgumentPropagatedHealthStateVal) GetLastUpdateTimestampOk() (*int64, bool) { - if o == nil || o.LastUpdateTimestamp == nil { - return nil, false - } - return o.LastUpdateTimestamp, true -} - -// HasLastUpdateTimestamp returns a boolean if a field has been set. -func (o *ArgumentPropagatedHealthStateVal) HasLastUpdateTimestamp() bool { - if o != nil && o.LastUpdateTimestamp != nil { - return true - } - - return false -} - -// SetLastUpdateTimestamp gets a reference to the given int64 and assigns it to the LastUpdateTimestamp field. -func (o *ArgumentPropagatedHealthStateVal) SetLastUpdateTimestamp(v int64) { - o.LastUpdateTimestamp = &v -} - -// GetParameter returns the Parameter field value -func (o *ArgumentPropagatedHealthStateVal) GetParameter() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.Parameter -} - -// GetParameterOk returns a tuple with the Parameter field value -// and a boolean to check if the value has been set. -func (o *ArgumentPropagatedHealthStateVal) GetParameterOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.Parameter, true -} - -// SetParameter sets field value -func (o *ArgumentPropagatedHealthStateVal) SetParameter(v int64) { - o.Parameter = v -} - -// GetValue returns the Value field value -func (o *ArgumentPropagatedHealthStateVal) GetValue() PropagatedHealthStateValue { - if o == nil { - var ret PropagatedHealthStateValue - return ret - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value field value -// and a boolean to check if the value has been set. -func (o *ArgumentPropagatedHealthStateVal) GetValueOk() (*PropagatedHealthStateValue, bool) { - if o == nil { - return nil, false - } - return &o.Value, true -} - -// SetValue sets field value -func (o *ArgumentPropagatedHealthStateVal) SetValue(v PropagatedHealthStateValue) { - o.Value = v -} - -func (o ArgumentPropagatedHealthStateVal) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["_type"] = o.Type - } - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.LastUpdateTimestamp != nil { - toSerialize["lastUpdateTimestamp"] = o.LastUpdateTimestamp - } - if true { - toSerialize["parameter"] = o.Parameter - } - if true { - toSerialize["value"] = o.Value - } - return json.Marshal(toSerialize) -} - -type NullableArgumentPropagatedHealthStateVal struct { - value *ArgumentPropagatedHealthStateVal - isSet bool -} - -func (v NullableArgumentPropagatedHealthStateVal) Get() *ArgumentPropagatedHealthStateVal { - return v.value -} - -func (v *NullableArgumentPropagatedHealthStateVal) Set(val *ArgumentPropagatedHealthStateVal) { - v.value = val - v.isSet = true -} - -func (v NullableArgumentPropagatedHealthStateVal) IsSet() bool { - return v.isSet -} - -func (v *NullableArgumentPropagatedHealthStateVal) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableArgumentPropagatedHealthStateVal(val *ArgumentPropagatedHealthStateVal) *NullableArgumentPropagatedHealthStateVal { - return &NullableArgumentPropagatedHealthStateVal{value: val, isSet: true} -} - -func (v NullableArgumentPropagatedHealthStateVal) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableArgumentPropagatedHealthStateVal) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/stackstate_api/model_channel_reference_id.go b/generated/stackstate_api/model_channel_reference_id.go index 41a96977..1fefb967 100644 --- a/generated/stackstate_api/model_channel_reference_id.go +++ b/generated/stackstate_api/model_channel_reference_id.go @@ -18,11 +18,20 @@ import ( // ChannelReferenceId - struct for ChannelReferenceId type ChannelReferenceId struct { + EmailChannelRefId *EmailChannelRefId OpsgenieChannelRefId *OpsgenieChannelRefId SlackChannelRefId *SlackChannelRefId + TeamsChannelRefId *TeamsChannelRefId WebhookChannelRefId *WebhookChannelRefId } +// EmailChannelRefIdAsChannelReferenceId is a convenience function that returns EmailChannelRefId wrapped in ChannelReferenceId +func EmailChannelRefIdAsChannelReferenceId(v *EmailChannelRefId) ChannelReferenceId { + return ChannelReferenceId{ + EmailChannelRefId: v, + } +} + // OpsgenieChannelRefIdAsChannelReferenceId is a convenience function that returns OpsgenieChannelRefId wrapped in ChannelReferenceId func OpsgenieChannelRefIdAsChannelReferenceId(v *OpsgenieChannelRefId) ChannelReferenceId { return ChannelReferenceId{ @@ -37,6 +46,13 @@ func SlackChannelRefIdAsChannelReferenceId(v *SlackChannelRefId) ChannelReferenc } } +// TeamsChannelRefIdAsChannelReferenceId is a convenience function that returns TeamsChannelRefId wrapped in ChannelReferenceId +func TeamsChannelRefIdAsChannelReferenceId(v *TeamsChannelRefId) ChannelReferenceId { + return ChannelReferenceId{ + TeamsChannelRefId: v, + } +} + // WebhookChannelRefIdAsChannelReferenceId is a convenience function that returns WebhookChannelRefId wrapped in ChannelReferenceId func WebhookChannelRefIdAsChannelReferenceId(v *WebhookChannelRefId) ChannelReferenceId { return ChannelReferenceId{ @@ -54,6 +70,18 @@ func (dst *ChannelReferenceId) UnmarshalJSON(data []byte) error { return fmt.Errorf("Failed to unmarshal JSON into map for the discriminator lookup.") } + // check if the discriminator value is 'EmailChannelRefId' + if jsonDict["_type"] == "EmailChannelRefId" { + // try to unmarshal JSON data into EmailChannelRefId + err = json.Unmarshal(data, &dst.EmailChannelRefId) + if err == nil { + return nil // data stored in dst.EmailChannelRefId, return on the first match + } else { + dst.EmailChannelRefId = nil + return fmt.Errorf("Failed to unmarshal ChannelReferenceId as EmailChannelRefId: %s", err.Error()) + } + } + // check if the discriminator value is 'OpsgenieChannelRefId' if jsonDict["_type"] == "OpsgenieChannelRefId" { // try to unmarshal JSON data into OpsgenieChannelRefId @@ -78,6 +106,18 @@ func (dst *ChannelReferenceId) UnmarshalJSON(data []byte) error { } } + // check if the discriminator value is 'TeamsChannelRefId' + if jsonDict["_type"] == "TeamsChannelRefId" { + // try to unmarshal JSON data into TeamsChannelRefId + err = json.Unmarshal(data, &dst.TeamsChannelRefId) + if err == nil { + return nil // data stored in dst.TeamsChannelRefId, return on the first match + } else { + dst.TeamsChannelRefId = nil + return fmt.Errorf("Failed to unmarshal ChannelReferenceId as TeamsChannelRefId: %s", err.Error()) + } + } + // check if the discriminator value is 'WebhookChannelRefId' if jsonDict["_type"] == "WebhookChannelRefId" { // try to unmarshal JSON data into WebhookChannelRefId @@ -95,6 +135,10 @@ func (dst *ChannelReferenceId) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src ChannelReferenceId) MarshalJSON() ([]byte, error) { + if src.EmailChannelRefId != nil { + return json.Marshal(&src.EmailChannelRefId) + } + if src.OpsgenieChannelRefId != nil { return json.Marshal(&src.OpsgenieChannelRefId) } @@ -103,6 +147,10 @@ func (src ChannelReferenceId) MarshalJSON() ([]byte, error) { return json.Marshal(&src.SlackChannelRefId) } + if src.TeamsChannelRefId != nil { + return json.Marshal(&src.TeamsChannelRefId) + } + if src.WebhookChannelRefId != nil { return json.Marshal(&src.WebhookChannelRefId) } @@ -115,6 +163,10 @@ func (obj *ChannelReferenceId) GetActualInstance() interface{} { if obj == nil { return nil } + if obj.EmailChannelRefId != nil { + return obj.EmailChannelRefId + } + if obj.OpsgenieChannelRefId != nil { return obj.OpsgenieChannelRefId } @@ -123,6 +175,10 @@ func (obj *ChannelReferenceId) GetActualInstance() interface{} { return obj.SlackChannelRefId } + if obj.TeamsChannelRefId != nil { + return obj.TeamsChannelRefId + } + if obj.WebhookChannelRefId != nil { return obj.WebhookChannelRefId } diff --git a/generated/stackstate_api/model_check_lease_request.go b/generated/stackstate_api/model_check_lease_request.go new file mode 100644 index 00000000..85d3e28d --- /dev/null +++ b/generated/stackstate_api/model_check_lease_request.go @@ -0,0 +1,143 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// CheckLeaseRequest struct for CheckLeaseRequest +type CheckLeaseRequest struct { + ApiKey string `json:"apiKey"` + AgentData *AgentData `json:"agentData,omitempty"` +} + +// NewCheckLeaseRequest instantiates a new CheckLeaseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCheckLeaseRequest(apiKey string) *CheckLeaseRequest { + this := CheckLeaseRequest{} + this.ApiKey = apiKey + return &this +} + +// NewCheckLeaseRequestWithDefaults instantiates a new CheckLeaseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCheckLeaseRequestWithDefaults() *CheckLeaseRequest { + this := CheckLeaseRequest{} + return &this +} + +// GetApiKey returns the ApiKey field value +func (o *CheckLeaseRequest) GetApiKey() string { + if o == nil { + var ret string + return ret + } + + return o.ApiKey +} + +// GetApiKeyOk returns a tuple with the ApiKey field value +// and a boolean to check if the value has been set. +func (o *CheckLeaseRequest) GetApiKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ApiKey, true +} + +// SetApiKey sets field value +func (o *CheckLeaseRequest) SetApiKey(v string) { + o.ApiKey = v +} + +// GetAgentData returns the AgentData field value if set, zero value otherwise. +func (o *CheckLeaseRequest) GetAgentData() AgentData { + if o == nil || o.AgentData == nil { + var ret AgentData + return ret + } + return *o.AgentData +} + +// GetAgentDataOk returns a tuple with the AgentData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckLeaseRequest) GetAgentDataOk() (*AgentData, bool) { + if o == nil || o.AgentData == nil { + return nil, false + } + return o.AgentData, true +} + +// HasAgentData returns a boolean if a field has been set. +func (o *CheckLeaseRequest) HasAgentData() bool { + if o != nil && o.AgentData != nil { + return true + } + + return false +} + +// SetAgentData gets a reference to the given AgentData and assigns it to the AgentData field. +func (o *CheckLeaseRequest) SetAgentData(v AgentData) { + o.AgentData = &v +} + +func (o CheckLeaseRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["apiKey"] = o.ApiKey + } + if o.AgentData != nil { + toSerialize["agentData"] = o.AgentData + } + return json.Marshal(toSerialize) +} + +type NullableCheckLeaseRequest struct { + value *CheckLeaseRequest + isSet bool +} + +func (v NullableCheckLeaseRequest) Get() *CheckLeaseRequest { + return v.value +} + +func (v *NullableCheckLeaseRequest) Set(val *CheckLeaseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCheckLeaseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCheckLeaseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCheckLeaseRequest(val *CheckLeaseRequest) *NullableCheckLeaseRequest { + return &NullableCheckLeaseRequest{value: val, isSet: true} +} + +func (v NullableCheckLeaseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCheckLeaseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_email_channel_ref_id.go b/generated/stackstate_api/model_email_channel_ref_id.go new file mode 100644 index 00000000..e581bc1d --- /dev/null +++ b/generated/stackstate_api/model_email_channel_ref_id.go @@ -0,0 +1,136 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// EmailChannelRefId struct for EmailChannelRefId +type EmailChannelRefId struct { + Type string `json:"_type"` + Id int64 `json:"id"` +} + +// NewEmailChannelRefId instantiates a new EmailChannelRefId object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEmailChannelRefId(type_ string, id int64) *EmailChannelRefId { + this := EmailChannelRefId{} + this.Type = type_ + this.Id = id + return &this +} + +// NewEmailChannelRefIdWithDefaults instantiates a new EmailChannelRefId object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEmailChannelRefIdWithDefaults() *EmailChannelRefId { + this := EmailChannelRefId{} + return &this +} + +// GetType returns the Type field value +func (o *EmailChannelRefId) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *EmailChannelRefId) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *EmailChannelRefId) SetType(v string) { + o.Type = v +} + +// GetId returns the Id field value +func (o *EmailChannelRefId) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *EmailChannelRefId) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *EmailChannelRefId) SetId(v int64) { + o.Id = v +} + +func (o EmailChannelRefId) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["_type"] = o.Type + } + if true { + toSerialize["id"] = o.Id + } + return json.Marshal(toSerialize) +} + +type NullableEmailChannelRefId struct { + value *EmailChannelRefId + isSet bool +} + +func (v NullableEmailChannelRefId) Get() *EmailChannelRefId { + return v.value +} + +func (v *NullableEmailChannelRefId) Set(val *EmailChannelRefId) { + v.value = val + v.isSet = true +} + +func (v NullableEmailChannelRefId) IsSet() bool { + return v.isSet +} + +func (v *NullableEmailChannelRefId) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmailChannelRefId(val *EmailChannelRefId) *NullableEmailChannelRefId { + return &NullableEmailChannelRefId{value: val, isSet: true} +} + +func (v NullableEmailChannelRefId) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmailChannelRefId) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_email_channel_write_schema.go b/generated/stackstate_api/model_email_channel_write_schema.go new file mode 100644 index 00000000..9665b18d --- /dev/null +++ b/generated/stackstate_api/model_email_channel_write_schema.go @@ -0,0 +1,172 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// EmailChannelWriteSchema struct for EmailChannelWriteSchema +type EmailChannelWriteSchema struct { + To []string `json:"to"` + Cc []string `json:"cc"` + SubjectPrefix *string `json:"subjectPrefix,omitempty"` +} + +// NewEmailChannelWriteSchema instantiates a new EmailChannelWriteSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEmailChannelWriteSchema(to []string, cc []string) *EmailChannelWriteSchema { + this := EmailChannelWriteSchema{} + this.To = to + this.Cc = cc + return &this +} + +// NewEmailChannelWriteSchemaWithDefaults instantiates a new EmailChannelWriteSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEmailChannelWriteSchemaWithDefaults() *EmailChannelWriteSchema { + this := EmailChannelWriteSchema{} + return &this +} + +// GetTo returns the To field value +func (o *EmailChannelWriteSchema) GetTo() []string { + if o == nil { + var ret []string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *EmailChannelWriteSchema) GetToOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.To, true +} + +// SetTo sets field value +func (o *EmailChannelWriteSchema) SetTo(v []string) { + o.To = v +} + +// GetCc returns the Cc field value +func (o *EmailChannelWriteSchema) GetCc() []string { + if o == nil { + var ret []string + return ret + } + + return o.Cc +} + +// GetCcOk returns a tuple with the Cc field value +// and a boolean to check if the value has been set. +func (o *EmailChannelWriteSchema) GetCcOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Cc, true +} + +// SetCc sets field value +func (o *EmailChannelWriteSchema) SetCc(v []string) { + o.Cc = v +} + +// GetSubjectPrefix returns the SubjectPrefix field value if set, zero value otherwise. +func (o *EmailChannelWriteSchema) GetSubjectPrefix() string { + if o == nil || o.SubjectPrefix == nil { + var ret string + return ret + } + return *o.SubjectPrefix +} + +// GetSubjectPrefixOk returns a tuple with the SubjectPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailChannelWriteSchema) GetSubjectPrefixOk() (*string, bool) { + if o == nil || o.SubjectPrefix == nil { + return nil, false + } + return o.SubjectPrefix, true +} + +// HasSubjectPrefix returns a boolean if a field has been set. +func (o *EmailChannelWriteSchema) HasSubjectPrefix() bool { + if o != nil && o.SubjectPrefix != nil { + return true + } + + return false +} + +// SetSubjectPrefix gets a reference to the given string and assigns it to the SubjectPrefix field. +func (o *EmailChannelWriteSchema) SetSubjectPrefix(v string) { + o.SubjectPrefix = &v +} + +func (o EmailChannelWriteSchema) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["to"] = o.To + } + if true { + toSerialize["cc"] = o.Cc + } + if o.SubjectPrefix != nil { + toSerialize["subjectPrefix"] = o.SubjectPrefix + } + return json.Marshal(toSerialize) +} + +type NullableEmailChannelWriteSchema struct { + value *EmailChannelWriteSchema + isSet bool +} + +func (v NullableEmailChannelWriteSchema) Get() *EmailChannelWriteSchema { + return v.value +} + +func (v *NullableEmailChannelWriteSchema) Set(val *EmailChannelWriteSchema) { + v.value = val + v.isSet = true +} + +func (v NullableEmailChannelWriteSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableEmailChannelWriteSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmailChannelWriteSchema(val *EmailChannelWriteSchema) *NullableEmailChannelWriteSchema { + return &NullableEmailChannelWriteSchema{value: val, isSet: true} +} + +func (v NullableEmailChannelWriteSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmailChannelWriteSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_email_notification_channel.go b/generated/stackstate_api/model_email_notification_channel.go new file mode 100644 index 00000000..28e80c1b --- /dev/null +++ b/generated/stackstate_api/model_email_notification_channel.go @@ -0,0 +1,295 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// EmailNotificationChannel struct for EmailNotificationChannel +type EmailNotificationChannel struct { + Id int64 `json:"id"` + NotificationConfigurationId *int64 `json:"notificationConfigurationId,omitempty"` + Status NotificationChannelStatus `json:"status"` + To []string `json:"to"` + Cc []string `json:"cc"` + SubjectPrefix *string `json:"subjectPrefix,omitempty"` + Type string `json:"_type"` +} + +// NewEmailNotificationChannel instantiates a new EmailNotificationChannel object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEmailNotificationChannel(id int64, status NotificationChannelStatus, to []string, cc []string, type_ string) *EmailNotificationChannel { + this := EmailNotificationChannel{} + this.Id = id + this.Status = status + this.To = to + this.Cc = cc + this.Type = type_ + return &this +} + +// NewEmailNotificationChannelWithDefaults instantiates a new EmailNotificationChannel object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEmailNotificationChannelWithDefaults() *EmailNotificationChannel { + this := EmailNotificationChannel{} + return &this +} + +// GetId returns the Id field value +func (o *EmailNotificationChannel) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *EmailNotificationChannel) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *EmailNotificationChannel) SetId(v int64) { + o.Id = v +} + +// GetNotificationConfigurationId returns the NotificationConfigurationId field value if set, zero value otherwise. +func (o *EmailNotificationChannel) GetNotificationConfigurationId() int64 { + if o == nil || o.NotificationConfigurationId == nil { + var ret int64 + return ret + } + return *o.NotificationConfigurationId +} + +// GetNotificationConfigurationIdOk returns a tuple with the NotificationConfigurationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailNotificationChannel) GetNotificationConfigurationIdOk() (*int64, bool) { + if o == nil || o.NotificationConfigurationId == nil { + return nil, false + } + return o.NotificationConfigurationId, true +} + +// HasNotificationConfigurationId returns a boolean if a field has been set. +func (o *EmailNotificationChannel) HasNotificationConfigurationId() bool { + if o != nil && o.NotificationConfigurationId != nil { + return true + } + + return false +} + +// SetNotificationConfigurationId gets a reference to the given int64 and assigns it to the NotificationConfigurationId field. +func (o *EmailNotificationChannel) SetNotificationConfigurationId(v int64) { + o.NotificationConfigurationId = &v +} + +// GetStatus returns the Status field value +func (o *EmailNotificationChannel) GetStatus() NotificationChannelStatus { + if o == nil { + var ret NotificationChannelStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *EmailNotificationChannel) GetStatusOk() (*NotificationChannelStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *EmailNotificationChannel) SetStatus(v NotificationChannelStatus) { + o.Status = v +} + +// GetTo returns the To field value +func (o *EmailNotificationChannel) GetTo() []string { + if o == nil { + var ret []string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *EmailNotificationChannel) GetToOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.To, true +} + +// SetTo sets field value +func (o *EmailNotificationChannel) SetTo(v []string) { + o.To = v +} + +// GetCc returns the Cc field value +func (o *EmailNotificationChannel) GetCc() []string { + if o == nil { + var ret []string + return ret + } + + return o.Cc +} + +// GetCcOk returns a tuple with the Cc field value +// and a boolean to check if the value has been set. +func (o *EmailNotificationChannel) GetCcOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Cc, true +} + +// SetCc sets field value +func (o *EmailNotificationChannel) SetCc(v []string) { + o.Cc = v +} + +// GetSubjectPrefix returns the SubjectPrefix field value if set, zero value otherwise. +func (o *EmailNotificationChannel) GetSubjectPrefix() string { + if o == nil || o.SubjectPrefix == nil { + var ret string + return ret + } + return *o.SubjectPrefix +} + +// GetSubjectPrefixOk returns a tuple with the SubjectPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailNotificationChannel) GetSubjectPrefixOk() (*string, bool) { + if o == nil || o.SubjectPrefix == nil { + return nil, false + } + return o.SubjectPrefix, true +} + +// HasSubjectPrefix returns a boolean if a field has been set. +func (o *EmailNotificationChannel) HasSubjectPrefix() bool { + if o != nil && o.SubjectPrefix != nil { + return true + } + + return false +} + +// SetSubjectPrefix gets a reference to the given string and assigns it to the SubjectPrefix field. +func (o *EmailNotificationChannel) SetSubjectPrefix(v string) { + o.SubjectPrefix = &v +} + +// GetType returns the Type field value +func (o *EmailNotificationChannel) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *EmailNotificationChannel) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *EmailNotificationChannel) SetType(v string) { + o.Type = v +} + +func (o EmailNotificationChannel) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["id"] = o.Id + } + if o.NotificationConfigurationId != nil { + toSerialize["notificationConfigurationId"] = o.NotificationConfigurationId + } + if true { + toSerialize["status"] = o.Status + } + if true { + toSerialize["to"] = o.To + } + if true { + toSerialize["cc"] = o.Cc + } + if o.SubjectPrefix != nil { + toSerialize["subjectPrefix"] = o.SubjectPrefix + } + if true { + toSerialize["_type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableEmailNotificationChannel struct { + value *EmailNotificationChannel + isSet bool +} + +func (v NullableEmailNotificationChannel) Get() *EmailNotificationChannel { + return v.value +} + +func (v *NullableEmailNotificationChannel) Set(val *EmailNotificationChannel) { + v.value = val + v.isSet = true +} + +func (v NullableEmailNotificationChannel) IsSet() bool { + return v.isSet +} + +func (v *NullableEmailNotificationChannel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmailNotificationChannel(val *EmailNotificationChannel) *NullableEmailNotificationChannel { + return &NullableEmailNotificationChannel{value: val, isSet: true} +} + +func (v NullableEmailNotificationChannel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmailNotificationChannel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_email_notification_channel_all_of.go b/generated/stackstate_api/model_email_notification_channel_all_of.go new file mode 100644 index 00000000..ffd45198 --- /dev/null +++ b/generated/stackstate_api/model_email_notification_channel_all_of.go @@ -0,0 +1,107 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// EmailNotificationChannelAllOf struct for EmailNotificationChannelAllOf +type EmailNotificationChannelAllOf struct { + Type string `json:"_type"` +} + +// NewEmailNotificationChannelAllOf instantiates a new EmailNotificationChannelAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEmailNotificationChannelAllOf(type_ string) *EmailNotificationChannelAllOf { + this := EmailNotificationChannelAllOf{} + this.Type = type_ + return &this +} + +// NewEmailNotificationChannelAllOfWithDefaults instantiates a new EmailNotificationChannelAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEmailNotificationChannelAllOfWithDefaults() *EmailNotificationChannelAllOf { + this := EmailNotificationChannelAllOf{} + return &this +} + +// GetType returns the Type field value +func (o *EmailNotificationChannelAllOf) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *EmailNotificationChannelAllOf) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *EmailNotificationChannelAllOf) SetType(v string) { + o.Type = v +} + +func (o EmailNotificationChannelAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["_type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableEmailNotificationChannelAllOf struct { + value *EmailNotificationChannelAllOf + isSet bool +} + +func (v NullableEmailNotificationChannelAllOf) Get() *EmailNotificationChannelAllOf { + return v.value +} + +func (v *NullableEmailNotificationChannelAllOf) Set(val *EmailNotificationChannelAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableEmailNotificationChannelAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableEmailNotificationChannelAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmailNotificationChannelAllOf(val *EmailNotificationChannelAllOf) *NullableEmailNotificationChannelAllOf { + return &NullableEmailNotificationChannelAllOf{value: val, isSet: true} +} + +func (v NullableEmailNotificationChannelAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmailNotificationChannelAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_email_notification_status.go b/generated/stackstate_api/model_email_notification_status.go new file mode 100644 index 00000000..c9c6f93f --- /dev/null +++ b/generated/stackstate_api/model_email_notification_status.go @@ -0,0 +1,107 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// EmailNotificationStatus struct for EmailNotificationStatus +type EmailNotificationStatus struct { + ValidConfiguration bool `json:"validConfiguration"` +} + +// NewEmailNotificationStatus instantiates a new EmailNotificationStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEmailNotificationStatus(validConfiguration bool) *EmailNotificationStatus { + this := EmailNotificationStatus{} + this.ValidConfiguration = validConfiguration + return &this +} + +// NewEmailNotificationStatusWithDefaults instantiates a new EmailNotificationStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEmailNotificationStatusWithDefaults() *EmailNotificationStatus { + this := EmailNotificationStatus{} + return &this +} + +// GetValidConfiguration returns the ValidConfiguration field value +func (o *EmailNotificationStatus) GetValidConfiguration() bool { + if o == nil { + var ret bool + return ret + } + + return o.ValidConfiguration +} + +// GetValidConfigurationOk returns a tuple with the ValidConfiguration field value +// and a boolean to check if the value has been set. +func (o *EmailNotificationStatus) GetValidConfigurationOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ValidConfiguration, true +} + +// SetValidConfiguration sets field value +func (o *EmailNotificationStatus) SetValidConfiguration(v bool) { + o.ValidConfiguration = v +} + +func (o EmailNotificationStatus) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["validConfiguration"] = o.ValidConfiguration + } + return json.Marshal(toSerialize) +} + +type NullableEmailNotificationStatus struct { + value *EmailNotificationStatus + isSet bool +} + +func (v NullableEmailNotificationStatus) Get() *EmailNotificationStatus { + return v.value +} + +func (v *NullableEmailNotificationStatus) Set(val *EmailNotificationStatus) { + v.value = val + v.isSet = true +} + +func (v NullableEmailNotificationStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableEmailNotificationStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmailNotificationStatus(val *EmailNotificationStatus) *NullableEmailNotificationStatus { + return &NullableEmailNotificationStatus{value: val, isSet: true} +} + +func (v NullableEmailNotificationStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmailNotificationStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_event_ref.go b/generated/stackstate_api/model_event_ref.go deleted file mode 100644 index 78eb2150..00000000 --- a/generated/stackstate_api/model_event_ref.go +++ /dev/null @@ -1,194 +0,0 @@ -/* -StackState API - -This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). - -API version: 5.2.0 -Contact: info@stackstate.com -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package stackstate_api - -import ( - "encoding/json" -) - -// EventRef struct for EventRef -type EventRef struct { - Title string `json:"title"` - EventId string `json:"eventId"` - EventTimestamp int64 `json:"eventTimestamp"` - EventType string `json:"eventType"` -} - -// NewEventRef instantiates a new EventRef object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewEventRef(title string, eventId string, eventTimestamp int64, eventType string) *EventRef { - this := EventRef{} - this.Title = title - this.EventId = eventId - this.EventTimestamp = eventTimestamp - this.EventType = eventType - return &this -} - -// NewEventRefWithDefaults instantiates a new EventRef object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewEventRefWithDefaults() *EventRef { - this := EventRef{} - return &this -} - -// GetTitle returns the Title field value -func (o *EventRef) GetTitle() string { - if o == nil { - var ret string - return ret - } - - return o.Title -} - -// GetTitleOk returns a tuple with the Title field value -// and a boolean to check if the value has been set. -func (o *EventRef) GetTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Title, true -} - -// SetTitle sets field value -func (o *EventRef) SetTitle(v string) { - o.Title = v -} - -// GetEventId returns the EventId field value -func (o *EventRef) GetEventId() string { - if o == nil { - var ret string - return ret - } - - return o.EventId -} - -// GetEventIdOk returns a tuple with the EventId field value -// and a boolean to check if the value has been set. -func (o *EventRef) GetEventIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.EventId, true -} - -// SetEventId sets field value -func (o *EventRef) SetEventId(v string) { - o.EventId = v -} - -// GetEventTimestamp returns the EventTimestamp field value -func (o *EventRef) GetEventTimestamp() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.EventTimestamp -} - -// GetEventTimestampOk returns a tuple with the EventTimestamp field value -// and a boolean to check if the value has been set. -func (o *EventRef) GetEventTimestampOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.EventTimestamp, true -} - -// SetEventTimestamp sets field value -func (o *EventRef) SetEventTimestamp(v int64) { - o.EventTimestamp = v -} - -// GetEventType returns the EventType field value -func (o *EventRef) GetEventType() string { - if o == nil { - var ret string - return ret - } - - return o.EventType -} - -// GetEventTypeOk returns a tuple with the EventType field value -// and a boolean to check if the value has been set. -func (o *EventRef) GetEventTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.EventType, true -} - -// SetEventType sets field value -func (o *EventRef) SetEventType(v string) { - o.EventType = v -} - -func (o EventRef) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["title"] = o.Title - } - if true { - toSerialize["eventId"] = o.EventId - } - if true { - toSerialize["eventTimestamp"] = o.EventTimestamp - } - if true { - toSerialize["eventType"] = o.EventType - } - return json.Marshal(toSerialize) -} - -type NullableEventRef struct { - value *EventRef - isSet bool -} - -func (v NullableEventRef) Get() *EventRef { - return v.value -} - -func (v *NullableEventRef) Set(val *EventRef) { - v.value = val - v.isSet = true -} - -func (v NullableEventRef) IsSet() bool { - return v.isSet -} - -func (v *NullableEventRef) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEventRef(val *EventRef) *NullableEventRef { - return &NullableEventRef{value: val, isSet: true} -} - -func (v NullableEventRef) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEventRef) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/stackstate_api/model_notification_channel.go b/generated/stackstate_api/model_notification_channel.go index 7e98d137..d6ff2143 100644 --- a/generated/stackstate_api/model_notification_channel.go +++ b/generated/stackstate_api/model_notification_channel.go @@ -18,11 +18,20 @@ import ( // NotificationChannel - struct for NotificationChannel type NotificationChannel struct { + EmailNotificationChannel *EmailNotificationChannel OpsgenieNotificationChannel *OpsgenieNotificationChannel SlackNotificationChannel *SlackNotificationChannel + TeamsNotificationChannel *TeamsNotificationChannel WebhookNotificationChannel *WebhookNotificationChannel } +// EmailNotificationChannelAsNotificationChannel is a convenience function that returns EmailNotificationChannel wrapped in NotificationChannel +func EmailNotificationChannelAsNotificationChannel(v *EmailNotificationChannel) NotificationChannel { + return NotificationChannel{ + EmailNotificationChannel: v, + } +} + // OpsgenieNotificationChannelAsNotificationChannel is a convenience function that returns OpsgenieNotificationChannel wrapped in NotificationChannel func OpsgenieNotificationChannelAsNotificationChannel(v *OpsgenieNotificationChannel) NotificationChannel { return NotificationChannel{ @@ -37,6 +46,13 @@ func SlackNotificationChannelAsNotificationChannel(v *SlackNotificationChannel) } } +// TeamsNotificationChannelAsNotificationChannel is a convenience function that returns TeamsNotificationChannel wrapped in NotificationChannel +func TeamsNotificationChannelAsNotificationChannel(v *TeamsNotificationChannel) NotificationChannel { + return NotificationChannel{ + TeamsNotificationChannel: v, + } +} + // WebhookNotificationChannelAsNotificationChannel is a convenience function that returns WebhookNotificationChannel wrapped in NotificationChannel func WebhookNotificationChannelAsNotificationChannel(v *WebhookNotificationChannel) NotificationChannel { return NotificationChannel{ @@ -54,6 +70,18 @@ func (dst *NotificationChannel) UnmarshalJSON(data []byte) error { return fmt.Errorf("Failed to unmarshal JSON into map for the discriminator lookup.") } + // check if the discriminator value is 'EmailNotificationChannel' + if jsonDict["_type"] == "EmailNotificationChannel" { + // try to unmarshal JSON data into EmailNotificationChannel + err = json.Unmarshal(data, &dst.EmailNotificationChannel) + if err == nil { + return nil // data stored in dst.EmailNotificationChannel, return on the first match + } else { + dst.EmailNotificationChannel = nil + return fmt.Errorf("Failed to unmarshal NotificationChannel as EmailNotificationChannel: %s", err.Error()) + } + } + // check if the discriminator value is 'OpsgenieNotificationChannel' if jsonDict["_type"] == "OpsgenieNotificationChannel" { // try to unmarshal JSON data into OpsgenieNotificationChannel @@ -78,6 +106,18 @@ func (dst *NotificationChannel) UnmarshalJSON(data []byte) error { } } + // check if the discriminator value is 'TeamsNotificationChannel' + if jsonDict["_type"] == "TeamsNotificationChannel" { + // try to unmarshal JSON data into TeamsNotificationChannel + err = json.Unmarshal(data, &dst.TeamsNotificationChannel) + if err == nil { + return nil // data stored in dst.TeamsNotificationChannel, return on the first match + } else { + dst.TeamsNotificationChannel = nil + return fmt.Errorf("Failed to unmarshal NotificationChannel as TeamsNotificationChannel: %s", err.Error()) + } + } + // check if the discriminator value is 'WebhookNotificationChannel' if jsonDict["_type"] == "WebhookNotificationChannel" { // try to unmarshal JSON data into WebhookNotificationChannel @@ -95,6 +135,10 @@ func (dst *NotificationChannel) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src NotificationChannel) MarshalJSON() ([]byte, error) { + if src.EmailNotificationChannel != nil { + return json.Marshal(&src.EmailNotificationChannel) + } + if src.OpsgenieNotificationChannel != nil { return json.Marshal(&src.OpsgenieNotificationChannel) } @@ -103,6 +147,10 @@ func (src NotificationChannel) MarshalJSON() ([]byte, error) { return json.Marshal(&src.SlackNotificationChannel) } + if src.TeamsNotificationChannel != nil { + return json.Marshal(&src.TeamsNotificationChannel) + } + if src.WebhookNotificationChannel != nil { return json.Marshal(&src.WebhookNotificationChannel) } @@ -115,6 +163,10 @@ func (obj *NotificationChannel) GetActualInstance() interface{} { if obj == nil { return nil } + if obj.EmailNotificationChannel != nil { + return obj.EmailNotificationChannel + } + if obj.OpsgenieNotificationChannel != nil { return obj.OpsgenieNotificationChannel } @@ -123,6 +175,10 @@ func (obj *NotificationChannel) GetActualInstance() interface{} { return obj.SlackNotificationChannel } + if obj.TeamsNotificationChannel != nil { + return obj.TeamsNotificationChannel + } + if obj.WebhookNotificationChannel != nil { return obj.WebhookNotificationChannel } diff --git a/generated/stackstate_api/model_propagated_health_state_value.go b/generated/stackstate_api/model_propagated_health_state_value.go deleted file mode 100644 index 45c46dfc..00000000 --- a/generated/stackstate_api/model_propagated_health_state_value.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -StackState API - -This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). - -API version: 5.2.0 -Contact: info@stackstate.com -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package stackstate_api - -import ( - "encoding/json" - "fmt" -) - -// PropagatedHealthStateValue the model 'PropagatedHealthStateValue' -type PropagatedHealthStateValue string - -// List of PropagatedHealthStateValue -const ( - PROPAGATEDHEALTHSTATEVALUE_UNKNOWN PropagatedHealthStateValue = "UNKNOWN" - PROPAGATEDHEALTHSTATEVALUE_PROPAGATION_ERROR PropagatedHealthStateValue = "PROPAGATION_ERROR" - PROPAGATEDHEALTHSTATEVALUE_DEVIATING PropagatedHealthStateValue = "DEVIATING" - PROPAGATEDHEALTHSTATEVALUE_FLAPPING PropagatedHealthStateValue = "FLAPPING" - PROPAGATEDHEALTHSTATEVALUE_CRITICAL PropagatedHealthStateValue = "CRITICAL" -) - -// All allowed values of PropagatedHealthStateValue enum -var AllowedPropagatedHealthStateValueEnumValues = []PropagatedHealthStateValue{ - "UNKNOWN", - "PROPAGATION_ERROR", - "DEVIATING", - "FLAPPING", - "CRITICAL", -} - -func (v *PropagatedHealthStateValue) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := PropagatedHealthStateValue(value) - for _, existing := range AllowedPropagatedHealthStateValueEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid PropagatedHealthStateValue", value) -} - -// NewPropagatedHealthStateValueFromValue returns a pointer to a valid PropagatedHealthStateValue -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewPropagatedHealthStateValueFromValue(v string) (*PropagatedHealthStateValue, error) { - ev := PropagatedHealthStateValue(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for PropagatedHealthStateValue: valid values are %v", v, AllowedPropagatedHealthStateValueEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v PropagatedHealthStateValue) IsValid() bool { - for _, existing := range AllowedPropagatedHealthStateValueEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to PropagatedHealthStateValue value -func (v PropagatedHealthStateValue) Ptr() *PropagatedHealthStateValue { - return &v -} - -type NullablePropagatedHealthStateValue struct { - value *PropagatedHealthStateValue - isSet bool -} - -func (v NullablePropagatedHealthStateValue) Get() *PropagatedHealthStateValue { - return v.value -} - -func (v *NullablePropagatedHealthStateValue) Set(val *PropagatedHealthStateValue) { - v.value = val - v.isSet = true -} - -func (v NullablePropagatedHealthStateValue) IsSet() bool { - return v.isSet -} - -func (v *NullablePropagatedHealthStateValue) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePropagatedHealthStateValue(val *PropagatedHealthStateValue) *NullablePropagatedHealthStateValue { - return &NullablePropagatedHealthStateValue{value: val, isSet: true} -} - -func (v NullablePropagatedHealthStateValue) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePropagatedHealthStateValue) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/stackstate_api/model_stack_element_not_found.go b/generated/stackstate_api/model_stack_element_not_found.go index e2e711b2..bd30e202 100644 --- a/generated/stackstate_api/model_stack_element_not_found.go +++ b/generated/stackstate_api/model_stack_element_not_found.go @@ -17,10 +17,12 @@ import ( // StackElementNotFound struct for StackElementNotFound type StackElementNotFound struct { - Type string `json:"_type"` - ObjectType string `json:"objectType"` - ObjectId string `json:"objectId"` - Message string `json:"message"` + Type string `json:"_type"` + ObjectType string `json:"objectType"` + ObjectId string `json:"objectId"` + Message string `json:"message"` + ExistedEarlierMs *int64 `json:"existedEarlierMs,omitempty"` + ExistsLaterMs *int64 `json:"existsLaterMs,omitempty"` } // NewStackElementNotFound instantiates a new StackElementNotFound object @@ -140,6 +142,70 @@ func (o *StackElementNotFound) SetMessage(v string) { o.Message = v } +// GetExistedEarlierMs returns the ExistedEarlierMs field value if set, zero value otherwise. +func (o *StackElementNotFound) GetExistedEarlierMs() int64 { + if o == nil || o.ExistedEarlierMs == nil { + var ret int64 + return ret + } + return *o.ExistedEarlierMs +} + +// GetExistedEarlierMsOk returns a tuple with the ExistedEarlierMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StackElementNotFound) GetExistedEarlierMsOk() (*int64, bool) { + if o == nil || o.ExistedEarlierMs == nil { + return nil, false + } + return o.ExistedEarlierMs, true +} + +// HasExistedEarlierMs returns a boolean if a field has been set. +func (o *StackElementNotFound) HasExistedEarlierMs() bool { + if o != nil && o.ExistedEarlierMs != nil { + return true + } + + return false +} + +// SetExistedEarlierMs gets a reference to the given int64 and assigns it to the ExistedEarlierMs field. +func (o *StackElementNotFound) SetExistedEarlierMs(v int64) { + o.ExistedEarlierMs = &v +} + +// GetExistsLaterMs returns the ExistsLaterMs field value if set, zero value otherwise. +func (o *StackElementNotFound) GetExistsLaterMs() int64 { + if o == nil || o.ExistsLaterMs == nil { + var ret int64 + return ret + } + return *o.ExistsLaterMs +} + +// GetExistsLaterMsOk returns a tuple with the ExistsLaterMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StackElementNotFound) GetExistsLaterMsOk() (*int64, bool) { + if o == nil || o.ExistsLaterMs == nil { + return nil, false + } + return o.ExistsLaterMs, true +} + +// HasExistsLaterMs returns a boolean if a field has been set. +func (o *StackElementNotFound) HasExistsLaterMs() bool { + if o != nil && o.ExistsLaterMs != nil { + return true + } + + return false +} + +// SetExistsLaterMs gets a reference to the given int64 and assigns it to the ExistsLaterMs field. +func (o *StackElementNotFound) SetExistsLaterMs(v int64) { + o.ExistsLaterMs = &v +} + func (o StackElementNotFound) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if true { @@ -154,6 +220,12 @@ func (o StackElementNotFound) MarshalJSON() ([]byte, error) { if true { toSerialize["message"] = o.Message } + if o.ExistedEarlierMs != nil { + toSerialize["existedEarlierMs"] = o.ExistedEarlierMs + } + if o.ExistsLaterMs != nil { + toSerialize["existsLaterMs"] = o.ExistsLaterMs + } return json.Marshal(toSerialize) } diff --git a/generated/stackstate_api/model_system_notification.go b/generated/stackstate_api/model_system_notification.go new file mode 100644 index 00000000..a4ae1a6b --- /dev/null +++ b/generated/stackstate_api/model_system_notification.go @@ -0,0 +1,252 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// SystemNotification struct for SystemNotification +type SystemNotification struct { + NotificationId string `json:"notificationId"` + Title string `json:"title"` + Severity SystemNotificationSeverity `json:"severity"` + NotificationTimeEpochMs int64 `json:"notificationTimeEpochMs"` + Content string `json:"content"` + Toast bool `json:"toast"` +} + +// NewSystemNotification instantiates a new SystemNotification object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSystemNotification(notificationId string, title string, severity SystemNotificationSeverity, notificationTimeEpochMs int64, content string, toast bool) *SystemNotification { + this := SystemNotification{} + this.NotificationId = notificationId + this.Title = title + this.Severity = severity + this.NotificationTimeEpochMs = notificationTimeEpochMs + this.Content = content + this.Toast = toast + return &this +} + +// NewSystemNotificationWithDefaults instantiates a new SystemNotification object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSystemNotificationWithDefaults() *SystemNotification { + this := SystemNotification{} + return &this +} + +// GetNotificationId returns the NotificationId field value +func (o *SystemNotification) GetNotificationId() string { + if o == nil { + var ret string + return ret + } + + return o.NotificationId +} + +// GetNotificationIdOk returns a tuple with the NotificationId field value +// and a boolean to check if the value has been set. +func (o *SystemNotification) GetNotificationIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NotificationId, true +} + +// SetNotificationId sets field value +func (o *SystemNotification) SetNotificationId(v string) { + o.NotificationId = v +} + +// GetTitle returns the Title field value +func (o *SystemNotification) GetTitle() string { + if o == nil { + var ret string + return ret + } + + return o.Title +} + +// GetTitleOk returns a tuple with the Title field value +// and a boolean to check if the value has been set. +func (o *SystemNotification) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Title, true +} + +// SetTitle sets field value +func (o *SystemNotification) SetTitle(v string) { + o.Title = v +} + +// GetSeverity returns the Severity field value +func (o *SystemNotification) GetSeverity() SystemNotificationSeverity { + if o == nil { + var ret SystemNotificationSeverity + return ret + } + + return o.Severity +} + +// GetSeverityOk returns a tuple with the Severity field value +// and a boolean to check if the value has been set. +func (o *SystemNotification) GetSeverityOk() (*SystemNotificationSeverity, bool) { + if o == nil { + return nil, false + } + return &o.Severity, true +} + +// SetSeverity sets field value +func (o *SystemNotification) SetSeverity(v SystemNotificationSeverity) { + o.Severity = v +} + +// GetNotificationTimeEpochMs returns the NotificationTimeEpochMs field value +func (o *SystemNotification) GetNotificationTimeEpochMs() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.NotificationTimeEpochMs +} + +// GetNotificationTimeEpochMsOk returns a tuple with the NotificationTimeEpochMs field value +// and a boolean to check if the value has been set. +func (o *SystemNotification) GetNotificationTimeEpochMsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.NotificationTimeEpochMs, true +} + +// SetNotificationTimeEpochMs sets field value +func (o *SystemNotification) SetNotificationTimeEpochMs(v int64) { + o.NotificationTimeEpochMs = v +} + +// GetContent returns the Content field value +func (o *SystemNotification) GetContent() string { + if o == nil { + var ret string + return ret + } + + return o.Content +} + +// GetContentOk returns a tuple with the Content field value +// and a boolean to check if the value has been set. +func (o *SystemNotification) GetContentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Content, true +} + +// SetContent sets field value +func (o *SystemNotification) SetContent(v string) { + o.Content = v +} + +// GetToast returns the Toast field value +func (o *SystemNotification) GetToast() bool { + if o == nil { + var ret bool + return ret + } + + return o.Toast +} + +// GetToastOk returns a tuple with the Toast field value +// and a boolean to check if the value has been set. +func (o *SystemNotification) GetToastOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Toast, true +} + +// SetToast sets field value +func (o *SystemNotification) SetToast(v bool) { + o.Toast = v +} + +func (o SystemNotification) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["notificationId"] = o.NotificationId + } + if true { + toSerialize["title"] = o.Title + } + if true { + toSerialize["severity"] = o.Severity + } + if true { + toSerialize["notificationTimeEpochMs"] = o.NotificationTimeEpochMs + } + if true { + toSerialize["content"] = o.Content + } + if true { + toSerialize["toast"] = o.Toast + } + return json.Marshal(toSerialize) +} + +type NullableSystemNotification struct { + value *SystemNotification + isSet bool +} + +func (v NullableSystemNotification) Get() *SystemNotification { + return v.value +} + +func (v *NullableSystemNotification) Set(val *SystemNotification) { + v.value = val + v.isSet = true +} + +func (v NullableSystemNotification) IsSet() bool { + return v.isSet +} + +func (v *NullableSystemNotification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSystemNotification(val *SystemNotification) *NullableSystemNotification { + return &NullableSystemNotification{value: val, isSet: true} +} + +func (v NullableSystemNotification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSystemNotification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_system_notification_severity.go b/generated/stackstate_api/model_system_notification_severity.go new file mode 100644 index 00000000..98b12455 --- /dev/null +++ b/generated/stackstate_api/model_system_notification_severity.go @@ -0,0 +1,115 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" + "fmt" +) + +// SystemNotificationSeverity the model 'SystemNotificationSeverity' +type SystemNotificationSeverity string + +// List of SystemNotificationSeverity +const ( + SYSTEMNOTIFICATIONSEVERITY_INFO SystemNotificationSeverity = "info" + SYSTEMNOTIFICATIONSEVERITY_OK SystemNotificationSeverity = "ok" + SYSTEMNOTIFICATIONSEVERITY_WARNING SystemNotificationSeverity = "warning" + SYSTEMNOTIFICATIONSEVERITY_PROBLEM SystemNotificationSeverity = "problem" +) + +// All allowed values of SystemNotificationSeverity enum +var AllowedSystemNotificationSeverityEnumValues = []SystemNotificationSeverity{ + "info", + "ok", + "warning", + "problem", +} + +func (v *SystemNotificationSeverity) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SystemNotificationSeverity(value) + for _, existing := range AllowedSystemNotificationSeverityEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SystemNotificationSeverity", value) +} + +// NewSystemNotificationSeverityFromValue returns a pointer to a valid SystemNotificationSeverity +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSystemNotificationSeverityFromValue(v string) (*SystemNotificationSeverity, error) { + ev := SystemNotificationSeverity(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SystemNotificationSeverity: valid values are %v", v, AllowedSystemNotificationSeverityEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SystemNotificationSeverity) IsValid() bool { + for _, existing := range AllowedSystemNotificationSeverityEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SystemNotificationSeverity value +func (v SystemNotificationSeverity) Ptr() *SystemNotificationSeverity { + return &v +} + +type NullableSystemNotificationSeverity struct { + value *SystemNotificationSeverity + isSet bool +} + +func (v NullableSystemNotificationSeverity) Get() *SystemNotificationSeverity { + return v.value +} + +func (v *NullableSystemNotificationSeverity) Set(val *SystemNotificationSeverity) { + v.value = val + v.isSet = true +} + +func (v NullableSystemNotificationSeverity) IsSet() bool { + return v.isSet +} + +func (v *NullableSystemNotificationSeverity) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSystemNotificationSeverity(val *SystemNotificationSeverity) *NullableSystemNotificationSeverity { + return &NullableSystemNotificationSeverity{value: val, isSet: true} +} + +func (v NullableSystemNotificationSeverity) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSystemNotificationSeverity) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_system_notifications.go b/generated/stackstate_api/model_system_notifications.go new file mode 100644 index 00000000..9d90b7c5 --- /dev/null +++ b/generated/stackstate_api/model_system_notifications.go @@ -0,0 +1,107 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// SystemNotifications struct for SystemNotifications +type SystemNotifications struct { + Notifications []SystemNotification `json:"notifications"` +} + +// NewSystemNotifications instantiates a new SystemNotifications object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSystemNotifications(notifications []SystemNotification) *SystemNotifications { + this := SystemNotifications{} + this.Notifications = notifications + return &this +} + +// NewSystemNotificationsWithDefaults instantiates a new SystemNotifications object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSystemNotificationsWithDefaults() *SystemNotifications { + this := SystemNotifications{} + return &this +} + +// GetNotifications returns the Notifications field value +func (o *SystemNotifications) GetNotifications() []SystemNotification { + if o == nil { + var ret []SystemNotification + return ret + } + + return o.Notifications +} + +// GetNotificationsOk returns a tuple with the Notifications field value +// and a boolean to check if the value has been set. +func (o *SystemNotifications) GetNotificationsOk() ([]SystemNotification, bool) { + if o == nil { + return nil, false + } + return o.Notifications, true +} + +// SetNotifications sets field value +func (o *SystemNotifications) SetNotifications(v []SystemNotification) { + o.Notifications = v +} + +func (o SystemNotifications) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["notifications"] = o.Notifications + } + return json.Marshal(toSerialize) +} + +type NullableSystemNotifications struct { + value *SystemNotifications + isSet bool +} + +func (v NullableSystemNotifications) Get() *SystemNotifications { + return v.value +} + +func (v *NullableSystemNotifications) Set(val *SystemNotifications) { + v.value = val + v.isSet = true +} + +func (v NullableSystemNotifications) IsSet() bool { + return v.isSet +} + +func (v *NullableSystemNotifications) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSystemNotifications(val *SystemNotifications) *NullableSystemNotifications { + return &NullableSystemNotifications{value: val, isSet: true} +} + +func (v NullableSystemNotifications) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSystemNotifications) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_teams_channel_ref_id.go b/generated/stackstate_api/model_teams_channel_ref_id.go new file mode 100644 index 00000000..83480a8c --- /dev/null +++ b/generated/stackstate_api/model_teams_channel_ref_id.go @@ -0,0 +1,136 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// TeamsChannelRefId struct for TeamsChannelRefId +type TeamsChannelRefId struct { + Type string `json:"_type"` + Id int64 `json:"id"` +} + +// NewTeamsChannelRefId instantiates a new TeamsChannelRefId object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTeamsChannelRefId(type_ string, id int64) *TeamsChannelRefId { + this := TeamsChannelRefId{} + this.Type = type_ + this.Id = id + return &this +} + +// NewTeamsChannelRefIdWithDefaults instantiates a new TeamsChannelRefId object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTeamsChannelRefIdWithDefaults() *TeamsChannelRefId { + this := TeamsChannelRefId{} + return &this +} + +// GetType returns the Type field value +func (o *TeamsChannelRefId) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *TeamsChannelRefId) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *TeamsChannelRefId) SetType(v string) { + o.Type = v +} + +// GetId returns the Id field value +func (o *TeamsChannelRefId) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TeamsChannelRefId) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TeamsChannelRefId) SetId(v int64) { + o.Id = v +} + +func (o TeamsChannelRefId) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["_type"] = o.Type + } + if true { + toSerialize["id"] = o.Id + } + return json.Marshal(toSerialize) +} + +type NullableTeamsChannelRefId struct { + value *TeamsChannelRefId + isSet bool +} + +func (v NullableTeamsChannelRefId) Get() *TeamsChannelRefId { + return v.value +} + +func (v *NullableTeamsChannelRefId) Set(val *TeamsChannelRefId) { + v.value = val + v.isSet = true +} + +func (v NullableTeamsChannelRefId) IsSet() bool { + return v.isSet +} + +func (v *NullableTeamsChannelRefId) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTeamsChannelRefId(val *TeamsChannelRefId) *NullableTeamsChannelRefId { + return &NullableTeamsChannelRefId{value: val, isSet: true} +} + +func (v NullableTeamsChannelRefId) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTeamsChannelRefId) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_teams_channel_write_schema.go b/generated/stackstate_api/model_teams_channel_write_schema.go new file mode 100644 index 00000000..04980451 --- /dev/null +++ b/generated/stackstate_api/model_teams_channel_write_schema.go @@ -0,0 +1,107 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// TeamsChannelWriteSchema struct for TeamsChannelWriteSchema +type TeamsChannelWriteSchema struct { + Url string `json:"url"` +} + +// NewTeamsChannelWriteSchema instantiates a new TeamsChannelWriteSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTeamsChannelWriteSchema(url string) *TeamsChannelWriteSchema { + this := TeamsChannelWriteSchema{} + this.Url = url + return &this +} + +// NewTeamsChannelWriteSchemaWithDefaults instantiates a new TeamsChannelWriteSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTeamsChannelWriteSchemaWithDefaults() *TeamsChannelWriteSchema { + this := TeamsChannelWriteSchema{} + return &this +} + +// GetUrl returns the Url field value +func (o *TeamsChannelWriteSchema) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *TeamsChannelWriteSchema) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *TeamsChannelWriteSchema) SetUrl(v string) { + o.Url = v +} + +func (o TeamsChannelWriteSchema) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["url"] = o.Url + } + return json.Marshal(toSerialize) +} + +type NullableTeamsChannelWriteSchema struct { + value *TeamsChannelWriteSchema + isSet bool +} + +func (v NullableTeamsChannelWriteSchema) Get() *TeamsChannelWriteSchema { + return v.value +} + +func (v *NullableTeamsChannelWriteSchema) Set(val *TeamsChannelWriteSchema) { + v.value = val + v.isSet = true +} + +func (v NullableTeamsChannelWriteSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableTeamsChannelWriteSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTeamsChannelWriteSchema(val *TeamsChannelWriteSchema) *NullableTeamsChannelWriteSchema { + return &NullableTeamsChannelWriteSchema{value: val, isSet: true} +} + +func (v NullableTeamsChannelWriteSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTeamsChannelWriteSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_teams_notification_channel.go b/generated/stackstate_api/model_teams_notification_channel.go new file mode 100644 index 00000000..b43cdb5d --- /dev/null +++ b/generated/stackstate_api/model_teams_notification_channel.go @@ -0,0 +1,230 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// TeamsNotificationChannel struct for TeamsNotificationChannel +type TeamsNotificationChannel struct { + Id int64 `json:"id"` + NotificationConfigurationId *int64 `json:"notificationConfigurationId,omitempty"` + Status NotificationChannelStatus `json:"status"` + Url string `json:"url"` + Type string `json:"_type"` +} + +// NewTeamsNotificationChannel instantiates a new TeamsNotificationChannel object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTeamsNotificationChannel(id int64, status NotificationChannelStatus, url string, type_ string) *TeamsNotificationChannel { + this := TeamsNotificationChannel{} + this.Id = id + this.Status = status + this.Url = url + this.Type = type_ + return &this +} + +// NewTeamsNotificationChannelWithDefaults instantiates a new TeamsNotificationChannel object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTeamsNotificationChannelWithDefaults() *TeamsNotificationChannel { + this := TeamsNotificationChannel{} + return &this +} + +// GetId returns the Id field value +func (o *TeamsNotificationChannel) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TeamsNotificationChannel) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TeamsNotificationChannel) SetId(v int64) { + o.Id = v +} + +// GetNotificationConfigurationId returns the NotificationConfigurationId field value if set, zero value otherwise. +func (o *TeamsNotificationChannel) GetNotificationConfigurationId() int64 { + if o == nil || o.NotificationConfigurationId == nil { + var ret int64 + return ret + } + return *o.NotificationConfigurationId +} + +// GetNotificationConfigurationIdOk returns a tuple with the NotificationConfigurationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TeamsNotificationChannel) GetNotificationConfigurationIdOk() (*int64, bool) { + if o == nil || o.NotificationConfigurationId == nil { + return nil, false + } + return o.NotificationConfigurationId, true +} + +// HasNotificationConfigurationId returns a boolean if a field has been set. +func (o *TeamsNotificationChannel) HasNotificationConfigurationId() bool { + if o != nil && o.NotificationConfigurationId != nil { + return true + } + + return false +} + +// SetNotificationConfigurationId gets a reference to the given int64 and assigns it to the NotificationConfigurationId field. +func (o *TeamsNotificationChannel) SetNotificationConfigurationId(v int64) { + o.NotificationConfigurationId = &v +} + +// GetStatus returns the Status field value +func (o *TeamsNotificationChannel) GetStatus() NotificationChannelStatus { + if o == nil { + var ret NotificationChannelStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *TeamsNotificationChannel) GetStatusOk() (*NotificationChannelStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *TeamsNotificationChannel) SetStatus(v NotificationChannelStatus) { + o.Status = v +} + +// GetUrl returns the Url field value +func (o *TeamsNotificationChannel) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *TeamsNotificationChannel) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *TeamsNotificationChannel) SetUrl(v string) { + o.Url = v +} + +// GetType returns the Type field value +func (o *TeamsNotificationChannel) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *TeamsNotificationChannel) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *TeamsNotificationChannel) SetType(v string) { + o.Type = v +} + +func (o TeamsNotificationChannel) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["id"] = o.Id + } + if o.NotificationConfigurationId != nil { + toSerialize["notificationConfigurationId"] = o.NotificationConfigurationId + } + if true { + toSerialize["status"] = o.Status + } + if true { + toSerialize["url"] = o.Url + } + if true { + toSerialize["_type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableTeamsNotificationChannel struct { + value *TeamsNotificationChannel + isSet bool +} + +func (v NullableTeamsNotificationChannel) Get() *TeamsNotificationChannel { + return v.value +} + +func (v *NullableTeamsNotificationChannel) Set(val *TeamsNotificationChannel) { + v.value = val + v.isSet = true +} + +func (v NullableTeamsNotificationChannel) IsSet() bool { + return v.isSet +} + +func (v *NullableTeamsNotificationChannel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTeamsNotificationChannel(val *TeamsNotificationChannel) *NullableTeamsNotificationChannel { + return &NullableTeamsNotificationChannel{value: val, isSet: true} +} + +func (v NullableTeamsNotificationChannel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTeamsNotificationChannel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_teams_notification_channel_all_of.go b/generated/stackstate_api/model_teams_notification_channel_all_of.go new file mode 100644 index 00000000..2d238a3a --- /dev/null +++ b/generated/stackstate_api/model_teams_notification_channel_all_of.go @@ -0,0 +1,107 @@ +/* +StackState API + +This API documentation page describes the StackState server API. The StackState UI and CLI use the StackState server API to configure and query StackState. You can use the API for similar purposes. Each request sent to the StackState server API must be authenticated using one of the available authentication methods. *Note that the StackState receiver API, used to send topology, telemetry and traces to StackState, is not described on this page and requires a different authentication method.* For more information on StackState, refer to the [StackState documentation](https://docs.stackstate.com). + +API version: 5.2.0 +Contact: info@stackstate.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package stackstate_api + +import ( + "encoding/json" +) + +// TeamsNotificationChannelAllOf struct for TeamsNotificationChannelAllOf +type TeamsNotificationChannelAllOf struct { + Type string `json:"_type"` +} + +// NewTeamsNotificationChannelAllOf instantiates a new TeamsNotificationChannelAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTeamsNotificationChannelAllOf(type_ string) *TeamsNotificationChannelAllOf { + this := TeamsNotificationChannelAllOf{} + this.Type = type_ + return &this +} + +// NewTeamsNotificationChannelAllOfWithDefaults instantiates a new TeamsNotificationChannelAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTeamsNotificationChannelAllOfWithDefaults() *TeamsNotificationChannelAllOf { + this := TeamsNotificationChannelAllOf{} + return &this +} + +// GetType returns the Type field value +func (o *TeamsNotificationChannelAllOf) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *TeamsNotificationChannelAllOf) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *TeamsNotificationChannelAllOf) SetType(v string) { + o.Type = v +} + +func (o TeamsNotificationChannelAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["_type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableTeamsNotificationChannelAllOf struct { + value *TeamsNotificationChannelAllOf + isSet bool +} + +func (v NullableTeamsNotificationChannelAllOf) Get() *TeamsNotificationChannelAllOf { + return v.value +} + +func (v *NullableTeamsNotificationChannelAllOf) Set(val *TeamsNotificationChannelAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableTeamsNotificationChannelAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableTeamsNotificationChannelAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTeamsNotificationChannelAllOf(val *TeamsNotificationChannelAllOf) *NullableTeamsNotificationChannelAllOf { + return &NullableTeamsNotificationChannelAllOf{value: val, isSet: true} +} + +func (v NullableTeamsNotificationChannelAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTeamsNotificationChannelAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/stackstate_api/model_topology_event.go b/generated/stackstate_api/model_topology_event.go index 74a0533e..7f9e58c9 100644 --- a/generated/stackstate_api/model_topology_event.go +++ b/generated/stackstate_api/model_topology_event.go @@ -31,14 +31,13 @@ type TopologyEvent struct { EventTime int64 `json:"eventTime"` ProcessedTime int64 `json:"processedTime"` Tags []EventTag `json:"tags"` - CausingEvents []EventRef `json:"causingEvents"` } // NewTopologyEvent instantiates a new TopologyEvent object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTopologyEvent(identifier string, elementIdentifiers []string, elements []EventElement, source string, category EventCategory, name string, sourceLinks []SourceLink, data map[string]interface{}, eventType string, eventTime int64, processedTime int64, tags []EventTag, causingEvents []EventRef) *TopologyEvent { +func NewTopologyEvent(identifier string, elementIdentifiers []string, elements []EventElement, source string, category EventCategory, name string, sourceLinks []SourceLink, data map[string]interface{}, eventType string, eventTime int64, processedTime int64, tags []EventTag) *TopologyEvent { this := TopologyEvent{} this.Identifier = identifier this.ElementIdentifiers = elementIdentifiers @@ -52,7 +51,6 @@ func NewTopologyEvent(identifier string, elementIdentifiers []string, elements [ this.EventTime = eventTime this.ProcessedTime = processedTime this.Tags = tags - this.CausingEvents = causingEvents return &this } @@ -416,30 +414,6 @@ func (o *TopologyEvent) SetTags(v []EventTag) { o.Tags = v } -// GetCausingEvents returns the CausingEvents field value -func (o *TopologyEvent) GetCausingEvents() []EventRef { - if o == nil { - var ret []EventRef - return ret - } - - return o.CausingEvents -} - -// GetCausingEventsOk returns a tuple with the CausingEvents field value -// and a boolean to check if the value has been set. -func (o *TopologyEvent) GetCausingEventsOk() ([]EventRef, bool) { - if o == nil { - return nil, false - } - return o.CausingEvents, true -} - -// SetCausingEvents sets field value -func (o *TopologyEvent) SetCausingEvents(v []EventRef) { - o.CausingEvents = v -} - func (o TopologyEvent) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if true { @@ -484,9 +458,6 @@ func (o TopologyEvent) MarshalJSON() ([]byte, error) { if true { toSerialize["tags"] = o.Tags } - if true { - toSerialize["causingEvents"] = o.CausingEvents - } return json.Marshal(toSerialize) } diff --git a/generated/stackstate_api/model_view_check_state.go b/generated/stackstate_api/model_view_check_state.go index 189ecd98..e099dd81 100644 --- a/generated/stackstate_api/model_view_check_state.go +++ b/generated/stackstate_api/model_view_check_state.go @@ -19,9 +19,9 @@ import ( type ViewCheckState struct { CheckStateId string `json:"checkStateId"` HealthState HealthStateValue `json:"healthState"` - ComponentName string `json:"componentName"` + ComponentName *string `json:"componentName,omitempty"` ComponentIdentifier string `json:"componentIdentifier"` - ComponentType string `json:"componentType"` + ComponentType *string `json:"componentType,omitempty"` LastUpdateTimestamp int64 `json:"lastUpdateTimestamp"` } @@ -29,13 +29,11 @@ type ViewCheckState struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewViewCheckState(checkStateId string, healthState HealthStateValue, componentName string, componentIdentifier string, componentType string, lastUpdateTimestamp int64) *ViewCheckState { +func NewViewCheckState(checkStateId string, healthState HealthStateValue, componentIdentifier string, lastUpdateTimestamp int64) *ViewCheckState { this := ViewCheckState{} this.CheckStateId = checkStateId this.HealthState = healthState - this.ComponentName = componentName this.ComponentIdentifier = componentIdentifier - this.ComponentType = componentType this.LastUpdateTimestamp = lastUpdateTimestamp return &this } @@ -96,28 +94,36 @@ func (o *ViewCheckState) SetHealthState(v HealthStateValue) { o.HealthState = v } -// GetComponentName returns the ComponentName field value +// GetComponentName returns the ComponentName field value if set, zero value otherwise. func (o *ViewCheckState) GetComponentName() string { - if o == nil { + if o == nil || o.ComponentName == nil { var ret string return ret } - - return o.ComponentName + return *o.ComponentName } -// GetComponentNameOk returns a tuple with the ComponentName field value +// GetComponentNameOk returns a tuple with the ComponentName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ViewCheckState) GetComponentNameOk() (*string, bool) { - if o == nil { + if o == nil || o.ComponentName == nil { return nil, false } - return &o.ComponentName, true + return o.ComponentName, true +} + +// HasComponentName returns a boolean if a field has been set. +func (o *ViewCheckState) HasComponentName() bool { + if o != nil && o.ComponentName != nil { + return true + } + + return false } -// SetComponentName sets field value +// SetComponentName gets a reference to the given string and assigns it to the ComponentName field. func (o *ViewCheckState) SetComponentName(v string) { - o.ComponentName = v + o.ComponentName = &v } // GetComponentIdentifier returns the ComponentIdentifier field value @@ -144,28 +150,36 @@ func (o *ViewCheckState) SetComponentIdentifier(v string) { o.ComponentIdentifier = v } -// GetComponentType returns the ComponentType field value +// GetComponentType returns the ComponentType field value if set, zero value otherwise. func (o *ViewCheckState) GetComponentType() string { - if o == nil { + if o == nil || o.ComponentType == nil { var ret string return ret } - - return o.ComponentType + return *o.ComponentType } -// GetComponentTypeOk returns a tuple with the ComponentType field value +// GetComponentTypeOk returns a tuple with the ComponentType field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ViewCheckState) GetComponentTypeOk() (*string, bool) { - if o == nil { + if o == nil || o.ComponentType == nil { return nil, false } - return &o.ComponentType, true + return o.ComponentType, true +} + +// HasComponentType returns a boolean if a field has been set. +func (o *ViewCheckState) HasComponentType() bool { + if o != nil && o.ComponentType != nil { + return true + } + + return false } -// SetComponentType sets field value +// SetComponentType gets a reference to the given string and assigns it to the ComponentType field. func (o *ViewCheckState) SetComponentType(v string) { - o.ComponentType = v + o.ComponentType = &v } // GetLastUpdateTimestamp returns the LastUpdateTimestamp field value @@ -200,13 +214,13 @@ func (o ViewCheckState) MarshalJSON() ([]byte, error) { if true { toSerialize["healthState"] = o.HealthState } - if true { + if o.ComponentName != nil { toSerialize["componentName"] = o.ComponentName } if true { toSerialize["componentIdentifier"] = o.ComponentIdentifier } - if true { + if o.ComponentType != nil { toSerialize["componentType"] = o.ComponentType } if true { diff --git a/stackstate_openapi/openapi_version b/stackstate_openapi/openapi_version index 9eff3103..e4c24c8b 100644 --- a/stackstate_openapi/openapi_version +++ b/stackstate_openapi/openapi_version @@ -1 +1 @@ -578b060b4ea5ceadc705b35475d726d72ddd2c94 +00887a136736fb57dffcaa33f2ee534c1e14374c