github.com/tada-team/tdproto@v1.51.57/billing_personal_account.go (about) 1 package tdproto 2 3 import "time" 4 5 // PersonalAccountBilling struct of billing api 6 type PersonalAccountBilling struct { 7 8 // PersonalAccountBilling ID 9 PersonalAccountId string `json:"personal_account_id"` 10 11 // ID User who owns this personal account 12 OwnerID string `json:"owner_id"` 13 14 // UUID of User who owns this personal account 15 OwnerUuid string `json:"owner_uuid"` 16 17 // Count of teams on personal account 18 TeamsCount uint32 `json:"teams_count"` 19 20 // Count of workplaces on personal account 21 WorkplaceCount uint32 `json:"workplace_count"` 22 23 // Count of empty workplaces on personal account 24 EmptyWorkplaceCount uint32 `json:"empty_workplace_count"` 25 26 // Count of occupied workplaces on personal account 27 OccupiedWorkplaceCount uint32 `json:"occupied_workplace_count"` 28 29 // Count of free workplaces on personal account 30 FreeWorkplaceCount uint32 `json:"free_workplace_count"` 31 32 // Count of paid workplaces on personal account 33 PaidWorkplaceCount uint32 `json:"paid_workplace_count"` 34 35 // Is the account blocked 36 IsBlocked bool `json:"is_blocked"` 37 38 // Is the account suspended 39 IsSuspended bool `json:"is_suspended"` 40 41 // Date of next debiting funds 42 NextBillingDate *time.Time `json:"next_billing_date,omitempty"` 43 44 // Account blocking date 45 BlockDate *time.Time `json:"block_date,omitempty"` 46 47 // Account suspending date 48 SuspendDate *time.Time `json:"suspend_date,omitempty"` 49 50 // Status of personal account 51 Status PersonalAccountStatus `json:"status"` 52 53 // Tariff on this personal account 54 Tariff TariffBilling `json:"tariff"` 55 56 // Owner of this personal account 57 Owner Contact `json:"owner,omitempty"` 58 } 59 60 // CreatePersonalAccountRequest request on create personal account 61 type CreatePersonalAccountRequest struct { 62 OwnerUuid string `json:"owner_uuid"` 63 FullName string `json:"full_name,omitempty"` 64 Phone string `json:"phone,omitempty"` 65 TeamUuid string `json:"team_uuid"` 66 } 67 68 // CreatePersonalAccountResponse response on create personal account 69 type CreatePersonalAccountResponse struct { 70 PersonalAccountBilling 71 } 72 73 // UpdatePersonalAccountRequest request on update personal account 74 type UpdatePersonalAccountRequest struct { 75 FullName string `json:"full_name,omitempty"` 76 Phone string `json:"phone,omitempty"` 77 } 78 79 // UpdatePersonalAccountResponse response on update personal account 80 type UpdatePersonalAccountResponse struct { 81 Success bool `json:"success,omitempty"` 82 } 83 84 // CheckActivePersonalAccountResponse response on check active personal account 85 type CheckActivePersonalAccountResponse struct { 86 Success bool `json:"success,omitempty"` 87 } 88 89 // GetPersonalAccountByIDResponse response on get personal account by ID 90 type GetPersonalAccountByIDResponse struct { 91 PersonalAccountBilling 92 } 93 94 // GetPersonalAccountsListResponse response on get list of personal accounts 95 type GetPersonalAccountsListResponse struct { 96 PersonalAccounts []PersonalAccountBilling `json:"personal_accounts,omitempty"` 97 } 98 99 // ActivatePersonalAccountResponse response on activate suspended personal account 100 type ActivatePersonalAccountResponse struct { 101 Success bool `json:"success"` 102 } 103 104 // BlockPersonalAccountResponse response on block unblocked personal account 105 type BlockPersonalAccountResponse struct { 106 Success bool `json:"success"` 107 } 108 109 // UnblockPersonalAccountResponse response on unblock blocked personal account 110 type UnblockPersonalAccountResponse struct { 111 Success bool `json:"success"` 112 } 113 114 // SuspendPersonalAccountResponse response on suspend active personal account 115 type SuspendPersonalAccountResponse struct { 116 Success bool `json:"success"` 117 } 118 119 type GetTeamsOnPersonalAccountResponse struct { 120 Teams []GetTeamOnPersonalAccountResponse `json:"teams"` 121 } 122 123 type GetTeamOnPersonalAccountResponse struct { 124 PersonalAccountId string `json:"personal_account_id"` 125 TeamId string `json:"team_id"` 126 TeamUuid string `json:"team_uuid"` 127 OpenDate time.Time `json:"open_date"` 128 CloseDate time.Time `json:"close_date,omitempty"` 129 }