package
0.0.0-20240824085712-bc4d957c958f
Repository: https://github.com/sbecker59/statuspage-api-client-go.git
Documentation: pkg.go.dev

# README

Go API client for openapi

Code of Conduct

Please don't abuse the API, and please report all feature requests and issues to https://support.atlassian.com/contact

Rate Limiting

Each API token is limited to 1 request / second as measured on a 60 second rolling window. To get this limit increased, please contact us at https://support.atlassian.com/contact

Error codes 420 or 429 indicate that you have exceeded the rate limit and the request has been rejected.

Basics

HTTPS

It's required

URL Prefix

In order to maintain version integrity into the future, the API is versioned. All calls currently begin with the following prefix:

https://api.statuspage.io/v1/

RESTful Interface

Wherever possible, the API seeks to implement repeatable patterns with logical, representative URLs and descriptive HTTP verbs. Below are some examples and conventions you will see throughout the documentation.

Sending Data

Information can be sent in the body as form urlencoded or JSON, but make sure the Content-Type header matches the body structure or the server gremlins will be angry.

All examples are provided in JSON format, however they can easily be converted to form encoding if required. Some examples of how to convert things are below:

// JSON
{
  \"incident\": {
    \"name\": \"test incident\",
    \"components\": [\"8kbf7d35c070\", \"vtnh60py4yd7\"]
  }
}

// Form Encoded (using curl as an example):
curl -X POST https://api.statuspage.io/v1/example \\
  -d \"incident[name]=test incident\" \\
  -d \"incident[components][]=8kbf7d35c070\" \\
  -d \"incident[components][]=vtnh60py4yd7\"

Authentication

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import sw "./openapi"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.statuspage.io/v1

