//
#nullable enable
namespace WotBlitzStatisticsPro.Blazor.GraphQl
{
///
/// Represents the operation service of the FindClans GraphQL operation
///
/// query FindClans($searchString: String!, $realmType: RealmType!, $language: RequestLanguage!) {
/// clans(searchString: $searchString, realmType: $realmType, language: $language) {
/// __typename
/// ... clanShortInfo
/// }
/// }
///
/// fragment clanShortInfo on ClanSearchResponseItem {
/// clanId
/// createdAt
/// membersCount
/// name
/// tag
/// }
///
///
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.12.1.0")]
public partial class FindClansQuery : global::WotBlitzStatisticsPro.Blazor.GraphQl.IFindClansQuery
{
private readonly global::StrawberryShake.IOperationExecutor _operationExecutor;
private readonly global::StrawberryShake.Serialization.IInputValueFormatter _stringFormatter;
private readonly global::StrawberryShake.Serialization.IInputValueFormatter _realmTypeFormatter;
private readonly global::StrawberryShake.Serialization.IInputValueFormatter _requestLanguageFormatter;
public FindClansQuery(global::StrawberryShake.IOperationExecutor operationExecutor, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver)
{
_operationExecutor = operationExecutor ?? throw new global::System.ArgumentNullException(nameof(operationExecutor));
_stringFormatter = serializerResolver.GetInputValueFormatter("String");
_realmTypeFormatter = serializerResolver.GetInputValueFormatter("RealmType");
_requestLanguageFormatter = serializerResolver.GetInputValueFormatter("RequestLanguage");
}
global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IFindClansResult);
public async global::System.Threading.Tasks.Task> ExecuteAsync(global::System.String searchString, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage language, global::System.Threading.CancellationToken cancellationToken = default)
{
var request = CreateRequest(searchString, realmType, language);
return await _operationExecutor.ExecuteAsync(request, cancellationToken).ConfigureAwait(false);
}
public global::System.IObservable> Watch(global::System.String searchString, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage language, global::StrawberryShake.ExecutionStrategy? strategy = null)
{
var request = CreateRequest(searchString, realmType, language);
return _operationExecutor.Watch(request, strategy);
}
private global::StrawberryShake.OperationRequest CreateRequest(global::System.String searchString, global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType realmType, global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage language)
{
var variables = new global::System.Collections.Generic.Dictionary();
variables.Add("searchString", FormatSearchString(searchString));
variables.Add("realmType", FormatRealmType(realmType));
variables.Add("language", FormatLanguage(language));
return CreateRequest(variables);
}
private global::StrawberryShake.OperationRequest CreateRequest(global::System.Collections.Generic.IReadOnlyDictionary? variables)
{
return new global::StrawberryShake.OperationRequest(id: FindClansQueryDocument.Instance.Hash.Value, name: "FindClans", document: FindClansQueryDocument.Instance, strategy: global::StrawberryShake.RequestStrategy.Default, variables: variables);
}
private global::System.Object? FormatSearchString(global::System.String value)
{
if (value is null)
{
throw new global::System.ArgumentNullException(nameof(value));
}
return _stringFormatter.Format(value);
}
private global::System.Object? FormatRealmType(global::WotBlitzStatisticsPro.Blazor.GraphQl.RealmType value)
{
return _realmTypeFormatter.Format(value);
}
private global::System.Object? FormatLanguage(global::WotBlitzStatisticsPro.Blazor.GraphQl.RequestLanguage value)
{
return _requestLanguageFormatter.Format(value);
}
global::StrawberryShake.OperationRequest global::StrawberryShake.IOperationRequestFactory.Create(global::System.Collections.Generic.IReadOnlyDictionary? variables)
{
return CreateRequest(variables!);
}
}
}