package com.simplesteph.kafka;

import org.apache.kafka.connect.data.Schema;
import org.apache.kafka.connect.data.SchemaBuilder;
import org.apache.kafka.connect.data.Timestamp;

public class GitHubSchemas {

    public static String NEXT_PAGE_FIELD = "next_page";

    // Issue fields
    public static String OWNER_FIELD = "owner";
    public static String REPOSITORY_FIELD = "repository";
    public static String CREATED_AT_FIELD = "created_at";
    public static String UPDATED_AT_FIELD = "updated_at";
    public static String NUMBER_FIELD = "number";
    public static String URL_FIELD = "url";
    public static String HTML_URL_FIELD = "html_url";
    public static String TITLE_FIELD = "title";
    public static String STATE_FIELD = "state";

    // User fields
    public static String USER_FIELD = "user";
    public static String USER_URL_FIELD = "url";
    public static String USER_HTML_URL_FIELD = "html_url";
    public static String USER_ID_FIELD = "id";
    public static String USER_LOGIN_FIELD = "login";

    // PR fields
    public static String PR_FIELD = "pull_request";
    public static String PR_URL_FIELD = "url";
    public static String PR_HTML_URL_FIELD = "html_url";

    // Schema names
    public static String SCHEMA_KEY = "com.simplesteph.kafka.connect.github.IssueKey";
    public static String SCHEMA_VALUE_ISSUE = "com.simplesteph.kafka.connect.github.IssueValue";
    public static String SCHEMA_VALUE_USER = "com.simplesteph.kafka.connect.github.UserValue";
    public static String SCHEMA_VALUE_PR = "com.simplesteph.kafka.connect.github.PrValue";

    // Key Schema
    public static Schema KEY_SCHEMA = SchemaBuilder.struct().name(SCHEMA_KEY)
            .version(1)
            .field(OWNER_FIELD, Schema.STRING_SCHEMA)
            .field(REPOSITORY_FIELD, Schema.STRING_SCHEMA)
            .field(NUMBER_FIELD, Schema.INT32_SCHEMA)
            .build();

    // Value Schema
    public static Schema USER_SCHEMA = SchemaBuilder.struct().name(SCHEMA_VALUE_USER)
            .version(1)
            .field(USER_URL_FIELD, Schema.STRING_SCHEMA)
            .field(USER_ID_FIELD, Schema.INT32_SCHEMA)
            .field(USER_LOGIN_FIELD, Schema.STRING_SCHEMA)
            .build();

    // optional schema
    public static Schema PR_SCHEMA = SchemaBuilder.struct().name(SCHEMA_VALUE_PR)
            .version(1)
            .field(PR_URL_FIELD, Schema.STRING_SCHEMA)
            .field(PR_HTML_URL_FIELD, Schema.STRING_SCHEMA)
            .optional()
            .build();

    public static Schema VALUE_SCHEMA = SchemaBuilder.struct().name(SCHEMA_VALUE_ISSUE)
            .version(2)
            .field(URL_FIELD, Schema.STRING_SCHEMA)
            .field(TITLE_FIELD, Schema.STRING_SCHEMA)
            .field(CREATED_AT_FIELD, Timestamp.SCHEMA)
            .field(UPDATED_AT_FIELD, Timestamp.SCHEMA)
            .field(NUMBER_FIELD, Schema.INT32_SCHEMA)
            .field(STATE_FIELD, Schema.STRING_SCHEMA)
            .field(USER_FIELD, USER_SCHEMA) // mandatory
            .field(PR_FIELD, PR_SCHEMA)     // optional
            .build();
}

@@ -211,32 +211,38 @@
   public static 
+final 
 String NEXT_PAGE
@@ -298,24 +298,30 @@
 blic static 
+final 
 String OWNER
@@ -352,24 +352,30 @@
 blic static 
+final 
 String REPOS
@@ -416,24 +416,30 @@
 blic static 
+final 
 String CREAT
@@ -476,32 +476,38 @@
   public static 
+final 
 String UPDATED_A
@@ -544,24 +544,30 @@
 blic static 
+final 
 String NUMBE
@@ -596,32 +596,38 @@
   public static 
+final 
 String URL_FIELD
@@ -650,24 +650,30 @@
 blic static 
+final 
 String HTML_
@@ -710,24 +710,30 @@
 blic static 
+final 
 String TITLE
@@ -760,32 +760,38 @@
   public static 
+final 
 String STATE_FIE
@@ -834,32 +834,38 @@
   public static 
+final 
 String USER_FIEL
@@ -886,32 +886,38 @@
   public static 
+final 
 String USER_URL_
@@ -941,32 +941,38 @@
   public static 
+final 
 String USER_HTML
@@ -1006,32 +1006,38 @@
   public static 
+final 
 String USER_ID_F
@@ -1063,24 +1063,30 @@
 blic static 
+final 
 String USER_
@@ -1136,32 +1136,38 @@
   public static 
+final 
 String PR_FIELD 
@@ -1194,32 +1194,38 @@
   public static 
+final 
 String PR_URL_FI
@@ -1251,24 +1251,30 @@
 blic static 
+final 
 String PR_HT
@@ -1331,32 +1331,38 @@
   public static 
+final 
 String SCHEMA_KE
@@ -1424,32 +1424,38 @@
   public static 
+final 
 String SCHEMA_VA
@@ -1527,32 +1527,38 @@
   public static 
+final 
 String SCHEMA_VA
@@ -1636,16 +1636,22 @@
  static 
+final 
 String S
@@ -1748,24 +1748,30 @@
 blic static 
+final 
 Schema KEY_S
@@ -2066,24 +2066,30 @@
 blic static 
+final 
 Schema USER_
@@ -2399,24 +2399,30 @@
 blic static 
+final 
 Schema PR_SC
@@ -2677,16 +2677,22 @@
  static 
+final 
 Schema V

Add `final` modifier for constants