All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.stigg.api.operations.adapter.PreviewSubscriptionMutation_ResponseAdapter Maven / Gradle / Ivy

There is a newer version: 2.129.0
Show newest version
//
// 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.PreviewSubscriptionMutation;
import io.stigg.api.operations.fragment.SubscriptionPreviewV2Fragment;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.util.Arrays;
import java.util.List;

public class PreviewSubscriptionMutation_ResponseAdapter {
  public enum Data implements Adapter {
    INSTANCE;

    private static final List RESPONSE_NAMES = Arrays.asList("previewSubscription");

    @Override
    public PreviewSubscriptionMutation.Data fromJson(JsonReader reader,
        CustomScalarAdapters customScalarAdapters) throws IOException {
      PreviewSubscriptionMutation.PreviewSubscription _previewSubscription = null;

      loop:
      while(true) {
        switch (reader.selectName(RESPONSE_NAMES)) {
          case 0: _previewSubscription = new ObjectAdapter(PreviewSubscription.INSTANCE, true).fromJson(reader, customScalarAdapters); break;
          default: break loop;
        }
      }

      Assertions.checkFieldNotMissing(_previewSubscription, "previewSubscription");

      return new PreviewSubscriptionMutation.Data(
        _previewSubscription
      );
    }

    @Override
    public void toJson(JsonWriter writer, CustomScalarAdapters customScalarAdapters,
        PreviewSubscriptionMutation.Data value) throws IOException {
      writer.name("previewSubscription");
      new ObjectAdapter(PreviewSubscription.INSTANCE, true).toJson(writer, customScalarAdapters, value.previewSubscription);
    }
  }

  public enum PreviewSubscription implements Adapter {
    INSTANCE;

    private static final List RESPONSE_NAMES = Arrays.asList("__typename");

    @Override
    public PreviewSubscriptionMutation.PreviewSubscription 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();
      SubscriptionPreviewV2Fragment _subscriptionPreviewV2Fragment = io.stigg.api.operations.fragment.SubscriptionPreviewV2FragmentImpl_ResponseAdapter.SubscriptionPreviewV2Fragment.INSTANCE.fromJson(reader, customScalarAdapters);

      Assertions.checkFieldNotMissing(__typename, "__typename");

      return new PreviewSubscriptionMutation.PreviewSubscription(
        __typename,
        _subscriptionPreviewV2Fragment
      );
    }

    @Override
    public void toJson(JsonWriter writer, CustomScalarAdapters customScalarAdapters,
        PreviewSubscriptionMutation.PreviewSubscription value) throws IOException {
      writer.name("__typename");
      Adapters.StringAdapter.toJson(writer, customScalarAdapters, value.__typename);

      io.stigg.api.operations.fragment.SubscriptionPreviewV2FragmentImpl_ResponseAdapter.SubscriptionPreviewV2Fragment.INSTANCE.toJson(writer, customScalarAdapters, value.subscriptionPreviewV2Fragment);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy