407 lines
14 KiB
C#

//----------------------------------------------------------------------------
//
// Copyright (c) Intel Corporation, 2003 - 2012 All Rights Reserved.
//
// File: CIM_AssociatedPowerManagementService.cs
//
// Contents: The association between a Managed System Element and its power management service.
// This file was automatically generated from CIM_AssociatedPowerManagementService.mof
//
//----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using System.Globalization;
using System.Xml.Serialization;
using System.IO;
using Intel.Manageability.WSManagement;
using Intel.Manageability.Cim.Untyped;
namespace Intel.Manageability.Cim.Typed
{
/// <summary>
///The association between a Managed System Element and its power management service.
/// </summary>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_AssociatedPowerManagementService")]
[System.Xml.Serialization.XmlRootAttribute("CIM_AssociatedPowerManagementService", Namespace="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_AssociatedPowerManagementService", IsNullable=false)]
public class CIM_AssociatedPowerManagementService : CIM_ServiceAvailableToElement
{
/// <summary>
/// Default constructor.
/// </summary>
public CIM_AssociatedPowerManagementService() :base()
{
}
/// <summary>
/// Constructor that recieves an xml string for deserialization.
/// </summary>
/// <param name="xml">xml string to deserialize</param>
public CIM_AssociatedPowerManagementService(string xml): base((IWSManClient)null)
{
this.Deserialize(xml);
}
/// <summary>
/// Constructor which recieves a Ws-Management client object.
/// </summary>
/// <param name="client">Ws-Management client</param>
public CIM_AssociatedPowerManagementService(IWSManClient client): base(client)
{
}
/// <summary>
/// Remove AvailableRequestedPowerStates field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveAvailableRequestedPowerStates()
{
RemoveField("AvailableRequestedPowerStates");
}
/// <summary>
/// Is true if the field AvailableRequestedPowerStates exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool AvailableRequestedPowerStatesExist
{
get
{
return ContainsField("AvailableRequestedPowerStates");
}
}
/// <summary>
/// Optional, AvailableRequestedPowerStates indicates the possible values for the PowerState parameter of the method RequestPowerStateChange, used to initiate a power state change.The values listed shall be a subset of the values contained in the RequestedPowerStatesSupported property of the CIM_PowerManagementCapabilities where the values selected are a function of the current power state of the system. This property shall be non-null if an implementation supports the advertisement of the set of possible values as a function of the current state. This property shall be null if an implementation does not support the advertisement of the set of possible values as a function of the current state.
/// The current values in the enumeration are:
/// 2=On, corresponding to ACPI state G0 or S0 or D0.
/// 3=Sleep - Light, corresponding to ACPI state G1, S1/S2, or D1.
/// 4=Sleep - Deep, corresponding to ACPI state G1, S3, or D2.
/// 5=Power Cycle (Off - Soft), corresponding to ACPI state G2, S5, or D3, but where the managed element is set to return to power state "On" at a pre-determined time.
/// 6=Off - Hard, corresponding to ACPI state G3, S5, or D3.
/// 7=Hibernate (Off - Soft), corresponding to ACPI state S4, where the state of the managed element is preserved and will be recovered upon powering on.
/// 8=Off - Soft, corresponding to ACPI state G2, S5, or D3. 9= Power Cycle (Off-Hard), corresponds to the managed element reaching the ACPI state G3 followed by ACPI state S0.
/// 10=Master Bus Reset, corresponds to the system reaching ACPI state S5 followed by ACPI state S0. This is used to represent system master bus reset. 11=Diagnostic Interrupt (NMI), corresponding to the system reaching ACPI state S5 followed by ACPI state S0. This is used to represent system non-maskable interrupt. 12=Off - Soft Graceful, equivalent to Off Soft but preceded by a request to the managed element to perform an orderly shutdown.
/// 13=Off - Hard Graceful, equivalent to Off Hard but preceded by a request to the managed element to perform an orderly shutdown.
/// 14=Master Bus Rest Graceful, equivalent to Master Bus Reset but preceded by a request to the managed element to perform an orderly shutdown.
/// 15=Power Cycle (Off - Soft Graceful), equivalent to Power Cycle (Off - Soft) but preceded by a request to the managed element to perform an orderly shutdown.
/// 16=Power Cycle (Off - Hard Graceful), equivalent to Power Cycle (Off - Hard) but preceded by a request to the managed element to perform an orderly shutdown.
/// ..=DMTF Reserved.
/// 0x7FFF..0xFFFF = Vendor Specific.
/// </summary>
[CimField(false, false)]
public virtual ushort[] AvailableRequestedPowerStates
{
get
{
return CimTypesUtils.StringArrayToArray<ushort>(this["AvailableRequestedPowerStates"]);
}
set
{
string[] arr = CimTypesUtils.ArrayToStringArray<ushort>(value);
this.SetOrAddField("AvailableRequestedPowerStates", arr);
}
}
/// <summary>
/// Remove OtherPowerState field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveOtherPowerState()
{
RemoveField("OtherPowerState");
}
/// <summary>
/// Is true if the field OtherPowerState exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool OtherPowerStateExist
{
get
{
return ContainsField("OtherPowerState");
}
}
/// <summary>
/// Optional, A string describing the additional power management state of the element, used when the PowerState is set to the value 1, "Other".
/// </summary>
[CimField(false, false)]
public virtual string OtherPowerState
{
get
{
return this.GetField("OtherPowerState")[0];
}
set
{
this.SetOrAddField("OtherPowerState",value);
}
}
/// <summary>
/// Remove OtherRequestedPowerState field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveOtherRequestedPowerState()
{
RemoveField("OtherRequestedPowerState");
}
/// <summary>
/// Is true if the field OtherRequestedPowerState exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool OtherRequestedPowerStateExist
{
get
{
return ContainsField("OtherRequestedPowerState");
}
}
/// <summary>
/// Optional, A string describing the additional power management state of the element, used when the RequestedPowerState is set to the value 1, "Other".
/// </summary>
[CimField(false, false)]
public virtual string OtherRequestedPowerState
{
get
{
return this.GetField("OtherRequestedPowerState")[0];
}
set
{
this.SetOrAddField("OtherRequestedPowerState",value);
}
}
/// <summary>
/// Remove PowerOnTime field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemovePowerOnTime()
{
RemoveField("PowerOnTime");
}
/// <summary>
/// Is true if the field PowerOnTime exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool PowerOnTimeExist
{
get
{
return ContainsField("PowerOnTime");
}
}
/// <summary>
/// Optional, The time when the element will be powered on again, used when the RequestedPowerState has the value 2, "On", 5, "Power Cycle (Off - Soft)" or 6, "Power Cycle (Off - Hard)".
/// </summary>
[CimField(false, false)]
public virtual CimDateTime PowerOnTime
{
get
{
return CimDateTime.Parse(this["PowerOnTime"][0]);
}
set
{
this.SetOrAddField("PowerOnTime",value.ToString());
}
}
/// <summary>
/// Remove PowerState field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemovePowerState()
{
RemoveField("PowerState");
}
/// <summary>
/// Is true if the field PowerState exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool PowerStateExist
{
get
{
return ContainsField("PowerState");
}
}
/// <summary>
/// Optional, The current power state of the associated Managed System Element.
/// </summary>
[CimField(false, false)]
public virtual ushort PowerState
{
get
{
return ushort.Parse(this["PowerState"][0], CultureInfo.InvariantCulture);
}
set
{
this.SetOrAddField("PowerState",value.ToString(CultureInfo.InvariantCulture));
}
}
/// <summary>
/// Remove RequestedPowerState field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveRequestedPowerState()
{
RemoveField("RequestedPowerState");
}
/// <summary>
/// Is true if the field RequestedPowerState exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool RequestedPowerStateExist
{
get
{
return ContainsField("RequestedPowerState");
}
}
/// <summary>
/// Optional, The desired or the last requested power state of the associated Managed System Element, irrespective of the mechanism through which the request was made. If the requested power state is unknown, then the property shall have the value of 0 ("Unknown"). If the property has no meaning or is not supported, then the property shall have value 12("Not Applicable").
/// </summary>
[CimField(false, false)]
public virtual ushort RequestedPowerState
{
get
{
return ushort.Parse(this["RequestedPowerState"][0], CultureInfo.InvariantCulture);
}
set
{
this.SetOrAddField("RequestedPowerState",value.ToString(CultureInfo.InvariantCulture));
}
}
/// <summary>
/// Required, The Service that is available.
/// </summary>
[CimField(true, false)]
public override CimReference ServiceProvided
{
get
{
string innerXML = this.GetField("ServiceProvided")[0];
CimReference epr = new CimReference("ServiceProvided", XmlNamespace, innerXML);
return epr;
}
set
{
this.SetOrAddField("ServiceProvided",value.Serialize(false));
}
}
/// <summary>
/// Remove TransitioningToPowerState field.
/// Note: This method will succeed only if this field is optional in the concrete object.
/// </summary>
public virtual void RemoveTransitioningToPowerState()
{
RemoveField("TransitioningToPowerState");
}
/// <summary>
/// Is true if the field TransitioningToPowerState exists in the current object,
/// otherwise is false.
/// </summary>
public virtual bool TransitioningToPowerStateExist
{
get
{
return ContainsField("TransitioningToPowerState");
}
}
/// <summary>
/// Optional, TransitioningToPowerState indicates the target power state to which the system is transitioning.
/// A value of 19 "No Change" shall indicate that no transition is in progress. A value of 18 "Not Applicable" shall indicate the implementation does not support representing ongoing transitions.
/// A value other than 18 or 19 shall identify the power state to which the element is in the process of transitioning.
/// </summary>
[CimField(false, false)]
public virtual ushort TransitioningToPowerState
{
get
{
return ushort.Parse(this["TransitioningToPowerState"][0], CultureInfo.InvariantCulture);
}
set
{
this.SetOrAddField("TransitioningToPowerState",value.ToString(CultureInfo.InvariantCulture));
}
}
/// <summary>
/// Enumerate instances of CIM_AssociatedPowerManagementService class at an endpoint.
/// </summary>
/// <param name="client">WS-Management client</param>
/// <param name="cimKeys">Keys for selecting the instances</param>
/// <returns>Collection of CIM_AssociatedPowerManagementService objects</returns>
public static new Collection<CIM_AssociatedPowerManagementService> Enumerate(IWSManClient client, CimBase.CimKeys cimKeys)
{
List<CIM_AssociatedPowerManagementService> ret = CimBase.Enumerate<CIM_AssociatedPowerManagementService>(client, cimKeys);
return new Collection<CIM_AssociatedPowerManagementService>(ret);
}
/// <summary>
/// Enumerate instances of CIM_AssociatedPowerManagementService class at an endpoint.
/// </summary>
/// <param name="client">WS-Management client</param>
/// <returns>Collection of CIM_AssociatedPowerManagementService objects</returns>
public static new Collection<CIM_AssociatedPowerManagementService> Enumerate(IWSManClient client)
{
List<CIM_AssociatedPowerManagementService> ret = CimBase.Enumerate<CIM_AssociatedPowerManagementService>(client);
return new Collection<CIM_AssociatedPowerManagementService>(ret);
}
/// <summary>
/// Delete the instance of CIM_AssociatedPowerManagementService if it is singular.
/// Note: This method will succeed only if a single instance of the class exists.
/// </summary>
/// <param name="client">WS-Management client</param>
public static new void Delete(IWSManClient client)
{
CimBase.Delete<CIM_AssociatedPowerManagementService>(client);
}
/// <summary>
/// Represents the keys of the CIM_AssociatedPowerManagementService class.
/// </summary>
public new class CimKeys : CIM_ServiceAvailableToElement.CimKeys
{
/// <summary>
/// Required, The Service that is available.
/// </summary>
public virtual CimReference ServiceProvided
{
get
{
string innerXML = GetKey("ServiceProvided");
CimReference epr = new CimReference("ServiceProvided", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_AssociatedPowerManagementService", innerXML);
return epr;
}
set
{
SetOrAddKey("ServiceProvided", value);
}
}
}
}
}