public async stt::Task UpdateIapSettingsRequestObjectAsync()
        {
            moq::Mock <IdentityAwareProxyAdminService.IdentityAwareProxyAdminServiceClient> mockGrpcClient = new moq::Mock <IdentityAwareProxyAdminService.IdentityAwareProxyAdminServiceClient>(moq::MockBehavior.Strict);
            UpdateIapSettingsRequest request = new UpdateIapSettingsRequest
            {
                IapSettings = new IapSettings(),
                UpdateMask  = new wkt::FieldMask(),
            };
            IapSettings expectedResponse = new IapSettings
            {
                Name                = "name1c9368b0",
                AccessSettings      = new AccessSettings(),
                ApplicationSettings = new ApplicationSettings(),
            };

            mockGrpcClient.Setup(x => x.UpdateIapSettingsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <IapSettings>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            IdentityAwareProxyAdminServiceClient client = new IdentityAwareProxyAdminServiceClientImpl(mockGrpcClient.Object, null);
            IapSettings responseCallSettings            = await client.UpdateIapSettingsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            IapSettings responseCancellationToken = await client.UpdateIapSettingsAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Exemple #2
0
 /// <summary>Snippet for GetIapSettings</summary>
 public void GetIapSettingsRequestObject()
 {
     // Snippet: GetIapSettings(GetIapSettingsRequest, CallSettings)
     // Create client
     IdentityAwareProxyAdminServiceClient identityAwareProxyAdminServiceClient = IdentityAwareProxyAdminServiceClient.Create();
     // Initialize request argument(s)
     GetIapSettingsRequest request = new GetIapSettingsRequest {
         Name = "",
     };
     // Make the request
     IapSettings response = identityAwareProxyAdminServiceClient.GetIapSettings(request);
     // End snippet
 }
Exemple #3
0
 /// <summary>Snippet for UpdateIapSettings</summary>
 public void UpdateIapSettingsRequestObject()
 {
     // Snippet: UpdateIapSettings(UpdateIapSettingsRequest, CallSettings)
     // Create client
     IdentityAwareProxyAdminServiceClient identityAwareProxyAdminServiceClient = IdentityAwareProxyAdminServiceClient.Create();
     // Initialize request argument(s)
     UpdateIapSettingsRequest request = new UpdateIapSettingsRequest
     {
         IapSettings = new IapSettings(),
         UpdateMask  = new FieldMask(),
     };
     // Make the request
     IapSettings response = identityAwareProxyAdminServiceClient.UpdateIapSettings(request);
     // End snippet
 }
Exemple #4
0
        /// <summary>Snippet for GetIapSettingsAsync</summary>
        public async Task GetIapSettingsRequestObjectAsync()
        {
            // Snippet: GetIapSettingsAsync(GetIapSettingsRequest, CallSettings)
            // Additional: GetIapSettingsAsync(GetIapSettingsRequest, CancellationToken)
            // Create client
            IdentityAwareProxyAdminServiceClient identityAwareProxyAdminServiceClient = await IdentityAwareProxyAdminServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetIapSettingsRequest request = new GetIapSettingsRequest {
                Name = "",
            };
            // Make the request
            IapSettings response = await identityAwareProxyAdminServiceClient.GetIapSettingsAsync(request);

            // End snippet
        }
Exemple #5
0
        /// <summary>Snippet for UpdateIapSettingsAsync</summary>
        public async Task UpdateIapSettingsRequestObjectAsync()
        {
            // Snippet: UpdateIapSettingsAsync(UpdateIapSettingsRequest, CallSettings)
            // Additional: UpdateIapSettingsAsync(UpdateIapSettingsRequest, CancellationToken)
            // Create client
            IdentityAwareProxyAdminServiceClient identityAwareProxyAdminServiceClient = await IdentityAwareProxyAdminServiceClient.CreateAsync();

            // Initialize request argument(s)
            UpdateIapSettingsRequest request = new UpdateIapSettingsRequest
            {
                IapSettings = new IapSettings(),
                UpdateMask  = new FieldMask(),
            };
            // Make the request
            IapSettings response = await identityAwareProxyAdminServiceClient.UpdateIapSettingsAsync(request);

            // End snippet
        }
        public void GetIapSettingsRequestObject()
        {
            moq::Mock <IdentityAwareProxyAdminService.IdentityAwareProxyAdminServiceClient> mockGrpcClient = new moq::Mock <IdentityAwareProxyAdminService.IdentityAwareProxyAdminServiceClient>(moq::MockBehavior.Strict);
            GetIapSettingsRequest request = new GetIapSettingsRequest
            {
                Name = "name1c9368b0",
            };
            IapSettings expectedResponse = new IapSettings
            {
                Name                = "name1c9368b0",
                AccessSettings      = new AccessSettings(),
                ApplicationSettings = new ApplicationSettings(),
            };

            mockGrpcClient.Setup(x => x.GetIapSettings(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            IdentityAwareProxyAdminServiceClient client = new IdentityAwareProxyAdminServiceClientImpl(mockGrpcClient.Object, null);
            IapSettings response = client.GetIapSettings(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemple #7
0
        public async Task <MethodResult <Dictionary <PokemonId, PokemonSettings> > > GetItemTemplates()
        {
            if (PokeSettings != null && PokeSettings.Count != 0)
            {
                return(new MethodResult <Dictionary <PokemonId, PokemonSettings> >
                {
                    Data = PokeSettings,
                    Message = "Settings already grabbed",
                    Success = true
                });
            }

            if (!_client.LoggedIn)
            {
                MethodResult result = await AcLogin();

                if (!result.Success)
                {
                    return(new MethodResult <Dictionary <PokemonId, PokemonSettings> >
                    {
                        Message = result.Message
                    });
                }
            }

            if (_client.ClientSession.Templates.ItemTemplates == null)
            {
                return new MethodResult <Dictionary <PokemonId, PokemonSettings> >
                       {
                           Message = "Failed to get setting templates"
                       }
            }
            ;

            var pokemonSettings      = new Dictionary <PokemonId, PokemonSettings>();
            var moveSettings         = new Dictionary <PokemonMove, MoveSettings>();
            var badgeSettings        = new Dictionary <BadgeType, BadgeSettings>();
            var itemSettings         = new Dictionary <ItemId, ItemSettings>();
            var battleSettings       = new GymBattleSettings();
            var upgradeSettings      = new PokemonUpgradeSettings();
            var moveSequenceSettings = new MoveSequenceSettings();
            var encounterSettings    = new EncounterSettings();
            var iapItemDisplay       = new IapItemDisplay();
            var iapSettings          = new IapSettings();
            var equippedBadge        = new EquippedBadgeSettings();
            var questSettings        = new QuestSettings();
            var avatarCustomization  = new AvatarCustomizationSettings();
            var formSettings         = new FormSettings();
            var genderSettings       = new GenderSettings();
            var gymBadgeSettings     = new GymBadgeGmtSettings();
            var weatherAffinities    = new WeatherAffinity();
            var weatherBonusSettings = new WeatherBonus();
            var pokemonScaleSettings = new PokemonScaleSetting();
            var typeEffective        = new TypeEffectiveSettings();
            var camera   = new CameraSettings();
            var gymLevel = new GymLevelSettings();

            foreach (var template in _client.ClientSession.Templates.ItemTemplates)
            {
                if (template.PlayerLevel != null)
                {
                    LevelSettings = template.PlayerLevel;

                    continue;
                }

                if (template.PokemonSettings != null)
                {
                    if (pokemonSettings.ContainsKey(template.PokemonSettings.PokemonId))
                    {
                        pokemonSettings.Remove(template.PokemonSettings.PokemonId);
                    }
                    pokemonSettings.Add(template.PokemonSettings.PokemonId, template.PokemonSettings);
                }
                else if (template.MoveSettings != null)
                {
                    if (moveSettings.ContainsKey(template.MoveSettings.MovementId))
                    {
                        moveSettings.Remove(template.MoveSettings.MovementId);
                    }
                    moveSettings.Add(template.MoveSettings.MovementId, template.MoveSettings);
                }
                else if (template.BadgeSettings != null)
                {
                    if (badgeSettings.ContainsKey(template.BadgeSettings.BadgeType))
                    {
                        badgeSettings.Remove(template.BadgeSettings.BadgeType);
                    }
                    badgeSettings.Add(template.BadgeSettings.BadgeType, template.BadgeSettings);
                }
                else if (template.ItemSettings != null)
                {
                    if (itemSettings.ContainsKey(template.ItemSettings.ItemId))
                    {
                        itemSettings.Remove(template.ItemSettings.ItemId);
                    }
                    itemSettings.Add(template.ItemSettings.ItemId, template.ItemSettings);
                }
                else if (template.EncounterSettings != null)
                {
                    encounterSettings = template.EncounterSettings;
                }
                else if (template.MoveSequenceSettings != null)
                {
                    moveSequenceSettings = template.MoveSequenceSettings;
                }
                else if (template.BattleSettings != null)
                {
                    battleSettings = template.BattleSettings;
                }
                else if (template.IapItemDisplay != null)
                {
                    iapItemDisplay = template.IapItemDisplay;
                }
                else if (template.IapSettings != null)
                {
                    iapSettings = template.IapSettings;
                }
                else if (template.EquippedBadges != null)
                {
                    equippedBadge = template.EquippedBadges;
                }
                else if (template.QuestSettings != null)
                {
                    questSettings = template.QuestSettings;
                }
                else if (template.AvatarCustomization != null)
                {
                    avatarCustomization = template.AvatarCustomization;
                }
                else if (template.FormSettings != null)
                {
                    formSettings = template.FormSettings;
                }
                else if (template.GenderSettings != null)
                {
                    genderSettings = template.GenderSettings;
                }
                else if (template.GymBadgeSettings != null)
                {
                    gymBadgeSettings = template.GymBadgeSettings;
                }
                else if (template.WeatherAffinities != null)
                {
                    weatherAffinities = template.WeatherAffinities;
                }
                else if (template.WeatherBonusSettings != null)
                {
                    weatherBonusSettings = template.WeatherBonusSettings;
                }
                else if (template.PokemonScaleSettings != null)
                {
                    pokemonScaleSettings = template.PokemonScaleSettings;
                }
                else if (template.TypeEffective != null)
                {
                    typeEffective = template.TypeEffective;
                }
                else if (template.Camera != null)
                {
                    camera = template.Camera;
                }
                else if (template.GymLevel != null)
                {
                    gymLevel = template.GymLevel;
                }
                else if (template.PokemonUpgrades != null)
                {
                    upgradeSettings = template.PokemonUpgrades;
                }
            }

            PokeSettings                   = pokemonSettings;
            MoveSettings                   = moveSettings;
            BadgeSettings                  = badgeSettings;
            ItemSettings                   = itemSettings;
            BadgeSettings                  = badgeSettings;
            UpgradeSettings                = upgradeSettings;
            GetMoveSequenceSettings        = moveSequenceSettings;
            GetEncounterSettings           = encounterSettings;
            GetIapItemDisplay              = iapItemDisplay;
            GetIapSettings                 = iapSettings;
            GetEquippedBadgeSettings       = equippedBadge;
            GetQuestSettings               = questSettings;
            GetAvatarCustomizationSettings = avatarCustomization;
            GetFormSettings                = formSettings;
            GetGenderSettings              = genderSettings;
            GetGymBadgeGmtSettings         = gymBadgeSettings;
            GetWeatherAffinity             = weatherAffinities;
            GetWeatherBonus                = weatherBonusSettings;
            GetPokemonScaleSetting         = pokemonScaleSettings;
            GetTypeEffectiveSettings       = typeEffective;
            GetCameraSettings              = camera;
            GetGymLevelSettings            = gymLevel;

            return(new MethodResult <Dictionary <PokemonId, PokemonSettings> >
            {
                Data = pokemonSettings,
                Message = "Success",
                Success = true
            });
        }