Packages

REST API Generated with swagger-codegen using the OpsGenie OpenAPI Specification.

Current section

Files

Jump to
ops_genie_restapi lib ops_genie_restapi api deprecated_policy.ex
Raw

lib/ops_genie_restapi/api/deprecated_policy.ex

# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.
defmodule OpsGenieRESTAPI.Api.DeprecatedPolicy do
@moduledoc """
API calls for all endpoints tagged `DeprecatedPolicy`.
"""
alias OpsGenieRESTAPI.Connection
import OpsGenieRESTAPI.RequestBuilder
@doc """
Change Alert Policy Order
Change execution order of the alert policy with given id
## Parameters
- connection (OpsGenieRESTAPI.Connection): Connection to server
- policy_id (String.t): Id of the requested policy
- body (DeprecatedChangeAlertPolicyOrderPayload): Change order payload
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %OpsGenieRESTAPI.Model.SuccessResponse{}} on success
{:error, info} on failure
"""
@spec change_alert_policy_order(Tesla.Env.client, String.t, OpsGenieRESTAPI.Model.DeprecatedChangeAlertPolicyOrderPayload.t, keyword()) :: {:ok, OpsGenieRESTAPI.Model.SuccessResponse.t} | {:error, Tesla.Env.t}
def change_alert_policy_order(connection, policy_id, body, _opts \\ []) do
%{}
|> method(:post)
|> url("/v1/policies/#{policy_id}/change-order")
|> add_param(:body, :"body", body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%OpsGenieRESTAPI.Model.SuccessResponse{})
end
@doc """
Create Alert Policy
Creates a new alert policy
## Parameters
- connection (OpsGenieRESTAPI.Connection): Connection to server
- body (DeprecatedAlertPolicy): Payload of created alert policy
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %OpsGenieRESTAPI.Model.DeprecatedCreateAlertPolicyResponse{}} on success
{:error, info} on failure
"""
@spec create_alert_policy(Tesla.Env.client, OpsGenieRESTAPI.Model.DeprecatedAlertPolicy.t, keyword()) :: {:ok, OpsGenieRESTAPI.Model.DeprecatedCreateAlertPolicyResponse.t} | {:error, Tesla.Env.t}
def create_alert_policy(connection, body, _opts \\ []) do
%{}
|> method(:post)
|> url("/v1/policies")
|> add_param(:body, :"body", body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%OpsGenieRESTAPI.Model.DeprecatedCreateAlertPolicyResponse{})
end
@doc """
Delete Alert Policy
Delete alert policy with given id
## Parameters
- connection (OpsGenieRESTAPI.Connection): Connection to server
- policy_id (String.t): Id of the requested policy
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %OpsGenieRESTAPI.Model.SuccessResponse{}} on success
{:error, info} on failure
"""
@spec delete_alert_policy(Tesla.Env.client, String.t, keyword()) :: {:ok, OpsGenieRESTAPI.Model.SuccessResponse.t} | {:error, Tesla.Env.t}
def delete_alert_policy(connection, policy_id, _opts \\ []) do
%{}
|> method(:delete)
|> url("/v1/policies/#{policy_id}")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%OpsGenieRESTAPI.Model.SuccessResponse{})
end
@doc """
Disable Alert Policy
Disable the alert policy with given id
## Parameters
- connection (OpsGenieRESTAPI.Connection): Connection to server
- policy_id (String.t): Id of the requested policy
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %OpsGenieRESTAPI.Model.SuccessResponse{}} on success
{:error, info} on failure
"""
@spec disable_alert_policy(Tesla.Env.client, String.t, keyword()) :: {:ok, OpsGenieRESTAPI.Model.SuccessResponse.t} | {:error, Tesla.Env.t}
def disable_alert_policy(connection, policy_id, _opts \\ []) do
%{}
|> method(:post)
|> url("/v1/policies/#{policy_id}/disable")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%OpsGenieRESTAPI.Model.SuccessResponse{})
end
@doc """
Enable Alert Policy
Enable the alert policy with given id
## Parameters
- connection (OpsGenieRESTAPI.Connection): Connection to server
- policy_id (String.t): Id of the requested policy
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %OpsGenieRESTAPI.Model.SuccessResponse{}} on success
{:error, info} on failure
"""
@spec enable_alert_policy(Tesla.Env.client, String.t, keyword()) :: {:ok, OpsGenieRESTAPI.Model.SuccessResponse.t} | {:error, Tesla.Env.t}
def enable_alert_policy(connection, policy_id, _opts \\ []) do
%{}
|> method(:post)
|> url("/v1/policies/#{policy_id}/enable")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%OpsGenieRESTAPI.Model.SuccessResponse{})
end
@doc """
Get Alert Policy
Used to get details of a single policy with id
## Parameters
- connection (OpsGenieRESTAPI.Connection): Connection to server
- policy_id (String.t): Id of the requested policy
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %OpsGenieRESTAPI.Model.DeprecatedGetAlertPolicyResponse{}} on success
{:error, info} on failure
"""
@spec get_alert_policy(Tesla.Env.client, String.t, keyword()) :: {:ok, OpsGenieRESTAPI.Model.DeprecatedGetAlertPolicyResponse.t} | {:error, Tesla.Env.t}
def get_alert_policy(connection, policy_id, _opts \\ []) do
%{}
|> method(:get)
|> url("/v1/policies/#{policy_id}")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%OpsGenieRESTAPI.Model.DeprecatedGetAlertPolicyResponse{})
end
@doc """
List Alert Policies
Returns list alert policies
## Parameters
- connection (OpsGenieRESTAPI.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %OpsGenieRESTAPI.Model.DeprecatedListAlertPoliciesResponse{}} on success
{:error, info} on failure
"""
@spec list_alert_policies(Tesla.Env.client, keyword()) :: {:ok, OpsGenieRESTAPI.Model.DeprecatedListAlertPoliciesResponse.t} | {:error, Tesla.Env.t}
def list_alert_policies(connection, _opts \\ []) do
%{}
|> method(:get)
|> url("/v1/policies")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%OpsGenieRESTAPI.Model.DeprecatedListAlertPoliciesResponse{})
end
@doc """
Update Alert Policy
Update alert policy with given id
## Parameters
- connection (OpsGenieRESTAPI.Connection): Connection to server
- policy_id (String.t): Id of the requested policy
- body (DeprecatedAlertPolicy): Payload of updated alert policy
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %OpsGenieRESTAPI.Model.SuccessResponse{}} on success
{:error, info} on failure
"""
@spec update_alert_policy(Tesla.Env.client, String.t, OpsGenieRESTAPI.Model.DeprecatedAlertPolicy.t, keyword()) :: {:ok, OpsGenieRESTAPI.Model.SuccessResponse.t} | {:error, Tesla.Env.t}
def update_alert_policy(connection, policy_id, body, _opts \\ []) do
%{}
|> method(:put)
|> url("/v1/policies/#{policy_id}")
|> add_param(:body, :"body", body)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%OpsGenieRESTAPI.Model.SuccessResponse{})
end
end