io.stigg.api.operations.GetEntitlementQuery 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;
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.GetEntitlementQuery_ResponseAdapter;
import io.stigg.api.operations.adapter.GetEntitlementQuery_VariablesAdapter;
import io.stigg.api.operations.fragment.EntitlementFragment;
import io.stigg.api.operations.selections.GetEntitlementQuerySelections;
import io.stigg.api.operations.type.FetchEntitlementQuery;
import java.io.IOException;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
public class GetEntitlementQuery implements Query {
public static final String OPERATION_ID = "b194715a2485e78f99b5260c1e95584853be5e9ebca1492b47bfb67919eece3e";
/**
* The minimized GraphQL document being sent to the server to save a few bytes.
* The un-minimized version is:
*
* query GetEntitlement($query: FetchEntitlementQuery!) {
* entitlement(query: $query) {
* __typename
* ...EntitlementFragment
* }
* }
*
* fragment ResetPeriodConfigurationFragment on ResetPeriodConfiguration {
* __typename
* ... on MonthlyResetPeriodConfig {
* monthlyAccordingTo
* }
* ... on WeeklyResetPeriodConfig {
* weeklyAccordingTo
* }
* }
*
* fragment FeatureFragment on EntitlementFeature {
* __typename
* featureType
* meterType
* featureUnits
* featureUnitsPlural
* description
* displayName
* refId
* unitTransformation {
* divide
* round
* }
* }
*
* fragment EntitlementFragment on Entitlement {
* __typename
* isGranted
* accessDeniedReason
* customerId
* resourceId
* usageLimit
* hasUnlimitedUsage
* hasSoftLimit
* currentUsage
* requestedUsage
* entitlementUpdatedAt
* usageUpdatedAt
* nextResetDate
* resetPeriod
* resetPeriodConfiguration {
* __typename
* ...ResetPeriodConfigurationFragment
* }
* feature {
* __typename
* ...FeatureFragment
* }
* }
*/
public static final String OPERATION_DOCUMENT = "query GetEntitlement($query: FetchEntitlementQuery!) { entitlement(query: $query) { __typename ...EntitlementFragment } } fragment ResetPeriodConfigurationFragment on ResetPeriodConfiguration { __typename ... on MonthlyResetPeriodConfig { monthlyAccordingTo } ... on WeeklyResetPeriodConfig { weeklyAccordingTo } } fragment FeatureFragment on EntitlementFeature { __typename featureType meterType featureUnits featureUnitsPlural description displayName refId unitTransformation { divide round } } fragment EntitlementFragment on Entitlement { __typename isGranted accessDeniedReason customerId resourceId usageLimit hasUnlimitedUsage hasSoftLimit currentUsage requestedUsage entitlementUpdatedAt usageUpdatedAt nextResetDate resetPeriod resetPeriodConfiguration { __typename ...ResetPeriodConfigurationFragment } feature { __typename ...FeatureFragment } }";
public static final String OPERATION_NAME = "GetEntitlement";
public final FetchEntitlementQuery query;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
private transient volatile String $toString;
public GetEntitlementQuery(FetchEntitlementQuery query) {
this.query = query;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof GetEntitlementQuery) {
GetEntitlementQuery that = (GetEntitlementQuery) o;
return ((this.query == null) ? (that.query == null) : this.query.equals(that.query));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int __h = 1;
__h *= 1000003;
__h ^= (query == null) ? 0 : query.hashCode();
$hashCode = __h;
$hashCodeMemoized = true;
}
return $hashCode;
}
@Override
public String toString() {
if ($toString == null) {
$toString = "GetEntitlementQuery{"
+ "query=" + query
+ "}";
}
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 {
GetEntitlementQuery_VariablesAdapter.INSTANCE.toJson(writer, customScalarAdapters, this);
}
@Override
public Adapter adapter() {
return new ObjectAdapter(GetEntitlementQuery_ResponseAdapter.Data.INSTANCE, false);
}
@Override
public CompiledField rootField() {
return new CompiledField.Builder(
"data",
io.stigg.api.operations.type.Query.type
)
.selections(GetEntitlementQuerySelections.__root)
.build();
}
public static final class Builder {
private FetchEntitlementQuery query;
Builder() {
}
public Builder query(FetchEntitlementQuery query) {
this.query = query;
return this;
}
public GetEntitlementQuery build() {
return new GetEntitlementQuery(query);
}
}
public static class Data implements Query.Data {
public Entitlement entitlement;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
private transient volatile String $toString;
public Data(Entitlement entitlement) {
this.entitlement = entitlement;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Data) {
Data that = (Data) o;
return ((this.entitlement == null) ? (that.entitlement == null) : this.entitlement.equals(that.entitlement));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int __h = 1;
__h *= 1000003;
__h ^= (entitlement == null) ? 0 : entitlement.hashCode();
$hashCode = __h;
$hashCodeMemoized = true;
}
return $hashCode;
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Data{"
+ "entitlement=" + entitlement
+ "}";
}
return $toString;
}
}
public static class Entitlement {
public String __typename;
/**
* Synthetic field for 'EntitlementFragment'
*/
public EntitlementFragment entitlementFragment;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
private transient volatile String $toString;
public Entitlement(String __typename, EntitlementFragment entitlementFragment) {
this.__typename = __typename;
this.entitlementFragment = entitlementFragment;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Entitlement) {
Entitlement that = (Entitlement) o;
return ((this.__typename == null) ? (that.__typename == null) : this.__typename.equals(that.__typename))
&&((this.entitlementFragment == null) ? (that.entitlementFragment == null) : this.entitlementFragment.equals(that.entitlementFragment));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int __h = 1;
__h *= 1000003;
__h ^= (__typename == null) ? 0 : __typename.hashCode();
__h *= 1000003;
__h ^= (entitlementFragment == null) ? 0 : entitlementFragment.hashCode();
$hashCode = __h;
$hashCodeMemoized = true;
}
return $hashCode;
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Entitlement{"
+ "__typename=" + __typename + ", "
+ "entitlementFragment=" + entitlementFragment
+ "}";
}
return $toString;
}
}
}