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

Align Go structs #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package tdproto

type Auth struct {
Token string `json:"token,omitempty"`
Method2fa string `json:"method2fa"`
Me UserWithMe `json:"me"`
Required2fa bool `json:"required2fa"`
Recovery2fa bool `json:"recovery2fa"`
Method2fa string `json:"method2fa"`
}
4 changes: 2 additions & 2 deletions billing_change_tariff.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import "time"

// ChangeTariffBilling struct of changes tariffs by personal account
type ChangeTariffBilling struct {
TariffId string `json:"tariff_id"` // TODO: must be int64
OpenDate time.Time `json:"open_date,omitempty"`
CloseDate time.Time `json:"close_date,omitempty"`
CreateDate time.Time `json:"create_date,omitempty"`
TariffId string `json:"tariff_id"` // TODO: must be int64
}

// GetChangesTariffsByPersonalAccountResponse response on get changes tariffs by personal account
Expand All @@ -17,8 +17,8 @@ type GetChangesTariffsByPersonalAccountResponse struct {

// CreateChangeTariffOnPersonalAccountRequest request on create change tariff on personal account
type CreateChangeTariffOnPersonalAccountRequest struct {
TariffId string `json:"tariff_id"` // TODO: must be int64
OpenDate time.Time `json:"open_date,omitempty"`
TariffId string `json:"tariff_id"` // TODO: must be int64
}

// CreateChangeTariffOnPersonalAccountResponse response on create change tariff on personal account
Expand Down
11 changes: 5 additions & 6 deletions billing_personal_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import "time"

// PersonalAccountBilling struct of billing api
type PersonalAccountBilling struct {
// Status of personal account
Status PersonalAccountStatus `json:"status"`

// Date of next debiting funds
NextBillingDate time.Time `json:"next_billing_date"`

// PersonalAccountBilling ID
PersonalAccountId string `json:"personal_account_id"` // TODO: must be int64
Expand All @@ -29,12 +34,6 @@ type PersonalAccountBilling struct {
// Amount of Discount on personal account
DiscountAmount int32 `json:"discount_amount"`

// Status of personal account
Status PersonalAccountStatus `json:"status"`

// Date of next debiting funds
NextBillingDate time.Time `json:"next_billing_date"`

// Count of teams on personal account
TeamCount int32 `json:"team_count"`

Expand Down
116 changes: 58 additions & 58 deletions billing_tariff.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,95 +7,92 @@ type TariffBilling struct {
// Date of closing tariff
CloseDate *time.Time `json:"close_date,omitempty"`

// Date of opening tariff
OpenDate *time.Time `json:"open_date"`

// Cost of one workplace
CostWorkplace string `json:"cost_workplace"`

// Currency of tariff
Currency Currency `json:"currency"`

// Count of minimum workspaces on tariff
MinTariffWorkplaces int32 `json:"min_tariff_workplaces"`
// Tariff id
TariffId string `json:"tariff_id"`

// Minimum step of change count workspaces on tariff
MinStepWorkplaces int32 `json:"min_step_workplaces"`
// Status of tariff
Status TariffStatus `json:"status"`

// Disk space limit per user
DiskSpaceQuotaMb string `json:"disk_space_quota_mb"`

// Count of free workspaces
FreeWorkplaces int32 `json:"free_workplaces"`

// Flag of availability of free seats when exceeding FreeWorkplace
IsBillingFree bool `json:"is_billing_free"`
// Name of tariff
TariffName string `json:"tariff_name"`

// Flag of accounting without looking at the number of days before the billing period
IsBillingFullTime bool `json:"is_billing_full_time"`
// Bitrate of video in video sharing
VideoSharingBitrate int32 `json:"video_sharing_bitrate"`

// Default tariff flag that is set when registering an account
IsDefaultTariff bool `json:"is_default_tariff"`
// Count of free workspaces
FreeWorkplaces int32 `json:"free_workplaces"`

// Flag for accounting for unspent days when switching to a new tariff
IsRecalcChangeTariff bool `json:"is_recalc_change_tariff"`
// Number of paid days
PeriodDays int32 `json:"period_days"`

// Maximum count of users in voice conference
MaxVoiceUser int32 `json:"max_voice_user"`

// Maximum count of users in video conference
MaxVideoUser int32 `json:"max_video_user"`

// Bitrate of video in video co
// Bitrate of video in video sharing
VideoCallBitrate int32 `json:"video_call_bitrate"`

// Bitrate of video in video sharing
VideoSharingBitrate int32 `json:"video_sharing_bitrate"`
// Minimum step of change count workspaces on tariff
MinStepWorkplaces int32 `json:"min_step_workplaces"`

// Date of opening tariff
OpenDate *time.Time `json:"open_date"`
// Count of minimum workspaces on tariff
MinTariffWorkplaces int32 `json:"min_tariff_workplaces"`

// Number of paid days
PeriodDays int32 `json:"period_days"`
// Flag of accounting without looking at the number of days before the billing period
IsBillingFullTime bool `json:"is_billing_full_time"`

// Status of tariff
Status TariffStatus `json:"status"`
// Default tariff flag that is set when registering an account
IsDefaultTariff bool `json:"is_default_tariff"`

// Tariff id
TariffId string `json:"tariff_id"` // TODO: must be int64
// Flag of availability of free seats when exceeding FreeWorkplace
IsBillingFree bool `json:"is_billing_free"`

// Name of tariff
TariffName string `json:"tariff_name"`
// Flag for accounting for unspent days when switching to a new tariff
IsRecalcChangeTariff bool `json:"is_recalc_change_tariff"`
}

// Request to create the tariff
type CreateTariffRequest struct {
// Date of opening tariff
OpenDate *time.Time `json:"open_date,omitempty"`

// Date of closing tariff
CloseDate *time.Time `json:"close_date,omitempty"`

// Disk space limit per user
DiskSpaceQuotaMb string `json:"disk_space_quota_mb,omitempty"`

// Cost of one workplace
CostWorkplace string `json:"cost_workplace,omitempty"`

// Currency of tariff
Currency Currency `json:"currency"`

// Count of minimum workspaces on tariff
MinTariffWorkplaces int32 `json:"min_tariff_workplaces"`

// Minimum step of change count workspaces on tariff
MinStepWorkplaces int32 `json:"min_step_workplaces"`

// Disk space limit per user
DiskSpaceQuotaMb string `json:"disk_space_quota_mb,omitempty"`
// Name of tariff
TariffName string `json:"tariff_name"`

// Count of free workspaces
FreeWorkplaces int32 `json:"free_workplaces,omitempty"`

// Flag of availability of free seats when exceeding FreeWorkplace
IsBillingFree bool `json:"is_billing_free,omitempty"`

// Flag of accounting without looking at the number of days before the billing period
IsBillingFullTime bool `json:"is_billing_full_time,omitempty"`
// Bitrate of video in video sharing
VideoSharingBitrate int32 `json:"video_sharing_bitrate"`

// Flag for accounting for unspent days when switching to a new tariff
IsRecalcChangeTariff bool `json:"is_recalc_change_tariff,omitempty"`
// Minimum step of change count workspaces on tariff
MinStepWorkplaces int32 `json:"min_step_workplaces"`

// Maximum count of users in voice conference
MaxVoiceUser int32 `json:"max_voice_user,omitempty"`
Expand All @@ -106,35 +103,38 @@ type CreateTariffRequest struct {
// Bitrate of video in video co
VideoCallBitrate int32 `json:"video_call_bitrate"`

// Bitrate of video in video sharing
VideoSharingBitrate int32 `json:"video_sharing_bitrate"`

// Default tariff flag that is set when registering an account
IsDefaultTariff bool `json:"is_default_tariff,omitempty"`

// Date of opening tariff
OpenDate *time.Time `json:"open_date,omitempty"`
// Count of minimum workspaces on tariff
MinTariffWorkplaces int32 `json:"min_tariff_workplaces"`

// Number of paid days
PeriodDays int32 `json:"period_days"`

// Name of tariff
TariffName string `json:"tariff_name"`
// Flag of accounting without looking at the number of days before the billing period
IsBillingFullTime bool `json:"is_billing_full_time,omitempty"`

// Flag of availability of free seats when exceeding FreeWorkplace
IsBillingFree bool `json:"is_billing_free,omitempty"`

// Default tariff flag that is set when registering an account
IsDefaultTariff bool `json:"is_default_tariff,omitempty"`

// Flag for accounting for unspent days when switching to a new tariff
IsRecalcChangeTariff bool `json:"is_recalc_change_tariff,omitempty"`
}

// Request to update the tariff
type UpdateTariffRequest struct {
// Tariff id
TariffId string `json:"tariff_id"`

// Date of closing tariff
CloseDate *time.Time `json:"close_date,omitempty"`

// Default tariff flag that is set when registering an account
IsDefaultTariff bool `json:"is_default_tariff,omitempty"`
// Tariff id
TariffId string `json:"tariff_id"`

// Status of tariff
Status TariffStatus `json:"status,omitempty"`

// Default tariff flag that is set when registering an account
IsDefaultTariff bool `json:"is_default_tariff,omitempty"`
}

// Response from getting a list of tariffs
Expand Down
2 changes: 1 addition & 1 deletion billing_team.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import "time"

// TeamBilling struct of billing api
type TeamBilling struct {
TeamUuid string `json:"team_uuid,omitempty"`
DeleteDate time.Time `json:"delete_date,omitempty"`
TeamUuid string `json:"team_uuid,omitempty"`
}

// AddTeamOnPersonalAccountRequest request on add team on personal account
Expand Down
4 changes: 2 additions & 2 deletions billing_workplace.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ type WorkplaceBilling struct {

// UserInfo user information
type UserInfo struct {
LastActivity *time.Time `json:"last_activity,omitempty"`
Uuid string `json:"uuid"`
FullName string `json:"full_name,omitempty"`
Phone string `json:"phone,omitempty"`
Email string `json:"email,omitempty"`
LastActivity *time.Time `json:"last_activity,omitempty"`
}

// WorkplaceOptions struct for pagination
Expand Down Expand Up @@ -110,8 +110,8 @@ type GetUsersInfoByUserUUIDArrayResponse struct {

// GetUsersInfoByUserUUIDArrayExcludingTeamMembersRequest request on get user information by array of UUID's users excluding team members in uuid team
type GetUsersInfoByUserUUIDArrayExcludingTeamMembersRequest struct {
UserUuid []string `json:"user_uuid"`
TeamUuid string `json:"team_uuid"`
UserUuid []string `json:"user_uuid"`
Limit int32 `json:"limit,omitempty"`
Offset int32 `json:"offset,omitempty"`
}
Expand Down
24 changes: 12 additions & 12 deletions call_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ type CallEvent struct {
// Call id
Uid string `json:"uid"`

// Call buzzing
Buzz bool `json:"buzz,omitempty"`

// Creation date, iso datetime
Created ISODateTimeString `json:"created"`

Expand All @@ -20,9 +17,6 @@ type CallEvent struct {
// Call finish
Finish ISODateTimeString `json:"finish,omitempty"`

// Call record enabled
Audiorecord bool `json:"audiorecord"`

// Call participants
Onliners []CallOnliner `json:"onliners,omitempty"`

Expand All @@ -31,6 +25,12 @@ type CallEvent struct {

// Deprecated: use gentime or created
Timestamp int64 `json:"timestamp"`

// Call record enabled
Audiorecord bool `json:"audiorecord"`

// Call buzzing
Buzz bool `json:"buzz,omitempty"`
}

// Call participant
Expand All @@ -47,21 +47,21 @@ type CallOnliner struct {
// Contact icon
Icon string `json:"icon"`

// Member devices, strictly one for now
Devices []CallDevice `json:"devices"`

// Microphone muted. Computed from devices muted states
Muted bool `json:"muted"`

// Video state
EnabledVideo bool `json:"enabled_video"`

// Member devices, strictly one for now
Devices []CallDevice `json:"devices"`
}

// Call participant device
type CallDevice struct {
// Device muted
Muted bool `json:"muted"`

// Device description
Useragent string `json:"useragent"`

// Device muted
Muted bool `json:"muted"`
}
Loading