ClassMethodHTTP requestDescription
ComponentGroupsApiDeletePagesPageIdComponentGroupsIdDelete /pages/{page_id}/component-groups/{id}Delete a component group
ComponentGroupsApiGetPagesPageIdComponentGroupsGet /pages/{page_id}/component-groupsGet a list of component groups
ComponentGroupsApiGetPagesPageIdComponentGroupsIdGet /pages/{page_id}/component-groups/{id}Get a component group
ComponentGroupsApiGetPagesPageIdComponentGroupsIdUptimeGet /pages/{page_id}/component-groups/{id}/uptimeGet uptime data for a component group
ComponentGroupsApiPatchPagesPageIdComponentGroupsIdPatch /pages/{page_id}/component-groups/{id}Update a component group
ComponentGroupsApiPostPagesPageIdComponentGroupsPost /pages/{page_id}/component-groupsCreate a component group
ComponentGroupsApiPutPagesPageIdComponentGroupsIdPut /pages/{page_id}/component-groups/{id}Update a component group
ComponentsApiDeletePagesPageIdComponentsComponentIdDelete /pages/{page_id}/components/{component_id}Delete a component
ComponentsApiDeletePagesPageIdComponentsComponentIdPageAccessGroupsDelete /pages/{page_id}/components/{component_id}/page_access_groupsRemove page access groups from a component
ComponentsApiDeletePagesPageIdComponentsComponentIdPageAccessUsersDelete /pages/{page_id}/components/{component_id}/page_access_usersRemove page access users from component
ComponentsApiGetPagesPageIdComponentsGet /pages/{page_id}/componentsGet a list of components
ComponentsApiGetPagesPageIdComponentsComponentIdGet /pages/{page_id}/components/{component_id}Get a component
ComponentsApiGetPagesPageIdComponentsComponentIdUptimeGet /pages/{page_id}/components/{component_id}/uptimeGet uptime data for a component
ComponentsApiPatchPagesPageIdComponentsComponentIdPatch /pages/{page_id}/components/{component_id}Update a component
ComponentsApiPostPagesPageIdComponentsPost /pages/{page_id}/componentsCreate a component
ComponentsApiPostPagesPageIdComponentsComponentIdPageAccessGroupsPost /pages/{page_id}/components/{component_id}/page_access_groupsAdd page access groups to a component
ComponentsApiPostPagesPageIdComponentsComponentIdPageAccessUsersPost /pages/{page_id}/components/{component_id}/page_access_usersAdd page access users to a component
ComponentsApiPutPagesPageIdComponentsComponentIdPut /pages/{page_id}/components/{component_id}Update a component
IncidentPostmortemApiDeletePagesPageIdIncidentsIncidentIdPostmortemDelete /pages/{page_id}/incidents/{incident_id}/postmortemDelete Postmortem
IncidentPostmortemApiGetPagesPageIdIncidentsIncidentIdPostmortemGet /pages/{page_id}/incidents/{incident_id}/postmortemGet Postmortem
IncidentPostmortemApiPutPagesPageIdIncidentsIncidentIdPostmortemPut /pages/{page_id}/incidents/{incident_id}/postmortemCreate Postmortem
IncidentPostmortemApiPutPagesPageIdIncidentsIncidentIdPostmortemPublishPut /pages/{page_id}/incidents/{incident_id}/postmortem/publishPublish Postmortem
IncidentPostmortemApiPutPagesPageIdIncidentsIncidentIdPostmortemRevertPut /pages/{page_id}/incidents/{incident_id}/postmortem/revertRevert Postmortem
IncidentSubscribersApiDeletePagesPageIdIncidentsIncidentIdSubscribersSubscriberIdDelete /pages/{page_id}/incidents/{incident_id}/subscribers/{subscriber_id}Unsubscribe an incident subscriber
IncidentSubscribersApiGetPagesPageIdIncidentsIncidentIdSubscribersGet /pages/{page_id}/incidents/{incident_id}/subscribersGet a list of incident subscribers
IncidentSubscribersApiGetPagesPageIdIncidentsIncidentIdSubscribersSubscriberIdGet /pages/{page_id}/incidents/{incident_id}/subscribers/{subscriber_id}Get an incident subscriber
IncidentSubscribersApiPostPagesPageIdIncidentsIncidentIdSubscribersPost /pages/{page_id}/incidents/{incident_id}/subscribersCreate an incident subscriber
IncidentSubscribersApiPostPagesPageIdIncidentsIncidentIdSubscribersSubscriberIdResendConfirmationPost /pages/{page_id}/incidents/{incident_id}/subscribers/{subscriber_id}/resend_confirmationResend confirmation to an incident subscriber
IncidentUpdatesApiPatchPagesPageIdIncidentsIncidentIdIncidentUpdatesIncidentUpdateIdPatch /pages/{page_id}/incidents/{incident_id}/incident_updates/{incident_update_id}Update a previous incident update
IncidentUpdatesApiPutPagesPageIdIncidentsIncidentIdIncidentUpdatesIncidentUpdateIdPut /pages/{page_id}/incidents/{incident_id}/incident_updates/{incident_update_id}Update a previous incident update
IncidentsApiDeletePagesPageIdIncidentsIncidentIdDelete /pages/{page_id}/incidents/{incident_id}Delete an incident
IncidentsApiGetPagesPageIdIncidentsGet /pages/{page_id}/incidentsGet a list of incidents
IncidentsApiGetPagesPageIdIncidentsActiveMaintenanceGet /pages/{page_id}/incidents/active_maintenanceGet a list of active maintenances
IncidentsApiGetPagesPageIdIncidentsIncidentIdGet /pages/{page_id}/incidents/{incident_id}Get an incident
IncidentsApiGetPagesPageIdIncidentsScheduledGet /pages/{page_id}/incidents/scheduledGet a list of scheduled incidents
IncidentsApiGetPagesPageIdIncidentsUnresolvedGet /pages/{page_id}/incidents/unresolvedGet a list of unresolved incidents
IncidentsApiGetPagesPageIdIncidentsUpcomingGet /pages/{page_id}/incidents/upcomingGet a list of upcoming incidents
IncidentsApiPatchPagesPageIdIncidentsIncidentIdPatch /pages/{page_id}/incidents/{incident_id}Update an incident
IncidentsApiPostPagesPageIdIncidentsPost /pages/{page_id}/incidentsCreate an incident
IncidentsApiPutPagesPageIdIncidentsIncidentIdPut /pages/{page_id}/incidents/{incident_id}Update an incident
MetricProvidersApiDeletePagesPageIdMetricsProvidersMetricsProviderIdDelete /pages/{page_id}/metrics_providers/{metrics_provider_id}Delete a metric provider
MetricProvidersApiGetPagesPageIdMetricsProvidersGet /pages/{page_id}/metrics_providersGet a list of metric providers
MetricProvidersApiGetPagesPageIdMetricsProvidersMetricsProviderIdGet /pages/{page_id}/metrics_providers/{metrics_provider_id}Get a metric provider
MetricProvidersApiGetPagesPageIdMetricsProvidersMetricsProviderIdMetricsGet /pages/{page_id}/metrics_providers/{metrics_provider_id}/metricsList metrics for a metric provider
MetricProvidersApiPatchPagesPageIdMetricsProvidersMetricsProviderIdPatch /pages/{page_id}/metrics_providers/{metrics_provider_id}Update a metric provider
MetricProvidersApiPostPagesPageIdMetricsProvidersPost /pages/{page_id}/metrics_providersCreate a metric provider
MetricProvidersApiPostPagesPageIdMetricsProvidersMetricsProviderIdMetricsPost /pages/{page_id}/metrics_providers/{metrics_provider_id}/metricsCreate a metric for a metric provider
MetricProvidersApiPutPagesPageIdMetricsProvidersMetricsProviderIdPut /pages/{page_id}/metrics_providers/{metrics_provider_id}Update a metric provider
MetricsApiDeletePagesPageIdMetricsMetricIdDelete /pages/{page_id}/metrics/{metric_id}Delete a metric
MetricsApiDeletePagesPageIdMetricsMetricIdDataDelete /pages/{page_id}/metrics/{metric_id}/dataReset data for a metric
MetricsApiGetPagesPageIdMetricsGet /pages/{page_id}/metricsGet a list of metrics
MetricsApiGetPagesPageIdMetricsMetricIdGet /pages/{page_id}/metrics/{metric_id}Get a metric
MetricsApiGetPagesPageIdMetricsProvidersMetricsProviderIdMetricsGet /pages/{page_id}/metrics_providers/{metrics_provider_id}/metricsList metrics for a metric provider
MetricsApiPatchPagesPageIdMetricsMetricIdPatch /pages/{page_id}/metrics/{metric_id}Update a metric
MetricsApiPostPagesPageIdMetricsDataPost /pages/{page_id}/metrics/dataAdd data points to metrics
MetricsApiPostPagesPageIdMetricsMetricIdDataPost /pages/{page_id}/metrics/{metric_id}/dataAdd data to a metric
MetricsApiPostPagesPageIdMetricsProvidersMetricsProviderIdMetricsPost /pages/{page_id}/metrics_providers/{metrics_provider_id}/metricsCreate a metric for a metric provider
MetricsApiPutPagesPageIdMetricsMetricIdPut /pages/{page_id}/metrics/{metric_id}Update a metric
PageAccessGroupComponentsApiDeletePagesPageIdPageAccessGroupsPageAccessGroupIdComponentsDelete /pages/{page_id}/page_access_groups/{page_access_group_id}/componentsDelete components for a page access group
PageAccessGroupComponentsApiDeletePagesPageIdPageAccessGroupsPageAccessGroupIdComponentsComponentIdDelete /pages/{page_id}/page_access_groups/{page_access_group_id}/components/{component_id}Remove a component from a page access group
PageAccessGroupComponentsApiGetPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsGet /pages/{page_id}/page_access_groups/{page_access_group_id}/componentsList components for a page access group
PageAccessGroupComponentsApiPatchPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsPatch /pages/{page_id}/page_access_groups/{page_access_group_id}/componentsAdd components to page access group
PageAccessGroupComponentsApiPostPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsPost /pages/{page_id}/page_access_groups/{page_access_group_id}/componentsReplace components for a page access group
PageAccessGroupComponentsApiPutPagesPageIdPageAccessGroupsPageAccessGroupIdComponentsPut /pages/{page_id}/page_access_groups/{page_access_group_id}/componentsAdd components to page access group
PageAccessGroupsApiDeletePagesPageIdPageAccessGroupsPageAccessGroupIdDelete /pages/{page_id}/page_access_groups/{page_access_group_id}Remove a page access group
PageAccessGroupsApiGetPagesPageIdPageAccessGroupsGet /pages/{page_id}/page_access_groupsGet a list of page access groups
PageAccessGroupsApiGetPagesPageIdPageAccessGroupsPageAccessGroupIdGet /pages/{page_id}/page_access_groups/{page_access_group_id}Get a page access group
PageAccessGroupsApiPatchPagesPageIdPageAccessGroupsPageAccessGroupIdPatch /pages/{page_id}/page_access_groups/{page_access_group_id}Update a page access group
PageAccessGroupsApiPostPagesPageIdPageAccessGroupsPost /pages/{page_id}/page_access_groupsCreate a page access group
PageAccessGroupsApiPutPagesPageIdPageAccessGroupsPageAccessGroupIdPut /pages/{page_id}/page_access_groups/{page_access_group_id}Update a page access group
PageAccessUserComponentsApiDeletePagesPageIdPageAccessUsersPageAccessUserIdComponentsDelete /pages/{page_id}/page_access_users/{page_access_user_id}/componentsRemove components for page access user
PageAccessUserComponentsApiDeletePagesPageIdPageAccessUsersPageAccessUserIdComponentsComponentIdDelete /pages/{page_id}/page_access_users/{page_access_user_id}/components/{component_id}Remove component for page access user
PageAccessUserComponentsApiGetPagesPageIdPageAccessUsersPageAccessUserIdComponentsGet /pages/{page_id}/page_access_users/{page_access_user_id}/componentsGet components for page access user
PageAccessUserComponentsApiPatchPagesPageIdPageAccessUsersPageAccessUserIdComponentsPatch /pages/{page_id}/page_access_users/{page_access_user_id}/componentsAdd components for page access user
PageAccessUserComponentsApiPostPagesPageIdPageAccessUsersPageAccessUserIdComponentsPost /pages/{page_id}/page_access_users/{page_access_user_id}/componentsReplace components for page access user
PageAccessUserComponentsApiPutPagesPageIdPageAccessUsersPageAccessUserIdComponentsPut /pages/{page_id}/page_access_users/{page_access_user_id}/componentsAdd components for page access user
PageAccessUserMetricsApiDeletePagesPageIdPageAccessUsersPageAccessUserIdMetricsDelete /pages/{page_id}/page_access_users/{page_access_user_id}/metricsDelete metrics for page access user
PageAccessUserMetricsApiDeletePagesPageIdPageAccessUsersPageAccessUserIdMetricsMetricIdDelete /pages/{page_id}/page_access_users/{page_access_user_id}/metrics/{metric_id}Delete metric for page access user
PageAccessUserMetricsApiGetPagesPageIdPageAccessUsersPageAccessUserIdMetricsGet /pages/{page_id}/page_access_users/{page_access_user_id}/metricsGet metrics for page access user
PageAccessUserMetricsApiPatchPagesPageIdPageAccessUsersPageAccessUserIdMetricsPatch /pages/{page_id}/page_access_users/{page_access_user_id}/metricsAdd metrics for page access user
PageAccessUserMetricsApiPostPagesPageIdPageAccessUsersPageAccessUserIdMetricsPost /pages/{page_id}/page_access_users/{page_access_user_id}/metricsReplace metrics for page access user
PageAccessUserMetricsApiPutPagesPageIdPageAccessUsersPageAccessUserIdMetricsPut /pages/{page_id}/page_access_users/{page_access_user_id}/metricsAdd metrics for page access user
PageAccessUsersApiDeletePagesPageIdPageAccessUsersPageAccessUserIdDelete /pages/{page_id}/page_access_users/{page_access_user_id}Delete page access user
PageAccessUsersApiGetPagesPageIdPageAccessUsersGet /pages/{page_id}/page_access_usersGet a list of page access users
PageAccessUsersApiGetPagesPageIdPageAccessUsersPageAccessUserIdGet /pages/{page_id}/page_access_users/{page_access_user_id}Get page access user
PageAccessUsersApiPatchPagesPageIdPageAccessUsersPageAccessUserIdPatch /pages/{page_id}/page_access_users/{page_access_user_id}Update page access user
PageAccessUsersApiPostPagesPageIdPageAccessUsersPost /pages/{page_id}/page_access_usersAdd a page access user
PageAccessUsersApiPutPagesPageIdPageAccessUsersPageAccessUserIdPut /pages/{page_id}/page_access_users/{page_access_user_id}Update page access user
PagesApiGetPagesGet /pagesGet a list of pages
PagesApiGetPagesPageIdGet /pages/{page_id}Get a page
PagesApiPatchPagesPageIdPatch /pages/{page_id}Update a page
PagesApiPutPagesPageIdPut /pages/{page_id}Update a page
PermissionsApiGetOrganizationsOrganizationIdPermissionsUserIdGet /organizations/{organization_id}/permissions/{user_id}Get a user's permissions
PermissionsApiPutOrganizationsOrganizationIdPermissionsUserIdPut /organizations/{organization_id}/permissions/{user_id}Update a user's role permissions
StatusEmbedConfigApiGetPagesPageIdStatusEmbedConfigGet /pages/{page_id}/status_embed_configGet status embed config settings
StatusEmbedConfigApiPatchPagesPageIdStatusEmbedConfigPatch /pages/{page_id}/status_embed_configUpdate status embed config settings
StatusEmbedConfigApiPutPagesPageIdStatusEmbedConfigPut /pages/{page_id}/status_embed_configUpdate status embed config settings
SubscribersApiDeletePagesPageIdSubscribersSubscriberIdDelete /pages/{page_id}/subscribers/{subscriber_id}Unsubscribe a subscriber
SubscribersApiGetPagesPageIdSubscribersGet /pages/{page_id}/subscribersGet a list of subscribers
SubscribersApiGetPagesPageIdSubscribersCountGet /pages/{page_id}/subscribers/countGet a count of subscribers by type
SubscribersApiGetPagesPageIdSubscribersHistogramByStateGet /pages/{page_id}/subscribers/histogram_by_stateGet a histogram of subscribers by type and then state
SubscribersApiGetPagesPageIdSubscribersSubscriberIdGet /pages/{page_id}/subscribers/{subscriber_id}Get a subscriber
SubscribersApiGetPagesPageIdSubscribersUnsubscribedGet /pages/{page_id}/subscribers/unsubscribedGet a list of unsubscribed subscribers
SubscribersApiPatchPagesPageIdSubscribersSubscriberIdPatch /pages/{page_id}/subscribers/{subscriber_id}Update a subscriber
SubscribersApiPostPagesPageIdSubscribersPost /pages/{page_id}/subscribersCreate a subscriber
SubscribersApiPostPagesPageIdSubscribersReactivatePost /pages/{page_id}/subscribers/reactivateReactivate a list of subscribers
SubscribersApiPostPagesPageIdSubscribersResendConfirmationPost /pages/{page_id}/subscribers/resend_confirmationResend confirmations to a list of subscribers
SubscribersApiPostPagesPageIdSubscribersSubscriberIdResendConfirmationPost /pages/{page_id}/subscribers/{subscriber_id}/resend_confirmationResend confirmation to a subscriber
SubscribersApiPostPagesPageIdSubscribersUnsubscribePost /pages/{page_id}/subscribers/unsubscribeUnsubscribe a list of subscribers
TemplatesApiGetPagesPageIdIncidentTemplatesGet /pages/{page_id}/incident_templatesGet a list of templates
TemplatesApiPostPagesPageIdIncidentTemplatesPost /pages/{page_id}/incident_templatesCreate a template
UsersApiDeleteOrganizationsOrganizationIdUsersUserIdDelete /organizations/{organization_id}/users/{user_id}Delete a user
UsersApiGetOrganizationsOrganizationIdPermissionsUserIdGet /organizations/{organization_id}/permissions/{user_id}Get a user's permissions
UsersApiGetOrganizationsOrganizationIdUsersGet /organizations/{organization_id}/usersGet a list of users
UsersApiPostOrganizationsOrganizationIdUsersPost /organizations/{organization_id}/usersCreate a user

Documentation For Models

Documentation For Authorization

api_key

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: Authorization and passed in as the auth context for each request.

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author