public TargetRefColumnSqlModel(TargetReference fk, TargetReferenceColumn col, TargetEntitySqlModel targetSqlModel, ColumnInfo colinfo)
     : base(colinfo)
 {
     _col = col;
     _fk = fk;
     _targetSqlModel = targetSqlModel;
 }
示例#2
0
        /// <summary>Snippet for SetTargetAsync</summary>
        public async Task SetTargetAsync()
        {
            // Snippet: SetTargetAsync(string, string, TargetReference, CallSettings)
            // Additional: SetTargetAsync(string, string, TargetReference, CancellationToken)
            // Create client
            GlobalForwardingRulesClient globalForwardingRulesClient = await GlobalForwardingRulesClient.CreateAsync();

            // Initialize request argument(s)
            string          project                 = "";
            string          forwardingRule          = "";
            TargetReference targetReferenceResource = new TargetReference();
            // Make the request
            lro::Operation <Operation, Operation> response = await globalForwardingRulesClient.SetTargetAsync(project, forwardingRule, targetReferenceResource);

            // Poll until the returned long-running operation is complete
            lro::Operation <Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            Operation result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            lro::Operation <Operation, Operation> retrievedResponse = await globalForwardingRulesClient.PollOnceSetTargetAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
示例#3
0
        private object ReadParameter(BitStream s, ParameterDefinition paramDefinition)
        {
            IParameter param = null;

            switch (paramDefinition.ParameterType)
            {
            case ParameterType.Float: { param = new FloatValue(); } break;

            case ParameterType.EntityFilter: { param = new EntityFilter(); } break;

            case ParameterType.GenericReference: { param = new GenericReference(); } break;

            case ParameterType.IntegerReference: { param = new IntegerReference(); } break;

            case ParameterType.Meter: { param = new MeterData(); } break;

            case ParameterType.ObjectReference: { param = new ObjectReference(); } break;

            case ParameterType.PlayerReference: { param = new PlayerReference(); } break;

            case ParameterType.Shape: { param = new BoundaryData(); } break;

            case ParameterType.StringReference: { param = new StringReference(); } break;

            case ParameterType.StringReferenceOneToken: { param = new StringReferenceOneToken(); } break;

            case ParameterType.StringReferenceTwoTokens: { param = new StringReferenceTwoTokens(); } break;

            case ParameterType.StringReferenceThreeTokens: { param = new StringReferenceThreeTokens(); } break;

            case ParameterType.TargetReference: { param = new TargetReference(); } break;

            case ParameterType.TeamReference: { param = new TeamReference(); } break;

            case ParameterType.TimerReference: { param = new TimerReference(); } break;

            case ParameterType.VirtualTrigger: { param = new VirtualTrigger(); } break;

            case ParameterType.WaypointIcon: { param = new WaypointIconData(); } break;

            case ParameterType.Coordinates3d: { param = new Coordinates3d(); } break;

            case ParameterType.Boolean:
                return(s.Reader.ReadBit());

            default:
                object value = 0;
                StreamIntegerValue(s, paramDefinition, ref value);
                return(value);
            }

            if (param != null)
            {
                param.SerializeObject(s, paramDefinition);
            }

            return(param);
        }
示例#4
0
 /// <summary>Snippet for SetTarget</summary>
 public void SetTarget()
 {
     // Snippet: SetTarget(string, string, TargetReference, CallSettings)
     // Create client
     GlobalForwardingRulesClient globalForwardingRulesClient = GlobalForwardingRulesClient.Create();
     // Initialize request argument(s)
     string          project                 = "";
     string          forwardingRule          = "";
     TargetReference targetReferenceResource = new TargetReference();
     // Make the request
     Operation response = globalForwardingRulesClient.SetTarget(project, forwardingRule, targetReferenceResource);
     // End snippet
 }
 /// <summary>Snippet for SetBackup</summary>
 public void SetBackup()
 {
     // Snippet: SetBackup(string, string, string, TargetReference, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     string          project    = "";
     string          region     = "";
     string          targetPool = "";
     TargetReference targetReferenceResource = new TargetReference();
     // Make the request
     Operation response = targetPoolsClient.SetBackup(project, region, targetPool, targetReferenceResource);
     // End snippet
 }
示例#6
0
        /// <summary>Snippet for SetTargetAsync</summary>
        public async Task SetTargetAsync()
        {
            // Snippet: SetTargetAsync(string, string, TargetReference, CallSettings)
            // Additional: SetTargetAsync(string, string, TargetReference, CancellationToken)
            // Create client
            GlobalForwardingRulesClient globalForwardingRulesClient = await GlobalForwardingRulesClient.CreateAsync();

            // Initialize request argument(s)
            string          project                 = "";
            string          forwardingRule          = "";
            TargetReference targetReferenceResource = new TargetReference();
            // Make the request
            Operation response = await globalForwardingRulesClient.SetTargetAsync(project, forwardingRule, targetReferenceResource);

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

            // Initialize request argument(s)
            string          project    = "";
            string          region     = "";
            string          targetPool = "";
            TargetReference targetReferenceResource = new TargetReference();
            // Make the request
            Operation response = await targetPoolsClient.SetBackupAsync(project, region, targetPool, targetReferenceResource);

            // End snippet
        }
        /// <summary>
        /// Changes target URL for forwarding rule. The new target should be of the same type as the old target.
        /// Documentation https://developers.google.com/compute/v1/reference/forwardingRules/setTarget
        /// 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="forwardingRule">Name of the ForwardingRule resource in which target is to be set.</param>
        /// <param name="body">A valid compute v1 body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation SetTarget(computeService service, string project, string region, string forwardingRule, TargetReference 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);
                }
                if (forwardingRule == null)
                {
                    throw new ArgumentNullException(forwardingRule);
                }

                // Make the request.
                return(service.ForwardingRules.SetTarget(body, project, region, forwardingRule).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request ForwardingRules.SetTarget failed.", ex);
            }
        }
 public void AddAction(TargetReference target, NumericExpressionTree expression)
 {
     _event.Statements.Add(new StatementInfo(target, expression));
 }
        /// <summary>
        /// Changes a backup target pool's configurations.
        /// Documentation https://developers.google.com/compute/beta/reference/targetPools/setBackup
        /// 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="targetPool">Name of the TargetPool resource to set a backup pool for.</param>
        /// <param name="body">A valid compute beta body.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>OperationResponse</returns>
        public static Operation SetBackup(computeService service, string project, string region, string targetPool, TargetReference body, TargetPoolsSetBackupOptionalParms 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);
                }
                if (targetPool == null)
                {
                    throw new ArgumentNullException(targetPool);
                }

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

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request TargetPools.SetBackup failed.", ex);
            }
        }
