Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to HistoryItem, User and Subscription #16

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion models.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,13 @@ type HistoryItem struct {
DateUnix int `json:"date_unix"`
Feedback Feedback `json:"feedback"`
HistoryItemId string `json:"history_item_id"`
ModelId string `json:"model_id"`
RequestId string `json:"request_id"`
Settings VoiceSettings `json:"settings"`
ShareLinkId string `json:"share_link_id"`
State string `json:"state"`
Text string `json:"text"`
VoiceCategory string `json:"voice_category"`
VoiceId string `json:"voice_id"`
VoiceName string `json:"voice_name"`
}
Expand All @@ -153,10 +156,12 @@ type Subscription struct {
CharacterLimit int `json:"character_limit"`
Currency string `json:"currency"`
NextCharacterCountResetUnix int `json:"next_character_count_reset_unix"`
VoiceLimit int `json:"voice_limit"`
ProfessionalVoiceLimit int `json:"professional_voice_limit"`
Status string `json:"status"`
Tier string `json:"tier"`
VoiceLimit int `json:"voice_limit"`
MaxVoiceAddEdits int `json:"max_voice_add_edits"`
VoiceAddEditCounter int `json:"voice_add_edit_counter"`
HasOpenInvoices bool `json:"has_open_invoices"`
NextInvoice Invoice `json:"next_invoice"`
withInvoicingDetails bool
Expand All @@ -169,7 +174,9 @@ type Invoice struct {

type User struct {
Subscription Subscription `json:"subscription"`
FirstName string `json:"first_name,omitempty"`
IsNewUser bool `json:"is_new_user"`
IsOnboardingComplete bool `json:"is_onboarding_complete"`
XiApiKey string `json:"xi_api_key"`
CanUseDelayedPaymentMethods bool `json:"can_use_delayed_payment_methods"`
}
Expand Down
9 changes: 9 additions & 0 deletions request_bodies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ var testRespBodies = map[string][]byte{
"TestGetHistoryItem": []byte(`{
"history_item_id": "TestHistoryItemID",
"request_id": "string",
"model_id": "TestModelID",
"voice_category": "generated",
"voice_id": "string",
"voice_name": "string",
"text": "string",
Expand All @@ -214,6 +216,7 @@ var testRespBodies = map[string][]byte{
"content_type": "string",
"state": "created",
"settings": {},
"share_link_id" : "TestLinkID",
"feedback": {
"thumbs_up": true,
"feedback": "string",
Expand All @@ -235,6 +238,8 @@ var testRespBodies = map[string][]byte{
"allowed_to_extend_character_limit": true,
"next_character_count_reset_unix": 0,
"voice_limit": 0,
"max_voice_add_edits": 1000,
"voice_add_edit_counter": 15,
"professional_voice_limit": 0,
"can_extend_voice_limit": true,
"can_use_instant_voice_cloning": true,
Expand All @@ -256,14 +261,18 @@ var testRespBodies = map[string][]byte{
"allowed_to_extend_character_limit": true,
"next_character_count_reset_unix": 0,
"voice_limit": 0,
"max_voice_add_edits": 1000,
"voice_add_edit_counter": 15,
"professional_voice_limit": 0,
"can_extend_voice_limit": true,
"can_use_instant_voice_cloning": true,
"can_use_professional_voice_cloning": true,
"currency": "usd",
"status": "trialing"
},
"first_name": "Bob",
"is_new_user": true,
"is_onboarding_complete": false,
"xi_api_key": "string",
"can_use_delayed_payment_methods": true
}`),
Expand Down
Loading