Skip to content

Commit

Permalink
Convert depracation comments to godoc and deprecate Resource struct. (#…
Browse files Browse the repository at this point in the history
…207)

* Fix deprecation comment formatting for godoc.

* Deprecate Resource struct
  • Loading branch information
thomasf authored Jul 20, 2021
1 parent 7f2eec9 commit d2210ad
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
16 changes: 11 additions & 5 deletions billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ type (
Links []Link `json:"links,omitempty"`
}

// CreateBillingResp deprecated, use CreateBillingResponse instead.
// CreateBillingResp.
//
// Deprecated: use CreateBillingResponse instead.
CreateBillingResp = CreateBillingResponse

// CreateAgreementResponse struct
Expand All @@ -32,22 +34,26 @@ type (
StartTime time.Time `json:"start_time,omitempty"`
}

// CreateAgreementResp is deprecated, use CreateAgreementResponse instead.
// CreateAgreementResp.
//
// Deprecated: use CreateAgreementResponse instead.
CreateAgreementResp = CreateAgreementResponse

// BillingPlanListParams struct
// BillingPlanListParams
BillingPlanListParams struct {
ListParams
Status string `json:"status,omitempty"` //Allowed values: CREATED, ACTIVE, INACTIVE, ALL.
}

//BillingPlanListResponse struct
// BillingPlanListResponse
BillingPlanListResponse struct {
SharedListResponse
Plans []BillingPlan `json:"plans,omitempty"`
}

// BillingPlanListResp is deprecated, use BillingPlanListResponse instead.
// BillingPlanListResp.
//
// Deprecated: use BillingPlanListResponse instead.
BillingPlanListResp = BillingPlanListResponse
)

Expand Down
10 changes: 9 additions & 1 deletion types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,8 +1132,16 @@ type (
Value interface{} `json:"value"`
}

// Resource is a mix of fields from several webhook resource types.
//
// Deprecated: Add implementation of specific resource types in your own
// code and don't use this catch all struct, you show know which resource
// type you are expecting and handle that type only.
//
// Every resource struct type should be unique for every combination of
// "resource_type"/"resource_version" combination of the Event type /
// webhook message.
Resource struct {
// Payment Resource type
ID string `json:"id,omitempty"`
Status string `json:"status,omitempty"`
StatusDetails *CaptureStatusDetails `json:"status_details,omitempty"`
Expand Down

0 comments on commit d2210ad

Please sign in to comment.