io.stigg.api.operations.fragment.AddonDependencyFragmentImpl_ResponseAdapter Maven / Gradle / Ivy
//
// AUTO-GENERATED FILE. DO NOT MODIFY.
//
// This class was automatically generated by Apollo GraphQL version '3.8.2'.
//
package io.stigg.api.operations.fragment;
import com.apollographql.apollo3.api.Adapter;
import com.apollographql.apollo3.api.Adapters;
import com.apollographql.apollo3.api.Assertions;
import com.apollographql.apollo3.api.CustomScalarAdapters;
import com.apollographql.apollo3.api.json.JsonReader;
import com.apollographql.apollo3.api.json.JsonWriter;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.util.Arrays;
import java.util.List;
public class AddonDependencyFragmentImpl_ResponseAdapter {
public enum AddonDependencyFragment implements Adapter {
INSTANCE;
private static final List RESPONSE_NAMES = Arrays.asList("id", "refId", "displayName", "description");
@Override
public io.stigg.api.operations.fragment.AddonDependencyFragment fromJson(JsonReader reader,
CustomScalarAdapters customScalarAdapters) throws IOException {
String _id = null;
String _refId = null;
String _displayName = null;
String _description = null;
loop:
while(true) {
switch (reader.selectName(RESPONSE_NAMES)) {
case 0: _id = Adapters.StringAdapter.fromJson(reader, customScalarAdapters); break;
case 1: _refId = Adapters.StringAdapter.fromJson(reader, customScalarAdapters); break;
case 2: _displayName = Adapters.StringAdapter.fromJson(reader, customScalarAdapters); break;
case 3: _description = Adapters.NullableStringAdapter.fromJson(reader, customScalarAdapters); break;
default: break loop;
}
}
Assertions.checkFieldNotMissing(_id, "id");
Assertions.checkFieldNotMissing(_refId, "refId");
Assertions.checkFieldNotMissing(_displayName, "displayName");
return new io.stigg.api.operations.fragment.AddonDependencyFragment(
_id,
_refId,
_displayName,
_description
);
}
@Override
public void toJson(JsonWriter writer, CustomScalarAdapters customScalarAdapters,
io.stigg.api.operations.fragment.AddonDependencyFragment value) throws IOException {
writer.name("id");
Adapters.StringAdapter.toJson(writer, customScalarAdapters, value.id);
writer.name("refId");
Adapters.StringAdapter.toJson(writer, customScalarAdapters, value.refId);
writer.name("displayName");
Adapters.StringAdapter.toJson(writer, customScalarAdapters, value.displayName);
writer.name("description");
Adapters.NullableStringAdapter.toJson(writer, customScalarAdapters, value.description);
}
}
}