示例#11
0
 public StatementInfo(TargetReference target, NumericExpressionTree expression)
 {
     Target     = target;
     Expression = expression;
 }
        /// <summary>
        /// Changes target URL for forwarding rule. The new target should be of the same type as the old target.
        /// Documentation https://developers.google.com/compute/v1/reference/forwardingRules/setTarget
        /// 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="forwardingRule">Name of the ForwardingRule resource in which target is to be set.</param>
        /// <param name="body">A valid Compute v1 body.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>OperationResponse</returns>
        public static Operation SetTarget(ComputeService service, string project, string region, string forwardingRule, TargetReference body, ForwardingRulesSetTargetOptionalParms 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);
                }
                if (forwardingRule == null)
                {
                    throw new ArgumentNullException(forwardingRule);
                }

                // Building the initial request.
                var request = service.ForwardingRules.SetTarget(body, project, region, forwardingRule);

                // Applying optional parameters to the request.
                request = (ForwardingRulesResource.SetTargetRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request ForwardingRules.SetTarget failed.", ex);
            }
        }
示例#13
0
        public void AddReference(TargetReference fk, TargetEntitySqlModel targetEntity)
        {
            RefEntities[fk] = targetEntity;

            foreach (var col in fk.Columns)
            {
                TargetColumns.Add(new TargetRefColumnSqlModel(fk, col, targetEntity, FindColumnInfo(col.BaseName)));
            }

            foreach (var col in targetEntity.KeySourceColumns)
            {
                RequiredSourceColumns.Add(col);
                if (fk.IsKey) KeySourceColumns.Add(col);
            }
        }