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
+18
-17
@@ -1,17 +1,18 @@
|
||||
// Package models provides data models for the Yandex Music API.
|
||||
package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// Experiments represents experiments
|
||||
// Experiments represents experiments from the Yandex Music API.
|
||||
type Experiments struct {
|
||||
BaseModel
|
||||
Experiments []ExperimentDetail `json:"experiments"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes Experiments from JSON
|
||||
// DeJSON deserializes Experiments from JSON data.
|
||||
func (e *Experiments) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -32,7 +33,7 @@ func (e *Experiments) DeJSON(data []byte, client ClientInterface) (Model, error)
|
||||
return experiments, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of Experiments
|
||||
// DeList deserializes a list of Experiments from JSON data.
|
||||
func (e *Experiments) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -50,7 +51,7 @@ func (e *Experiments) DeList(data []byte, client ClientInterface) ([]Model, erro
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// ExperimentDetail represents experiment details
|
||||
// ExperimentDetail represents experiment details.
|
||||
type ExperimentDetail struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -62,7 +63,7 @@ type ExperimentDetail struct {
|
||||
EndDate string `json:"end_date"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes ExperimentDetail from JSON
|
||||
// DeJSON deserializes ExperimentDetail from JSON data.
|
||||
func (e *ExperimentDetail) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -96,7 +97,7 @@ func (e *ExperimentDetail) DeJSON(data []byte, client ClientInterface) (Model, e
|
||||
return detail, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of ExperimentDetails
|
||||
// DeList deserializes a list of ExperimentDetails from JSON data.
|
||||
func (e *ExperimentDetail) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -114,7 +115,7 @@ func (e *ExperimentDetail) DeList(data []byte, client ClientInterface) ([]Model,
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// Permissions represents user permissions
|
||||
// Permissions represents user permissions.
|
||||
type Permissions struct {
|
||||
BaseModel
|
||||
CanPlay bool `json:"can_play"`
|
||||
@@ -129,7 +130,7 @@ type Permissions struct {
|
||||
CanUseLossless bool `json:"can_use_lossless"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes Permissions from JSON
|
||||
// DeJSON deserializes Permissions from JSON data.
|
||||
func (p *Permissions) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -172,7 +173,7 @@ func (p *Permissions) DeJSON(data []byte, client ClientInterface) (Model, error)
|
||||
return perms, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of Permissions
|
||||
// DeList deserializes a list of Permissions from JSON data.
|
||||
func (p *Permissions) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -190,14 +191,14 @@ func (p *Permissions) DeList(data []byte, client ClientInterface) ([]Model, erro
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// PermissionAlerts represents permission alerts
|
||||
// PermissionAlerts represents permission alerts.
|
||||
type PermissionAlerts struct {
|
||||
BaseModel
|
||||
Alerts []PermissionAlert `json:"alerts"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes PermissionAlerts from JSON
|
||||
// DeJSON deserializes PermissionAlerts from JSON data.
|
||||
func (p *PermissionAlerts) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -218,7 +219,7 @@ func (p *PermissionAlerts) DeJSON(data []byte, client ClientInterface) (Model, e
|
||||
return alerts, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of PermissionAlerts
|
||||
// DeList deserializes a list of PermissionAlerts from JSON data. from JSON data.
|
||||
func (p *PermissionAlerts) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -236,7 +237,7 @@ func (p *PermissionAlerts) DeList(data []byte, client ClientInterface) ([]Model,
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// PermissionAlert represents a permission alert
|
||||
// PermissionAlert represents a permission alert.
|
||||
type PermissionAlert struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -248,7 +249,7 @@ type PermissionAlert struct {
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes PermissionAlert from JSON
|
||||
// DeJSON deserializes PermissionAlert from JSON data.
|
||||
func (p *PermissionAlert) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -300,7 +301,7 @@ func (p *PermissionAlert) DeList(data []byte, client ClientInterface) ([]Model,
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// ContentRestrictions represents content restrictions
|
||||
// ContentRestrictions represents content restrictions.
|
||||
type ContentRestrictions struct {
|
||||
BaseModel
|
||||
HasExplicitContent bool `json:"has_explicit_content"`
|
||||
@@ -311,7 +312,7 @@ type ContentRestrictions struct {
|
||||
BlockedArtists []string `json:"blocked_artists"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes ContentRestrictions from JSON
|
||||
// DeJSON deserializes ContentRestrictions from JSON data.
|
||||
func (c *ContentRestrictions) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -342,7 +343,7 @@ func (c *ContentRestrictions) DeJSON(data []byte, client ClientInterface) (Model
|
||||
return restrictions, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of ContentRestrictions
|
||||
// DeList deserializes a list of ContentRestrictions from JSON data.
|
||||
func (c *ContentRestrictions) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
|
||||
Reference in new issue
Block a user