Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct formatting of deprecation notices. #340

Merged
merged 1 commit into from
Aug 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ability.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ type ListAbilityResponse struct {
Abilities []string `json:"abilities"`
}

// ListAbilities lists all abilities on your account. It's recommended to use
// ListAbilitiesWithContext instead.
// ListAbilities lists all abilities on your account.
//
// Deprecated: Use ListAbilitiesWithContext instead.
dsymonds marked this conversation as resolved.
Show resolved Hide resolved
func (c *Client) ListAbilities() (*ListAbilityResponse, error) {
return c.ListAbilitiesWithContext(context.Background())
}
Expand All @@ -29,6 +30,8 @@ func (c *Client) ListAbilitiesWithContext(ctx context.Context) (*ListAbilityResp
}

// TestAbility checks if your account has the given ability.
//
// Deprecated: Use TestAbilityWithContext instead.
func (c *Client) TestAbility(ability string) error {
return c.TestAbilityWithContext(context.Background(), ability)
}
Expand Down
25 changes: 15 additions & 10 deletions addon.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ type ListAddonResponse struct {
Addons []Addon `json:"addons"`
}

// ListAddons lists all of the add-ons installed on your account. It's
// recommended to use ListAddonsWithContext instead.
// ListAddons lists all of the add-ons installed on your account.
//
// Deprecated: Use ListAddonsWithContext instead.
func (c *Client) ListAddons(o ListAddonOptions) (*ListAddonResponse, error) {
return c.ListAddonsWithContext(context.Background(), o)
}
Expand All @@ -56,8 +57,9 @@ func (c *Client) ListAddonsWithContext(ctx context.Context, o ListAddonOptions)
return &result, nil
}

// InstallAddon installs an add-on for your account. It's recommended to use
// InstallAddonWithContext instead.
// InstallAddon installs an add-on for your account.
//
// Deprecated: Use InstallAddonWithContext instead.
func (c *Client) InstallAddon(a Addon) (*Addon, error) {
return c.InstallAddonWithContext(context.Background(), a)
}
Expand All @@ -80,8 +82,9 @@ func (c *Client) InstallAddonWithContext(ctx context.Context, a Addon) (*Addon,
return getAddonFromResponse(c, resp)
}

// DeleteAddon deletes an add-on from your account. It's recommended to use
// DeleteAddonWithContext instead.
// DeleteAddon deletes an add-on from your account.
//
// Deprecated: Use DeleteAddonWithContext instead.
func (c *Client) DeleteAddon(id string) error {
return c.DeleteAddonWithContext(context.Background(), id)
}
Expand All @@ -92,8 +95,9 @@ func (c *Client) DeleteAddonWithContext(ctx context.Context, id string) error {
return err
}

// GetAddon gets details about an existing add-on. It's recommended to use
// GetAddonWithContext instead.
// GetAddon gets details about an existing add-on.
//
// Deprecated: Use GetAddonWithContext instead.
func (c *Client) GetAddon(id string) (*Addon, error) {
return c.GetAddonWithContext(context.Background(), id)
}
Expand All @@ -108,8 +112,9 @@ func (c *Client) GetAddonWithContext(ctx context.Context, id string) (*Addon, er
return getAddonFromResponse(c, resp)
}

// UpdateAddon updates an existing add-on. It's recommended to use
// UpdateAddonWithContext instead.
// UpdateAddon updates an existing add-on.
//
// Deprecated: Use UpdateAddonWithContext instead.
func (c *Client) UpdateAddon(id string, a Addon) (*Addon, error) {
return c.UpdateAddonWithContext(context.Background(), id, a)
}
Expand Down
20 changes: 12 additions & 8 deletions business_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ func (c *Client) ListBusinessServicesPaginated(ctx context.Context, o ListBusine
return businessServices, nil
}

// CreateBusinessService creates a new business service. It's recommended to use
// CreateBusinessServiceWithContext instead
// CreateBusinessService creates a new business service.
//
// Deprecated: Use CreateBusinessServiceWithContext instead
func (c *Client) CreateBusinessService(b *BusinessService) (*BusinessService, *http.Response, error) {
return c.createBusinessServiceWithContext(context.Background(), b)
}
Expand All @@ -120,8 +121,9 @@ func (c *Client) createBusinessServiceWithContext(ctx context.Context, b *Busine
return getBusinessServiceFromResponse(c, resp, err)
}

