From 1c0ed6574f75c79e3320b9dcbd44bd03ce37833c Mon Sep 17 00:00:00 2001
From: Quaternions <krakow20@gmail.com>
Date: Mon, 9 Dec 2024 20:45:24 -0800
Subject: [PATCH] openapi: remove redundant SubmissionType

---
 openapi.yaml               |  4 ----
 pkg/api/oas_json_gen.go    | 23 +++--------------------
 pkg/api/oas_schemas_gen.go | 25 +++++++------------------
 3 files changed, 10 insertions(+), 42 deletions(-)

diff --git a/openapi.yaml b/openapi.yaml
index e2124ca..aa8b65d 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -643,7 +643,6 @@ components:
       - Submitter
       - AssetID
       - AssetVersion
-      - SubmissionType
 #     - TargetAssetID
       type: object
       properties:
@@ -663,9 +662,6 @@ components:
         AssetVersion:
           type: integer
           format: int64
-        SubmissionType:
-          type: integer
-          format: int32
         TargetAssetID:
           type: integer
           format: int64
diff --git a/pkg/api/oas_json_gen.go b/pkg/api/oas_json_gen.go
index 12356f0..0148f9b 100644
--- a/pkg/api/oas_json_gen.go
+++ b/pkg/api/oas_json_gen.go
@@ -1457,10 +1457,6 @@ func (s *SubmissionCreate) encodeFields(e *jx.Encoder) {
 		e.FieldStart("AssetVersion")
 		e.Int64(s.AssetVersion)
 	}
-	{
-		e.FieldStart("SubmissionType")
-		e.Int32(s.SubmissionType)
-	}
 	{
 		if s.TargetAssetID.Set {
 			e.FieldStart("TargetAssetID")
@@ -1469,15 +1465,14 @@ func (s *SubmissionCreate) encodeFields(e *jx.Encoder) {
 	}
 }
 
-var jsonFieldsNameOfSubmissionCreate = [8]string{
+var jsonFieldsNameOfSubmissionCreate = [7]string{
 	0: "DisplayName",
 	1: "Creator",
 	2: "GameID",
 	3: "Submitter",
 	4: "AssetID",
 	5: "AssetVersion",
-	6: "SubmissionType",
-	7: "TargetAssetID",
+	6: "TargetAssetID",
 }
 
 // Decode decodes SubmissionCreate from json.
@@ -1561,18 +1556,6 @@ func (s *SubmissionCreate) Decode(d *jx.Decoder) error {
 			}(); err != nil {
 				return errors.Wrap(err, "decode field \"AssetVersion\"")
 			}
-		case "SubmissionType":
-			requiredBitSet[0] |= 1 << 6
-			if err := func() error {
-				v, err := d.Int32()
-				s.SubmissionType = int32(v)
-				if err != nil {
-					return err
-				}
-				return nil
-			}(); err != nil {
-				return errors.Wrap(err, "decode field \"SubmissionType\"")
-			}
 		case "TargetAssetID":
 			if err := func() error {
 				s.TargetAssetID.Reset()
@@ -1593,7 +1576,7 @@ func (s *SubmissionCreate) Decode(d *jx.Decoder) error {
 	// Validate required fields.
 	var failures []validate.FieldError
 	for i, mask := range [1]uint8{
-		0b01111111,
+		0b00111111,
 	} {
 		if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
 			// Mask only required fields and check equality to mask using XOR.
diff --git a/pkg/api/oas_schemas_gen.go b/pkg/api/oas_schemas_gen.go
index 6e70618..16a7e89 100644
--- a/pkg/api/oas_schemas_gen.go
+++ b/pkg/api/oas_schemas_gen.go
@@ -720,14 +720,13 @@ func (s *Submission) SetStatusID(val int32) {
 
 // Ref: #/components/schemas/SubmissionCreate
 type SubmissionCreate struct {
-	DisplayName    string   `json:"DisplayName"`
-	Creator        string   `json:"Creator"`
-	GameID         int32    `json:"GameID"`
-	Submitter      int64    `json:"Submitter"`
-	AssetID        int64    `json:"AssetID"`
-	AssetVersion   int64    `json:"AssetVersion"`
-	SubmissionType int32    `json:"SubmissionType"`
-	TargetAssetID  OptInt64 `json:"TargetAssetID"`
+	DisplayName   string   `json:"DisplayName"`
+	Creator       string   `json:"Creator"`
+	GameID        int32    `json:"GameID"`
+	Submitter     int64    `json:"Submitter"`
+	AssetID       int64    `json:"AssetID"`
+	AssetVersion  int64    `json:"AssetVersion"`
+	TargetAssetID OptInt64 `json:"TargetAssetID"`
 }
 
 // GetDisplayName returns the value of DisplayName.
@@ -760,11 +759,6 @@ func (s *SubmissionCreate) GetAssetVersion() int64 {
 	return s.AssetVersion
 }
 
-// GetSubmissionType returns the value of SubmissionType.
-func (s *SubmissionCreate) GetSubmissionType() int32 {
-	return s.SubmissionType
-}
-
 // GetTargetAssetID returns the value of TargetAssetID.
 func (s *SubmissionCreate) GetTargetAssetID() OptInt64 {
 	return s.TargetAssetID
@@ -800,11 +794,6 @@ func (s *SubmissionCreate) SetAssetVersion(val int64) {
 	s.AssetVersion = val
 }
 
-// SetSubmissionType sets the value of SubmissionType.
-func (s *SubmissionCreate) SetSubmissionType(val int32) {
-	s.SubmissionType = val
-}
-
 // SetTargetAssetID sets the value of TargetAssetID.
 func (s *SubmissionCreate) SetTargetAssetID(val OptInt64) {
 	s.TargetAssetID = val