Merge pull request #53 from mizzy/omitempty-some-keys

Add "omitempty" to some keys which need not to be returned
This commit is contained in:
Junpei Tsuji
2018-03-29 17:05:04 +09:00
committed by GitHub

View File

@@ -62,16 +62,16 @@ type (
// The ExpiresDate type indicates the expiration date for the subscription
ExpiresDate struct {
ExpiresDate string `json:"expires_date"`
ExpiresDateMS string `json:"expires_date_ms"`
ExpiresDatePST string `json:"expires_date_pst"`
ExpiresDate string `json:"expires_date,omitempty"`
ExpiresDateMS string `json:"expires_date_ms,omitempty"`
ExpiresDatePST string `json:"expires_date_pst,omitempty"`
}
// The CancellationDate type indicates the time and date of the cancellation by Apple customer support
CancellationDate struct {
CancellationDate string `json:"cancellation_date"`
CancellationDateMS string `json:"cancellation_date_ms"`
CancellationDatePST string `json:"cancellation_date_pst"`
CancellationDate string `json:"cancellation_date,omitempty"`
CancellationDateMS string `json:"cancellation_date_ms,omitempty"`
CancellationDatePST string `json:"cancellation_date_pst,omitempty"`
}
// The InApp type has the receipt attributes
@@ -80,7 +80,7 @@ type (
ProductID string `json:"product_id"`
TransactionID string `json:"transaction_id"`
OriginalTransactionID string `json:"original_transaction_id"`
WebOrderLineItemID string `json:"web_order_line_item_id"`
WebOrderLineItemID string `json:"web_order_line_item_id,omitempty"`
IsTrialPeriod string `json:"is_trial_period"`
ExpiresDate
@@ -89,7 +89,7 @@ type (
OriginalPurchaseDate
CancellationDate
CancellationReason string `json:"cancellation_reason"`
CancellationReason string `json:"cancellation_reason,omitempty"`
}
// The Receipt type has whole data of receipt
@@ -127,10 +127,10 @@ type (
Status int `json:"status"`
Environment Environment `json:"environment"`
Receipt Receipt `json:"receipt"`
LatestReceiptInfo []InApp `json:"latest_receipt_info"`
LatestReceipt string `json:"latest_receipt"`
PendingRenewalInfo []PendingRenewalInfo `json:"pending_renewal_info"`
IsRetryable bool `json:"is-retryable"`
LatestReceiptInfo []InApp `json:"latest_receipt_info,omitempty"`
LatestReceipt string `json:"latest_receipt,omitempty"`
PendingRenewalInfo []PendingRenewalInfo `json:"pending_renewal_info,omitempty"`
IsRetryable bool `json:"is-retryable,omitempty"`
}
// The HttpStatusResponse struct contains the status code returned by the store