io.stigg.api.operations.adapter.UnarchiveCustomerMutation_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.UnarchiveCustomerMutation;
import io.stigg.api.operations.fragment.SlimCustomerFragment;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.util.Arrays;
import java.util.List;
public class UnarchiveCustomerMutation_ResponseAdapter {
public enum Data implements Adapter {
INSTANCE;
private static final List RESPONSE_NAMES = Arrays.asList("unarchiveCustomer");
@Override
public UnarchiveCustomerMutation.Data fromJson(JsonReader reader,
CustomScalarAdapters customScalarAdapters) throws IOException {
UnarchiveCustomerMutation.UnarchiveCustomer _unarchiveCustomer = null;
loop:
while(true) {
switch (reader.selectName(RESPONSE_NAMES)) {
case 0: _unarchiveCustomer = new ObjectAdapter(UnarchiveCustomer.INSTANCE, true).fromJson(reader, customScalarAdapters); break;
default: break loop;
}
}
Assertions.checkFieldNotMissing(_unarchiveCustomer, "unarchiveCustomer");
return new UnarchiveCustomerMutation.Data(
_unarchiveCustomer
);
}
@Override
public void toJson(JsonWriter writer, CustomScalarAdapters customScalarAdapters,
UnarchiveCustomerMutation.Data value) throws IOException {
writer.name("unarchiveCustomer");
new ObjectAdapter(UnarchiveCustomer.INSTANCE, true).toJson(writer, customScalarAdapters, value.unarchiveCustomer);
}
}
public enum UnarchiveCustomer implements Adapter {
INSTANCE;
private static final List RESPONSE_NAMES = Arrays.asList("__typename");
@Override
public UnarchiveCustomerMutation.UnarchiveCustomer 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();
SlimCustomerFragment _slimCustomerFragment = io.stigg.api.operations.fragment.SlimCustomerFragmentImpl_ResponseAdapter.SlimCustomerFragment.INSTANCE.fromJson(reader, customScalarAdapters);
Assertions.checkFieldNotMissing(__typename, "__typename");
return new UnarchiveCustomerMutation.UnarchiveCustomer(
__typename,
_slimCustomerFragment
);
}
@Override
public void toJson(JsonWriter writer, CustomScalarAdapters customScalarAdapters,
UnarchiveCustomerMutation.UnarchiveCustomer value) throws IOException {
writer.name("__typename");
Adapters.StringAdapter.toJson(writer, customScalarAdapters, value.__typename);
io.stigg.api.operations.fragment.SlimCustomerFragmentImpl_ResponseAdapter.SlimCustomerFragment.INSTANCE.toJson(writer, customScalarAdapters, value.slimCustomerFragment);
}
}
}