Add comprehensive godoc documentation to all exported symbols
- Document all exported types, functions, methods, and constants across 52 files - Add package-level doc comments to client, models, utils, and ynison packages - Document HTTP method and endpoint path for each API client method - Document model struct fields and DeJSON/DeList/ToJSON/ToMap methods - Fix duplicate package doc comment in internal/models/base.go Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
1 parent
7a68ad86cb
commit
0456ca0665
54 files changed
+1097
-652
No files matched your search
+13
-12
@@ -1,10 +1,11 @@
|
||||
// Package models provides data models for the Yandex Music API.
|
||||
package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// AccountSettings represents account settings
|
||||
// AccountSettings represents account settings from the Yandex Music API.
|
||||
type AccountSettings struct {
|
||||
BaseModel
|
||||
Language string `json:"language"`
|
||||
@@ -26,7 +27,7 @@ type AccountSettings struct {
|
||||
DownloadOnWifiOnly bool `json:"download_on_wifi_only"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes AccountSettings from JSON
|
||||
// DeJSON deserializes AccountSettings from JSON data.
|
||||
func (a *AccountSettings) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -90,7 +91,7 @@ func (a *AccountSettings) DeJSON(data []byte, c ClientInterface) (Model, error)
|
||||
return settings, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of AccountSettings
|
||||
// DeList deserializes a list of AccountSettings from JSON data.
|
||||
func (a *AccountSettings) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -108,7 +109,7 @@ func (a *AccountSettings) DeList(data []byte, c ClientInterface) ([]Model, error
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// Subscription represents subscription info
|
||||
// Subscription represents subscription info.
|
||||
type Subscription struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -127,7 +128,7 @@ type Subscription struct {
|
||||
TrialUsed bool `json:"trial_used"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes Subscription from JSON
|
||||
// DeJSON deserializes Subscription from JSON data.
|
||||
func (s *Subscription) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -182,7 +183,7 @@ func (s *Subscription) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
return sub, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of Subscriptions
|
||||
// DeList deserializes a list of Subscriptions from JSON data.
|
||||
func (s *Subscription) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -200,7 +201,7 @@ func (s *Subscription) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// PlusInfo represents Plus subscription info (from /account/plus or account status)
|
||||
// PlusInfo represents Plus subscription info.
|
||||
type PlusInfo struct {
|
||||
BaseModel
|
||||
HasPlus bool `json:"has_plus"`
|
||||
@@ -208,7 +209,7 @@ type PlusInfo struct {
|
||||
Migrated *bool `json:"migrated,omitempty"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes PlusInfo from JSON
|
||||
// DeJSON deserializes PlusInfo from JSON data.
|
||||
func (p *PlusInfo) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -232,7 +233,7 @@ func (p *PlusInfo) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
return plus, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of PlusInfo
|
||||
// DeList deserializes a list of PlusInfo from JSON data.
|
||||
func (p *PlusInfo) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -250,7 +251,7 @@ func (p *PlusInfo) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// PromoCodeStatus represents promo code status
|
||||
// PromoCodeStatus represents promo code status.
|
||||
type PromoCodeStatus struct {
|
||||
BaseModel
|
||||
Code string `json:"code"`
|
||||
@@ -262,7 +263,7 @@ type PromoCodeStatus struct {
|
||||
Activated bool `json:"activated"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes PromoCodeStatus from JSON
|
||||
// DeJSON deserializes PromoCodeStatus from JSON data.
|
||||
func (p *PromoCodeStatus) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -296,7 +297,7 @@ func (p *PromoCodeStatus) DeJSON(data []byte, c ClientInterface) (Model, error)
|
||||
return promo, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of PromoCodeStatus
|
||||
// DeList deserializes a list of PromoCodeStatus from JSON data.
|
||||
func (p *PromoCodeStatus) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
|
||||
Reference in new issue
Block a user