io.stigg.api.operations.adapter.GetUsageHistoryQuery_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.adapter;
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.ObjectAdapter;
import com.apollographql.apollo3.api.json.JsonReader;
import com.apollographql.apollo3.api.json.JsonWriter;
import io.stigg.api.operations.GetUsageHistoryQuery;
import io.stigg.api.operations.fragment.UsageHistoryFragment;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.util.Arrays;
import java.util.List;
public class GetUsageHistoryQuery_ResponseAdapter {
public enum Data implements Adapter {
INSTANCE;
private static final List RESPONSE_NAMES = Arrays.asList("usageHistory");
@Override
public GetUsageHistoryQuery.Data fromJson(JsonReader reader,
CustomScalarAdapters customScalarAdapters) throws IOException {
GetUsageHistoryQuery.UsageHistory _usageHistory = null;
loop:
while(true) {
switch (reader.selectName(RESPONSE_NAMES)) {
case 0: _usageHistory = new ObjectAdapter(UsageHistory.INSTANCE, true).fromJson(reader, customScalarAdapters); break;
default: break loop;
}
}
Assertions.checkFieldNotMissing(_usageHistory, "usageHistory");
return new GetUsageHistoryQuery.Data(
_usageHistory
);
}
@Override
public void toJson(JsonWriter writer, CustomScalarAdapters customScalarAdapters,
GetUsageHistoryQuery.Data value) throws IOException {
writer.name("usageHistory");
new ObjectAdapter(UsageHistory.INSTANCE, true).toJson(writer, customScalarAdapters, value.usageHistory);
}
}
public enum UsageHistory implements Adapter {
INSTANCE;
private static final List RESPONSE_NAMES = Arrays.asList("__typename");
@Override
public GetUsageHistoryQuery.UsageHistory fromJson(JsonReader reader,
CustomScalarAdapters customScalarAdapters) throws IOException {
String __typename = null;
loop:
while(true) {
switch (reader.selectName(RESPONSE_NAMES)) {
case 0: __typename = Adapters.StringAdapter.fromJson(reader, customScalarAdapters); break;
default: break loop;
}
}
reader.rewind();
UsageHistoryFragment _usageHistoryFragment = io.stigg.api.operations.fragment.UsageHistoryFragmentImpl_ResponseAdapter.UsageHistoryFragment.INSTANCE.fromJson(reader, customScalarAdapters);
Assertions.checkFieldNotMissing(__typename, "__typename");
return new GetUsageHistoryQuery.UsageHistory(
__typename,
_usageHistoryFragment
);
}
@Override
public void toJson(JsonWriter writer, CustomScalarAdapters customScalarAdapters,
GetUsageHistoryQuery.UsageHistory value) throws IOException {
writer.name("__typename");
Adapters.StringAdapter.toJson(writer, customScalarAdapters, value.__typename);
io.stigg.api.operations.fragment.UsageHistoryFragmentImpl_ResponseAdapter.UsageHistoryFragment.INSTANCE.toJson(writer, customScalarAdapters, value.usageHistoryFragment);
}
}
}