// GetBusinessService gets details about a business service. It's recommended to
// use GetBusinessServiceWithContext instead.
// GetBusinessService gets details about a business service.
//
// Deprecated: Use GetBusinessServiceWithContext instead.
func (c *Client) GetBusinessService(id string) (*BusinessService, *http.Response, error) {
return c.getBusinessServiceWithContext(context.Background(), id)
}
Expand All @@ -137,8 +139,9 @@ func (c *Client) getBusinessServiceWithContext(ctx context.Context, id string) (
return getBusinessServiceFromResponse(c, resp, err)
}

// DeleteBusinessService deletes a business_service. It's recommended to use
// DeleteBusinessServiceWithContext instead.
// DeleteBusinessService deletes a business_service.
//
// Deprecated: Use DeleteBusinessServiceWithContext instead.
func (c *Client) DeleteBusinessService(id string) error {
return c.DeleteBusinessServiceWithContext(context.Background(), id)
}
Expand All @@ -149,8 +152,9 @@ func (c *Client) DeleteBusinessServiceWithContext(ctx context.Context, id string
return err
}

// UpdateBusinessService updates a business_service. It's recommended to use
// UpdateBusinessServiceWithContext instead.
// UpdateBusinessService updates a business_service.
//
// Deprecated: Use UpdateBusinessServiceWithContext instead.
func (c *Client) UpdateBusinessService(b *BusinessService) (*BusinessService, *http.Response, error) {
return c.updateBusinessServiceWithContext(context.Background(), b)
}
Expand Down
2 changes: 1 addition & 1 deletion change_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type ChangeEventResponse struct {
// The v2EventsAPIEndpoint parameter must be set on the client
// Documentation can be found at https://developer.pagerduty.com/docs/events-api-v2/send-change-events
//
// It's recommended to use CreateChangeEventWithContext instead.
// Deprecated: Use CreateChangeEventWithContext instead.
func (c *Client) CreateChangeEvent(e ChangeEvent) (*ChangeEventResponse, error) {
return c.CreateChangeEventWithContext(context.Background(), e)
}
Expand Down
47 changes: 29 additions & 18 deletions escalation_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ type GetEscalationRuleOptions struct {
Includes []string `url:"include,omitempty,brackets"`
}

// ListEscalationPolicies lists all of the existing escalation policies. It's
// recommended to use ListEscalationPoliciesWithContext instead.
// ListEscalationPolicies lists all of the existing escalation policies.
//
// Deprecated: Use ListEscalationPoliciesWithContext instead.
func (c *Client) ListEscalationPolicies(o ListEscalationPoliciesOptions) (*ListEscalationPoliciesResponse, error) {
return c.ListEscalationPoliciesWithContext(context.Background(), o)
}
Expand All @@ -85,8 +86,9 @@ func (c *Client) ListEscalationPoliciesWithContext(ctx context.Context, o ListEs
return &result, nil
}

// CreateEscalationPolicy creates a new escalation policy. It's recommended to
// use CreateEscalationPolicyWithContext instead.
// CreateEscalationPolicy creates a new escalation policy.
//
// Deprecated: Use CreateEscalationPolicyWithContext instead.
func (c *Client) CreateEscalationPolicy(e EscalationPolicy) (*EscalationPolicy, error) {
return c.CreateEscalationPolicyWithContext(context.Background(), e)
}
Expand All @@ -101,8 +103,9 @@ func (c *Client) CreateEscalationPolicyWithContext(ctx context.Context, e Escala
return getEscalationPolicyFromResponse(c, resp, err)
}

// DeleteEscalationPolicy deletes an existing escalation policy and rules. It's
// recommended to use DeleteEscalationPolicyWithContext instead.
// DeleteEscalationPolicy deletes an existing escalation policy and rules.
//
// Deprecated: Use DeleteEscalationPolicyWithContext instead.
func (c *Client) DeleteEscalationPolicy(id string) error {
return c.DeleteEscalationPolicyWithContext(context.Background(), id)
}
Expand All @@ -119,7 +122,9 @@ type GetEscalationPolicyOptions struct {
}

// GetEscalationPolicy gets information about an existing escalation policy and
// its rules. It's recommended to use GetEscalationPolicyWithContext instead.
// its rules.
//
// Deprecated: Use GetEscalationPolicyWithContext instead.
func (c *Client) GetEscalationPolicy(id string, o *GetEscalationPolicyOptions) (*EscalationPolicy, error) {
return c.GetEscalationPolicyWithContext(context.Background(), id, o)
}
Expand All @@ -137,7 +142,8 @@ func (c *Client) GetEscalationPolicyWithContext(ctx context.Context, id string,
}

// UpdateEscalationPolicy updates an existing escalation policy and its rules.
// It's recommended to use UpdateEscalationPolicyWithContext instead.
//
// Deprecated: Use UpdateEscalationPolicyWithContext instead.
func (c *Client) UpdateEscalationPolicy(id string, e *EscalationPolicy) (*EscalationPolicy, error) {
return c.UpdateEscalationPolicyWithContext(context.Background(), id, *e)
}
Expand All @@ -153,8 +159,9 @@ func (c *Client) UpdateEscalationPolicyWithContext(ctx context.Context, id strin
}

// CreateEscalationRule creates a new escalation rule for an escalation policy
// and appends it to the end of the existing escalation rules. It's recommended
// to use CreateEscalationRuleWithContext instead.
// and appends it to the end of the existing escalation rules.
//
// Deprecated: Use CreateEscalationRuleWithContext instead.
func (c *Client) CreateEscalationRule(escID string, e EscalationRule) (*EscalationRule, error) {
return c.CreateEscalationRuleWithContext(context.Background(), escID, e)
}
Expand All @@ -170,8 +177,9 @@ func (c *Client) CreateEscalationRuleWithContext(ctx context.Context, escID stri
return getEscalationRuleFromResponse(c, resp, err)
}

// GetEscalationRule gets information about an existing escalation rule. It's
// recommended to use GetEscalationRuleWithContext instead.
// GetEscalationRule gets information about an existing escalation rule.
//
// Deprecated: Use GetEscalationRuleWithContext instead.
func (c *Client) GetEscalationRule(escID string, id string, o *GetEscalationRuleOptions) (*EscalationRule, error) {
return c.GetEscalationRuleWithContext(context.Background(), escID, id, o)
}
Expand All @@ -187,8 +195,9 @@ func (c *Client) GetEscalationRuleWithContext(ctx context.Context, escID string,
return getEscalationRuleFromResponse(c, resp, err)
}

// DeleteEscalationRule deletes an existing escalation rule. It's recommended to
// use DeleteEscalationRuleWithContext instead.
// DeleteEscalationRule deletes an existing escalation rule.
//
// Deprecated: Use DeleteEscalationRuleWithContext instead.
func (c *Client) DeleteEscalationRule(escID string, id string) error {
return c.DeleteEscalationRuleWithContext(context.Background(), escID, id)
}
Expand All @@ -199,8 +208,9 @@ func (c *Client) DeleteEscalationRuleWithContext(ctx context.Context, escID stri
return err
}

// UpdateEscalationRule updates an existing escalation rule. It's recommended to
// use UpdateEscalationRuleWithContext instead.
// UpdateEscalationRule updates an existing escalation rule.
//
// Deprecated: Use UpdateEscalationRuleWithContext instead.
func (c *Client) UpdateEscalationRule(escID string, id string, e *EscalationRule) (*EscalationRule, error) {
return c.UpdateEscalationRuleWithContext(context.Background(), escID, id, *e)
}
Expand All @@ -216,8 +226,9 @@ func (c *Client) UpdateEscalationRuleWithContext(ctx context.Context, escID stri
}

// ListEscalationRules lists all of the escalation rules for an existing
// escalation policy. It's recommended to use ListEscalationRulesWithContext
// instead.
// escalation policy.
//
// Deprecated: Use ListEscalationRulesWithContext instead.
func (c *Client) ListEscalationRules(escID string) (*ListEscalationRulesResponse, error) {
return c.ListEscalationRulesWithContext(context.Background(), escID)
}
Expand Down
8 changes: 6 additions & 2 deletions event_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ type V2EventResponse struct {
const v2eventEndPoint = "https://events.pagerduty.com/v2/enqueue"

// ManageEvent handles the trigger, acknowledge, and resolve methods for an
// event. It's recommended to use ManageEventWithContext instead.
// event.
//
// Deprecated: Use ManageEventWithContext instead.
func ManageEvent(e V2Event) (*V2EventResponse, error) {
return ManageEventWithContext(context.Background(), e)
}
Expand Down Expand Up @@ -90,7 +92,9 @@ func ManageEventWithContext(ctx context.Context, e V2Event) (*V2EventResponse, e
}

// ManageEvent handles the trigger, acknowledge, and resolve methods for an
// event. It's recommended to use ManageEventWithContext instead.
// event.
//
// Deprecated: Use ManageEventWithContext instead.
func (c *Client) ManageEvent(e *V2Event) (*V2EventResponse, error) {
return c.ManageEventWithContext(context.Background(), e)
}
Expand Down
13 changes: 11 additions & 2 deletions extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ type ListExtensionOptions struct {
Query string `url:"query,omitempty"`
}

// ListExtensions lists the extensions from the API. It's recommended to use
// ListExtensionsWithContext instead.
// ListExtensions lists the extensions from the API.
//
// Deprecated: Use ListExtensionsWithContext instead.
func (c *Client) ListExtensions(o ListExtensionOptions) (*ListExtensionResponse, error) {
return c.ListExtensionsWithContext(context.Background(), o)
}
Expand All @@ -61,6 +62,8 @@ func (c *Client) ListExtensionsWithContext(ctx context.Context, o ListExtensionO
}

// CreateExtension creates a single extension.
//
// Deprecated: Use CreateExtensionWithContext instead.
func (c *Client) CreateExtension(e *Extension) (*Extension, error) {
return c.CreateExtensionWithContext(context.Background(), e)
}
Expand All @@ -72,6 +75,8 @@ func (c *Client) CreateExtensionWithContext(ctx context.Context, e *Extension) (
}

// DeleteExtension deletes an extension by its ID.
//
// Deprecated: Use DeleteExtensionWithContext instead.
func (c *Client) DeleteExtension(id string) error {
return c.DeleteExtensionWithContext(context.Background(), id)
}
Expand All @@ -83,6 +88,8 @@ func (c *Client) DeleteExtensionWithContext(ctx context.Context, id string) erro
}

// GetExtension gets an extension by its ID.
//
// Deprecated: Use GetExtensionWithContext instead.
func (c *Client) GetExtension(id string) (*Extension, error) {
return c.GetExtensionWithContext(context.Background(), id)
}
Expand All @@ -94,6 +101,8 @@ func (c *Client) GetExtensionWithContext(ctx context.Context, id string) (*Exten
}

// UpdateExtension updates an extension by its ID.
//
// Deprecated: Use UpdateExtensionWithContext instead.
func (c *Client) UpdateExtension(id string, e *Extension) (*Extension, error) {
return c.UpdateExtensionWithContext(context.Background(), id, e)
}
Expand Down
10 changes: 6 additions & 4 deletions extension_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ type ListExtensionSchemaOptions struct {
}

// ListExtensionSchemas lists all of the extension schemas. Each schema
// represents a specific type of outbound extension. It's recommended to use
// ListExtensionSchemasWithContext instead.
// represents a specific type of outbound extension.
//
// Deprecated: Use ListExtensionSchemasWithContext instead.
func (c *Client) ListExtensionSchemas(o ListExtensionSchemaOptions) (*ListExtensionSchemaResponse, error) {
return c.ListExtensionSchemasWithContext(context.Background(), o)
}
Expand All @@ -64,8 +65,9 @@ func (c *Client) ListExtensionSchemasWithContext(ctx context.Context, o ListExte
return &result, nil
}

// GetExtensionSchema gets a single extension schema. It's recommended to use
// GetExtensionSchemaWithContext instead.
// GetExtensionSchema gets a single extension schema.
//
// Deprecated: Use GetExtensionSchemaWithContext instead.
func (c *Client) GetExtensionSchema(id string) (*ExtensionSchema, error) {
return c.GetExtensionSchemaWithContext(context.Background(), id)
}
Expand Down
Loading