| 1 | // @generated by protoc-gen-es v1.10.0 with parameter "target=ts,import_extension=none" |
| 2 | // @generated from file types/v1/subscription.proto (package types.v1, syntax proto3) |
| 3 | /* eslint-disable */ |
| 4 | // @ts-nocheck |
| 5 | |
| 6 | import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; |
| 7 | import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; |
| 8 | import { PaymentMethod } from "./payment_method_pb"; |
| 9 | |
| 10 | /** |
| 11 | * @generated from message types.v1.Subscription |
| 12 | */ |
| 13 | export class Subscription extends Message<Subscription> { |
| 14 | /** |
| 15 | * @generated from field: google.protobuf.Timestamp created_at = 100; |
| 16 | */ |
| 17 | createdAt?: Timestamp; |
| 18 | |
| 19 | /** |
| 20 | * @generated from field: string stripe_id = 1; |
| 21 | */ |
| 22 | stripeId = ""; |
| 23 | |
| 24 | /** |
| 25 | * @generated from field: types.v1.PaymentMethod default_payment_method = 2; |
| 26 | */ |
| 27 | defaultPaymentMethod?: PaymentMethod; |
| 28 | |
| 29 | /** |
| 30 | * @generated from field: types.v1.Subscription.Status status = 3; |
| 31 | */ |
| 32 | status = Subscription_Status.Unknown; |
| 33 | |
| 34 | /** |
| 35 | * @generated from field: google.protobuf.Timestamp current_period_start_at = 201; |
| 36 | */ |
| 37 | currentPeriodStartAt?: Timestamp; |
| 38 | |
| 39 | /** |
| 40 | * @generated from field: google.protobuf.Timestamp current_period_end_at = 202; |
| 41 | */ |
| 42 | currentPeriodEndAt?: Timestamp; |
| 43 | |
| 44 | /** |
| 45 | * @generated from field: google.protobuf.Timestamp cancel_at = 301; |
| 46 | */ |
| 47 | cancelAt?: Timestamp; |
| 48 | |
| 49 | /** |
| 50 | * @generated from field: google.protobuf.Timestamp canceled_at = 302; |
| 51 | */ |
| 52 | canceledAt?: Timestamp; |
| 53 | |
| 54 | /** |
| 55 | * @generated from field: google.protobuf.Timestamp ended_at = 401; |
| 56 | */ |
| 57 | endedAt?: Timestamp; |
| 58 | |
| 59 | constructor(data?: PartialMessage<Subscription>) { |
| 60 | super(); |
| 61 | proto3.util.initPartial(data, this); |
| 62 | } |
| 63 | |
| 64 | static readonly runtime: typeof proto3 = proto3; |
| 65 | static readonly typeName = "types.v1.Subscription"; |
| 66 | static readonly fields: FieldList = proto3.util.newFieldList(() => [ |
| 67 | { no: 100, name: "created_at", kind: "message", T: Timestamp }, |
| 68 | { no: 1, name: "stripe_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, |
| 69 | { no: 2, name: "default_payment_method", kind: "message", T: PaymentMethod }, |
| 70 | { no: 3, name: "status", kind: "enum", T: proto3.getEnumType(Subscription_Status) }, |
| 71 | { no: 201, name: "current_period_start_at", kind: "message", T: Timestamp }, |
| 72 | { no: 202, name: "current_period_end_at", kind: "message", T: Timestamp }, |
| 73 | { no: 301, name: "cancel_at", kind: "message", T: Timestamp }, |
| 74 | { no: 302, name: "canceled_at", kind: "message", T: Timestamp }, |
| 75 | { no: 401, name: "ended_at", kind: "message", T: Timestamp }, |
| 76 | ]); |
| 77 | |
| 78 | static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Subscription { |
| 79 | return new Subscription().fromBinary(bytes, options); |
| 80 | } |
| 81 | |
| 82 | static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Subscription { |
| 83 | return new Subscription().fromJson(jsonValue, options); |
| 84 | } |
| 85 | |
| 86 | static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Subscription { |
| 87 | return new Subscription().fromJsonString(jsonString, options); |
| 88 | } |
| 89 | |
| 90 | static equals(a: Subscription | PlainMessage<Subscription> | undefined, b: Subscription | PlainMessage<Subscription> | undefined): boolean { |
| 91 | return proto3.util.equals(Subscription, a, b); |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * @generated from enum types.v1.Subscription.Status |
| 97 | */ |
| 98 | export enum Subscription_Status { |
| 99 | /** |
| 100 | * @generated from enum value: Unknown = 0; |
| 101 | */ |
| 102 | Unknown = 0, |
| 103 | |
| 104 | /** |
| 105 | * @generated from enum value: Active = 1; |
| 106 | */ |
| 107 | Active = 1, |
| 108 | |
| 109 | /** |
| 110 | * @generated from enum value: Canceled = 2; |
| 111 | */ |
| 112 | Canceled = 2, |
| 113 | |
| 114 | /** |
| 115 | * @generated from enum value: Incomplete = 3; |
| 116 | */ |
| 117 | Incomplete = 3, |
| 118 | |
| 119 | /** |
| 120 | * @generated from enum value: IncompleteExpired = 4; |
| 121 | */ |
| 122 | IncompleteExpired = 4, |
| 123 | |
| 124 | /** |
| 125 | * @generated from enum value: PastDue = 5; |
| 126 | */ |
| 127 | PastDue = 5, |
| 128 | |
| 129 | /** |
| 130 | * @generated from enum value: Paused = 6; |
| 131 | */ |
| 132 | Paused = 6, |
| 133 | |
| 134 | /** |
| 135 | * @generated from enum value: Trialing = 7; |
| 136 | */ |
| 137 | Trialing = 7, |
| 138 | |
| 139 | /** |
| 140 | * @generated from enum value: Unpaid = 8; |
| 141 | */ |
| 142 | Unpaid = 8, |
| 143 | } |
| 144 | // Retrieve enum metadata with: proto3.getEnumType(Subscription_Status) |
| 145 | proto3.util.setEnumType(Subscription_Status, "types.v1.Subscription.Status", [ |
| 146 | { no: 0, name: "Unknown" }, |
| 147 | { no: 1, name: "Active" }, |
| 148 | { no: 2, name: "Canceled" }, |
| 149 | { no: 3, name: "Incomplete" }, |
| 150 | { no: 4, name: "IncompleteExpired" }, |
| 151 | { no: 5, name: "PastDue" }, |
| 152 | { no: 6, name: "Paused" }, |
| 153 | { no: 7, name: "Trialing" }, |
| 154 | { no: 8, name: "Unpaid" }, |
| 155 | ]); |
| 156 |