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

io.stigg.api.operations.GetUsageHistoryQuery 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;

import com.apollographql.apollo3.api.Adapter;
import com.apollographql.apollo3.api.CompiledField;
import com.apollographql.apollo3.api.CustomScalarAdapters;
import com.apollographql.apollo3.api.ObjectAdapter;
import com.apollographql.apollo3.api.Query;
import com.apollographql.apollo3.api.json.JsonWriter;
import io.stigg.api.operations.adapter.GetUsageHistoryQuery_ResponseAdapter;
import io.stigg.api.operations.adapter.GetUsageHistoryQuery_VariablesAdapter;
import io.stigg.api.operations.fragment.UsageHistoryFragment;
import io.stigg.api.operations.selections.GetUsageHistoryQuerySelections;
import io.stigg.api.operations.type.UsageHistoryInput;
import java.io.IOException;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;

public class GetUsageHistoryQuery implements Query {
  public static final String OPERATION_ID = "c74aa69f7d5240bfd62f84c7da8fe81c4f1aa8dfb91e3298943348eaef152c6b";

  /**
   * The minimized GraphQL document being sent to the server to save a few bytes.
   * The un-minimized version is:
   *
   * query GetUsageHistory($usageHistoryInput: UsageHistoryInput!) {
   *   usageHistory(usageHistoryInput: $usageHistoryInput) {
   *     __typename
   *     ...UsageHistoryFragment
   *   }
   * }
   *
   * fragment UsageHistoryFragment on UsageHistory {
   *   startDate
   *   endDate
   *   usageMeasurements {
   *     date
   *     value
   *     isResetPoint
   *   }
   *   groups {
   *     groupInfo {
   *       key
   *       value
   *     }
   *     usageMeasurements {
   *       date
   *       value
   *       isResetPoint
   *     }
   *   }
   * }
   */
  public static final String OPERATION_DOCUMENT = "query GetUsageHistory($usageHistoryInput: UsageHistoryInput!) { usageHistory(usageHistoryInput: $usageHistoryInput) { __typename ...UsageHistoryFragment } }  fragment UsageHistoryFragment on UsageHistory { startDate endDate usageMeasurements { date value isResetPoint } groups { groupInfo { key value } usageMeasurements { date value isResetPoint } } }";

  public static final String OPERATION_NAME = "GetUsageHistory";

  public final UsageHistoryInput usageHistoryInput;

  private transient volatile int $hashCode;

  private transient volatile boolean $hashCodeMemoized;

  private transient volatile String $toString;

  public GetUsageHistoryQuery(UsageHistoryInput usageHistoryInput) {
    this.usageHistoryInput = usageHistoryInput;
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof GetUsageHistoryQuery) {
      GetUsageHistoryQuery that = (GetUsageHistoryQuery) o;
      return ((this.usageHistoryInput == null) ? (that.usageHistoryInput == null) : this.usageHistoryInput.equals(that.usageHistoryInput));
    }
    return false;
  }

  @Override
  public int hashCode() {
    if (!$hashCodeMemoized) {
      int __h = 1;
      __h *= 1000003;
      __h ^= (usageHistoryInput == null) ? 0 : usageHistoryInput.hashCode();
      $hashCode = __h;
      $hashCodeMemoized = true;
    }
    return $hashCode;
  }

  @Override
  public String toString() {
    if ($toString == null) {
      $toString = "GetUsageHistoryQuery{"
        + "usageHistoryInput=" + usageHistoryInput
        + "}";
    }
    return $toString;
  }

  public static Builder builder() {
    return new Builder();
  }

  @Override
  public String id() {
    return OPERATION_ID;
  }

  @Override
  public String document() {
    return OPERATION_DOCUMENT;
  }

  @Override
  public String name() {
    return OPERATION_NAME;
  }

  @Override
  public void serializeVariables(JsonWriter writer, CustomScalarAdapters customScalarAdapters)
      throws IOException {
    GetUsageHistoryQuery_VariablesAdapter.INSTANCE.toJson(writer, customScalarAdapters, this);
  }

  @Override
  public Adapter adapter() {
    return new ObjectAdapter(GetUsageHistoryQuery_ResponseAdapter.Data.INSTANCE, false);
  }

  @Override
  public CompiledField rootField() {
    return new CompiledField.Builder(
      "data",
      io.stigg.api.operations.type.Query.type
    )
    .selections(GetUsageHistoryQuerySelections.__root)
    .build();
  }

  public static final class Builder {
    private UsageHistoryInput usageHistoryInput;

    Builder() {
    }

    public Builder usageHistoryInput(UsageHistoryInput usageHistoryInput) {
      this.usageHistoryInput = usageHistoryInput;
      return this;
    }

    public GetUsageHistoryQuery build() {
      return new GetUsageHistoryQuery(usageHistoryInput);
    }
  }

  public static class Data implements Query.Data {
    public UsageHistory usageHistory;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    private transient volatile String $toString;

    public Data(UsageHistory usageHistory) {
      this.usageHistory = usageHistory;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Data) {
        Data that = (Data) o;
        return ((this.usageHistory == null) ? (that.usageHistory == null) : this.usageHistory.equals(that.usageHistory));
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int __h = 1;
        __h *= 1000003;
        __h ^= (usageHistory == null) ? 0 : usageHistory.hashCode();
        $hashCode = __h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Data{"
          + "usageHistory=" + usageHistory
          + "}";
      }
      return $toString;
    }
  }

  public static class UsageHistory {
    public String __typename;

    /**
     * Synthetic field for 'UsageHistoryFragment'
     */
    public UsageHistoryFragment usageHistoryFragment;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    private transient volatile String $toString;

    public UsageHistory(String __typename, UsageHistoryFragment usageHistoryFragment) {
      this.__typename = __typename;
      this.usageHistoryFragment = usageHistoryFragment;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof UsageHistory) {
        UsageHistory that = (UsageHistory) o;
        return ((this.__typename == null) ? (that.__typename == null) : this.__typename.equals(that.__typename))
         &&((this.usageHistoryFragment == null) ? (that.usageHistoryFragment == null) : this.usageHistoryFragment.equals(that.usageHistoryFragment));
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int __h = 1;
        __h *= 1000003;
        __h ^= (__typename == null) ? 0 : __typename.hashCode();
        __h *= 1000003;
        __h ^= (usageHistoryFragment == null) ? 0 : usageHistoryFragment.hashCode();
        $hashCode = __h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "UsageHistory{"
          + "__typename=" + __typename + ", "
          + "usageHistoryFragment=" + usageHistoryFragment
          + "}";
      }
      return $toString;
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy