/// <summary> /// Initializes a new instance of the SetCupsPoliciesRequest class. /// </summary> /// <param name="policyDomainId">The policy domain unique identifier.</param> /// <param name="policyTargetId">The policy target unique identifier.</param> /// <param name="enable">if set to <c>true</c> [enable].</param> /// <param name="policyType">Type of the policy.</param> /// <param name="policyExcursionAlert">if set to <c>true</c> [policy excursion alert].</param> /// <param name="cupsThreshold">The cups threshold.</param> /// <param name="avgWindow">The average window.</param> internal SetCupsPoliciesRequest(NodeManagerCupsPolicyDomainId policyDomainId, NodeManagerCupsPolicyTargetId policyTargetId, bool enable, NodeManagerCupsPolicyType policyType, bool policyExcursionAlert, ushort cupsThreshold, ushort avgWindow) { /// CUPS Policy ID // Bits [0:3] is the Domain Identifier byte tempPolicyID = (byte)((byte)policyDomainId & 0xf); // Bits [4:7] is the Target Identifier tempPolicyID = (byte)(tempPolicyID | (((byte)policyTargetId & 0xf) << 4)); this.policyID = tempPolicyID; // Enable Policy if (enable) { this.enable = 0x1; } // Policy Type this.policyType = (byte)(((byte)policyType & 0x1) << 7); // Policy Excursion Actions if (policyExcursionAlert) { this.policyExcursionAction = 0x1; } this.cupsThreshold = cupsThreshold; this.avgWindow = avgWindow; }
/// <summary> /// Initializes a new instance of the SetCupsPoliciesRequest class. /// </summary> /// <param name="policyDomainId">The policy domain unique identifier.</param> /// <param name="policyTargetId">The policy target unique identifier.</param> /// <param name="enable">if set to <c>true</c> [enable].</param> /// <param name="policyType">Type of the policy.</param> /// <param name="policyExcursionAlert">if set to <c>true</c> [policy excursion alert].</param> /// <param name="cupsThreshold">The cups threshold.</param> /// <param name="avgWindow">The average window.</param> internal SetCupsPoliciesRequest(NodeManagerCupsPolicyDomainId policyDomainId, NodeManagerCupsPolicyTargetId policyTargetId, bool enable, NodeManagerCupsPolicyType policyType, bool policyExcursionAlert, ushort cupsThreshold, ushort avgWindow) { /// CUPS Policy ID // Bits [0:3] is the Domain Identifier byte tempPolicyID = (byte)((byte)policyDomainId & 0xf); // Bits [4:7] is the Target Identifier tempPolicyID = (byte)(tempPolicyID | (((byte)policyTargetId & 0xf) << 4)); this.policyID = tempPolicyID; // Enable Policy if (enable) this.enable = 0x1; // Policy Type this.policyType = (byte)(((byte)policyType & 0x1) << 7); // Policy Excursion Actions if (policyExcursionAlert) this.policyExcursionAction = 0x1; this.cupsThreshold = cupsThreshold; this.avgWindow = avgWindow; }