From d2210adf9cc98fca275b32547a2a29946687993e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Fr=C3=B6ssman?= Date: Tue, 20 Jul 2021 08:37:23 +0200 Subject: [PATCH] Convert depracation comments to godoc and deprecate Resource struct. (#207) * Fix deprecation comment formatting for godoc. * Deprecate Resource struct --- billing.go | 16 +++++++++++----- types.go | 10 +++++++++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/billing.go b/billing.go index 9e5de73..fa6d461 100644 --- a/billing.go +++ b/billing.go @@ -20,7 +20,9 @@ type ( Links []Link `json:"links,omitempty"` } - // CreateBillingResp deprecated, use CreateBillingResponse instead. + // CreateBillingResp. + // + // Deprecated: use CreateBillingResponse instead. CreateBillingResp = CreateBillingResponse // CreateAgreementResponse struct @@ -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 ) diff --git a/types.go b/types.go index af04c15..71d547b 100644 --- a/types.go +++ b/types.go @@ -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"`