// Package subscription provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
package subscription

import (
	core "github.com/meshery/schemas/models/core"
	planv1beta2 "github.com/meshery/schemas/models/v1beta2/plan"
	openapi_types "github.com/oapi-codegen/runtime/types"
)

// Defines values for PaymentProcessor.
const (
	Braintree PaymentProcessor = "braintree"
	Paypal    PaymentProcessor = "paypal"
	Stripe    PaymentProcessor = "stripe"
)

// Defines values for SubscriptionStatus.
const (
	Active            SubscriptionStatus = "active"
	Canceled          SubscriptionStatus = "canceled"
	Incomplete        SubscriptionStatus = "incomplete"
	IncompleteExpired SubscriptionStatus = "incomplete_expired"
	PastDue           SubscriptionStatus = "past_due"
	Trialing          SubscriptionStatus = "trialing"
	Unpaid            SubscriptionStatus = "unpaid"
)

// CancelSubscriptionRequest defines model for CancelSubscriptionRequest.
type CancelSubscriptionRequest struct {
	// PaymentProcessor Supported payment processors
	PaymentProcessor *PaymentProcessor `json:"paymentProcessor,omitempty" yaml:"paymentProcessor,omitempty"`

	// SubscriptionId Subscription ID from the payment processor
	SubscriptionId *string `json:"subscriptionId,omitempty" yaml:"subscriptionId,omitempty"`
}

// CreateSubscriptionRequest defines model for CreateSubscriptionRequest.
type CreateSubscriptionRequest struct {
	// CouponId Coupon ID to apply
	CouponId *string `json:"couponId,omitempty" yaml:"couponId,omitempty"`

	// Email Email of the customer
	Email *openapi_types.Email `json:"email,omitempty" yaml:"email,omitempty"`

	// OrgId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	OrgId *core.Uuid `json:"orgId,omitempty" yaml:"orgId,omitempty"`

	// PaymentProcessor Supported payment processors
	PaymentProcessor *PaymentProcessor `json:"paymentProcessor,omitempty" yaml:"paymentProcessor,omitempty"`

	// PlanId Price ID from the payment processor
	PlanId *string `json:"planId,omitempty" yaml:"planId,omitempty"`

	// UserCount Number of users in the organization
	UserCount *int `json:"userCount,omitempty" yaml:"userCount,omitempty"`
}

// CreateSubscriptionResponse defines model for CreateSubscriptionResponse.
type CreateSubscriptionResponse struct {
	// ClientSecret Client secret returned by the payment processor for the subscription checkout flow.
	ClientSecret *string `json:"clientSecret,omitempty" yaml:"clientSecret,omitempty"`

	// SubscriptionId ID of the associated subscription.
	SubscriptionId *string `json:"subscriptionId,omitempty" yaml:"subscriptionId,omitempty"`
}

// PaymentProcessor Supported payment processors
type PaymentProcessor string

// Subscription Subscription entity schema.
type Subscription struct {
	// BillingId Billing ID of the subscription. This is the ID of the subscription in the billing system. eg Stripe
	BillingId string                   `db:"billing_id" json:"billing_id" yaml:"billing_id"`
	CreatedAt core.Time        `db:"created_at" json:"created_at,omitempty" yaml:"created_at,omitempty"`
	DeletedAt core.SqlNullTime `db:"deleted_at" json:"deleted_at,omitempty" yaml:"deleted_at,omitempty"`
	EndDate   core.Time        `db:"end_date" json:"end_date,omitempty" yaml:"end_date,omitempty"`

	// Id A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	ID core.Uuid `db:"id" json:"id" yaml:"id"`

	// OrgId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	OrgId core.Uuid `db:"org_id" json:"org_id" yaml:"org_id"`

	// Plan Plan entity schema.
	Plan *planv1beta2.Plan `fk_id:"PlanId" belongs_to:"plans" json:"plan,omitempty" yaml:"plan,omitempty"`

	// PlanId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	PlanId core.Uuid `db:"plan_id" json:"plan_id" yaml:"plan_id"`

	// Quantity number of units subscribed (eg number of users)
	Quantity  int               `db:"quantity" json:"quantity" yaml:"quantity"`
	StartDate core.Time `db:"start_date" json:"start_date,omitempty" yaml:"start_date,omitempty"`

	// Status Possible statuses of a Stripe subscription.
	Status    SubscriptionStatus `db:"status" json:"status" yaml:"status"`
	UpdatedAt core.Time  `db:"updated_at" json:"updated_at,omitempty" yaml:"updated_at,omitempty"`
}

// SubscriptionPage defines model for SubscriptionPage.
type SubscriptionPage struct {
	// Page Current page number of the result set.
	Page int `json:"page" yaml:"page"`

	// PageSize Number of items per page.
	PageSize int `json:"page_size" yaml:"page_size"`

	// Subscriptions Subscriptions returned in the current page of results.
	Subscriptions []Subscription `json:"subscriptions" yaml:"subscriptions"`

	// TotalCount Total number of items available.
	TotalCount int `json:"total_count" yaml:"total_count"`
}

// SubscriptionStatus Possible statuses of a Stripe subscription.
type SubscriptionStatus string

// UpdateUsersRequest defines model for UpdateUsersRequest.
type UpdateUsersRequest struct {
	// PaymentProcessor Supported payment processors
	PaymentProcessor *PaymentProcessor `json:"paymentProcessor,omitempty" yaml:"paymentProcessor,omitempty"`
}

// UpgradeSubscriptionRequest defines model for UpgradeSubscriptionRequest.
type UpgradeSubscriptionRequest struct {
	// NewPlanId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	NewPlanId *core.Uuid `json:"newPlanId,omitempty" yaml:"newPlanId,omitempty"`

	// OldPlanId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	OldPlanId *core.Uuid `json:"oldPlanId,omitempty" yaml:"oldPlanId,omitempty"`
}

// WebhookEvent Payload for webhook events from payment processors
type WebhookEvent = map[string]interface{}

// Order defines model for order.
type Order = string

// Page defines model for page.
type Page = int

// Pagesize defines model for pagesize.
type Pagesize = int

// PagesizeWithAll defines model for pagesizeWithAll.
type PagesizeWithAll = string

// SubscriptionId defines model for subscriptionId.
type SubscriptionId = string
