/// <summary>Snippet for Insert</summary>
 public void Insert()
 {
     // Snippet: Insert(string, string, TargetPool, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     string     project            = "";
     string     region             = "";
     TargetPool targetPoolResource = new TargetPool();
     // Make the request
     Operation response = targetPoolsClient.Insert(project, region, targetPoolResource);
     // End snippet
 }
 /// <summary>Snippet for Get</summary>
 public void Get()
 {
     // Snippet: Get(string, string, string, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     string project    = "";
     string region     = "";
     string targetPool = "";
     // Make the request
     TargetPool response = targetPoolsClient.Get(project, region, targetPool);
     // End snippet
 }
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertAsync()
        {
            // Snippet: InsertAsync(string, string, TargetPool, CallSettings)
            // Additional: InsertAsync(string, string, TargetPool, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            string     project            = "";
            string     region             = "";
            TargetPool targetPoolResource = new TargetPool();
            // Make the request
            Operation response = await targetPoolsClient.InsertAsync(project, region, targetPoolResource);

            // End snippet
        }
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetAsync()
        {
            // Snippet: GetAsync(string, string, string, CallSettings)
            // Additional: GetAsync(string, string, string, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            string project    = "";
            string region     = "";
            string targetPool = "";
            // Make the request
            TargetPool response = await targetPoolsClient.GetAsync(project, region, targetPool);

            // End snippet
        }
 /// <summary>Snippet for Get</summary>
 public void GetRequestObject()
 {
     // Snippet: Get(GetTargetPoolRequest, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     GetTargetPoolRequest request = new GetTargetPoolRequest
     {
         TargetPool = "",
         Region     = "",
         Project    = "",
     };
     // Make the request
     TargetPool response = targetPoolsClient.Get(request);
     // End snippet
 }
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetRequestObjectAsync()
        {
            // Snippet: GetAsync(GetTargetPoolRequest, CallSettings)
            // Additional: GetAsync(GetTargetPoolRequest, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            GetTargetPoolRequest request = new GetTargetPoolRequest
            {
                TargetPool = "",
                Region     = "",
                Project    = "",
            };
            // Make the request
            TargetPool response = await targetPoolsClient.GetAsync(request);

            // End snippet
        }
        public async stt::Task GetRequestObjectAsync()
        {
            moq::Mock <TargetPools.TargetPoolsClient> mockGrpcClient = new moq::Mock <TargetPools.TargetPoolsClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetTargetPoolRequest request = new GetTargetPoolRequest
            {
                TargetPool = "target_pool65e437ac",
                Region     = "regionedb20d96",
                Project    = "projectaa6ff846",
            };
            TargetPool expectedResponse = new TargetPool
            {
                Id        = 11672635353343658936UL,
                Kind      = "kindf7aa39d9",
                Name      = "name1c9368b0",
                Instances =
                {
                    "instances5432a96f",
                },
                CreationTimestamp = "creation_timestamp235e59a1",
                BackupPool        = "backup_pool2446601c",
                Region            = "regionedb20d96",
                FailoverRatio     = -7.1869584E+17F,
                Description       = "description2cf9da67",
                HealthChecks      =
                {
                    "health_checksedb1f3f8",
                },
                SelfLink        = "self_link7e87f12d",
                SessionAffinity = "session_affinitye702dadf",
            };

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

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

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Example #8
0
        void CreateDebugSphere()
        {
            TargetPool targetPool = FindObjectOfType <TargetPool>();

            if (sphereTargets.Any())
            {
                foreach (Target target in sphereTargets)
                {
                    targetPool.Return(target);
                }
            }

            for (int i = 0; i < (pitchCount - 1); i++)
            {
                TargetPosition targetPos  = TargetTransform.CalculateTargetTransform(i + 1, (0f, 0f, 0f));
                TargetData     targetData = new TargetData(TargetBehavior.Standard, TargetHandType.Left, 0, targetPos);
                Target         newTarget  = targetPool.Take(targetData);
                sphereTargets.Add(newTarget);
            }
        }
        public void GetRequestObject()
        {
            moq::Mock <TargetPools.TargetPoolsClient> mockGrpcClient = new moq::Mock <TargetPools.TargetPoolsClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetTargetPoolRequest request = new GetTargetPoolRequest
            {
                TargetPool = "target_pool65e437ac",
                Region     = "regionedb20d96",
                Project    = "projectaa6ff846",
            };
            TargetPool expectedResponse = new TargetPool
            {
                Id        = 11672635353343658936UL,
                Kind      = "kindf7aa39d9",
                Name      = "name1c9368b0",
                Instances =
                {
                    "instances5432a96f",
                },
                CreationTimestamp = "creation_timestamp235e59a1",
                BackupPool        = "backup_pool2446601c",
                Region            = "regionedb20d96",
                FailoverRatio     = -7.1869584E+17F,
                Description       = "description2cf9da67",
                HealthChecks      =
                {
                    "health_checksedb1f3f8",
                },
                SelfLink        = "self_link7e87f12d",
                SessionAffinity = TargetPool.Types.SessionAffinity.GeneratedCookie,
            };

            mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            TargetPoolsClient client   = new TargetPoolsClientImpl(mockGrpcClient.Object, null);
            TargetPool        response = client.Get(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        /// <summary>
        /// Creates a target pool in the specified project and region using the data included in the request.
        /// Documentation https://developers.google.com/compute/beta/reference/targetPools/insert
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="region">Name of the region scoping this request.</param>
        /// <param name="body">A valid compute beta body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Insert(computeService service, string project, string region, TargetPool body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (region == null)
                {
                    throw new ArgumentNullException(region);
                }

                // Make the request.
                return(service.TargetPools.Insert(body, project, region).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request TargetPools.Insert failed.", ex);
            }
        }
Example #11
0
        /// <summary>
        /// Creates a target pool in the specified project and region using the data included in the request.
        /// Documentation https://developers.google.com/compute/alpha/reference/targetPools/insert
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="region">Name of the region scoping this request.</param>
        /// <param name="body">A valid Compute alpha body.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Insert(ComputeService service, string project, string region, TargetPool body, TargetPoolsInsertOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (region == null)
                {
                    throw new ArgumentNullException(region);
                }

                // Building the initial request.
                var request = service.TargetPools.Insert(body, project, region);

                // Applying optional parameters to the request.
                request = (TargetPoolsResource.InsertRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request TargetPools.Insert failed.", ex);
            }
        }
Example #12
0
        protected override void Init()
        {
            Size = new Vector2 {
                X = 840, Y = 630
            };
            base.Init();
            var actions = new Action[]
            {
                () => Data.TryAdd(SectionName.Help, new IGMDataItem.HelpBox {
                    Pos = new Rectangle(15, 69, 810, 78), Title = Icons.ID.HELP, Options = Box_Options.Middle
                }),
                () => {
                    var keys = new FF8String[] {
                        Strings.Name.Use, //todo add to Strings.Name
                        Strings.Name.Rearrange,
                        Strings.Name.Sort,
                        Strings.Name.Battle
                    };
                    var values = new FF8String[] {
                        Strings.Description.Use, //todo add to Strings.Description
                        Strings.Description.Rearrange,
                        Strings.Description.Sort,
                        Strings.Description.Battle
                    };
                    if (keys.Distinct().Count() == keys.Length && keys.Length == values.Length)
                    {
                        Data.TryAdd(SectionName.TopMenu, TopMenu.Create((from i in Enumerable.Range(0, keys.Length) select i).ToDictionary(x => keys[x], x => values[x])));
                    }
                    else
                    {
                        Data.TryAdd(SectionName.TopMenu, null);
                    }
                },
                () => Data.TryAdd(SectionName.Title, new IGMDataItem.Box {
                    Data = Memory.Strings.Read(Strings.FileID.MenuGroup, 0, 2), Pos = new Rectangle(615, 0, 225, 66)
                }),
                () => Data.TryAdd(SectionName.UseItemGroup, IGMData.Group.Base.Create(Statuses.Create(), IGMData.Pool.Item.Create(), TargetPool.Create()))
            };

            Memory.ProcessActions(actions);
            ChoiceChangeHandler         = help.TextChangeEvent;
            ItemPool.ItemChangeHandler += help.TextChangeEvent;
            ModeChangeHandler          += help.ModeChangeEvent;
            Func <bool> TopMenuInputs = null;

            if (Data[SectionName.TopMenu] != null)
            {
                TopMenuInputs = Data[SectionName.TopMenu].Inputs;
            }
            InputsDict = new Dictionary <Mode, Func <bool> >()
            {
                { Mode.TopMenu, TopMenuInputs },
                { Mode.SelectItem, UseItemGroup.ITEM[1, 0].Inputs },
                { Mode.UseItemOnTarget, UseItemGroup.ITEM[2, 0].Inputs }
            };
            SetMode(Mode.SelectItem);
        }
Example #13
0
 // Start is called before the first frame update
 void Awake()
 {
     Instance = this;
     Init();
 }